var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __require = /* @__PURE__ */ ((x3) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x3, {
  get: (a3, b2) => (typeof require !== "undefined" ? require : a3)[b2]
}) : x3)(function(x3) {
  if (typeof require !== "undefined")
    return require.apply(this, arguments);
  throw new Error('Dynamic require of "' + x3 + '" is not supported');
});
var __esm = (fn, res) => function __init() {
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
};
var __commonJS = (cb, mod) => function __require2() {
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __export = (target, all2) => {
  for (var name in all2)
    __defProp(target, name, { get: all2[name], enumerable: true });
};
var __copyProps = (to2, from2, except, desc) => {
  if (from2 && typeof from2 === "object" || typeof from2 === "function") {
    for (let key of __getOwnPropNames(from2))
      if (!__hasOwnProp.call(to2, key) && key !== except)
        __defProp(to2, key, { get: () => from2[key], enumerable: !(desc = __getOwnPropDesc(from2, key)) || desc.enumerable });
  }
  return to2;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));

// ../simple-mind-map/node_modules/eventemitter3/index.js
var require_eventemitter3 = __commonJS({
  "../simple-mind-map/node_modules/eventemitter3/index.js"(exports, module) {
    "use strict";
    var has = Object.prototype.hasOwnProperty;
    var prefix = "~";
    function Events() {
    }
    if (Object.create) {
      Events.prototype = /* @__PURE__ */ Object.create(null);
      if (!new Events().__proto__)
        prefix = false;
    }
    function EE(fn, context, once) {
      this.fn = fn;
      this.context = context;
      this.once = once || false;
    }
    function addListener(emitter, event, fn, context, once) {
      if (typeof fn !== "function") {
        throw new TypeError("The listener must be a function");
      }
      var listener = new EE(fn, context || emitter, once), evt = prefix ? prefix + event : event;
      if (!emitter._events[evt])
        emitter._events[evt] = listener, emitter._eventsCount++;
      else if (!emitter._events[evt].fn)
        emitter._events[evt].push(listener);
      else
        emitter._events[evt] = [emitter._events[evt], listener];
      return emitter;
    }
    function clearEvent(emitter, evt) {
      if (--emitter._eventsCount === 0)
        emitter._events = new Events();
      else
        delete emitter._events[evt];
    }
    function EventEmitter2() {
      this._events = new Events();
      this._eventsCount = 0;
    }
    EventEmitter2.prototype.eventNames = function eventNames() {
      var names2 = [], events, name;
      if (this._eventsCount === 0)
        return names2;
      for (name in events = this._events) {
        if (has.call(events, name))
          names2.push(prefix ? name.slice(1) : name);
      }
      if (Object.getOwnPropertySymbols) {
        return names2.concat(Object.getOwnPropertySymbols(events));
      }
      return names2;
    };
    EventEmitter2.prototype.listeners = function listeners(event) {
      var evt = prefix ? prefix + event : event, handlers = this._events[evt];
      if (!handlers)
        return [];
      if (handlers.fn)
        return [handlers.fn];
      for (var i3 = 0, l3 = handlers.length, ee2 = new Array(l3); i3 < l3; i3++) {
        ee2[i3] = handlers[i3].fn;
      }
      return ee2;
    };
    EventEmitter2.prototype.listenerCount = function listenerCount(event) {
      var evt = prefix ? prefix + event : event, listeners = this._events[evt];
      if (!listeners)
        return 0;
      if (listeners.fn)
        return 1;
      return listeners.length;
    };
    EventEmitter2.prototype.emit = function emit(event, a1, a22, a3, a4, a5) {
      var evt = prefix ? prefix + event : event;
      if (!this._events[evt])
        return false;
      var listeners = this._events[evt], len = arguments.length, args, i3;
      if (listeners.fn) {
        if (listeners.once)
          this.removeListener(event, listeners.fn, void 0, true);
        switch (len) {
          case 1:
            return listeners.fn.call(listeners.context), true;
          case 2:
            return listeners.fn.call(listeners.context, a1), true;
          case 3:
            return listeners.fn.call(listeners.context, a1, a22), true;
          case 4:
            return listeners.fn.call(listeners.context, a1, a22, a3), true;
          case 5:
            return listeners.fn.call(listeners.context, a1, a22, a3, a4), true;
          case 6:
            return listeners.fn.call(listeners.context, a1, a22, a3, a4, a5), true;
        }
        for (i3 = 1, args = new Array(len - 1); i3 < len; i3++) {
          args[i3 - 1] = arguments[i3];
        }
        listeners.fn.apply(listeners.context, args);
      } else {
        var length2 = listeners.length, j2;
        for (i3 = 0; i3 < length2; i3++) {
          if (listeners[i3].once)
            this.removeListener(event, listeners[i3].fn, void 0, true);
          switch (len) {
            case 1:
              listeners[i3].fn.call(listeners[i3].context);
              break;
            case 2:
              listeners[i3].fn.call(listeners[i3].context, a1);
              break;
            case 3:
              listeners[i3].fn.call(listeners[i3].context, a1, a22);
              break;
            case 4:
              listeners[i3].fn.call(listeners[i3].context, a1, a22, a3);
              break;
            default:
              if (!args)
                for (j2 = 1, args = new Array(len - 1); j2 < len; j2++) {
                  args[j2 - 1] = arguments[j2];
                }
              listeners[i3].fn.apply(listeners[i3].context, args);
          }
        }
      }
      return true;
    };
    EventEmitter2.prototype.on = function on2(event, fn, context) {
      return addListener(this, event, fn, context, false);
    };
    EventEmitter2.prototype.once = function once(event, fn, context) {
      return addListener(this, event, fn, context, true);
    };
    EventEmitter2.prototype.removeListener = function removeListener(event, fn, context, once) {
      var evt = prefix ? prefix + event : event;
      if (!this._events[evt])
        return this;
      if (!fn) {
        clearEvent(this, evt);
        return this;
      }
      var listeners = this._events[evt];
      if (listeners.fn) {
        if (listeners.fn === fn && (!once || listeners.once) && (!context || listeners.context === context)) {
          clearEvent(this, evt);
        }
      } else {
        for (var i3 = 0, events = [], length2 = listeners.length; i3 < length2; i3++) {
          if (listeners[i3].fn !== fn || once && !listeners[i3].once || context && listeners[i3].context !== context) {
            events.push(listeners[i3]);
          }
        }
        if (events.length)
          this._events[evt] = events.length === 1 ? events[0] : events;
        else
          clearEvent(this, evt);
      }
      return this;
    };
    EventEmitter2.prototype.removeAllListeners = function removeAllListeners(event) {
      var evt;
      if (event) {
        evt = prefix ? prefix + event : event;
        if (this._events[evt])
          clearEvent(this, evt);
      } else {
        this._events = new Events();
        this._eventsCount = 0;
      }
      return this;
    };
    EventEmitter2.prototype.off = EventEmitter2.prototype.removeListener;
    EventEmitter2.prototype.addListener = EventEmitter2.prototype.on;
    EventEmitter2.prefixed = prefix;
    EventEmitter2.EventEmitter = EventEmitter2;
    if ("undefined" !== typeof module) {
      module.exports = EventEmitter2;
    }
  }
});

// ../simple-mind-map/node_modules/deepmerge/dist/cjs.js
var require_cjs = __commonJS({
  "../simple-mind-map/node_modules/deepmerge/dist/cjs.js"(exports, module) {
    "use strict";
    var isMergeableObject = function isMergeableObject2(value) {
      return isNonNullObject(value) && !isSpecial(value);
    };
    function isNonNullObject(value) {
      return !!value && typeof value === "object";
    }
    function isSpecial(value) {
      var stringValue = Object.prototype.toString.call(value);
      return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value);
    }
    var canUseSymbol = typeof Symbol === "function" && Symbol.for;
    var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for("react.element") : 60103;
    function isReactElement(value) {
      return value.$$typeof === REACT_ELEMENT_TYPE;
    }
    function emptyTarget(val) {
      return Array.isArray(val) ? [] : {};
    }
    function cloneIfNecessary(value, optionsArgument) {
      var clone = optionsArgument && optionsArgument.clone === true;
      return clone && isMergeableObject(value) ? deepmerge(emptyTarget(value), value, optionsArgument) : value;
    }
    function defaultArrayMerge(target, source, optionsArgument) {
      var destination = target.slice();
      source.forEach(function(e2, i3) {
        if (typeof destination[i3] === "undefined") {
          destination[i3] = cloneIfNecessary(e2, optionsArgument);
        } else if (isMergeableObject(e2)) {
          destination[i3] = deepmerge(target[i3], e2, optionsArgument);
        } else if (target.indexOf(e2) === -1) {
          destination.push(cloneIfNecessary(e2, optionsArgument));
        }
      });
      return destination;
    }
    function mergeObject(target, source, optionsArgument) {
      var destination = {};
      if (isMergeableObject(target)) {
        Object.keys(target).forEach(function(key) {
          destination[key] = cloneIfNecessary(target[key], optionsArgument);
        });
      }
      Object.keys(source).forEach(function(key) {
        if (!isMergeableObject(source[key]) || !target[key]) {
          destination[key] = cloneIfNecessary(source[key], optionsArgument);
        } else {
          destination[key] = deepmerge(target[key], source[key], optionsArgument);
        }
      });
      return destination;
    }
    function deepmerge(target, source, optionsArgument) {
      var sourceIsArray = Array.isArray(source);
      var targetIsArray = Array.isArray(target);
      var options = optionsArgument || { arrayMerge: defaultArrayMerge };
      var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
      if (!sourceAndTargetTypesMatch) {
        return cloneIfNecessary(source, optionsArgument);
      } else if (sourceIsArray) {
        var arrayMerge = options.arrayMerge || defaultArrayMerge;
        return arrayMerge(target, source, optionsArgument);
      } else {
        return mergeObject(target, source, optionsArgument);
      }
    }
    deepmerge.all = function deepmergeAll(array2, optionsArgument) {
      if (!Array.isArray(array2) || array2.length < 2) {
        throw new Error("first argument should be an array with at least two elements");
      }
      return array2.reduce(function(prev2, next2) {
        return deepmerge(prev2, next2, optionsArgument);
      });
    };
    var deepmerge_1 = deepmerge;
    module.exports = deepmerge_1;
  }
});

// ../simple-mind-map/node_modules/@babel/runtime/helpers/esm/typeof.js
function _typeof(obj) {
  "@babel/helpers - typeof";
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
    return typeof obj2;
  } : function(obj2) {
    return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
  }, _typeof(obj);
}
var init_typeof = __esm({
  "../simple-mind-map/node_modules/@babel/runtime/helpers/esm/typeof.js"() {
  }
});

// ../simple-mind-map/node_modules/html2canvas/dist/html2canvas.js
var require_html2canvas = __commonJS({
  "../simple-mind-map/node_modules/html2canvas/dist/html2canvas.js"(exports, module) {
    (function(global3, factory) {
      typeof exports === "object" && typeof module !== "undefined" ? module.exports = factory() : typeof define === "function" && define.amd ? define(factory) : (global3 = typeof globalThis !== "undefined" ? globalThis : global3 || self, global3.html2canvas = factory());
    })(exports, function() {
      "use strict";
      var extendStatics = function(d2, b2) {
        extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b3) {
          d3.__proto__ = b3;
        } || function(d3, b3) {
          for (var p3 in b3)
            if (Object.prototype.hasOwnProperty.call(b3, p3))
              d3[p3] = b3[p3];
        };
        return extendStatics(d2, b2);
      };
      function __extends(d2, b2) {
        if (typeof b2 !== "function" && b2 !== null)
          throw new TypeError("Class extends value " + String(b2) + " is not a constructor or null");
        extendStatics(d2, b2);
        function __() {
          this.constructor = d2;
        }
        d2.prototype = b2 === null ? Object.create(b2) : (__.prototype = b2.prototype, new __());
      }
      var __assign = function() {
        __assign = Object.assign || function __assign2(t3) {
          for (var s3, i4 = 1, n3 = arguments.length; i4 < n3; i4++) {
            s3 = arguments[i4];
            for (var p3 in s3)
              if (Object.prototype.hasOwnProperty.call(s3, p3))
                t3[p3] = s3[p3];
          }
          return t3;
        };
        return __assign.apply(this, arguments);
      };
      function __awaiter(thisArg, _arguments, P2, generator) {
        function adopt2(value) {
          return value instanceof P2 ? value : new P2(function(resolve) {
            resolve(value);
          });
        }
        return new (P2 || (P2 = Promise))(function(resolve, reject) {
          function fulfilled(value) {
            try {
              step(generator.next(value));
            } catch (e3) {
              reject(e3);
            }
          }
          function rejected(value) {
            try {
              step(generator["throw"](value));
            } catch (e3) {
              reject(e3);
            }
          }
          function step(result) {
            result.done ? resolve(result.value) : adopt2(result.value).then(fulfilled, rejected);
          }
          step((generator = generator.apply(thisArg, _arguments || [])).next());
        });
      }
      function __generator(thisArg, body) {
        var _3 = { label: 0, sent: function() {
          if (t3[0] & 1)
            throw t3[1];
          return t3[1];
        }, trys: [], ops: [] }, f4, y4, t3, g2;
        return g2 = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g2[Symbol.iterator] = function() {
          return this;
        }), g2;
        function verb(n3) {
          return function(v3) {
            return step([n3, v3]);
          };
        }
        function step(op) {
          if (f4)
            throw new TypeError("Generator is already executing.");
          while (_3)
            try {
              if (f4 = 1, y4 && (t3 = op[0] & 2 ? y4["return"] : op[0] ? y4["throw"] || ((t3 = y4["return"]) && t3.call(y4), 0) : y4.next) && !(t3 = t3.call(y4, op[1])).done)
                return t3;
              if (y4 = 0, t3)
                op = [op[0] & 2, t3.value];
              switch (op[0]) {
                case 0:
                case 1:
                  t3 = op;
                  break;
                case 4:
                  _3.label++;
                  return { value: op[1], done: false };
                case 5:
                  _3.label++;
                  y4 = op[1];
                  op = [0];
                  continue;
                case 7:
                  op = _3.ops.pop();
                  _3.trys.pop();
                  continue;
                default:
                  if (!(t3 = _3.trys, t3 = t3.length > 0 && t3[t3.length - 1]) && (op[0] === 6 || op[0] === 2)) {
                    _3 = 0;
                    continue;
                  }
                  if (op[0] === 3 && (!t3 || op[1] > t3[0] && op[1] < t3[3])) {
                    _3.label = op[1];
                    break;
                  }
                  if (op[0] === 6 && _3.label < t3[1]) {
                    _3.label = t3[1];
                    t3 = op;
                    break;
                  }
                  if (t3 && _3.label < t3[2]) {
                    _3.label = t3[2];
                    _3.ops.push(op);
                    break;
                  }
                  if (t3[2])
                    _3.ops.pop();
                  _3.trys.pop();
                  continue;
              }
              op = body.call(thisArg, _3);
            } catch (e3) {
              op = [6, e3];
              y4 = 0;
            } finally {
              f4 = t3 = 0;
            }
          if (op[0] & 5)
            throw op[1];
          return { value: op[0] ? op[1] : void 0, done: true };
        }
      }
      function __spreadArray(to2, from2, pack2) {
        if (pack2 || arguments.length === 2)
          for (var i4 = 0, l3 = from2.length, ar; i4 < l3; i4++) {
            if (ar || !(i4 in from2)) {
              if (!ar)
                ar = Array.prototype.slice.call(from2, 0, i4);
              ar[i4] = from2[i4];
            }
          }
        return to2.concat(ar || from2);
      }
      var Bounds = (
        /** @class */
        function() {
          function Bounds2(left, top, width2, height2) {
            this.left = left;
            this.top = top;
            this.width = width2;
            this.height = height2;
          }
          Bounds2.prototype.add = function(x3, y4, w2, h3) {
            return new Bounds2(this.left + x3, this.top + y4, this.width + w2, this.height + h3);
          };
          Bounds2.fromClientRect = function(context, clientRect) {
            return new Bounds2(clientRect.left + context.windowBounds.left, clientRect.top + context.windowBounds.top, clientRect.width, clientRect.height);
          };
          Bounds2.fromDOMRectList = function(context, domRectList) {
            var domRect = Array.from(domRectList).find(function(rect) {
              return rect.width !== 0;
            });
            return domRect ? new Bounds2(domRect.left + context.windowBounds.left, domRect.top + context.windowBounds.top, domRect.width, domRect.height) : Bounds2.EMPTY;
          };
          Bounds2.EMPTY = new Bounds2(0, 0, 0, 0);
          return Bounds2;
        }()
      );
      var parseBounds = function(context, node3) {
        return Bounds.fromClientRect(context, node3.getBoundingClientRect());
      };
      var parseDocumentSize = function(document4) {
        var body = document4.body;
        var documentElement = document4.documentElement;
        if (!body || !documentElement) {
          throw new Error("Unable to get document size");
        }
        var width2 = Math.max(Math.max(body.scrollWidth, documentElement.scrollWidth), Math.max(body.offsetWidth, documentElement.offsetWidth), Math.max(body.clientWidth, documentElement.clientWidth));
        var height2 = Math.max(Math.max(body.scrollHeight, documentElement.scrollHeight), Math.max(body.offsetHeight, documentElement.offsetHeight), Math.max(body.clientHeight, documentElement.clientHeight));
        return new Bounds(0, 0, width2, height2);
      };
      var toCodePoints$1 = function(str) {
        var codePoints = [];
        var i4 = 0;
        var length2 = str.length;
        while (i4 < length2) {
          var value = str.charCodeAt(i4++);
          if (value >= 55296 && value <= 56319 && i4 < length2) {
            var extra = str.charCodeAt(i4++);
            if ((extra & 64512) === 56320) {
              codePoints.push(((value & 1023) << 10) + (extra & 1023) + 65536);
            } else {
              codePoints.push(value);
              i4--;
            }
          } else {
            codePoints.push(value);
          }
        }
        return codePoints;
      };
      var fromCodePoint$1 = function() {
        var codePoints = [];
        for (var _i = 0; _i < arguments.length; _i++) {
          codePoints[_i] = arguments[_i];
        }
        if (String.fromCodePoint) {
          return String.fromCodePoint.apply(String, codePoints);
        }
        var length2 = codePoints.length;
        if (!length2) {
          return "";
        }
        var codeUnits = [];
        var index3 = -1;
        var result = "";
        while (++index3 < length2) {
          var codePoint = codePoints[index3];
          if (codePoint <= 65535) {
            codeUnits.push(codePoint);
          } else {
            codePoint -= 65536;
            codeUnits.push((codePoint >> 10) + 55296, codePoint % 1024 + 56320);
          }
          if (index3 + 1 === length2 || codeUnits.length > 16384) {
            result += String.fromCharCode.apply(String, codeUnits);
            codeUnits.length = 0;
          }
        }
        return result;
      };
      var chars$2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
      var lookup$2 = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);
      for (var i$2 = 0; i$2 < chars$2.length; i$2++) {
        lookup$2[chars$2.charCodeAt(i$2)] = i$2;
      }
      var chars$1$1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
      var lookup$1$1 = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);
      for (var i$1$1 = 0; i$1$1 < chars$1$1.length; i$1$1++) {
        lookup$1$1[chars$1$1.charCodeAt(i$1$1)] = i$1$1;
      }
      var decode$1 = function(base642) {
        var bufferLength = base642.length * 0.75, len = base642.length, i4, p3 = 0, encoded1, encoded2, encoded3, encoded4;
        if (base642[base642.length - 1] === "=") {
          bufferLength--;
          if (base642[base642.length - 2] === "=") {
            bufferLength--;
          }
        }
        var buffer = typeof ArrayBuffer !== "undefined" && typeof Uint8Array !== "undefined" && typeof Uint8Array.prototype.slice !== "undefined" ? new ArrayBuffer(bufferLength) : new Array(bufferLength);
        var bytes = Array.isArray(buffer) ? buffer : new Uint8Array(buffer);
        for (i4 = 0; i4 < len; i4 += 4) {
          encoded1 = lookup$1$1[base642.charCodeAt(i4)];
          encoded2 = lookup$1$1[base642.charCodeAt(i4 + 1)];
          encoded3 = lookup$1$1[base642.charCodeAt(i4 + 2)];
          encoded4 = lookup$1$1[base642.charCodeAt(i4 + 3)];
          bytes[p3++] = encoded1 << 2 | encoded2 >> 4;
          bytes[p3++] = (encoded2 & 15) << 4 | encoded3 >> 2;
          bytes[p3++] = (encoded3 & 3) << 6 | encoded4 & 63;
        }
        return buffer;
      };
      var polyUint16Array$1 = function(buffer) {
        var length2 = buffer.length;
        var bytes = [];
        for (var i4 = 0; i4 < length2; i4 += 2) {
          bytes.push(buffer[i4 + 1] << 8 | buffer[i4]);
        }
        return bytes;
      };
      var polyUint32Array$1 = function(buffer) {
        var length2 = buffer.length;
        var bytes = [];
        for (var i4 = 0; i4 < length2; i4 += 4) {
          bytes.push(buffer[i4 + 3] << 24 | buffer[i4 + 2] << 16 | buffer[i4 + 1] << 8 | buffer[i4]);
        }
        return bytes;
      };
      var UTRIE2_SHIFT_2$1 = 5;
      var UTRIE2_SHIFT_1$1 = 6 + 5;
      var UTRIE2_INDEX_SHIFT$1 = 2;
      var UTRIE2_SHIFT_1_2$1 = UTRIE2_SHIFT_1$1 - UTRIE2_SHIFT_2$1;
      var UTRIE2_LSCP_INDEX_2_OFFSET$1 = 65536 >> UTRIE2_SHIFT_2$1;
      var UTRIE2_DATA_BLOCK_LENGTH$1 = 1 << UTRIE2_SHIFT_2$1;
      var UTRIE2_DATA_MASK$1 = UTRIE2_DATA_BLOCK_LENGTH$1 - 1;
      var UTRIE2_LSCP_INDEX_2_LENGTH$1 = 1024 >> UTRIE2_SHIFT_2$1;
      var UTRIE2_INDEX_2_BMP_LENGTH$1 = UTRIE2_LSCP_INDEX_2_OFFSET$1 + UTRIE2_LSCP_INDEX_2_LENGTH$1;
      var UTRIE2_UTF8_2B_INDEX_2_OFFSET$1 = UTRIE2_INDEX_2_BMP_LENGTH$1;
      var UTRIE2_UTF8_2B_INDEX_2_LENGTH$1 = 2048 >> 6;
      var UTRIE2_INDEX_1_OFFSET$1 = UTRIE2_UTF8_2B_INDEX_2_OFFSET$1 + UTRIE2_UTF8_2B_INDEX_2_LENGTH$1;
      var UTRIE2_OMITTED_BMP_INDEX_1_LENGTH$1 = 65536 >> UTRIE2_SHIFT_1$1;
      var UTRIE2_INDEX_2_BLOCK_LENGTH$1 = 1 << UTRIE2_SHIFT_1_2$1;
      var UTRIE2_INDEX_2_MASK$1 = UTRIE2_INDEX_2_BLOCK_LENGTH$1 - 1;
      var slice16$1 = function(view, start, end) {
        if (view.slice) {
          return view.slice(start, end);
        }
        return new Uint16Array(Array.prototype.slice.call(view, start, end));
      };
      var slice32$1 = function(view, start, end) {
        if (view.slice) {
          return view.slice(start, end);
        }
        return new Uint32Array(Array.prototype.slice.call(view, start, end));
      };
      var createTrieFromBase64$1 = function(base642, _byteLength) {
        var buffer = decode$1(base642);
        var view32 = Array.isArray(buffer) ? polyUint32Array$1(buffer) : new Uint32Array(buffer);
        var view16 = Array.isArray(buffer) ? polyUint16Array$1(buffer) : new Uint16Array(buffer);
        var headerLength = 24;
        var index3 = slice16$1(view16, headerLength / 2, view32[4] / 2);
        var data2 = view32[5] === 2 ? slice16$1(view16, (headerLength + view32[4]) / 2) : slice32$1(view32, Math.ceil((headerLength + view32[4]) / 4));
        return new Trie$1(view32[0], view32[1], view32[2], view32[3], index3, data2);
      };
      var Trie$1 = (
        /** @class */
        function() {
          function Trie2(initialValue, errorValue, highStart, highValueIndex, index3, data2) {
            this.initialValue = initialValue;
            this.errorValue = errorValue;
            this.highStart = highStart;
            this.highValueIndex = highValueIndex;
            this.index = index3;
            this.data = data2;
          }
          Trie2.prototype.get = function(codePoint) {
            var ix;
            if (codePoint >= 0) {
              if (codePoint < 55296 || codePoint > 56319 && codePoint <= 65535) {
                ix = this.index[codePoint >> UTRIE2_SHIFT_2$1];
                ix = (ix << UTRIE2_INDEX_SHIFT$1) + (codePoint & UTRIE2_DATA_MASK$1);
                return this.data[ix];
              }
              if (codePoint <= 65535) {
                ix = this.index[UTRIE2_LSCP_INDEX_2_OFFSET$1 + (codePoint - 55296 >> UTRIE2_SHIFT_2$1)];
                ix = (ix << UTRIE2_INDEX_SHIFT$1) + (codePoint & UTRIE2_DATA_MASK$1);
                return this.data[ix];
              }
              if (codePoint < this.highStart) {
                ix = UTRIE2_INDEX_1_OFFSET$1 - UTRIE2_OMITTED_BMP_INDEX_1_LENGTH$1 + (codePoint >> UTRIE2_SHIFT_1$1);
                ix = this.index[ix];
                ix += codePoint >> UTRIE2_SHIFT_2$1 & UTRIE2_INDEX_2_MASK$1;
                ix = this.index[ix];
                ix = (ix << UTRIE2_INDEX_SHIFT$1) + (codePoint & UTRIE2_DATA_MASK$1);
                return this.data[ix];
              }
              if (codePoint <= 1114111) {
                return this.data[this.highValueIndex];
              }
            }
            return this.errorValue;
          };
          return Trie2;
        }()
      );
      var chars$3 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
      var lookup$3 = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);
      for (var i$3 = 0; i$3 < chars$3.length; i$3++) {
        lookup$3[chars$3.charCodeAt(i$3)] = i$3;
      }
      var base64$1 = "[encoded data, 52888 characters]";
      var LETTER_NUMBER_MODIFIER = 50;
      var BK = 1;
      var CR$1 = 2;
      var LF$1 = 3;
      var CM = 4;
      var NL = 5;
      var WJ = 7;
      var ZW = 8;
      var GL = 9;
      var SP = 10;
      var ZWJ$1 = 11;
      var B2 = 12;
      var BA = 13;
      var BB = 14;
      var HY = 15;
      var CB = 16;
      var CL = 17;
      var CP = 18;
      var EX = 19;
      var IN = 20;
      var NS = 21;
      var OP = 22;
      var QU = 23;
      var IS = 24;
      var NU = 25;
      var PO = 26;
      var PR = 27;
      var SY = 28;
      var AI = 29;
      var AL = 30;
      var CJ = 31;
      var EB = 32;
      var EM = 33;
      var H2 = 34;
      var H3 = 35;
      var HL = 36;
      var ID = 37;
      var JL = 38;
      var JV = 39;
      var JT = 40;
      var RI$1 = 41;
      var SA = 42;
      var XX = 43;
      var ea_OP = [9001, 65288];
      var BREAK_MANDATORY = "!";
      var BREAK_NOT_ALLOWED$1 = "\xD7";
      var BREAK_ALLOWED$1 = "\xF7";
      var UnicodeTrie$1 = createTrieFromBase64$1(base64$1);
      var ALPHABETICS = [AL, HL];
      var HARD_LINE_BREAKS = [BK, CR$1, LF$1, NL];
      var SPACE$1 = [SP, ZW];
      var PREFIX_POSTFIX = [PR, PO];
      var LINE_BREAKS = HARD_LINE_BREAKS.concat(SPACE$1);
      var KOREAN_SYLLABLE_BLOCK = [JL, JV, JT, H2, H3];
      var HYPHEN = [HY, BA];
      var codePointsToCharacterClasses = function(codePoints, lineBreak2) {
        if (lineBreak2 === void 0) {
          lineBreak2 = "strict";
        }
        var types = [];
        var indices = [];
        var categories = [];
        codePoints.forEach(function(codePoint, index3) {
          var classType = UnicodeTrie$1.get(codePoint);
          if (classType > LETTER_NUMBER_MODIFIER) {
            categories.push(true);
            classType -= LETTER_NUMBER_MODIFIER;
          } else {
            categories.push(false);
          }
          if (["normal", "auto", "loose"].indexOf(lineBreak2) !== -1) {
            if ([8208, 8211, 12316, 12448].indexOf(codePoint) !== -1) {
              indices.push(index3);
              return types.push(CB);
            }
          }
          if (classType === CM || classType === ZWJ$1) {
            if (index3 === 0) {
              indices.push(index3);
              return types.push(AL);
            }
            var prev2 = types[index3 - 1];
            if (LINE_BREAKS.indexOf(prev2) === -1) {
              indices.push(indices[index3 - 1]);
              return types.push(prev2);
            }
            indices.push(index3);
            return types.push(AL);
          }
          indices.push(index3);
          if (classType === CJ) {
            return types.push(lineBreak2 === "strict" ? NS : ID);
          }
          if (classType === SA) {
            return types.push(AL);
          }
          if (classType === AI) {
            return types.push(AL);
          }
          if (classType === XX) {
            if (codePoint >= 131072 && codePoint <= 196605 || codePoint >= 196608 && codePoint <= 262141) {
              return types.push(ID);
            } else {
              return types.push(AL);
            }
          }
          types.push(classType);
        });
        return [indices, types, categories];
      };
      var isAdjacentWithSpaceIgnored = function(a4, b2, currentIndex, classTypes) {
        var current = classTypes[currentIndex];
        if (Array.isArray(a4) ? a4.indexOf(current) !== -1 : a4 === current) {
          var i4 = currentIndex;
          while (i4 <= classTypes.length) {
            i4++;
            var next2 = classTypes[i4];
            if (next2 === b2) {
              return true;
            }
            if (next2 !== SP) {
              break;
            }
          }
        }
        if (current === SP) {
          var i4 = currentIndex;
          while (i4 > 0) {
            i4--;
            var prev2 = classTypes[i4];
            if (Array.isArray(a4) ? a4.indexOf(prev2) !== -1 : a4 === prev2) {
              var n3 = currentIndex;
              while (n3 <= classTypes.length) {
                n3++;
                var next2 = classTypes[n3];
                if (next2 === b2) {
                  return true;
                }
                if (next2 !== SP) {
                  break;
                }
              }
            }
            if (prev2 !== SP) {
              break;
            }
          }
        }
        return false;
      };
      var previousNonSpaceClassType = function(currentIndex, classTypes) {
        var i4 = currentIndex;
        while (i4 >= 0) {
          var type = classTypes[i4];
          if (type === SP) {
            i4--;
          } else {
            return type;
          }
        }
        return 0;
      };
      var _lineBreakAtIndex = function(codePoints, classTypes, indicies, index3, forbiddenBreaks) {
        if (indicies[index3] === 0) {
          return BREAK_NOT_ALLOWED$1;
        }
        var currentIndex = index3 - 1;
        if (Array.isArray(forbiddenBreaks) && forbiddenBreaks[currentIndex] === true) {
          return BREAK_NOT_ALLOWED$1;
        }
        var beforeIndex = currentIndex - 1;
        var afterIndex = currentIndex + 1;
        var current = classTypes[currentIndex];
        var before2 = beforeIndex >= 0 ? classTypes[beforeIndex] : 0;
        var next2 = classTypes[afterIndex];
        if (current === CR$1 && next2 === LF$1) {
          return BREAK_NOT_ALLOWED$1;
        }
        if (HARD_LINE_BREAKS.indexOf(current) !== -1) {
          return BREAK_MANDATORY;
        }
        if (HARD_LINE_BREAKS.indexOf(next2) !== -1) {
          return BREAK_NOT_ALLOWED$1;
        }
        if (SPACE$1.indexOf(next2) !== -1) {
          return BREAK_NOT_ALLOWED$1;
        }
        if (previousNonSpaceClassType(currentIndex, classTypes) === ZW) {
          return BREAK_ALLOWED$1;
        }
        if (UnicodeTrie$1.get(codePoints[currentIndex]) === ZWJ$1) {
          return BREAK_NOT_ALLOWED$1;
        }
        if ((current === EB || current === EM) && UnicodeTrie$1.get(codePoints[afterIndex]) === ZWJ$1) {
          return BREAK_NOT_ALLOWED$1;
        }
        if (current === WJ || next2 === WJ) {
          return BREAK_NOT_ALLOWED$1;
        }
        if (current === GL) {
          return BREAK_NOT_ALLOWED$1;
        }
        if ([SP, BA, HY].indexOf(current) === -1 && next2 === GL) {
          return BREAK_NOT_ALLOWED$1;
        }
        if ([CL, CP, EX, IS, SY].indexOf(next2) !== -1) {
          return BREAK_NOT_ALLOWED$1;
        }
        if (previousNonSpaceClassType(currentIndex, classTypes) === OP) {
          return BREAK_NOT_ALLOWED$1;
        }
        if (isAdjacentWithSpaceIgnored(QU, OP, currentIndex, classTypes)) {
          return BREAK_NOT_ALLOWED$1;
        }
        if (isAdjacentWithSpaceIgnored([CL, CP], NS, currentIndex, classTypes)) {
          return BREAK_NOT_ALLOWED$1;
        }
        if (isAdjacentWithSpaceIgnored(B2, B2, currentIndex, classTypes)) {
          return BREAK_NOT_ALLOWED$1;
        }
        if (current === SP) {
          return BREAK_ALLOWED$1;
        }
        if (current === QU || next2 === QU) {
          return BREAK_NOT_ALLOWED$1;
        }
        if (next2 === CB || current === CB) {
          return BREAK_ALLOWED$1;
        }
        if ([BA, HY, NS].indexOf(next2) !== -1 || current === BB) {
          return BREAK_NOT_ALLOWED$1;
        }
        if (before2 === HL && HYPHEN.indexOf(current) !== -1) {
          return BREAK_NOT_ALLOWED$1;
        }
        if (current === SY && next2 === HL) {
          return BREAK_NOT_ALLOWED$1;
        }
        if (next2 === IN) {
          return BREAK_NOT_ALLOWED$1;
        }
        if (ALPHABETICS.indexOf(next2) !== -1 && current === NU || ALPHABETICS.indexOf(current) !== -1 && next2 === NU) {
          return BREAK_NOT_ALLOWED$1;
        }
        if (current === PR && [ID, EB, EM].indexOf(next2) !== -1 || [ID, EB, EM].indexOf(current) !== -1 && next2 === PO) {
          return BREAK_NOT_ALLOWED$1;
        }
        if (ALPHABETICS.indexOf(current) !== -1 && PREFIX_POSTFIX.indexOf(next2) !== -1 || PREFIX_POSTFIX.indexOf(current) !== -1 && ALPHABETICS.indexOf(next2) !== -1) {
          return BREAK_NOT_ALLOWED$1;
        }
        if (
          // (PR | PO) × ( OP | HY )? NU
          [PR, PO].indexOf(current) !== -1 && (next2 === NU || [OP, HY].indexOf(next2) !== -1 && classTypes[afterIndex + 1] === NU) || // ( OP | HY ) × NU
          [OP, HY].indexOf(current) !== -1 && next2 === NU || // NU ×	(NU | SY | IS)
          current === NU && [NU, SY, IS].indexOf(next2) !== -1
        ) {
          return BREAK_NOT_ALLOWED$1;
        }
        if ([NU, SY, IS, CL, CP].indexOf(next2) !== -1) {
          var prevIndex = currentIndex;
          while (prevIndex >= 0) {
            var type = classTypes[prevIndex];
            if (type === NU) {
              return BREAK_NOT_ALLOWED$1;
            } else if ([SY, IS].indexOf(type) !== -1) {
              prevIndex--;
            } else {
              break;
            }
          }
        }
        if ([PR, PO].indexOf(next2) !== -1) {
          var prevIndex = [CL, CP].indexOf(current) !== -1 ? beforeIndex : currentIndex;
          while (prevIndex >= 0) {
            var type = classTypes[prevIndex];
            if (type === NU) {
              return BREAK_NOT_ALLOWED$1;
            } else if ([SY, IS].indexOf(type) !== -1) {
              prevIndex--;
            } else {
              break;
            }
          }
        }
        if (JL === current && [JL, JV, H2, H3].indexOf(next2) !== -1 || [JV, H2].indexOf(current) !== -1 && [JV, JT].indexOf(next2) !== -1 || [JT, H3].indexOf(current) !== -1 && next2 === JT) {
          return BREAK_NOT_ALLOWED$1;
        }
        if (KOREAN_SYLLABLE_BLOCK.indexOf(current) !== -1 && [IN, PO].indexOf(next2) !== -1 || KOREAN_SYLLABLE_BLOCK.indexOf(next2) !== -1 && current === PR) {
          return BREAK_NOT_ALLOWED$1;
        }
        if (ALPHABETICS.indexOf(current) !== -1 && ALPHABETICS.indexOf(next2) !== -1) {
          return BREAK_NOT_ALLOWED$1;
        }
        if (current === IS && ALPHABETICS.indexOf(next2) !== -1) {
          return BREAK_NOT_ALLOWED$1;
        }
        if (ALPHABETICS.concat(NU).indexOf(current) !== -1 && next2 === OP && ea_OP.indexOf(codePoints[afterIndex]) === -1 || ALPHABETICS.concat(NU).indexOf(next2) !== -1 && current === CP) {
          return BREAK_NOT_ALLOWED$1;
        }
        if (current === RI$1 && next2 === RI$1) {
          var i4 = indicies[currentIndex];
          var count = 1;
          while (i4 > 0) {
            i4--;
            if (classTypes[i4] === RI$1) {
              count++;
            } else {
              break;
            }
          }
          if (count % 2 !== 0) {
            return BREAK_NOT_ALLOWED$1;
          }
        }
        if (current === EB && next2 === EM) {
          return BREAK_NOT_ALLOWED$1;
        }
        return BREAK_ALLOWED$1;
      };
      var cssFormattedClasses = function(codePoints, options) {
        if (!options) {
          options = { lineBreak: "normal", wordBreak: "normal" };
        }
        var _a2 = codePointsToCharacterClasses(codePoints, options.lineBreak), indicies = _a2[0], classTypes = _a2[1], isLetterNumber = _a2[2];
        if (options.wordBreak === "break-all" || options.wordBreak === "break-word") {
          classTypes = classTypes.map(function(type) {
            return [NU, AL, SA].indexOf(type) !== -1 ? ID : type;
          });
        }
        var forbiddenBreakpoints = options.wordBreak === "keep-all" ? isLetterNumber.map(function(letterNumber, i4) {
          return letterNumber && codePoints[i4] >= 19968 && codePoints[i4] <= 40959;
        }) : void 0;
        return [indicies, classTypes, forbiddenBreakpoints];
      };
      var Break = (
        /** @class */
        function() {
          function Break2(codePoints, lineBreak2, start, end) {
            this.codePoints = codePoints;
            this.required = lineBreak2 === BREAK_MANDATORY;
            this.start = start;
            this.end = end;
          }
          Break2.prototype.slice = function() {
            return fromCodePoint$1.apply(void 0, this.codePoints.slice(this.start, this.end));
          };
          return Break2;
        }()
      );
      var LineBreaker = function(str, options) {
        var codePoints = toCodePoints$1(str);
        var _a2 = cssFormattedClasses(codePoints, options), indicies = _a2[0], classTypes = _a2[1], forbiddenBreakpoints = _a2[2];
        var length2 = codePoints.length;
        var lastEnd = 0;
        var nextIndex = 0;
        return {
          next: function() {
            if (nextIndex >= length2) {
              return { done: true, value: null };
            }
            var lineBreak2 = BREAK_NOT_ALLOWED$1;
            while (nextIndex < length2 && (lineBreak2 = _lineBreakAtIndex(codePoints, classTypes, indicies, ++nextIndex, forbiddenBreakpoints)) === BREAK_NOT_ALLOWED$1) {
            }
            if (lineBreak2 !== BREAK_NOT_ALLOWED$1 || nextIndex === length2) {
              var value = new Break(codePoints, lineBreak2, lastEnd, nextIndex);
              lastEnd = nextIndex;
              return { value, done: false };
            }
            return { done: true, value: null };
          }
        };
      };
      var FLAG_UNRESTRICTED = 1 << 0;
      var FLAG_ID = 1 << 1;
      var FLAG_INTEGER = 1 << 2;
      var FLAG_NUMBER = 1 << 3;
      var LINE_FEED = 10;
      var SOLIDUS = 47;
      var REVERSE_SOLIDUS = 92;
      var CHARACTER_TABULATION = 9;
      var SPACE = 32;
      var QUOTATION_MARK = 34;
      var EQUALS_SIGN = 61;
      var NUMBER_SIGN = 35;
      var DOLLAR_SIGN = 36;
      var PERCENTAGE_SIGN = 37;
      var APOSTROPHE = 39;
      var LEFT_PARENTHESIS = 40;
      var RIGHT_PARENTHESIS = 41;
      var LOW_LINE = 95;
      var HYPHEN_MINUS = 45;
      var EXCLAMATION_MARK = 33;
      var LESS_THAN_SIGN = 60;
      var GREATER_THAN_SIGN = 62;
      var COMMERCIAL_AT = 64;
      var LEFT_SQUARE_BRACKET = 91;
      var RIGHT_SQUARE_BRACKET = 93;
      var CIRCUMFLEX_ACCENT = 61;
      var LEFT_CURLY_BRACKET = 123;
      var QUESTION_MARK = 63;
      var RIGHT_CURLY_BRACKET = 125;
      var VERTICAL_LINE = 124;
      var TILDE = 126;
      var CONTROL = 128;
      var REPLACEMENT_CHARACTER = 65533;
      var ASTERISK = 42;
      var PLUS_SIGN = 43;
      var COMMA = 44;
      var COLON = 58;
      var SEMICOLON = 59;
      var FULL_STOP = 46;
      var NULL = 0;
      var BACKSPACE = 8;
      var LINE_TABULATION = 11;
      var SHIFT_OUT = 14;
      var INFORMATION_SEPARATOR_ONE = 31;
      var DELETE = 127;
      var EOF = -1;
      var ZERO = 48;
      var a3 = 97;
      var e2 = 101;
      var f3 = 102;
      var u3 = 117;
      var z2 = 122;
      var A3 = 65;
      var E2 = 69;
      var F2 = 70;
      var U2 = 85;
      var Z2 = 90;
      var isDigit = function(codePoint) {
        return codePoint >= ZERO && codePoint <= 57;
      };
      var isSurrogateCodePoint = function(codePoint) {
        return codePoint >= 55296 && codePoint <= 57343;
      };
      var isHex2 = function(codePoint) {
        return isDigit(codePoint) || codePoint >= A3 && codePoint <= F2 || codePoint >= a3 && codePoint <= f3;
      };
      var isLowerCaseLetter = function(codePoint) {
        return codePoint >= a3 && codePoint <= z2;
      };
      var isUpperCaseLetter = function(codePoint) {
        return codePoint >= A3 && codePoint <= Z2;
      };
      var isLetter = function(codePoint) {
        return isLowerCaseLetter(codePoint) || isUpperCaseLetter(codePoint);
      };
      var isNonASCIICodePoint = function(codePoint) {
        return codePoint >= CONTROL;
      };
      var isWhiteSpace = function(codePoint) {
        return codePoint === LINE_FEED || codePoint === CHARACTER_TABULATION || codePoint === SPACE;
      };
      var isNameStartCodePoint = function(codePoint) {
        return isLetter(codePoint) || isNonASCIICodePoint(codePoint) || codePoint === LOW_LINE;
      };
      var isNameCodePoint = function(codePoint) {
        return isNameStartCodePoint(codePoint) || isDigit(codePoint) || codePoint === HYPHEN_MINUS;
      };
      var isNonPrintableCodePoint = function(codePoint) {
        return codePoint >= NULL && codePoint <= BACKSPACE || codePoint === LINE_TABULATION || codePoint >= SHIFT_OUT && codePoint <= INFORMATION_SEPARATOR_ONE || codePoint === DELETE;
      };
      var isValidEscape = function(c1, c22) {
        if (c1 !== REVERSE_SOLIDUS) {
          return false;
        }
        return c22 !== LINE_FEED;
      };
      var isIdentifierStart = function(c1, c22, c32) {
        if (c1 === HYPHEN_MINUS) {
          return isNameStartCodePoint(c22) || isValidEscape(c22, c32);
        } else if (isNameStartCodePoint(c1)) {
          return true;
        } else if (c1 === REVERSE_SOLIDUS && isValidEscape(c1, c22)) {
          return true;
        }
        return false;
      };
      var isNumberStart = function(c1, c22, c32) {
        if (c1 === PLUS_SIGN || c1 === HYPHEN_MINUS) {
          if (isDigit(c22)) {
            return true;
          }
          return c22 === FULL_STOP && isDigit(c32);
        }
        if (c1 === FULL_STOP) {
          return isDigit(c22);
        }
        return isDigit(c1);
      };
      var stringToNumber = function(codePoints) {
        var c4 = 0;
        var sign = 1;
        if (codePoints[c4] === PLUS_SIGN || codePoints[c4] === HYPHEN_MINUS) {
          if (codePoints[c4] === HYPHEN_MINUS) {
            sign = -1;
          }
          c4++;
        }
        var integers = [];
        while (isDigit(codePoints[c4])) {
          integers.push(codePoints[c4++]);
        }
        var int = integers.length ? parseInt(fromCodePoint$1.apply(void 0, integers), 10) : 0;
        if (codePoints[c4] === FULL_STOP) {
          c4++;
        }
        var fraction = [];
        while (isDigit(codePoints[c4])) {
          fraction.push(codePoints[c4++]);
        }
        var fracd = fraction.length;
        var frac = fracd ? parseInt(fromCodePoint$1.apply(void 0, fraction), 10) : 0;
        if (codePoints[c4] === E2 || codePoints[c4] === e2) {
          c4++;
        }
        var expsign = 1;
        if (codePoints[c4] === PLUS_SIGN || codePoints[c4] === HYPHEN_MINUS) {
          if (codePoints[c4] === HYPHEN_MINUS) {
            expsign = -1;
          }
          c4++;
        }
        var exponent = [];
        while (isDigit(codePoints[c4])) {
          exponent.push(codePoints[c4++]);
        }
        var exp = exponent.length ? parseInt(fromCodePoint$1.apply(void 0, exponent), 10) : 0;
        return sign * (int + frac * Math.pow(10, -fracd)) * Math.pow(10, expsign * exp);
      };
      var LEFT_PARENTHESIS_TOKEN = {
        type: 2
        /* LEFT_PARENTHESIS_TOKEN */
      };
      var RIGHT_PARENTHESIS_TOKEN = {
        type: 3
        /* RIGHT_PARENTHESIS_TOKEN */
      };
      var COMMA_TOKEN = {
        type: 4
        /* COMMA_TOKEN */
      };
      var SUFFIX_MATCH_TOKEN = {
        type: 13
        /* SUFFIX_MATCH_TOKEN */
      };
      var PREFIX_MATCH_TOKEN = {
        type: 8
        /* PREFIX_MATCH_TOKEN */
      };
      var COLUMN_TOKEN = {
        type: 21
        /* COLUMN_TOKEN */
      };
      var DASH_MATCH_TOKEN = {
        type: 9
        /* DASH_MATCH_TOKEN */
      };
      var INCLUDE_MATCH_TOKEN = {
        type: 10
        /* INCLUDE_MATCH_TOKEN */
      };
      var LEFT_CURLY_BRACKET_TOKEN = {
        type: 11
        /* LEFT_CURLY_BRACKET_TOKEN */
      };
      var RIGHT_CURLY_BRACKET_TOKEN = {
        type: 12
        /* RIGHT_CURLY_BRACKET_TOKEN */
      };
      var SUBSTRING_MATCH_TOKEN = {
        type: 14
        /* SUBSTRING_MATCH_TOKEN */
      };
      var BAD_URL_TOKEN = {
        type: 23
        /* BAD_URL_TOKEN */
      };
      var BAD_STRING_TOKEN = {
        type: 1
        /* BAD_STRING_TOKEN */
      };
      var CDO_TOKEN = {
        type: 25
        /* CDO_TOKEN */
      };
      var CDC_TOKEN = {
        type: 24
        /* CDC_TOKEN */
      };
      var COLON_TOKEN = {
        type: 26
        /* COLON_TOKEN */
      };
      var SEMICOLON_TOKEN = {
        type: 27
        /* SEMICOLON_TOKEN */
      };
      var LEFT_SQUARE_BRACKET_TOKEN = {
        type: 28
        /* LEFT_SQUARE_BRACKET_TOKEN */
      };
      var RIGHT_SQUARE_BRACKET_TOKEN = {
        type: 29
        /* RIGHT_SQUARE_BRACKET_TOKEN */
      };
      var WHITESPACE_TOKEN = {
        type: 31
        /* WHITESPACE_TOKEN */
      };
      var EOF_TOKEN = {
        type: 32
        /* EOF_TOKEN */
      };
      var Tokenizer = (
        /** @class */
        function() {
          function Tokenizer2() {
            this._value = [];
          }
          Tokenizer2.prototype.write = function(chunk) {
            this._value = this._value.concat(toCodePoints$1(chunk));
          };
          Tokenizer2.prototype.read = function() {
            var tokens = [];
            var token = this.consumeToken();
            while (token !== EOF_TOKEN) {
              tokens.push(token);
              token = this.consumeToken();
            }
            return tokens;
          };
          Tokenizer2.prototype.consumeToken = function() {
            var codePoint = this.consumeCodePoint();
            switch (codePoint) {
              case QUOTATION_MARK:
                return this.consumeStringToken(QUOTATION_MARK);
              case NUMBER_SIGN:
                var c1 = this.peekCodePoint(0);
                var c22 = this.peekCodePoint(1);
                var c32 = this.peekCodePoint(2);
                if (isNameCodePoint(c1) || isValidEscape(c22, c32)) {
                  var flags = isIdentifierStart(c1, c22, c32) ? FLAG_ID : FLAG_UNRESTRICTED;
                  var value = this.consumeName();
                  return { type: 5, value, flags };
                }
                break;
              case DOLLAR_SIGN:
                if (this.peekCodePoint(0) === EQUALS_SIGN) {
                  this.consumeCodePoint();
                  return SUFFIX_MATCH_TOKEN;
                }
                break;
              case APOSTROPHE:
                return this.consumeStringToken(APOSTROPHE);
              case LEFT_PARENTHESIS:
                return LEFT_PARENTHESIS_TOKEN;
              case RIGHT_PARENTHESIS:
                return RIGHT_PARENTHESIS_TOKEN;
              case ASTERISK:
                if (this.peekCodePoint(0) === EQUALS_SIGN) {
                  this.consumeCodePoint();
                  return SUBSTRING_MATCH_TOKEN;
                }
                break;
              case PLUS_SIGN:
                if (isNumberStart(codePoint, this.peekCodePoint(0), this.peekCodePoint(1))) {
                  this.reconsumeCodePoint(codePoint);
                  return this.consumeNumericToken();
                }
                break;
              case COMMA:
                return COMMA_TOKEN;
              case HYPHEN_MINUS:
                var e1 = codePoint;
                var e22 = this.peekCodePoint(0);
                var e3 = this.peekCodePoint(1);
                if (isNumberStart(e1, e22, e3)) {
                  this.reconsumeCodePoint(codePoint);
                  return this.consumeNumericToken();
                }
                if (isIdentifierStart(e1, e22, e3)) {
                  this.reconsumeCodePoint(codePoint);
                  return this.consumeIdentLikeToken();
                }
                if (e22 === HYPHEN_MINUS && e3 === GREATER_THAN_SIGN) {
                  this.consumeCodePoint();
                  this.consumeCodePoint();
                  return CDC_TOKEN;
                }
                break;
              case FULL_STOP:
                if (isNumberStart(codePoint, this.peekCodePoint(0), this.peekCodePoint(1))) {
                  this.reconsumeCodePoint(codePoint);
                  return this.consumeNumericToken();
                }
                break;
              case SOLIDUS:
                if (this.peekCodePoint(0) === ASTERISK) {
                  this.consumeCodePoint();
                  while (true) {
                    var c4 = this.consumeCodePoint();
                    if (c4 === ASTERISK) {
                      c4 = this.consumeCodePoint();
                      if (c4 === SOLIDUS) {
                        return this.consumeToken();
                      }
                    }
                    if (c4 === EOF) {
                      return this.consumeToken();
                    }
                  }
                }
                break;
              case COLON:
                return COLON_TOKEN;
              case SEMICOLON:
                return SEMICOLON_TOKEN;
              case LESS_THAN_SIGN:
                if (this.peekCodePoint(0) === EXCLAMATION_MARK && this.peekCodePoint(1) === HYPHEN_MINUS && this.peekCodePoint(2) === HYPHEN_MINUS) {
                  this.consumeCodePoint();
                  this.consumeCodePoint();
                  return CDO_TOKEN;
                }
                break;
              case COMMERCIAL_AT:
                var a1 = this.peekCodePoint(0);
                var a22 = this.peekCodePoint(1);
                var a32 = this.peekCodePoint(2);
                if (isIdentifierStart(a1, a22, a32)) {
                  var value = this.consumeName();
                  return { type: 7, value };
                }
                break;
              case LEFT_SQUARE_BRACKET:
                return LEFT_SQUARE_BRACKET_TOKEN;
              case REVERSE_SOLIDUS:
                if (isValidEscape(codePoint, this.peekCodePoint(0))) {
                  this.reconsumeCodePoint(codePoint);
                  return this.consumeIdentLikeToken();
                }
                break;
              case RIGHT_SQUARE_BRACKET:
                return RIGHT_SQUARE_BRACKET_TOKEN;
              case CIRCUMFLEX_ACCENT:
                if (this.peekCodePoint(0) === EQUALS_SIGN) {
                  this.consumeCodePoint();
                  return PREFIX_MATCH_TOKEN;
                }
                break;
              case LEFT_CURLY_BRACKET:
                return LEFT_CURLY_BRACKET_TOKEN;
              case RIGHT_CURLY_BRACKET:
                return RIGHT_CURLY_BRACKET_TOKEN;
              case u3:
              case U2:
                var u1 = this.peekCodePoint(0);
                var u22 = this.peekCodePoint(1);
                if (u1 === PLUS_SIGN && (isHex2(u22) || u22 === QUESTION_MARK)) {
                  this.consumeCodePoint();
                  this.consumeUnicodeRangeToken();
                }
                this.reconsumeCodePoint(codePoint);
                return this.consumeIdentLikeToken();
              case VERTICAL_LINE:
                if (this.peekCodePoint(0) === EQUALS_SIGN) {
                  this.consumeCodePoint();
                  return DASH_MATCH_TOKEN;
                }
                if (this.peekCodePoint(0) === VERTICAL_LINE) {
                  this.consumeCodePoint();
                  return COLUMN_TOKEN;
                }
                break;
              case TILDE:
                if (this.peekCodePoint(0) === EQUALS_SIGN) {
                  this.consumeCodePoint();
                  return INCLUDE_MATCH_TOKEN;
                }
                break;
              case EOF:
                return EOF_TOKEN;
            }
            if (isWhiteSpace(codePoint)) {
              this.consumeWhiteSpace();
              return WHITESPACE_TOKEN;
            }
            if (isDigit(codePoint)) {
              this.reconsumeCodePoint(codePoint);
              return this.consumeNumericToken();
            }
            if (isNameStartCodePoint(codePoint)) {
              this.reconsumeCodePoint(codePoint);
              return this.consumeIdentLikeToken();
            }
            return { type: 6, value: fromCodePoint$1(codePoint) };
          };
          Tokenizer2.prototype.consumeCodePoint = function() {
            var value = this._value.shift();
            return typeof value === "undefined" ? -1 : value;
          };
          Tokenizer2.prototype.reconsumeCodePoint = function(codePoint) {
            this._value.unshift(codePoint);
          };
          Tokenizer2.prototype.peekCodePoint = function(delta) {
            if (delta >= this._value.length) {
              return -1;
            }
            return this._value[delta];
          };
          Tokenizer2.prototype.consumeUnicodeRangeToken = function() {
            var digits = [];
            var codePoint = this.consumeCodePoint();
            while (isHex2(codePoint) && digits.length < 6) {
              digits.push(codePoint);
              codePoint = this.consumeCodePoint();
            }
            var questionMarks = false;
            while (codePoint === QUESTION_MARK && digits.length < 6) {
              digits.push(codePoint);
              codePoint = this.consumeCodePoint();
              questionMarks = true;
            }
            if (questionMarks) {
              var start_1 = parseInt(fromCodePoint$1.apply(void 0, digits.map(function(digit) {
                return digit === QUESTION_MARK ? ZERO : digit;
              })), 16);
              var end = parseInt(fromCodePoint$1.apply(void 0, digits.map(function(digit) {
                return digit === QUESTION_MARK ? F2 : digit;
              })), 16);
              return { type: 30, start: start_1, end };
            }
            var start = parseInt(fromCodePoint$1.apply(void 0, digits), 16);
            if (this.peekCodePoint(0) === HYPHEN_MINUS && isHex2(this.peekCodePoint(1))) {
              this.consumeCodePoint();
              codePoint = this.consumeCodePoint();
              var endDigits = [];
              while (isHex2(codePoint) && endDigits.length < 6) {
                endDigits.push(codePoint);
                codePoint = this.consumeCodePoint();
              }
              var end = parseInt(fromCodePoint$1.apply(void 0, endDigits), 16);
              return { type: 30, start, end };
            } else {
              return { type: 30, start, end: start };
            }
          };
          Tokenizer2.prototype.consumeIdentLikeToken = function() {
            var value = this.consumeName();
            if (value.toLowerCase() === "url" && this.peekCodePoint(0) === LEFT_PARENTHESIS) {
              this.consumeCodePoint();
              return this.consumeUrlToken();
            } else if (this.peekCodePoint(0) === LEFT_PARENTHESIS) {
              this.consumeCodePoint();
              return { type: 19, value };
            }
            return { type: 20, value };
          };
          Tokenizer2.prototype.consumeUrlToken = function() {
            var value = [];
            this.consumeWhiteSpace();
            if (this.peekCodePoint(0) === EOF) {
              return { type: 22, value: "" };
            }
            var next2 = this.peekCodePoint(0);
            if (next2 === APOSTROPHE || next2 === QUOTATION_MARK) {
              var stringToken = this.consumeStringToken(this.consumeCodePoint());
              if (stringToken.type === 0) {
                this.consumeWhiteSpace();
                if (this.peekCodePoint(0) === EOF || this.peekCodePoint(0) === RIGHT_PARENTHESIS) {
                  this.consumeCodePoint();
                  return { type: 22, value: stringToken.value };
                }
              }
              this.consumeBadUrlRemnants();
              return BAD_URL_TOKEN;
            }
            while (true) {
              var codePoint = this.consumeCodePoint();
              if (codePoint === EOF || codePoint === RIGHT_PARENTHESIS) {
                return { type: 22, value: fromCodePoint$1.apply(void 0, value) };
              } else if (isWhiteSpace(codePoint)) {
                this.consumeWhiteSpace();
                if (this.peekCodePoint(0) === EOF || this.peekCodePoint(0) === RIGHT_PARENTHESIS) {
                  this.consumeCodePoint();
                  return { type: 22, value: fromCodePoint$1.apply(void 0, value) };
                }
                this.consumeBadUrlRemnants();
                return BAD_URL_TOKEN;
              } else if (codePoint === QUOTATION_MARK || codePoint === APOSTROPHE || codePoint === LEFT_PARENTHESIS || isNonPrintableCodePoint(codePoint)) {
                this.consumeBadUrlRemnants();
                return BAD_URL_TOKEN;
              } else if (codePoint === REVERSE_SOLIDUS) {
                if (isValidEscape(codePoint, this.peekCodePoint(0))) {
                  value.push(this.consumeEscapedCodePoint());
                } else {
                  this.consumeBadUrlRemnants();
                  return BAD_URL_TOKEN;
                }
              } else {
                value.push(codePoint);
              }
            }
          };
          Tokenizer2.prototype.consumeWhiteSpace = function() {
            while (isWhiteSpace(this.peekCodePoint(0))) {
              this.consumeCodePoint();
            }
          };
          Tokenizer2.prototype.consumeBadUrlRemnants = function() {
            while (true) {
              var codePoint = this.consumeCodePoint();
              if (codePoint === RIGHT_PARENTHESIS || codePoint === EOF) {
                return;
              }
              if (isValidEscape(codePoint, this.peekCodePoint(0))) {
                this.consumeEscapedCodePoint();
              }
            }
          };
          Tokenizer2.prototype.consumeStringSlice = function(count) {
            var SLICE_STACK_SIZE = 5e4;
            var value = "";
            while (count > 0) {
              var amount = Math.min(SLICE_STACK_SIZE, count);
              value += fromCodePoint$1.apply(void 0, this._value.splice(0, amount));
              count -= amount;
            }
            this._value.shift();
            return value;
          };
          Tokenizer2.prototype.consumeStringToken = function(endingCodePoint) {
            var value = "";
            var i4 = 0;
            do {
              var codePoint = this._value[i4];
              if (codePoint === EOF || codePoint === void 0 || codePoint === endingCodePoint) {
                value += this.consumeStringSlice(i4);
                return { type: 0, value };
              }
              if (codePoint === LINE_FEED) {
                this._value.splice(0, i4);
                return BAD_STRING_TOKEN;
              }
              if (codePoint === REVERSE_SOLIDUS) {
                var next2 = this._value[i4 + 1];
                if (next2 !== EOF && next2 !== void 0) {
                  if (next2 === LINE_FEED) {
                    value += this.consumeStringSlice(i4);
                    i4 = -1;
                    this._value.shift();
                  } else if (isValidEscape(codePoint, next2)) {
                    value += this.consumeStringSlice(i4);
                    value += fromCodePoint$1(this.consumeEscapedCodePoint());
                    i4 = -1;
                  }
                }
              }
              i4++;
            } while (true);
          };
          Tokenizer2.prototype.consumeNumber = function() {
            var repr = [];
            var type = FLAG_INTEGER;
            var c1 = this.peekCodePoint(0);
            if (c1 === PLUS_SIGN || c1 === HYPHEN_MINUS) {
              repr.push(this.consumeCodePoint());
            }
            while (isDigit(this.peekCodePoint(0))) {
              repr.push(this.consumeCodePoint());
            }
            c1 = this.peekCodePoint(0);
            var c22 = this.peekCodePoint(1);
            if (c1 === FULL_STOP && isDigit(c22)) {
              repr.push(this.consumeCodePoint(), this.consumeCodePoint());
              type = FLAG_NUMBER;
              while (isDigit(this.peekCodePoint(0))) {
                repr.push(this.consumeCodePoint());
              }
            }
            c1 = this.peekCodePoint(0);
            c22 = this.peekCodePoint(1);
            var c32 = this.peekCodePoint(2);
            if ((c1 === E2 || c1 === e2) && ((c22 === PLUS_SIGN || c22 === HYPHEN_MINUS) && isDigit(c32) || isDigit(c22))) {
              repr.push(this.consumeCodePoint(), this.consumeCodePoint());
              type = FLAG_NUMBER;
              while (isDigit(this.peekCodePoint(0))) {
                repr.push(this.consumeCodePoint());
              }
            }
            return [stringToNumber(repr), type];
          };
          Tokenizer2.prototype.consumeNumericToken = function() {
            var _a2 = this.consumeNumber(), number = _a2[0], flags = _a2[1];
            var c1 = this.peekCodePoint(0);
            var c22 = this.peekCodePoint(1);
            var c32 = this.peekCodePoint(2);
            if (isIdentifierStart(c1, c22, c32)) {
              var unit = this.consumeName();
              return { type: 15, number, flags, unit };
            }
            if (c1 === PERCENTAGE_SIGN) {
              this.consumeCodePoint();
              return { type: 16, number, flags };
            }
            return { type: 17, number, flags };
          };
          Tokenizer2.prototype.consumeEscapedCodePoint = function() {
            var codePoint = this.consumeCodePoint();
            if (isHex2(codePoint)) {
              var hex2 = fromCodePoint$1(codePoint);
              while (isHex2(this.peekCodePoint(0)) && hex2.length < 6) {
                hex2 += fromCodePoint$1(this.consumeCodePoint());
              }
              if (isWhiteSpace(this.peekCodePoint(0))) {
                this.consumeCodePoint();
              }
              var hexCodePoint = parseInt(hex2, 16);
              if (hexCodePoint === 0 || isSurrogateCodePoint(hexCodePoint) || hexCodePoint > 1114111) {
                return REPLACEMENT_CHARACTER;
              }
              return hexCodePoint;
            }
            if (codePoint === EOF) {
              return REPLACEMENT_CHARACTER;
            }
            return codePoint;
          };
          Tokenizer2.prototype.consumeName = function() {
            var result = "";
            while (true) {
              var codePoint = this.consumeCodePoint();
              if (isNameCodePoint(codePoint)) {
                result += fromCodePoint$1(codePoint);
              } else if (isValidEscape(codePoint, this.peekCodePoint(0))) {
                result += fromCodePoint$1(this.consumeEscapedCodePoint());
              } else {
                this.reconsumeCodePoint(codePoint);
                return result;
              }
            }
          };
          return Tokenizer2;
        }()
      );
      var Parser2 = (
        /** @class */
        function() {
          function Parser3(tokens) {
            this._tokens = tokens;
          }
          Parser3.create = function(value) {
            var tokenizer = new Tokenizer();
            tokenizer.write(value);
            return new Parser3(tokenizer.read());
          };
          Parser3.parseValue = function(value) {
            return Parser3.create(value).parseComponentValue();
          };
          Parser3.parseValues = function(value) {
            return Parser3.create(value).parseComponentValues();
          };
          Parser3.prototype.parseComponentValue = function() {
            var token = this.consumeToken();
            while (token.type === 31) {
              token = this.consumeToken();
            }
            if (token.type === 32) {
              throw new SyntaxError("Error parsing CSS component value, unexpected EOF");
            }
            this.reconsumeToken(token);
            var value = this.consumeComponentValue();
            do {
              token = this.consumeToken();
            } while (token.type === 31);
            if (token.type === 32) {
              return value;
            }
            throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one");
          };
          Parser3.prototype.parseComponentValues = function() {
            var values = [];
            while (true) {
              var value = this.consumeComponentValue();
              if (value.type === 32) {
                return values;
              }
              values.push(value);
              values.push();
            }
          };
          Parser3.prototype.consumeComponentValue = function() {
            var token = this.consumeToken();
            switch (token.type) {
              case 11:
              case 28:
              case 2:
                return this.consumeSimpleBlock(token.type);
              case 19:
                return this.consumeFunction(token);
            }
            return token;
          };
          Parser3.prototype.consumeSimpleBlock = function(type) {
            var block = { type, values: [] };
            var token = this.consumeToken();
            while (true) {
              if (token.type === 32 || isEndingTokenFor(token, type)) {
                return block;
              }
              this.reconsumeToken(token);
              block.values.push(this.consumeComponentValue());
              token = this.consumeToken();
            }
          };
          Parser3.prototype.consumeFunction = function(functionToken) {
            var cssFunction = {
              name: functionToken.value,
              values: [],
              type: 18
              /* FUNCTION */
            };
            while (true) {
              var token = this.consumeToken();
              if (token.type === 32 || token.type === 3) {
                return cssFunction;
              }
              this.reconsumeToken(token);
              cssFunction.values.push(this.consumeComponentValue());
            }
          };
          Parser3.prototype.consumeToken = function() {
            var token = this._tokens.shift();
            return typeof token === "undefined" ? EOF_TOKEN : token;
          };
          Parser3.prototype.reconsumeToken = function(token) {
            this._tokens.unshift(token);
          };
          return Parser3;
        }()
      );
      var isDimensionToken = function(token) {
        return token.type === 15;
      };
      var isNumberToken = function(token) {
        return token.type === 17;
      };
      var isIdentToken = function(token) {
        return token.type === 20;
      };
      var isStringToken = function(token) {
        return token.type === 0;
      };
      var isIdentWithValue = function(token, value) {
        return isIdentToken(token) && token.value === value;
      };
      var nonWhiteSpace = function(token) {
        return token.type !== 31;
      };
      var nonFunctionArgSeparator = function(token) {
        return token.type !== 31 && token.type !== 4;
      };
      var parseFunctionArgs = function(tokens) {
        var args = [];
        var arg = [];
        tokens.forEach(function(token) {
          if (token.type === 4) {
            if (arg.length === 0) {
              throw new Error("Error parsing function args, zero tokens for arg");
            }
            args.push(arg);
            arg = [];
            return;
          }
          if (token.type !== 31) {
            arg.push(token);
          }
        });
        if (arg.length) {
          args.push(arg);
        }
        return args;
      };
      var isEndingTokenFor = function(token, type) {
        if (type === 11 && token.type === 12) {
          return true;
        }
        if (type === 28 && token.type === 29) {
          return true;
        }
        return type === 2 && token.type === 3;
      };
      var isLength = function(token) {
        return token.type === 17 || token.type === 15;
      };
      var isLengthPercentage = function(token) {
        return token.type === 16 || isLength(token);
      };
      var parseLengthPercentageTuple = function(tokens) {
        return tokens.length > 1 ? [tokens[0], tokens[1]] : [tokens[0]];
      };
      var ZERO_LENGTH = {
        type: 17,
        number: 0,
        flags: FLAG_INTEGER
      };
      var FIFTY_PERCENT = {
        type: 16,
        number: 50,
        flags: FLAG_INTEGER
      };
      var HUNDRED_PERCENT = {
        type: 16,
        number: 100,
        flags: FLAG_INTEGER
      };
      var getAbsoluteValueForTuple = function(tuple, width2, height2) {
        var x3 = tuple[0], y4 = tuple[1];
        return [getAbsoluteValue(x3, width2), getAbsoluteValue(typeof y4 !== "undefined" ? y4 : x3, height2)];
      };
      var getAbsoluteValue = function(token, parent) {
        if (token.type === 16) {
          return token.number / 100 * parent;
        }
        if (isDimensionToken(token)) {
          switch (token.unit) {
            case "rem":
            case "em":
              return 16 * token.number;
            case "px":
            default:
              return token.number;
          }
        }
        return token.number;
      };
      var DEG = "deg";
      var GRAD = "grad";
      var RAD = "rad";
      var TURN = "turn";
      var angle = {
        name: "angle",
        parse: function(_context, value) {
          if (value.type === 15) {
            switch (value.unit) {
              case DEG:
                return Math.PI * value.number / 180;
              case GRAD:
                return Math.PI / 200 * value.number;
              case RAD:
                return value.number;
              case TURN:
                return Math.PI * 2 * value.number;
            }
          }
          throw new Error("Unsupported angle type");
        }
      };
      var isAngle = function(value) {
        if (value.type === 15) {
          if (value.unit === DEG || value.unit === GRAD || value.unit === RAD || value.unit === TURN) {
            return true;
          }
        }
        return false;
      };
      var parseNamedSide = function(tokens) {
        var sideOrCorner = tokens.filter(isIdentToken).map(function(ident) {
          return ident.value;
        }).join(" ");
        switch (sideOrCorner) {
          case "to bottom right":
          case "to right bottom":
          case "left top":
          case "top left":
            return [ZERO_LENGTH, ZERO_LENGTH];
          case "to top":
          case "bottom":
            return deg(0);
          case "to bottom left":
          case "to left bottom":
          case "right top":
          case "top right":
            return [ZERO_LENGTH, HUNDRED_PERCENT];
          case "to right":
          case "left":
            return deg(90);
          case "to top left":
          case "to left top":
          case "right bottom":
          case "bottom right":
            return [HUNDRED_PERCENT, HUNDRED_PERCENT];
          case "to bottom":
          case "top":
            return deg(180);
          case "to top right":
          case "to right top":
          case "left bottom":
          case "bottom left":
            return [HUNDRED_PERCENT, ZERO_LENGTH];
          case "to left":
          case "right":
            return deg(270);
        }
        return 0;
      };
      var deg = function(deg2) {
        return Math.PI * deg2 / 180;
      };
      var color$1 = {
        name: "color",
        parse: function(context, value) {
          if (value.type === 18) {
            var colorFunction = SUPPORTED_COLOR_FUNCTIONS[value.name];
            if (typeof colorFunction === "undefined") {
              throw new Error('Attempting to parse an unsupported color function "' + value.name + '"');
            }
            return colorFunction(context, value.values);
          }
          if (value.type === 5) {
            if (value.value.length === 3) {
              var r2 = value.value.substring(0, 1);
              var g2 = value.value.substring(1, 2);
              var b2 = value.value.substring(2, 3);
              return pack(parseInt(r2 + r2, 16), parseInt(g2 + g2, 16), parseInt(b2 + b2, 16), 1);
            }
            if (value.value.length === 4) {
              var r2 = value.value.substring(0, 1);
              var g2 = value.value.substring(1, 2);
              var b2 = value.value.substring(2, 3);
              var a4 = value.value.substring(3, 4);
              return pack(parseInt(r2 + r2, 16), parseInt(g2 + g2, 16), parseInt(b2 + b2, 16), parseInt(a4 + a4, 16) / 255);
            }
            if (value.value.length === 6) {
              var r2 = value.value.substring(0, 2);
              var g2 = value.value.substring(2, 4);
              var b2 = value.value.substring(4, 6);
              return pack(parseInt(r2, 16), parseInt(g2, 16), parseInt(b2, 16), 1);
            }
            if (value.value.length === 8) {
              var r2 = value.value.substring(0, 2);
              var g2 = value.value.substring(2, 4);
              var b2 = value.value.substring(4, 6);
              var a4 = value.value.substring(6, 8);
              return pack(parseInt(r2, 16), parseInt(g2, 16), parseInt(b2, 16), parseInt(a4, 16) / 255);
            }
          }
          if (value.type === 20) {
            var namedColor = COLORS[value.value.toUpperCase()];
            if (typeof namedColor !== "undefined") {
              return namedColor;
            }
          }
          return COLORS.TRANSPARENT;
        }
      };
      var isTransparent = function(color2) {
        return (255 & color2) === 0;
      };
      var asString = function(color2) {
        var alpha = 255 & color2;
        var blue = 255 & color2 >> 8;
        var green = 255 & color2 >> 16;
        var red = 255 & color2 >> 24;
        return alpha < 255 ? "rgba(" + red + "," + green + "," + blue + "," + alpha / 255 + ")" : "rgb(" + red + "," + green + "," + blue + ")";
      };
      var pack = function(r2, g2, b2, a4) {
        return (r2 << 24 | g2 << 16 | b2 << 8 | Math.round(a4 * 255) << 0) >>> 0;
      };
      var getTokenColorValue = function(token, i4) {
        if (token.type === 17) {
          return token.number;
        }
        if (token.type === 16) {
          var max3 = i4 === 3 ? 1 : 255;
          return i4 === 3 ? token.number / 100 * max3 : Math.round(token.number / 100 * max3);
        }
        return 0;
      };
      var rgb2 = function(_context, args) {
        var tokens = args.filter(nonFunctionArgSeparator);
        if (tokens.length === 3) {
          var _a2 = tokens.map(getTokenColorValue), r2 = _a2[0], g2 = _a2[1], b2 = _a2[2];
          return pack(r2, g2, b2, 1);
        }
        if (tokens.length === 4) {
          var _b2 = tokens.map(getTokenColorValue), r2 = _b2[0], g2 = _b2[1], b2 = _b2[2], a4 = _b2[3];
          return pack(r2, g2, b2, a4);
        }
        return 0;
      };
      function hue2rgb(t1, t22, hue) {
        if (hue < 0) {
          hue += 1;
        }
        if (hue >= 1) {
          hue -= 1;
        }
        if (hue < 1 / 6) {
          return (t22 - t1) * hue * 6 + t1;
        } else if (hue < 1 / 2) {
          return t22;
        } else if (hue < 2 / 3) {
          return (t22 - t1) * 6 * (2 / 3 - hue) + t1;
        } else {
          return t1;
        }
      }
      var hsl = function(context, args) {
        var tokens = args.filter(nonFunctionArgSeparator);
        var hue = tokens[0], saturation = tokens[1], lightness = tokens[2], alpha = tokens[3];
        var h3 = (hue.type === 17 ? deg(hue.number) : angle.parse(context, hue)) / (Math.PI * 2);
        var s3 = isLengthPercentage(saturation) ? saturation.number / 100 : 0;
        var l3 = isLengthPercentage(lightness) ? lightness.number / 100 : 0;
        var a4 = typeof alpha !== "undefined" && isLengthPercentage(alpha) ? getAbsoluteValue(alpha, 1) : 1;
        if (s3 === 0) {
          return pack(l3 * 255, l3 * 255, l3 * 255, 1);
        }
        var t22 = l3 <= 0.5 ? l3 * (s3 + 1) : l3 + s3 - l3 * s3;
        var t1 = l3 * 2 - t22;
        var r2 = hue2rgb(t1, t22, h3 + 1 / 3);
        var g2 = hue2rgb(t1, t22, h3);
        var b2 = hue2rgb(t1, t22, h3 - 1 / 3);
        return pack(r2 * 255, g2 * 255, b2 * 255, a4);
      };
      var SUPPORTED_COLOR_FUNCTIONS = {
        hsl,
        hsla: hsl,
        rgb: rgb2,
        rgba: rgb2
      };
      var parseColor = function(context, value) {
        return color$1.parse(context, Parser2.create(value).parseComponentValue());
      };
      var COLORS = {
        ALICEBLUE: 4042850303,
        ANTIQUEWHITE: 4209760255,
        AQUA: 16777215,
        AQUAMARINE: 2147472639,
        AZURE: 4043309055,
        BEIGE: 4126530815,
        BISQUE: 4293182719,
        BLACK: 255,
        BLANCHEDALMOND: 4293643775,
        BLUE: 65535,
        BLUEVIOLET: 2318131967,
        BROWN: 2771004159,
        BURLYWOOD: 3736635391,
        CADETBLUE: 1604231423,
        CHARTREUSE: 2147418367,
        CHOCOLATE: 3530104575,
        CORAL: 4286533887,
        CORNFLOWERBLUE: 1687547391,
        CORNSILK: 4294499583,
        CRIMSON: 3692313855,
        CYAN: 16777215,
        DARKBLUE: 35839,
        DARKCYAN: 9145343,
        DARKGOLDENROD: 3095837695,
        DARKGRAY: 2846468607,
        DARKGREEN: 6553855,
        DARKGREY: 2846468607,
        DARKKHAKI: 3182914559,
        DARKMAGENTA: 2332068863,
        DARKOLIVEGREEN: 1433087999,
        DARKORANGE: 4287365375,
        DARKORCHID: 2570243327,
        DARKRED: 2332033279,
        DARKSALMON: 3918953215,
        DARKSEAGREEN: 2411499519,
        DARKSLATEBLUE: 1211993087,
        DARKSLATEGRAY: 793726975,
        DARKSLATEGREY: 793726975,
        DARKTURQUOISE: 13554175,
        DARKVIOLET: 2483082239,
        DEEPPINK: 4279538687,
        DEEPSKYBLUE: 12582911,
        DIMGRAY: 1768516095,
        DIMGREY: 1768516095,
        DODGERBLUE: 512819199,
        FIREBRICK: 2988581631,
        FLORALWHITE: 4294635775,
        FORESTGREEN: 579543807,
        FUCHSIA: 4278255615,
        GAINSBORO: 3705462015,
        GHOSTWHITE: 4177068031,
        GOLD: 4292280575,
        GOLDENROD: 3668254975,
        GRAY: 2155905279,
        GREEN: 8388863,
        GREENYELLOW: 2919182335,
        GREY: 2155905279,
        HONEYDEW: 4043305215,
        HOTPINK: 4285117695,
        INDIANRED: 3445382399,
        INDIGO: 1258324735,
        IVORY: 4294963455,
        KHAKI: 4041641215,
        LAVENDER: 3873897215,
        LAVENDERBLUSH: 4293981695,
        LAWNGREEN: 2096890111,
        LEMONCHIFFON: 4294626815,
        LIGHTBLUE: 2916673279,
        LIGHTCORAL: 4034953471,
        LIGHTCYAN: 3774873599,
        LIGHTGOLDENRODYELLOW: 4210742015,
        LIGHTGRAY: 3553874943,
        LIGHTGREEN: 2431553791,
        LIGHTGREY: 3553874943,
        LIGHTPINK: 4290167295,
        LIGHTSALMON: 4288707327,
        LIGHTSEAGREEN: 548580095,
        LIGHTSKYBLUE: 2278488831,
        LIGHTSLATEGRAY: 2005441023,
        LIGHTSLATEGREY: 2005441023,
        LIGHTSTEELBLUE: 2965692159,
        LIGHTYELLOW: 4294959359,
        LIME: 16711935,
        LIMEGREEN: 852308735,
        LINEN: 4210091775,
        MAGENTA: 4278255615,
        MAROON: 2147483903,
        MEDIUMAQUAMARINE: 1724754687,
        MEDIUMBLUE: 52735,
        MEDIUMORCHID: 3126187007,
        MEDIUMPURPLE: 2473647103,
        MEDIUMSEAGREEN: 1018393087,
        MEDIUMSLATEBLUE: 2070474495,
        MEDIUMSPRINGGREEN: 16423679,
        MEDIUMTURQUOISE: 1221709055,
        MEDIUMVIOLETRED: 3340076543,
        MIDNIGHTBLUE: 421097727,
        MINTCREAM: 4127193855,
        MISTYROSE: 4293190143,
        MOCCASIN: 4293178879,
        NAVAJOWHITE: 4292783615,
        NAVY: 33023,
        OLDLACE: 4260751103,
        OLIVE: 2155872511,
        OLIVEDRAB: 1804477439,
        ORANGE: 4289003775,
        ORANGERED: 4282712319,
        ORCHID: 3664828159,
        PALEGOLDENROD: 4008225535,
        PALEGREEN: 2566625535,
        PALETURQUOISE: 2951671551,
        PALEVIOLETRED: 3681588223,
        PAPAYAWHIP: 4293907967,
        PEACHPUFF: 4292524543,
        PERU: 3448061951,
        PINK: 4290825215,
        PLUM: 3718307327,
        POWDERBLUE: 2967529215,
        PURPLE: 2147516671,
        REBECCAPURPLE: 1714657791,
        RED: 4278190335,
        ROSYBROWN: 3163525119,
        ROYALBLUE: 1097458175,
        SADDLEBROWN: 2336560127,
        SALMON: 4202722047,
        SANDYBROWN: 4104413439,
        SEAGREEN: 780883967,
        SEASHELL: 4294307583,
        SIENNA: 2689740287,
        SILVER: 3233857791,
        SKYBLUE: 2278484991,
        SLATEBLUE: 1784335871,
        SLATEGRAY: 1887473919,
        SLATEGREY: 1887473919,
        SNOW: 4294638335,
        SPRINGGREEN: 16744447,
        STEELBLUE: 1182971135,
        TAN: 3535047935,
        TEAL: 8421631,
        THISTLE: 3636451583,
        TOMATO: 4284696575,
        TRANSPARENT: 0,
        TURQUOISE: 1088475391,
        VIOLET: 4001558271,
        WHEAT: 4125012991,
        WHITE: 4294967295,
        WHITESMOKE: 4126537215,
        YELLOW: 4294902015,
        YELLOWGREEN: 2597139199
      };
      var backgroundClip = {
        name: "background-clip",
        initialValue: "border-box",
        prefix: false,
        type: 1,
        parse: function(_context, tokens) {
          return tokens.map(function(token) {
            if (isIdentToken(token)) {
              switch (token.value) {
                case "padding-box":
                  return 1;
                case "content-box":
                  return 2;
              }
            }
            return 0;
          });
        }
      };
      var backgroundColor = {
        name: "background-color",
        initialValue: "transparent",
        prefix: false,
        type: 3,
        format: "color"
      };
      var parseColorStop = function(context, args) {
        var color2 = color$1.parse(context, args[0]);
        var stop = args[1];
        return stop && isLengthPercentage(stop) ? { color: color2, stop } : { color: color2, stop: null };
      };
      var processColorStops = function(stops, lineLength) {
        var first = stops[0];
        var last = stops[stops.length - 1];
        if (first.stop === null) {
          first.stop = ZERO_LENGTH;
        }
        if (last.stop === null) {
          last.stop = HUNDRED_PERCENT;
        }
        var processStops = [];
        var previous2 = 0;
        for (var i4 = 0; i4 < stops.length; i4++) {
          var stop_1 = stops[i4].stop;
          if (stop_1 !== null) {
            var absoluteValue = getAbsoluteValue(stop_1, lineLength);
            if (absoluteValue > previous2) {
              processStops.push(absoluteValue);
            } else {
              processStops.push(previous2);
            }
            previous2 = absoluteValue;
          } else {
            processStops.push(null);
          }
        }
        var gapBegin = null;
        for (var i4 = 0; i4 < processStops.length; i4++) {
          var stop_2 = processStops[i4];
          if (stop_2 === null) {
            if (gapBegin === null) {
              gapBegin = i4;
            }
          } else if (gapBegin !== null) {
            var gapLength = i4 - gapBegin;
            var beforeGap = processStops[gapBegin - 1];
            var gapValue = (stop_2 - beforeGap) / (gapLength + 1);
            for (var g2 = 1; g2 <= gapLength; g2++) {
              processStops[gapBegin + g2 - 1] = gapValue * g2;
            }
            gapBegin = null;
          }
        }
        return stops.map(function(_a2, i5) {
          var color2 = _a2.color;
          return { color: color2, stop: Math.max(Math.min(1, processStops[i5] / lineLength), 0) };
        });
      };
      var getAngleFromCorner = function(corner, width2, height2) {
        var centerX = width2 / 2;
        var centerY = height2 / 2;
        var x3 = getAbsoluteValue(corner[0], width2) - centerX;
        var y4 = centerY - getAbsoluteValue(corner[1], height2);
        return (Math.atan2(y4, x3) + Math.PI * 2) % (Math.PI * 2);
      };
      var calculateGradientDirection = function(angle2, width2, height2) {
        var radian = typeof angle2 === "number" ? angle2 : getAngleFromCorner(angle2, width2, height2);
        var lineLength = Math.abs(width2 * Math.sin(radian)) + Math.abs(height2 * Math.cos(radian));
        var halfWidth = width2 / 2;
        var halfHeight = height2 / 2;
        var halfLineLength = lineLength / 2;
        var yDiff = Math.sin(radian - Math.PI / 2) * halfLineLength;
        var xDiff = Math.cos(radian - Math.PI / 2) * halfLineLength;
        return [lineLength, halfWidth - xDiff, halfWidth + xDiff, halfHeight - yDiff, halfHeight + yDiff];
      };
      var distance = function(a4, b2) {
        return Math.sqrt(a4 * a4 + b2 * b2);
      };
      var findCorner = function(width2, height2, x3, y4, closest) {
        var corners = [
          [0, 0],
          [0, height2],
          [width2, 0],
          [width2, height2]
        ];
        return corners.reduce(function(stat, corner) {
          var cx2 = corner[0], cy2 = corner[1];
          var d2 = distance(x3 - cx2, y4 - cy2);
          if (closest ? d2 < stat.optimumDistance : d2 > stat.optimumDistance) {
            return {
              optimumCorner: corner,
              optimumDistance: d2
            };
          }
          return stat;
        }, {
          optimumDistance: closest ? Infinity : -Infinity,
          optimumCorner: null
        }).optimumCorner;
      };
      var calculateRadius = function(gradient, x3, y4, width2, height2) {
        var rx2 = 0;
        var ry2 = 0;
        switch (gradient.size) {
          case 0:
            if (gradient.shape === 0) {
              rx2 = ry2 = Math.min(Math.abs(x3), Math.abs(x3 - width2), Math.abs(y4), Math.abs(y4 - height2));
            } else if (gradient.shape === 1) {
              rx2 = Math.min(Math.abs(x3), Math.abs(x3 - width2));
              ry2 = Math.min(Math.abs(y4), Math.abs(y4 - height2));
            }
            break;
          case 2:
            if (gradient.shape === 0) {
              rx2 = ry2 = Math.min(distance(x3, y4), distance(x3, y4 - height2), distance(x3 - width2, y4), distance(x3 - width2, y4 - height2));
            } else if (gradient.shape === 1) {
              var c4 = Math.min(Math.abs(y4), Math.abs(y4 - height2)) / Math.min(Math.abs(x3), Math.abs(x3 - width2));
              var _a2 = findCorner(width2, height2, x3, y4, true), cx2 = _a2[0], cy2 = _a2[1];
              rx2 = distance(cx2 - x3, (cy2 - y4) / c4);
              ry2 = c4 * rx2;
            }
            break;
          case 1:
            if (gradient.shape === 0) {
              rx2 = ry2 = Math.max(Math.abs(x3), Math.abs(x3 - width2), Math.abs(y4), Math.abs(y4 - height2));
            } else if (gradient.shape === 1) {
              rx2 = Math.max(Math.abs(x3), Math.abs(x3 - width2));
              ry2 = Math.max(Math.abs(y4), Math.abs(y4 - height2));
            }
            break;
          case 3:
            if (gradient.shape === 0) {
              rx2 = ry2 = Math.max(distance(x3, y4), distance(x3, y4 - height2), distance(x3 - width2, y4), distance(x3 - width2, y4 - height2));
            } else if (gradient.shape === 1) {
              var c4 = Math.max(Math.abs(y4), Math.abs(y4 - height2)) / Math.max(Math.abs(x3), Math.abs(x3 - width2));
              var _b2 = findCorner(width2, height2, x3, y4, false), cx2 = _b2[0], cy2 = _b2[1];
              rx2 = distance(cx2 - x3, (cy2 - y4) / c4);
              ry2 = c4 * rx2;
            }
            break;
        }
        if (Array.isArray(gradient.size)) {
          rx2 = getAbsoluteValue(gradient.size[0], width2);
          ry2 = gradient.size.length === 2 ? getAbsoluteValue(gradient.size[1], height2) : rx2;
        }
        return [rx2, ry2];
      };
      var linearGradient = function(context, tokens) {
        var angle$1 = deg(180);
        var stops = [];
        parseFunctionArgs(tokens).forEach(function(arg, i4) {
          if (i4 === 0) {
            var firstToken = arg[0];
            if (firstToken.type === 20 && firstToken.value === "to") {
              angle$1 = parseNamedSide(arg);
              return;
            } else if (isAngle(firstToken)) {
              angle$1 = angle.parse(context, firstToken);
              return;
            }
          }
          var colorStop = parseColorStop(context, arg);
          stops.push(colorStop);
        });
        return {
          angle: angle$1,
          stops,
          type: 1
          /* LINEAR_GRADIENT */
        };
      };
      var prefixLinearGradient = function(context, tokens) {
        var angle$1 = deg(180);
        var stops = [];
        parseFunctionArgs(tokens).forEach(function(arg, i4) {
          if (i4 === 0) {
            var firstToken = arg[0];
            if (firstToken.type === 20 && ["top", "left", "right", "bottom"].indexOf(firstToken.value) !== -1) {
              angle$1 = parseNamedSide(arg);
              return;
            } else if (isAngle(firstToken)) {
              angle$1 = (angle.parse(context, firstToken) + deg(270)) % deg(360);
              return;
            }
          }
          var colorStop = parseColorStop(context, arg);
          stops.push(colorStop);
        });
        return {
          angle: angle$1,
          stops,
          type: 1
          /* LINEAR_GRADIENT */
        };
      };
      var webkitGradient = function(context, tokens) {
        var angle2 = deg(180);
        var stops = [];
        var type = 1;
        var shape = 0;
        var size2 = 3;
        var position4 = [];
        parseFunctionArgs(tokens).forEach(function(arg, i4) {
          var firstToken = arg[0];
          if (i4 === 0) {
            if (isIdentToken(firstToken) && firstToken.value === "linear") {
              type = 1;
              return;
            } else if (isIdentToken(firstToken) && firstToken.value === "radial") {
              type = 2;
              return;
            }
          }
          if (firstToken.type === 18) {
            if (firstToken.name === "from") {
              var color2 = color$1.parse(context, firstToken.values[0]);
              stops.push({ stop: ZERO_LENGTH, color: color2 });
            } else if (firstToken.name === "to") {
              var color2 = color$1.parse(context, firstToken.values[0]);
              stops.push({ stop: HUNDRED_PERCENT, color: color2 });
            } else if (firstToken.name === "color-stop") {
              var values = firstToken.values.filter(nonFunctionArgSeparator);
              if (values.length === 2) {
                var color2 = color$1.parse(context, values[1]);
                var stop_1 = values[0];
                if (isNumberToken(stop_1)) {
                  stops.push({
                    stop: { type: 16, number: stop_1.number * 100, flags: stop_1.flags },
                    color: color2
                  });
                }
              }
            }
          }
        });
        return type === 1 ? {
          angle: (angle2 + deg(180)) % deg(360),
          stops,
          type
        } : { size: size2, shape, stops, position: position4, type };
      };
      var CLOSEST_SIDE = "closest-side";
      var FARTHEST_SIDE = "farthest-side";
      var CLOSEST_CORNER = "closest-corner";
      var FARTHEST_CORNER = "farthest-corner";
      var CIRCLE = "circle";
      var ELLIPSE = "ellipse";
      var COVER = "cover";
      var CONTAIN = "contain";
      var radialGradient = function(context, tokens) {
        var shape = 0;
        var size2 = 3;
        var stops = [];
        var position4 = [];
        parseFunctionArgs(tokens).forEach(function(arg, i4) {
          var isColorStop = true;
          if (i4 === 0) {
            var isAtPosition_1 = false;
            isColorStop = arg.reduce(function(acc, token) {
              if (isAtPosition_1) {
                if (isIdentToken(token)) {
                  switch (token.value) {
                    case "center":
                      position4.push(FIFTY_PERCENT);
                      return acc;
                    case "top":
                    case "left":
                      position4.push(ZERO_LENGTH);
                      return acc;
                    case "right":
                    case "bottom":
                      position4.push(HUNDRED_PERCENT);
                      return acc;
                  }
                } else if (isLengthPercentage(token) || isLength(token)) {
                  position4.push(token);
                }
              } else if (isIdentToken(token)) {
                switch (token.value) {
                  case CIRCLE:
                    shape = 0;
                    return false;
                  case ELLIPSE:
                    shape = 1;
                    return false;
                  case "at":
                    isAtPosition_1 = true;
                    return false;
                  case CLOSEST_SIDE:
                    size2 = 0;
                    return false;
                  case COVER:
                  case FARTHEST_SIDE:
                    size2 = 1;
                    return false;
                  case CONTAIN:
                  case CLOSEST_CORNER:
                    size2 = 2;
                    return false;
                  case FARTHEST_CORNER:
                    size2 = 3;
                    return false;
                }
              } else if (isLength(token) || isLengthPercentage(token)) {
                if (!Array.isArray(size2)) {
                  size2 = [];
                }
                size2.push(token);
                return false;
              }
              return acc;
            }, isColorStop);
          }
          if (isColorStop) {
            var colorStop = parseColorStop(context, arg);
            stops.push(colorStop);
          }
        });
        return {
          size: size2,
          shape,
          stops,
          position: position4,
          type: 2
          /* RADIAL_GRADIENT */
        };
      };
      var prefixRadialGradient = function(context, tokens) {
        var shape = 0;
        var size2 = 3;
        var stops = [];
        var position4 = [];
        parseFunctionArgs(tokens).forEach(function(arg, i4) {
          var isColorStop = true;
          if (i4 === 0) {
            isColorStop = arg.reduce(function(acc, token) {
              if (isIdentToken(token)) {
                switch (token.value) {
                  case "center":
                    position4.push(FIFTY_PERCENT);
                    return false;
                  case "top":
                  case "left":
                    position4.push(ZERO_LENGTH);
                    return false;
                  case "right":
                  case "bottom":
                    position4.push(HUNDRED_PERCENT);
                    return false;
                }
              } else if (isLengthPercentage(token) || isLength(token)) {
                position4.push(token);
                return false;
              }
              return acc;
            }, isColorStop);
          } else if (i4 === 1) {
            isColorStop = arg.reduce(function(acc, token) {
              if (isIdentToken(token)) {
                switch (token.value) {
                  case CIRCLE:
                    shape = 0;
                    return false;
                  case ELLIPSE:
                    shape = 1;
                    return false;
                  case CONTAIN:
                  case CLOSEST_SIDE:
                    size2 = 0;
                    return false;
                  case FARTHEST_SIDE:
                    size2 = 1;
                    return false;
                  case CLOSEST_CORNER:
                    size2 = 2;
                    return false;
                  case COVER:
                  case FARTHEST_CORNER:
                    size2 = 3;
                    return false;
                }
              } else if (isLength(token) || isLengthPercentage(token)) {
                if (!Array.isArray(size2)) {
                  size2 = [];
                }
                size2.push(token);
                return false;
              }
              return acc;
            }, isColorStop);
          }
          if (isColorStop) {
            var colorStop = parseColorStop(context, arg);
            stops.push(colorStop);
          }
        });
        return {
          size: size2,
          shape,
          stops,
          position: position4,
          type: 2
          /* RADIAL_GRADIENT */
        };
      };
      var isLinearGradient = function(background) {
        return background.type === 1;
      };
      var isRadialGradient = function(background) {
        return background.type === 2;
      };
      var image = {
        name: "image",
        parse: function(context, value) {
          if (value.type === 22) {
            var image_1 = {
              url: value.value,
              type: 0
              /* URL */
            };
            context.cache.addImage(value.value);
            return image_1;
          }
          if (value.type === 18) {
            var imageFunction = SUPPORTED_IMAGE_FUNCTIONS[value.name];
            if (typeof imageFunction === "undefined") {
              throw new Error('Attempting to parse an unsupported image function "' + value.name + '"');
            }
            return imageFunction(context, value.values);
          }
          throw new Error("Unsupported image type " + value.type);
        }
      };
      function isSupportedImage(value) {
        return !(value.type === 20 && value.value === "none") && (value.type !== 18 || !!SUPPORTED_IMAGE_FUNCTIONS[value.name]);
      }
      var SUPPORTED_IMAGE_FUNCTIONS = {
        "linear-gradient": linearGradient,
        "-moz-linear-gradient": prefixLinearGradient,
        "-ms-linear-gradient": prefixLinearGradient,
        "-o-linear-gradient": prefixLinearGradient,
        "-webkit-linear-gradient": prefixLinearGradient,
        "radial-gradient": radialGradient,
        "-moz-radial-gradient": prefixRadialGradient,
        "-ms-radial-gradient": prefixRadialGradient,
        "-o-radial-gradient": prefixRadialGradient,
        "-webkit-radial-gradient": prefixRadialGradient,
        "-webkit-gradient": webkitGradient
      };
      var backgroundImage = {
        name: "background-image",
        initialValue: "none",
        type: 1,
        prefix: false,
        parse: function(context, tokens) {
          if (tokens.length === 0) {
            return [];
          }
          var first = tokens[0];
          if (first.type === 20 && first.value === "none") {
            return [];
          }
          return tokens.filter(function(value) {
            return nonFunctionArgSeparator(value) && isSupportedImage(value);
          }).map(function(value) {
            return image.parse(context, value);
          });
        }
      };
      var backgroundOrigin = {
        name: "background-origin",
        initialValue: "border-box",
        prefix: false,
        type: 1,
        parse: function(_context, tokens) {
          return tokens.map(function(token) {
            if (isIdentToken(token)) {
              switch (token.value) {
                case "padding-box":
                  return 1;
                case "content-box":
                  return 2;
              }
            }
            return 0;
          });
        }
      };
      var backgroundPosition = {
        name: "background-position",
        initialValue: "0% 0%",
        type: 1,
        prefix: false,
        parse: function(_context, tokens) {
          return parseFunctionArgs(tokens).map(function(values) {
            return values.filter(isLengthPercentage);
          }).map(parseLengthPercentageTuple);
        }
      };
      var backgroundRepeat = {
        name: "background-repeat",
        initialValue: "repeat",
        prefix: false,
        type: 1,
        parse: function(_context, tokens) {
          return parseFunctionArgs(tokens).map(function(values) {
            return values.filter(isIdentToken).map(function(token) {
              return token.value;
            }).join(" ");
          }).map(parseBackgroundRepeat);
        }
      };
      var parseBackgroundRepeat = function(value) {
        switch (value) {
          case "no-repeat":
            return 1;
          case "repeat-x":
          case "repeat no-repeat":
            return 2;
          case "repeat-y":
          case "no-repeat repeat":
            return 3;
          case "repeat":
          default:
            return 0;
        }
      };
      var BACKGROUND_SIZE;
      (function(BACKGROUND_SIZE2) {
        BACKGROUND_SIZE2["AUTO"] = "auto";
        BACKGROUND_SIZE2["CONTAIN"] = "contain";
        BACKGROUND_SIZE2["COVER"] = "cover";
      })(BACKGROUND_SIZE || (BACKGROUND_SIZE = {}));
      var backgroundSize = {
        name: "background-size",
        initialValue: "0",
        prefix: false,
        type: 1,
        parse: function(_context, tokens) {
          return parseFunctionArgs(tokens).map(function(values) {
            return values.filter(isBackgroundSizeInfoToken);
          });
        }
      };
      var isBackgroundSizeInfoToken = function(value) {
        return isIdentToken(value) || isLengthPercentage(value);
      };
      var borderColorForSide = function(side) {
        return {
          name: "border-" + side + "-color",
          initialValue: "transparent",
          prefix: false,
          type: 3,
          format: "color"
        };
      };
      var borderTopColor = borderColorForSide("top");
      var borderRightColor = borderColorForSide("right");
      var borderBottomColor = borderColorForSide("bottom");
      var borderLeftColor = borderColorForSide("left");
      var borderRadiusForSide = function(side) {
        return {
          name: "border-radius-" + side,
          initialValue: "0 0",
          prefix: false,
          type: 1,
          parse: function(_context, tokens) {
            return parseLengthPercentageTuple(tokens.filter(isLengthPercentage));
          }
        };
      };
      var borderTopLeftRadius = borderRadiusForSide("top-left");
      var borderTopRightRadius = borderRadiusForSide("top-right");
      var borderBottomRightRadius = borderRadiusForSide("bottom-right");
      var borderBottomLeftRadius = borderRadiusForSide("bottom-left");
      var borderStyleForSide = function(side) {
        return {
          name: "border-" + side + "-style",
          initialValue: "solid",
          prefix: false,
          type: 2,
          parse: function(_context, style) {
            switch (style) {
              case "none":
                return 0;
              case "dashed":
                return 2;
              case "dotted":
                return 3;
              case "double":
                return 4;
            }
            return 1;
          }
        };
      };
      var borderTopStyle = borderStyleForSide("top");
      var borderRightStyle = borderStyleForSide("right");
      var borderBottomStyle = borderStyleForSide("bottom");
      var borderLeftStyle = borderStyleForSide("left");
      var borderWidthForSide = function(side) {
        return {
          name: "border-" + side + "-width",
          initialValue: "0",
          type: 0,
          prefix: false,
          parse: function(_context, token) {
            if (isDimensionToken(token)) {
              return token.number;
            }
            return 0;
          }
        };
      };
      var borderTopWidth = borderWidthForSide("top");
      var borderRightWidth = borderWidthForSide("right");
      var borderBottomWidth = borderWidthForSide("bottom");
      var borderLeftWidth = borderWidthForSide("left");
      var color = {
        name: "color",
        initialValue: "transparent",
        prefix: false,
        type: 3,
        format: "color"
      };
      var direction = {
        name: "direction",
        initialValue: "ltr",
        prefix: false,
        type: 2,
        parse: function(_context, direction2) {
          switch (direction2) {
            case "rtl":
              return 1;
            case "ltr":
            default:
              return 0;
          }
        }
      };
      var display = {
        name: "display",
        initialValue: "inline-block",
        prefix: false,
        type: 1,
        parse: function(_context, tokens) {
          return tokens.filter(isIdentToken).reduce(
            function(bit, token) {
              return bit | parseDisplayValue(token.value);
            },
            0
            /* NONE */
          );
        }
      };
      var parseDisplayValue = function(display2) {
        switch (display2) {
          case "block":
          case "-webkit-box":
            return 2;
          case "inline":
            return 4;
          case "run-in":
            return 8;
          case "flow":
            return 16;
          case "flow-root":
            return 32;
          case "table":
            return 64;
          case "flex":
          case "-webkit-flex":
            return 128;
          case "grid":
          case "-ms-grid":
            return 256;
          case "ruby":
            return 512;
          case "subgrid":
            return 1024;
          case "list-item":
            return 2048;
          case "table-row-group":
            return 4096;
          case "table-header-group":
            return 8192;
          case "table-footer-group":
            return 16384;
          case "table-row":
            return 32768;
          case "table-cell":
            return 65536;
          case "table-column-group":
            return 131072;
          case "table-column":
            return 262144;
          case "table-caption":
            return 524288;
          case "ruby-base":
            return 1048576;
          case "ruby-text":
            return 2097152;
          case "ruby-base-container":
            return 4194304;
          case "ruby-text-container":
            return 8388608;
          case "contents":
            return 16777216;
          case "inline-block":
            return 33554432;
          case "inline-list-item":
            return 67108864;
          case "inline-table":
            return 134217728;
          case "inline-flex":
            return 268435456;
          case "inline-grid":
            return 536870912;
        }
        return 0;
      };
      var float = {
        name: "float",
        initialValue: "none",
        prefix: false,
        type: 2,
        parse: function(_context, float2) {
          switch (float2) {
            case "left":
              return 1;
            case "right":
              return 2;
            case "inline-start":
              return 3;
            case "inline-end":
              return 4;
          }
          return 0;
        }
      };
      var letterSpacing = {
        name: "letter-spacing",
        initialValue: "0",
        prefix: false,
        type: 0,
        parse: function(_context, token) {
          if (token.type === 20 && token.value === "normal") {
            return 0;
          }
          if (token.type === 17) {
            return token.number;
          }
          if (token.type === 15) {
            return token.number;
          }
          return 0;
        }
      };
      var LINE_BREAK;
      (function(LINE_BREAK2) {
        LINE_BREAK2["NORMAL"] = "normal";
        LINE_BREAK2["STRICT"] = "strict";
      })(LINE_BREAK || (LINE_BREAK = {}));
      var lineBreak = {
        name: "line-break",
        initialValue: "normal",
        prefix: false,
        type: 2,
        parse: function(_context, lineBreak2) {
          switch (lineBreak2) {
            case "strict":
              return LINE_BREAK.STRICT;
            case "normal":
            default:
              return LINE_BREAK.NORMAL;
          }
        }
      };
      var lineHeight = {
        name: "line-height",
        initialValue: "normal",
        prefix: false,
        type: 4
        /* TOKEN_VALUE */
      };
      var computeLineHeight = function(token, fontSize2) {
        if (isIdentToken(token) && token.value === "normal") {
          return 1.2 * fontSize2;
        } else if (token.type === 17) {
          return fontSize2 * token.number;
        } else if (isLengthPercentage(token)) {
          return getAbsoluteValue(token, fontSize2);
        }
        return fontSize2;
      };
      var listStyleImage = {
        name: "list-style-image",
        initialValue: "none",
        type: 0,
        prefix: false,
        parse: function(context, token) {
          if (token.type === 20 && token.value === "none") {
            return null;
          }
          return image.parse(context, token);
        }
      };
      var listStylePosition = {
        name: "list-style-position",
        initialValue: "outside",
        prefix: false,
        type: 2,
        parse: function(_context, position4) {
          switch (position4) {
            case "inside":
              return 0;
            case "outside":
            default:
              return 1;
          }
        }
      };
      var listStyleType = {
        name: "list-style-type",
        initialValue: "none",
        prefix: false,
        type: 2,
        parse: function(_context, type) {
          switch (type) {
            case "disc":
              return 0;
            case "circle":
              return 1;
            case "square":
              return 2;
            case "decimal":
              return 3;
            case "cjk-decimal":
              return 4;
            case "decimal-leading-zero":
              return 5;
            case "lower-roman":
              return 6;
            case "upper-roman":
              return 7;
            case "lower-greek":
              return 8;
            case "lower-alpha":
              return 9;
            case "upper-alpha":
              return 10;
            case "arabic-indic":
              return 11;
            case "armenian":
              return 12;
            case "bengali":
              return 13;
            case "cambodian":
              return 14;
            case "cjk-earthly-branch":
              return 15;
            case "cjk-heavenly-stem":
              return 16;
            case "cjk-ideographic":
              return 17;
            case "devanagari":
              return 18;
            case "ethiopic-numeric":
              return 19;
            case "georgian":
              return 20;
            case "gujarati":
              return 21;
            case "gurmukhi":
              return 22;
            case "hebrew":
              return 22;
            case "hiragana":
              return 23;
            case "hiragana-iroha":
              return 24;
            case "japanese-formal":
              return 25;
            case "japanese-informal":
              return 26;
            case "kannada":
              return 27;
            case "katakana":
              return 28;
            case "katakana-iroha":
              return 29;
            case "khmer":
              return 30;
            case "korean-hangul-formal":
              return 31;
            case "korean-hanja-formal":
              return 32;
            case "korean-hanja-informal":
              return 33;
            case "lao":
              return 34;
            case "lower-armenian":
              return 35;
            case "malayalam":
              return 36;
            case "mongolian":
              return 37;
            case "myanmar":
              return 38;
            case "oriya":
              return 39;
            case "persian":
              return 40;
            case "simp-chinese-formal":
              return 41;
            case "simp-chinese-informal":
              return 42;
            case "tamil":
              return 43;
            case "telugu":
              return 44;
            case "thai":
              return 45;
            case "tibetan":
              return 46;
            case "trad-chinese-formal":
              return 47;
            case "trad-chinese-informal":
              return 48;
            case "upper-armenian":
              return 49;
            case "disclosure-open":
              return 50;
            case "disclosure-closed":
              return 51;
            case "none":
            default:
              return -1;
          }
        }
      };
      var marginForSide = function(side) {
        return {
          name: "margin-" + side,
          initialValue: "0",
          prefix: false,
          type: 4
          /* TOKEN_VALUE */
        };
      };
      var marginTop = marginForSide("top");
      var marginRight = marginForSide("right");
      var marginBottom = marginForSide("bottom");
      var marginLeft = marginForSide("left");
      var overflow = {
        name: "overflow",
        initialValue: "visible",
        prefix: false,
        type: 1,
        parse: function(_context, tokens) {
          return tokens.filter(isIdentToken).map(function(overflow2) {
            switch (overflow2.value) {
              case "hidden":
                return 1;
              case "scroll":
                return 2;
              case "clip":
                return 3;
              case "auto":
                return 4;
              case "visible":
              default:
                return 0;
            }
          });
        }
      };
      var overflowWrap = {
        name: "overflow-wrap",
        initialValue: "normal",
        prefix: false,
        type: 2,
        parse: function(_context, overflow2) {
          switch (overflow2) {
            case "break-word":
              return "break-word";
            case "normal":
            default:
              return "normal";
          }
        }
      };
      var paddingForSide = function(side) {
        return {
          name: "padding-" + side,
          initialValue: "0",
          prefix: false,
          type: 3,
          format: "length-percentage"
        };
      };
      var paddingTop = paddingForSide("top");
      var paddingRight = paddingForSide("right");
      var paddingBottom = paddingForSide("bottom");
      var paddingLeft = paddingForSide("left");
      var textAlign = {
        name: "text-align",
        initialValue: "left",
        prefix: false,
        type: 2,
        parse: function(_context, textAlign2) {
          switch (textAlign2) {
            case "right":
              return 2;
            case "center":
            case "justify":
              return 1;
            case "left":
            default:
              return 0;
          }
        }
      };
      var position3 = {
        name: "position",
        initialValue: "static",
        prefix: false,
        type: 2,
        parse: function(_context, position4) {
          switch (position4) {
            case "relative":
              return 1;
            case "absolute":
              return 2;
            case "fixed":
              return 3;
            case "sticky":
              return 4;
          }
          return 0;
        }
      };
      var textShadow = {
        name: "text-shadow",
        initialValue: "none",
        type: 1,
        prefix: false,
        parse: function(context, tokens) {
          if (tokens.length === 1 && isIdentWithValue(tokens[0], "none")) {
            return [];
          }
          return parseFunctionArgs(tokens).map(function(values) {
            var shadow = {
              color: COLORS.TRANSPARENT,
              offsetX: ZERO_LENGTH,
              offsetY: ZERO_LENGTH,
              blur: ZERO_LENGTH
            };
            var c4 = 0;
            for (var i4 = 0; i4 < values.length; i4++) {
              var token = values[i4];
              if (isLength(token)) {
                if (c4 === 0) {
                  shadow.offsetX = token;
                } else if (c4 === 1) {
                  shadow.offsetY = token;
                } else {
                  shadow.blur = token;
                }
                c4++;
              } else {
                shadow.color = color$1.parse(context, token);
              }
            }
            return shadow;
          });
        }
      };
      var textTransform = {
        name: "text-transform",
        initialValue: "none",
        prefix: false,
        type: 2,
        parse: function(_context, textTransform2) {
          switch (textTransform2) {
            case "uppercase":
              return 2;
            case "lowercase":
              return 1;
            case "capitalize":
              return 3;
          }
          return 0;
        }
      };
      var transform$1 = {
        name: "transform",
        initialValue: "none",
        prefix: true,
        type: 0,
        parse: function(_context, token) {
          if (token.type === 20 && token.value === "none") {
            return null;
          }
          if (token.type === 18) {
            var transformFunction = SUPPORTED_TRANSFORM_FUNCTIONS[token.name];
            if (typeof transformFunction === "undefined") {
              throw new Error('Attempting to parse an unsupported transform function "' + token.name + '"');
            }
            return transformFunction(token.values);
          }
          return null;
        }
      };
      var matrix = function(args) {
        var values = args.filter(function(arg) {
          return arg.type === 17;
        }).map(function(arg) {
          return arg.number;
        });
        return values.length === 6 ? values : null;
      };
      var matrix3d = function(args) {
        var values = args.filter(function(arg) {
          return arg.type === 17;
        }).map(function(arg) {
          return arg.number;
        });
        var a1 = values[0], b1 = values[1];
        values[2];
        values[3];
        var a22 = values[4], b2 = values[5];
        values[6];
        values[7];
        values[8];
        values[9];
        values[10];
        values[11];
        var a4 = values[12], b4 = values[13];
        values[14];
        values[15];
        return values.length === 16 ? [a1, b1, a22, b2, a4, b4] : null;
      };
      var SUPPORTED_TRANSFORM_FUNCTIONS = {
        matrix,
        matrix3d
      };
      var DEFAULT_VALUE = {
        type: 16,
        number: 50,
        flags: FLAG_INTEGER
      };
      var DEFAULT = [DEFAULT_VALUE, DEFAULT_VALUE];
      var transformOrigin = {
        name: "transform-origin",
        initialValue: "50% 50%",
        prefix: true,
        type: 1,
        parse: function(_context, tokens) {
          var origins = tokens.filter(isLengthPercentage);
          if (origins.length !== 2) {
            return DEFAULT;
          }
          return [origins[0], origins[1]];
        }
      };
      var visibility = {
        name: "visible",
        initialValue: "none",
        prefix: false,
        type: 2,
        parse: function(_context, visibility2) {
          switch (visibility2) {
            case "hidden":
              return 1;
            case "collapse":
              return 2;
            case "visible":
            default:
              return 0;
          }
        }
      };
      var WORD_BREAK;
      (function(WORD_BREAK2) {
        WORD_BREAK2["NORMAL"] = "normal";
        WORD_BREAK2["BREAK_ALL"] = "break-all";
        WORD_BREAK2["KEEP_ALL"] = "keep-all";
      })(WORD_BREAK || (WORD_BREAK = {}));
      var wordBreak = {
        name: "word-break",
        initialValue: "normal",
        prefix: false,
        type: 2,
        parse: function(_context, wordBreak2) {
          switch (wordBreak2) {
            case "break-all":
              return WORD_BREAK.BREAK_ALL;
            case "keep-all":
              return WORD_BREAK.KEEP_ALL;
            case "normal":
            default:
              return WORD_BREAK.NORMAL;
          }
        }
      };
      var zIndex = {
        name: "z-index",
        initialValue: "auto",
        prefix: false,
        type: 0,
        parse: function(_context, token) {
          if (token.type === 20) {
            return { auto: true, order: 0 };
          }
          if (isNumberToken(token)) {
            return { auto: false, order: token.number };
          }
          throw new Error("Invalid z-index number parsed");
        }
      };
      var time = {
        name: "time",
        parse: function(_context, value) {
          if (value.type === 15) {
            switch (value.unit.toLowerCase()) {
              case "s":
                return 1e3 * value.number;
              case "ms":
                return value.number;
            }
          }
          throw new Error("Unsupported time type");
        }
      };
      var opacity = {
        name: "opacity",
        initialValue: "1",
        type: 0,
        prefix: false,
        parse: function(_context, token) {
          if (isNumberToken(token)) {
            return token.number;
          }
          return 1;
        }
      };
      var textDecorationColor = {
        name: "text-decoration-color",
        initialValue: "transparent",
        prefix: false,
        type: 3,
        format: "color"
      };
      var textDecorationLine = {
        name: "text-decoration-line",
        initialValue: "none",
        prefix: false,
        type: 1,
        parse: function(_context, tokens) {
          return tokens.filter(isIdentToken).map(function(token) {
            switch (token.value) {
              case "underline":
                return 1;
              case "overline":
                return 2;
              case "line-through":
                return 3;
              case "none":
                return 4;
            }
            return 0;
          }).filter(function(line) {
            return line !== 0;
          });
        }
      };
      var fontFamily = {
        name: "font-family",
        initialValue: "",
        prefix: false,
        type: 1,
        parse: function(_context, tokens) {
          var accumulator = [];
          var results = [];
          tokens.forEach(function(token) {
            switch (token.type) {
              case 20:
              case 0:
                accumulator.push(token.value);
                break;
              case 17:
                accumulator.push(token.number.toString());
                break;
              case 4:
                results.push(accumulator.join(" "));
                accumulator.length = 0;
                break;
            }
          });
          if (accumulator.length) {
            results.push(accumulator.join(" "));
          }
          return results.map(function(result) {
            return result.indexOf(" ") === -1 ? result : "'" + result + "'";
          });
        }
      };
      var fontSize = {
        name: "font-size",
        initialValue: "0",
        prefix: false,
        type: 3,
        format: "length"
      };
      var fontWeight = {
        name: "font-weight",
        initialValue: "normal",
        type: 0,
        prefix: false,
        parse: function(_context, token) {
          if (isNumberToken(token)) {
            return token.number;
          }
          if (isIdentToken(token)) {
            switch (token.value) {
              case "bold":
                return 700;
              case "normal":
              default:
                return 400;
            }
          }
          return 400;
        }
      };
      var fontVariant = {
        name: "font-variant",
        initialValue: "none",
        type: 1,
        prefix: false,
        parse: function(_context, tokens) {
          return tokens.filter(isIdentToken).map(function(token) {
            return token.value;
          });
        }
      };
      var fontStyle = {
        name: "font-style",
        initialValue: "normal",
        prefix: false,
        type: 2,
        parse: function(_context, overflow2) {
          switch (overflow2) {
            case "oblique":
              return "oblique";
            case "italic":
              return "italic";
            case "normal":
            default:
              return "normal";
          }
        }
      };
      var contains = function(bit, value) {
        return (bit & value) !== 0;
      };
      var content3 = {
        name: "content",
        initialValue: "none",
        type: 1,
        prefix: false,
        parse: function(_context, tokens) {
          if (tokens.length === 0) {
            return [];
          }
          var first = tokens[0];
          if (first.type === 20 && first.value === "none") {
            return [];
          }
          return tokens;
        }
      };
      var counterIncrement = {
        name: "counter-increment",
        initialValue: "none",
        prefix: true,
        type: 1,
        parse: function(_context, tokens) {
          if (tokens.length === 0) {
            return null;
          }
          var first = tokens[0];
          if (first.type === 20 && first.value === "none") {
            return null;
          }
          var increments = [];
          var filtered = tokens.filter(nonWhiteSpace);
          for (var i4 = 0; i4 < filtered.length; i4++) {
            var counter = filtered[i4];
            var next2 = filtered[i4 + 1];
            if (counter.type === 20) {
              var increment = next2 && isNumberToken(next2) ? next2.number : 1;
              increments.push({ counter: counter.value, increment });
            }
          }
          return increments;
        }
      };
      var counterReset = {
        name: "counter-reset",
        initialValue: "none",
        prefix: true,
        type: 1,
        parse: function(_context, tokens) {
          if (tokens.length === 0) {
            return [];
          }
          var resets = [];
          var filtered = tokens.filter(nonWhiteSpace);
          for (var i4 = 0; i4 < filtered.length; i4++) {
            var counter = filtered[i4];
            var next2 = filtered[i4 + 1];
            if (isIdentToken(counter) && counter.value !== "none") {
              var reset = next2 && isNumberToken(next2) ? next2.number : 0;
              resets.push({ counter: counter.value, reset });
            }
          }
          return resets;
        }
      };
      var duration = {
        name: "duration",
        initialValue: "0s",
        prefix: false,
        type: 1,
        parse: function(context, tokens) {
          return tokens.filter(isDimensionToken).map(function(token) {
            return time.parse(context, token);
          });
        }
      };
      var quotes = {
        name: "quotes",
        initialValue: "none",
        prefix: true,
        type: 1,
        parse: function(_context, tokens) {
          if (tokens.length === 0) {
            return null;
          }
          var first = tokens[0];
          if (first.type === 20 && first.value === "none") {
            return null;
          }
          var quotes2 = [];
          var filtered = tokens.filter(isStringToken);
          if (filtered.length % 2 !== 0) {
            return null;
          }
          for (var i4 = 0; i4 < filtered.length; i4 += 2) {
            var open_1 = filtered[i4].value;
            var close_1 = filtered[i4 + 1].value;
            quotes2.push({ open: open_1, close: close_1 });
          }
          return quotes2;
        }
      };
      var getQuote = function(quotes2, depth, open3) {
        if (!quotes2) {
          return "";
        }
        var quote = quotes2[Math.min(depth, quotes2.length - 1)];
        if (!quote) {
          return "";
        }
        return open3 ? quote.open : quote.close;
      };
      var boxShadow = {
        name: "box-shadow",
        initialValue: "none",
        type: 1,
        prefix: false,
        parse: function(context, tokens) {
          if (tokens.length === 1 && isIdentWithValue(tokens[0], "none")) {
            return [];
          }
          return parseFunctionArgs(tokens).map(function(values) {
            var shadow = {
              color: 255,
              offsetX: ZERO_LENGTH,
              offsetY: ZERO_LENGTH,
              blur: ZERO_LENGTH,
              spread: ZERO_LENGTH,
              inset: false
            };
            var c4 = 0;
            for (var i4 = 0; i4 < values.length; i4++) {
              var token = values[i4];
              if (isIdentWithValue(token, "inset")) {
                shadow.inset = true;
              } else if (isLength(token)) {
                if (c4 === 0) {
                  shadow.offsetX = token;
                } else if (c4 === 1) {
                  shadow.offsetY = token;
                } else if (c4 === 2) {
                  shadow.blur = token;
                } else {
                  shadow.spread = token;
                }
                c4++;
              } else {
                shadow.color = color$1.parse(context, token);
              }
            }
            return shadow;
          });
        }
      };
      var paintOrder = {
        name: "paint-order",
        initialValue: "normal",
        prefix: false,
        type: 1,
        parse: function(_context, tokens) {
          var DEFAULT_VALUE2 = [
            0,
            1,
            2
            /* MARKERS */
          ];
          var layers = [];
          tokens.filter(isIdentToken).forEach(function(token) {
            switch (token.value) {
              case "stroke":
                layers.push(
                  1
                  /* STROKE */
                );
                break;
              case "fill":
                layers.push(
                  0
                  /* FILL */
                );
                break;
              case "markers":
                layers.push(
                  2
                  /* MARKERS */
                );
                break;
            }
          });
          DEFAULT_VALUE2.forEach(function(value) {
            if (layers.indexOf(value) === -1) {
              layers.push(value);
            }
          });
          return layers;
        }
      };
      var webkitTextStrokeColor = {
        name: "-webkit-text-stroke-color",
        initialValue: "currentcolor",
        prefix: false,
        type: 3,
        format: "color"
      };
      var webkitTextStrokeWidth = {
        name: "-webkit-text-stroke-width",
        initialValue: "0",
        type: 0,
        prefix: false,
        parse: function(_context, token) {
          if (isDimensionToken(token)) {
            return token.number;
          }
          return 0;
        }
      };
      var CSSParsedDeclaration = (
        /** @class */
        function() {
          function CSSParsedDeclaration2(context, declaration) {
            var _a2, _b2;
            this.animationDuration = parse2(context, duration, declaration.animationDuration);
            this.backgroundClip = parse2(context, backgroundClip, declaration.backgroundClip);
            this.backgroundColor = parse2(context, backgroundColor, declaration.backgroundColor);
            this.backgroundImage = parse2(context, backgroundImage, declaration.backgroundImage);
            this.backgroundOrigin = parse2(context, backgroundOrigin, declaration.backgroundOrigin);
            this.backgroundPosition = parse2(context, backgroundPosition, declaration.backgroundPosition);
            this.backgroundRepeat = parse2(context, backgroundRepeat, declaration.backgroundRepeat);
            this.backgroundSize = parse2(context, backgroundSize, declaration.backgroundSize);
            this.borderTopColor = parse2(context, borderTopColor, declaration.borderTopColor);
            this.borderRightColor = parse2(context, borderRightColor, declaration.borderRightColor);
            this.borderBottomColor = parse2(context, borderBottomColor, declaration.borderBottomColor);
            this.borderLeftColor = parse2(context, borderLeftColor, declaration.borderLeftColor);
            this.borderTopLeftRadius = parse2(context, borderTopLeftRadius, declaration.borderTopLeftRadius);
            this.borderTopRightRadius = parse2(context, borderTopRightRadius, declaration.borderTopRightRadius);
            this.borderBottomRightRadius = parse2(context, borderBottomRightRadius, declaration.borderBottomRightRadius);
            this.borderBottomLeftRadius = parse2(context, borderBottomLeftRadius, declaration.borderBottomLeftRadius);
            this.borderTopStyle = parse2(context, borderTopStyle, declaration.borderTopStyle);
            this.borderRightStyle = parse2(context, borderRightStyle, declaration.borderRightStyle);
            this.borderBottomStyle = parse2(context, borderBottomStyle, declaration.borderBottomStyle);
            this.borderLeftStyle = parse2(context, borderLeftStyle, declaration.borderLeftStyle);
            this.borderTopWidth = parse2(context, borderTopWidth, declaration.borderTopWidth);
            this.borderRightWidth = parse2(context, borderRightWidth, declaration.borderRightWidth);
            this.borderBottomWidth = parse2(context, borderBottomWidth, declaration.borderBottomWidth);
            this.borderLeftWidth = parse2(context, borderLeftWidth, declaration.borderLeftWidth);
            this.boxShadow = parse2(context, boxShadow, declaration.boxShadow);
            this.color = parse2(context, color, declaration.color);
            this.direction = parse2(context, direction, declaration.direction);
            this.display = parse2(context, display, declaration.display);
            this.float = parse2(context, float, declaration.cssFloat);
            this.fontFamily = parse2(context, fontFamily, declaration.fontFamily);
            this.fontSize = parse2(context, fontSize, declaration.fontSize);
            this.fontStyle = parse2(context, fontStyle, declaration.fontStyle);
            this.fontVariant = parse2(context, fontVariant, declaration.fontVariant);
            this.fontWeight = parse2(context, fontWeight, declaration.fontWeight);
            this.letterSpacing = parse2(context, letterSpacing, declaration.letterSpacing);
            this.lineBreak = parse2(context, lineBreak, declaration.lineBreak);
            this.lineHeight = parse2(context, lineHeight, declaration.lineHeight);
            this.listStyleImage = parse2(context, listStyleImage, declaration.listStyleImage);
            this.listStylePosition = parse2(context, listStylePosition, declaration.listStylePosition);
            this.listStyleType = parse2(context, listStyleType, declaration.listStyleType);
            this.marginTop = parse2(context, marginTop, declaration.marginTop);
            this.marginRight = parse2(context, marginRight, declaration.marginRight);
            this.marginBottom = parse2(context, marginBottom, declaration.marginBottom);
            this.marginLeft = parse2(context, marginLeft, declaration.marginLeft);
            this.opacity = parse2(context, opacity, declaration.opacity);
            var overflowTuple = parse2(context, overflow, declaration.overflow);
            this.overflowX = overflowTuple[0];
            this.overflowY = overflowTuple[overflowTuple.length > 1 ? 1 : 0];
            this.overflowWrap = parse2(context, overflowWrap, declaration.overflowWrap);
            this.paddingTop = parse2(context, paddingTop, declaration.paddingTop);
            this.paddingRight = parse2(context, paddingRight, declaration.paddingRight);
            this.paddingBottom = parse2(context, paddingBottom, declaration.paddingBottom);
            this.paddingLeft = parse2(context, paddingLeft, declaration.paddingLeft);
            this.paintOrder = parse2(context, paintOrder, declaration.paintOrder);
            this.position = parse2(context, position3, declaration.position);
            this.textAlign = parse2(context, textAlign, declaration.textAlign);
            this.textDecorationColor = parse2(context, textDecorationColor, (_a2 = declaration.textDecorationColor) !== null && _a2 !== void 0 ? _a2 : declaration.color);
            this.textDecorationLine = parse2(context, textDecorationLine, (_b2 = declaration.textDecorationLine) !== null && _b2 !== void 0 ? _b2 : declaration.textDecoration);
            this.textShadow = parse2(context, textShadow, declaration.textShadow);
            this.textTransform = parse2(context, textTransform, declaration.textTransform);
            this.transform = parse2(context, transform$1, declaration.transform);
            this.transformOrigin = parse2(context, transformOrigin, declaration.transformOrigin);
            this.visibility = parse2(context, visibility, declaration.visibility);
            this.webkitTextStrokeColor = parse2(context, webkitTextStrokeColor, declaration.webkitTextStrokeColor);
            this.webkitTextStrokeWidth = parse2(context, webkitTextStrokeWidth, declaration.webkitTextStrokeWidth);
            this.wordBreak = parse2(context, wordBreak, declaration.wordBreak);
            this.zIndex = parse2(context, zIndex, declaration.zIndex);
          }
          CSSParsedDeclaration2.prototype.isVisible = function() {
            return this.display > 0 && this.opacity > 0 && this.visibility === 0;
          };
          CSSParsedDeclaration2.prototype.isTransparent = function() {
            return isTransparent(this.backgroundColor);
          };
          CSSParsedDeclaration2.prototype.isTransformed = function() {
            return this.transform !== null;
          };
          CSSParsedDeclaration2.prototype.isPositioned = function() {
            return this.position !== 0;
          };
          CSSParsedDeclaration2.prototype.isPositionedWithZIndex = function() {
            return this.isPositioned() && !this.zIndex.auto;
          };
          CSSParsedDeclaration2.prototype.isFloating = function() {
            return this.float !== 0;
          };
          CSSParsedDeclaration2.prototype.isInlineLevel = function() {
            return contains(
              this.display,
              4
              /* INLINE */
            ) || contains(
              this.display,
              33554432
              /* INLINE_BLOCK */
            ) || contains(
              this.display,
              268435456
              /* INLINE_FLEX */
            ) || contains(
              this.display,
              536870912
              /* INLINE_GRID */
            ) || contains(
              this.display,
              67108864
              /* INLINE_LIST_ITEM */
            ) || contains(
              this.display,
              134217728
              /* INLINE_TABLE */
            );
          };
          return CSSParsedDeclaration2;
        }()
      );
      var CSSParsedPseudoDeclaration = (
        /** @class */
        function() {
          function CSSParsedPseudoDeclaration2(context, declaration) {
            this.content = parse2(context, content3, declaration.content);
            this.quotes = parse2(context, quotes, declaration.quotes);
          }
          return CSSParsedPseudoDeclaration2;
        }()
      );
      var CSSParsedCounterDeclaration = (
        /** @class */
        function() {
          function CSSParsedCounterDeclaration2(context, declaration) {
            this.counterIncrement = parse2(context, counterIncrement, declaration.counterIncrement);
            this.counterReset = parse2(context, counterReset, declaration.counterReset);
          }
          return CSSParsedCounterDeclaration2;
        }()
      );
      var parse2 = function(context, descriptor, style) {
        var tokenizer = new Tokenizer();
        var value = style !== null && typeof style !== "undefined" ? style.toString() : descriptor.initialValue;
        tokenizer.write(value);
        var parser2 = new Parser2(tokenizer.read());
        switch (descriptor.type) {
          case 2:
            var token = parser2.parseComponentValue();
            return descriptor.parse(context, isIdentToken(token) ? token.value : descriptor.initialValue);
          case 0:
            return descriptor.parse(context, parser2.parseComponentValue());
          case 1:
            return descriptor.parse(context, parser2.parseComponentValues());
          case 4:
            return parser2.parseComponentValue();
          case 3:
            switch (descriptor.format) {
              case "angle":
                return angle.parse(context, parser2.parseComponentValue());
              case "color":
                return color$1.parse(context, parser2.parseComponentValue());
              case "image":
                return image.parse(context, parser2.parseComponentValue());
              case "length":
                var length_1 = parser2.parseComponentValue();
                return isLength(length_1) ? length_1 : ZERO_LENGTH;
              case "length-percentage":
                var value_1 = parser2.parseComponentValue();
                return isLengthPercentage(value_1) ? value_1 : ZERO_LENGTH;
              case "time":
                return time.parse(context, parser2.parseComponentValue());
            }
            break;
        }
      };
      var elementDebuggerAttribute = "data-html2canvas-debug";
      var getElementDebugType = function(element2) {
        var attribute = element2.getAttribute(elementDebuggerAttribute);
        switch (attribute) {
          case "all":
            return 1;
          case "clone":
            return 2;
          case "parse":
            return 3;
          case "render":
            return 4;
          default:
            return 0;
        }
      };
      var isDebugging = function(element2, type) {
        var elementType = getElementDebugType(element2);
        return elementType === 1 || type === elementType;
      };
      var ElementContainer = (
        /** @class */
        function() {
          function ElementContainer2(context, element2) {
            this.context = context;
            this.textNodes = [];
            this.elements = [];
            this.flags = 0;
            if (isDebugging(
              element2,
              3
              /* PARSE */
            )) {
              debugger;
            }
            this.styles = new CSSParsedDeclaration(context, window.getComputedStyle(element2, null));
            if (isHTMLElementNode(element2)) {
              if (this.styles.animationDuration.some(function(duration2) {
                return duration2 > 0;
              })) {
                element2.style.animationDuration = "0s";
              }
              if (this.styles.transform !== null) {
                element2.style.transform = "none";
              }
            }
            this.bounds = parseBounds(this.context, element2);
            if (isDebugging(
              element2,
              4
              /* RENDER */
            )) {
              this.flags |= 16;
            }
          }
          return ElementContainer2;
        }()
      );
      var base64 = "[encoded data, 26156 characters]";
      var chars$1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
      var lookup$1 = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);
      for (var i$1 = 0; i$1 < chars$1.length; i$1++) {
        lookup$1[chars$1.charCodeAt(i$1)] = i$1;
      }
      var decode2 = function(base642) {
        var bufferLength = base642.length * 0.75, len = base642.length, i4, p3 = 0, encoded1, encoded2, encoded3, encoded4;
        if (base642[base642.length - 1] === "=") {
          bufferLength--;
          if (base642[base642.length - 2] === "=") {
            bufferLength--;
          }
        }
        var buffer = typeof ArrayBuffer !== "undefined" && typeof Uint8Array !== "undefined" && typeof Uint8Array.prototype.slice !== "undefined" ? new ArrayBuffer(bufferLength) : new Array(bufferLength);
        var bytes = Array.isArray(buffer) ? buffer : new Uint8Array(buffer);
        for (i4 = 0; i4 < len; i4 += 4) {
          encoded1 = lookup$1[base642.charCodeAt(i4)];
          encoded2 = lookup$1[base642.charCodeAt(i4 + 1)];
          encoded3 = lookup$1[base642.charCodeAt(i4 + 2)];
          encoded4 = lookup$1[base642.charCodeAt(i4 + 3)];
          bytes[p3++] = encoded1 << 2 | encoded2 >> 4;
          bytes[p3++] = (encoded2 & 15) << 4 | encoded3 >> 2;
          bytes[p3++] = (encoded3 & 3) << 6 | encoded4 & 63;
        }
        return buffer;
      };
      var polyUint16Array = function(buffer) {
        var length2 = buffer.length;
        var bytes = [];
        for (var i4 = 0; i4 < length2; i4 += 2) {
          bytes.push(buffer[i4 + 1] << 8 | buffer[i4]);
        }
        return bytes;
      };
      var polyUint32Array = function(buffer) {
        var length2 = buffer.length;
        var bytes = [];
        for (var i4 = 0; i4 < length2; i4 += 4) {
          bytes.push(buffer[i4 + 3] << 24 | buffer[i4 + 2] << 16 | buffer[i4 + 1] << 8 | buffer[i4]);
        }
        return bytes;
      };
      var UTRIE2_SHIFT_2 = 5;
      var UTRIE2_SHIFT_1 = 6 + 5;
      var UTRIE2_INDEX_SHIFT = 2;
      var UTRIE2_SHIFT_1_2 = UTRIE2_SHIFT_1 - UTRIE2_SHIFT_2;
      var UTRIE2_LSCP_INDEX_2_OFFSET = 65536 >> UTRIE2_SHIFT_2;
      var UTRIE2_DATA_BLOCK_LENGTH = 1 << UTRIE2_SHIFT_2;
      var UTRIE2_DATA_MASK = UTRIE2_DATA_BLOCK_LENGTH - 1;
      var UTRIE2_LSCP_INDEX_2_LENGTH = 1024 >> UTRIE2_SHIFT_2;
      var UTRIE2_INDEX_2_BMP_LENGTH = UTRIE2_LSCP_INDEX_2_OFFSET + UTRIE2_LSCP_INDEX_2_LENGTH;
      var UTRIE2_UTF8_2B_INDEX_2_OFFSET = UTRIE2_INDEX_2_BMP_LENGTH;
      var UTRIE2_UTF8_2B_INDEX_2_LENGTH = 2048 >> 6;
      var UTRIE2_INDEX_1_OFFSET = UTRIE2_UTF8_2B_INDEX_2_OFFSET + UTRIE2_UTF8_2B_INDEX_2_LENGTH;
      var UTRIE2_OMITTED_BMP_INDEX_1_LENGTH = 65536 >> UTRIE2_SHIFT_1;
      var UTRIE2_INDEX_2_BLOCK_LENGTH = 1 << UTRIE2_SHIFT_1_2;
      var UTRIE2_INDEX_2_MASK = UTRIE2_INDEX_2_BLOCK_LENGTH - 1;
      var slice16 = function(view, start, end) {
        if (view.slice) {
          return view.slice(start, end);
        }
        return new Uint16Array(Array.prototype.slice.call(view, start, end));
      };
      var slice32 = function(view, start, end) {
        if (view.slice) {
          return view.slice(start, end);
        }
        return new Uint32Array(Array.prototype.slice.call(view, start, end));
      };
      var createTrieFromBase64 = function(base642, _byteLength) {
        var buffer = decode2(base642);
        var view32 = Array.isArray(buffer) ? polyUint32Array(buffer) : new Uint32Array(buffer);
        var view16 = Array.isArray(buffer) ? polyUint16Array(buffer) : new Uint16Array(buffer);
        var headerLength = 24;
        var index3 = slice16(view16, headerLength / 2, view32[4] / 2);
        var data2 = view32[5] === 2 ? slice16(view16, (headerLength + view32[4]) / 2) : slice32(view32, Math.ceil((headerLength + view32[4]) / 4));
        return new Trie(view32[0], view32[1], view32[2], view32[3], index3, data2);
      };
      var Trie = (
        /** @class */
        function() {
          function Trie2(initialValue, errorValue, highStart, highValueIndex, index3, data2) {
            this.initialValue = initialValue;
            this.errorValue = errorValue;
            this.highStart = highStart;
            this.highValueIndex = highValueIndex;
            this.index = index3;
            this.data = data2;
          }
          Trie2.prototype.get = function(codePoint) {
            var ix;
            if (codePoint >= 0) {
              if (codePoint < 55296 || codePoint > 56319 && codePoint <= 65535) {
                ix = this.index[codePoint >> UTRIE2_SHIFT_2];
                ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);
                return this.data[ix];
              }
              if (codePoint <= 65535) {
                ix = this.index[UTRIE2_LSCP_INDEX_2_OFFSET + (codePoint - 55296 >> UTRIE2_SHIFT_2)];
                ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);
                return this.data[ix];
              }
              if (codePoint < this.highStart) {
                ix = UTRIE2_INDEX_1_OFFSET - UTRIE2_OMITTED_BMP_INDEX_1_LENGTH + (codePoint >> UTRIE2_SHIFT_1);
                ix = this.index[ix];
                ix += codePoint >> UTRIE2_SHIFT_2 & UTRIE2_INDEX_2_MASK;
                ix = this.index[ix];
                ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);
                return this.data[ix];
              }
              if (codePoint <= 1114111) {
                return this.data[this.highValueIndex];
              }
            }
            return this.errorValue;
          };
          return Trie2;
        }()
      );
      var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
      var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);
      for (var i3 = 0; i3 < chars.length; i3++) {
        lookup[chars.charCodeAt(i3)] = i3;
      }
      var Prepend = 1;
      var CR = 2;
      var LF = 3;
      var Control = 4;
      var Extend = 5;
      var SpacingMark = 7;
      var L2 = 8;
      var V2 = 9;
      var T3 = 10;
      var LV = 11;
      var LVT = 12;
      var ZWJ = 13;
      var Extended_Pictographic = 14;
      var RI = 15;
      var toCodePoints = function(str) {
        var codePoints = [];
        var i4 = 0;
        var length2 = str.length;
        while (i4 < length2) {
          var value = str.charCodeAt(i4++);
          if (value >= 55296 && value <= 56319 && i4 < length2) {
            var extra = str.charCodeAt(i4++);
            if ((extra & 64512) === 56320) {
              codePoints.push(((value & 1023) << 10) + (extra & 1023) + 65536);
            } else {
              codePoints.push(value);
              i4--;
            }
          } else {
            codePoints.push(value);
          }
        }
        return codePoints;
      };
      var fromCodePoint = function() {
        var codePoints = [];
        for (var _i = 0; _i < arguments.length; _i++) {
          codePoints[_i] = arguments[_i];
        }
        if (String.fromCodePoint) {
          return String.fromCodePoint.apply(String, codePoints);
        }
        var length2 = codePoints.length;
        if (!length2) {
          return "";
        }
        var codeUnits = [];
        var index3 = -1;
        var result = "";
        while (++index3 < length2) {
          var codePoint = codePoints[index3];
          if (codePoint <= 65535) {
            codeUnits.push(codePoint);
          } else {
            codePoint -= 65536;
            codeUnits.push((codePoint >> 10) + 55296, codePoint % 1024 + 56320);
          }
          if (index3 + 1 === length2 || codeUnits.length > 16384) {
            result += String.fromCharCode.apply(String, codeUnits);
            codeUnits.length = 0;
          }
        }
        return result;
      };
      var UnicodeTrie = createTrieFromBase64(base64);
      var BREAK_NOT_ALLOWED = "\xD7";
      var BREAK_ALLOWED = "\xF7";
      var codePointToClass = function(codePoint) {
        return UnicodeTrie.get(codePoint);
      };
      var _graphemeBreakAtIndex = function(_codePoints, classTypes, index3) {
        var prevIndex = index3 - 2;
        var prev2 = classTypes[prevIndex];
        var current = classTypes[index3 - 1];
        var next2 = classTypes[index3];
        if (current === CR && next2 === LF) {
          return BREAK_NOT_ALLOWED;
        }
        if (current === CR || current === LF || current === Control) {
          return BREAK_ALLOWED;
        }
        if (next2 === CR || next2 === LF || next2 === Control) {
          return BREAK_ALLOWED;
        }
        if (current === L2 && [L2, V2, LV, LVT].indexOf(next2) !== -1) {
          return BREAK_NOT_ALLOWED;
        }
        if ((current === LV || current === V2) && (next2 === V2 || next2 === T3)) {
          return BREAK_NOT_ALLOWED;
        }
        if ((current === LVT || current === T3) && next2 === T3) {
          return BREAK_NOT_ALLOWED;
        }
        if (next2 === ZWJ || next2 === Extend) {
          return BREAK_NOT_ALLOWED;
        }
        if (next2 === SpacingMark) {
          return BREAK_NOT_ALLOWED;
        }
        if (current === Prepend) {
          return BREAK_NOT_ALLOWED;
        }
        if (current === ZWJ && next2 === Extended_Pictographic) {
          while (prev2 === Extend) {
            prev2 = classTypes[--prevIndex];
          }
          if (prev2 === Extended_Pictographic) {
            return BREAK_NOT_ALLOWED;
          }
        }
        if (current === RI && next2 === RI) {
          var countRI = 0;
          while (prev2 === RI) {
            countRI++;
            prev2 = classTypes[--prevIndex];
          }
          if (countRI % 2 === 0) {
            return BREAK_NOT_ALLOWED;
          }
        }
        return BREAK_ALLOWED;
      };
      var GraphemeBreaker = function(str) {
        var codePoints = toCodePoints(str);
        var length2 = codePoints.length;
        var index3 = 0;
        var lastEnd = 0;
        var classTypes = codePoints.map(codePointToClass);
        return {
          next: function() {
            if (index3 >= length2) {
              return { done: true, value: null };
            }
            var graphemeBreak = BREAK_NOT_ALLOWED;
            while (index3 < length2 && (graphemeBreak = _graphemeBreakAtIndex(codePoints, classTypes, ++index3)) === BREAK_NOT_ALLOWED) {
            }
            if (graphemeBreak !== BREAK_NOT_ALLOWED || index3 === length2) {
              var value = fromCodePoint.apply(null, codePoints.slice(lastEnd, index3));
              lastEnd = index3;
              return { value, done: false };
            }
            return { done: true, value: null };
          }
        };
      };
      var splitGraphemes = function(str) {
        var breaker = GraphemeBreaker(str);
        var graphemes = [];
        var bk;
        while (!(bk = breaker.next()).done) {
          if (bk.value) {
            graphemes.push(bk.value.slice());
          }
        }
        return graphemes;
      };
      var testRangeBounds = function(document4) {
        var TEST_HEIGHT = 123;
        if (document4.createRange) {
          var range = document4.createRange();
          if (range.getBoundingClientRect) {
            var testElement = document4.createElement("boundtest");
            testElement.style.height = TEST_HEIGHT + "px";
            testElement.style.display = "block";
            document4.body.appendChild(testElement);
            range.selectNode(testElement);
            var rangeBounds = range.getBoundingClientRect();
            var rangeHeight = Math.round(rangeBounds.height);
            document4.body.removeChild(testElement);
            if (rangeHeight === TEST_HEIGHT) {
              return true;
            }
          }
        }
        return false;
      };
      var testIOSLineBreak = function(document4) {
        var testElement = document4.createElement("boundtest");
        testElement.style.width = "50px";
        testElement.style.display = "block";
        testElement.style.fontSize = "12px";
        testElement.style.letterSpacing = "0px";
        testElement.style.wordSpacing = "0px";
        document4.body.appendChild(testElement);
        var range = document4.createRange();
        testElement.innerHTML = typeof "".repeat === "function" ? "&#128104;".repeat(10) : "";
        var node3 = testElement.firstChild;
        var textList = toCodePoints$1(node3.data).map(function(i4) {
          return fromCodePoint$1(i4);
        });
        var offset = 0;
        var prev2 = {};
        var supports = textList.every(function(text3, i4) {
          range.setStart(node3, offset);
          range.setEnd(node3, offset + text3.length);
          var rect = range.getBoundingClientRect();
          offset += text3.length;
          var boundAhead = rect.x > prev2.x || rect.y > prev2.y;
          prev2 = rect;
          if (i4 === 0) {
            return true;
          }
          return boundAhead;
        });
        document4.body.removeChild(testElement);
        return supports;
      };
      var testCORS = function() {
        return typeof new Image().crossOrigin !== "undefined";
      };
      var testResponseType = function() {
        return typeof new XMLHttpRequest().responseType === "string";
      };
      var testSVG = function(document4) {
        var img = new Image();
        var canvas = document4.createElement("canvas");
        var ctx = canvas.getContext("2d");
        if (!ctx) {
          return false;
        }
        img.src = "data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";
        try {
          ctx.drawImage(img, 0, 0);
          canvas.toDataURL();
        } catch (e3) {
          return false;
        }
        return true;
      };
      var isGreenPixel = function(data2) {
        return data2[0] === 0 && data2[1] === 255 && data2[2] === 0 && data2[3] === 255;
      };
      var testForeignObject = function(document4) {
        var canvas = document4.createElement("canvas");
        var size2 = 100;
        canvas.width = size2;
        canvas.height = size2;
        var ctx = canvas.getContext("2d");
        if (!ctx) {
          return Promise.reject(false);
        }
        ctx.fillStyle = "rgb(0, 255, 0)";
        ctx.fillRect(0, 0, size2, size2);
        var img = new Image();
        var greenImageSrc = canvas.toDataURL();
        img.src = greenImageSrc;
        var svg2 = createForeignObjectSVG(size2, size2, 0, 0, img);
        ctx.fillStyle = "red";
        ctx.fillRect(0, 0, size2, size2);
        return loadSerializedSVG$1(svg2).then(function(img2) {
          ctx.drawImage(img2, 0, 0);
          var data2 = ctx.getImageData(0, 0, size2, size2).data;
          ctx.fillStyle = "red";
          ctx.fillRect(0, 0, size2, size2);
          var node3 = document4.createElement("div");
          node3.style.backgroundImage = "url(" + greenImageSrc + ")";
          node3.style.height = size2 + "px";
          return isGreenPixel(data2) ? loadSerializedSVG$1(createForeignObjectSVG(size2, size2, 0, 0, node3)) : Promise.reject(false);
        }).then(function(img2) {
          ctx.drawImage(img2, 0, 0);
          return isGreenPixel(ctx.getImageData(0, 0, size2, size2).data);
        }).catch(function() {
          return false;
        });
      };
      var createForeignObjectSVG = function(width2, height2, x3, y4, node3) {
        var xmlns2 = "http://www.w3.org/2000/svg";
        var svg2 = document.createElementNS(xmlns2, "svg");
        var foreignObject = document.createElementNS(xmlns2, "foreignObject");
        svg2.setAttributeNS(null, "width", width2.toString());
        svg2.setAttributeNS(null, "height", height2.toString());
        foreignObject.setAttributeNS(null, "width", "100%");
        foreignObject.setAttributeNS(null, "height", "100%");
        foreignObject.setAttributeNS(null, "x", x3.toString());
        foreignObject.setAttributeNS(null, "y", y4.toString());
        foreignObject.setAttributeNS(null, "externalResourcesRequired", "true");
        svg2.appendChild(foreignObject);
        foreignObject.appendChild(node3);
        return svg2;
      };
      var loadSerializedSVG$1 = function(svg2) {
        return new Promise(function(resolve, reject) {
          var img = new Image();
          img.onload = function() {
            return resolve(img);
          };
          img.onerror = reject;
          img.src = "data:image/svg+xml;charset=utf-8," + encodeURIComponent(new XMLSerializer().serializeToString(svg2));
        });
      };
      var FEATURES = {
        get SUPPORT_RANGE_BOUNDS() {
          var value = testRangeBounds(document);
          Object.defineProperty(FEATURES, "SUPPORT_RANGE_BOUNDS", { value });
          return value;
        },
        get SUPPORT_WORD_BREAKING() {
          var value = FEATURES.SUPPORT_RANGE_BOUNDS && testIOSLineBreak(document);
          Object.defineProperty(FEATURES, "SUPPORT_WORD_BREAKING", { value });
          return value;
        },
        get SUPPORT_SVG_DRAWING() {
          var value = testSVG(document);
          Object.defineProperty(FEATURES, "SUPPORT_SVG_DRAWING", { value });
          return value;
        },
        get SUPPORT_FOREIGNOBJECT_DRAWING() {
          var value = typeof Array.from === "function" && typeof window.fetch === "function" ? testForeignObject(document) : Promise.resolve(false);
          Object.defineProperty(FEATURES, "SUPPORT_FOREIGNOBJECT_DRAWING", { value });
          return value;
        },
        get SUPPORT_CORS_IMAGES() {
          var value = testCORS();
          Object.defineProperty(FEATURES, "SUPPORT_CORS_IMAGES", { value });
          return value;
        },
        get SUPPORT_RESPONSE_TYPE() {
          var value = testResponseType();
          Object.defineProperty(FEATURES, "SUPPORT_RESPONSE_TYPE", { value });
          return value;
        },
        get SUPPORT_CORS_XHR() {
          var value = "withCredentials" in new XMLHttpRequest();
          Object.defineProperty(FEATURES, "SUPPORT_CORS_XHR", { value });
          return value;
        },
        get SUPPORT_NATIVE_TEXT_SEGMENTATION() {
          var value = !!(typeof Intl !== "undefined" && Intl.Segmenter);
          Object.defineProperty(FEATURES, "SUPPORT_NATIVE_TEXT_SEGMENTATION", { value });
          return value;
        }
      };
      var TextBounds = (
        /** @class */
        function() {
          function TextBounds2(text3, bounds) {
            this.text = text3;
            this.bounds = bounds;
          }
          return TextBounds2;
        }()
      );
      var parseTextBounds = function(context, value, styles, node3) {
        var textList = breakText(value, styles);
        var textBounds = [];
        var offset = 0;
        textList.forEach(function(text3) {
          if (styles.textDecorationLine.length || text3.trim().length > 0) {
            if (FEATURES.SUPPORT_RANGE_BOUNDS) {
              var clientRects = createRange(node3, offset, text3.length).getClientRects();
              if (clientRects.length > 1) {
                var subSegments = segmentGraphemes(text3);
                var subOffset_1 = 0;
                subSegments.forEach(function(subSegment) {
                  textBounds.push(new TextBounds(subSegment, Bounds.fromDOMRectList(context, createRange(node3, subOffset_1 + offset, subSegment.length).getClientRects())));
                  subOffset_1 += subSegment.length;
                });
              } else {
                textBounds.push(new TextBounds(text3, Bounds.fromDOMRectList(context, clientRects)));
              }
            } else {
              var replacementNode = node3.splitText(text3.length);
              textBounds.push(new TextBounds(text3, getWrapperBounds(context, node3)));
              node3 = replacementNode;
            }
          } else if (!FEATURES.SUPPORT_RANGE_BOUNDS) {
            node3 = node3.splitText(text3.length);
          }
          offset += text3.length;
        });
        return textBounds;
      };
      var getWrapperBounds = function(context, node3) {
        var ownerDocument = node3.ownerDocument;
        if (ownerDocument) {
          var wrapper = ownerDocument.createElement("html2canvaswrapper");
          wrapper.appendChild(node3.cloneNode(true));
          var parentNode = node3.parentNode;
          if (parentNode) {
            parentNode.replaceChild(wrapper, node3);
            var bounds = parseBounds(context, wrapper);
            if (wrapper.firstChild) {
              parentNode.replaceChild(wrapper.firstChild, wrapper);
            }
            return bounds;
          }
        }
        return Bounds.EMPTY;
      };
      var createRange = function(node3, offset, length2) {
        var ownerDocument = node3.ownerDocument;
        if (!ownerDocument) {
          throw new Error("Node has no owner document");
        }
        var range = ownerDocument.createRange();
        range.setStart(node3, offset);
        range.setEnd(node3, offset + length2);
        return range;
      };
      var segmentGraphemes = function(value) {
        if (FEATURES.SUPPORT_NATIVE_TEXT_SEGMENTATION) {
          var segmenter = new Intl.Segmenter(void 0, { granularity: "grapheme" });
          return Array.from(segmenter.segment(value)).map(function(segment) {
            return segment.segment;
          });
        }
        return splitGraphemes(value);
      };
      var segmentWords = function(value, styles) {
        if (FEATURES.SUPPORT_NATIVE_TEXT_SEGMENTATION) {
          var segmenter = new Intl.Segmenter(void 0, {
            granularity: "word"
          });
          return Array.from(segmenter.segment(value)).map(function(segment) {
            return segment.segment;
          });
        }
        return breakWords(value, styles);
      };
      var breakText = function(value, styles) {
        return styles.letterSpacing !== 0 ? segmentGraphemes(value) : segmentWords(value, styles);
      };
      var wordSeparators = [32, 160, 4961, 65792, 65793, 4153, 4241];
      var breakWords = function(str, styles) {
        var breaker = LineBreaker(str, {
          lineBreak: styles.lineBreak,
          wordBreak: styles.overflowWrap === "break-word" ? "break-word" : styles.wordBreak
        });
        var words = [];
        var bk;
        var _loop_1 = function() {
          if (bk.value) {
            var value = bk.value.slice();
            var codePoints = toCodePoints$1(value);
            var word_1 = "";
            codePoints.forEach(function(codePoint) {
              if (wordSeparators.indexOf(codePoint) === -1) {
                word_1 += fromCodePoint$1(codePoint);
              } else {
                if (word_1.length) {
                  words.push(word_1);
                }
                words.push(fromCodePoint$1(codePoint));
                word_1 = "";
              }
            });
            if (word_1.length) {
              words.push(word_1);
            }
          }
        };
        while (!(bk = breaker.next()).done) {
          _loop_1();
        }
        return words;
      };
      var TextContainer = (
        /** @class */
        function() {
          function TextContainer2(context, node3, styles) {
            this.text = transform2(node3.data, styles.textTransform);
            this.textBounds = parseTextBounds(context, this.text, styles, node3);
          }
          return TextContainer2;
        }()
      );
      var transform2 = function(text3, transform3) {
        switch (transform3) {
          case 1:
            return text3.toLowerCase();
          case 3:
            return text3.replace(CAPITALIZE, capitalize2);
          case 2:
            return text3.toUpperCase();
          default:
            return text3;
        }
      };
      var CAPITALIZE = /(^|\s|:|-|\(|\))([a-z])/g;
      var capitalize2 = function(m4, p1, p22) {
        if (m4.length > 0) {
          return p1 + p22.toUpperCase();
        }
        return m4;
      };
      var ImageElementContainer = (
        /** @class */
        function(_super) {
          __extends(ImageElementContainer2, _super);
          function ImageElementContainer2(context, img) {
            var _this = _super.call(this, context, img) || this;
            _this.src = img.currentSrc || img.src;
            _this.intrinsicWidth = img.naturalWidth;
            _this.intrinsicHeight = img.naturalHeight;
            _this.context.cache.addImage(_this.src);
            return _this;
          }
          return ImageElementContainer2;
        }(ElementContainer)
      );
      var CanvasElementContainer = (
        /** @class */
        function(_super) {
          __extends(CanvasElementContainer2, _super);
          function CanvasElementContainer2(context, canvas) {
            var _this = _super.call(this, context, canvas) || this;
            _this.canvas = canvas;
            _this.intrinsicWidth = canvas.width;
            _this.intrinsicHeight = canvas.height;
            return _this;
          }
          return CanvasElementContainer2;
        }(ElementContainer)
      );
      var SVGElementContainer = (
        /** @class */
        function(_super) {
          __extends(SVGElementContainer2, _super);
          function SVGElementContainer2(context, img) {
            var _this = _super.call(this, context, img) || this;
            var s3 = new XMLSerializer();
            var bounds = parseBounds(context, img);
            img.setAttribute("width", bounds.width + "px");
            img.setAttribute("height", bounds.height + "px");
            _this.svg = "data:image/svg+xml," + encodeURIComponent(s3.serializeToString(img));
            _this.intrinsicWidth = img.width.baseVal.value;
            _this.intrinsicHeight = img.height.baseVal.value;
            _this.context.cache.addImage(_this.svg);
            return _this;
          }
          return SVGElementContainer2;
        }(ElementContainer)
      );
      var LIElementContainer = (
        /** @class */
        function(_super) {
          __extends(LIElementContainer2, _super);
          function LIElementContainer2(context, element2) {
            var _this = _super.call(this, context, element2) || this;
            _this.value = element2.value;
            return _this;
          }
          return LIElementContainer2;
        }(ElementContainer)
      );
      var OLElementContainer = (
        /** @class */
        function(_super) {
          __extends(OLElementContainer2, _super);
          function OLElementContainer2(context, element2) {
            var _this = _super.call(this, context, element2) || this;
            _this.start = element2.start;
            _this.reversed = typeof element2.reversed === "boolean" && element2.reversed === true;
            return _this;
          }
          return OLElementContainer2;
        }(ElementContainer)
      );
      var CHECKBOX_BORDER_RADIUS = [
        {
          type: 15,
          flags: 0,
          unit: "px",
          number: 3
        }
      ];
      var RADIO_BORDER_RADIUS = [
        {
          type: 16,
          flags: 0,
          number: 50
        }
      ];
      var reformatInputBounds = function(bounds) {
        if (bounds.width > bounds.height) {
          return new Bounds(bounds.left + (bounds.width - bounds.height) / 2, bounds.top, bounds.height, bounds.height);
        } else if (bounds.width < bounds.height) {
          return new Bounds(bounds.left, bounds.top + (bounds.height - bounds.width) / 2, bounds.width, bounds.width);
        }
        return bounds;
      };
      var getInputValue = function(node3) {
        var value = node3.type === PASSWORD ? new Array(node3.value.length + 1).join("\u2022") : node3.value;
        return value.length === 0 ? node3.placeholder || "" : value;
      };
      var CHECKBOX = "checkbox";
      var RADIO = "radio";
      var PASSWORD = "password";
      var INPUT_COLOR = 707406591;
      var InputElementContainer = (
        /** @class */
        function(_super) {
          __extends(InputElementContainer2, _super);
          function InputElementContainer2(context, input) {
            var _this = _super.call(this, context, input) || this;
            _this.type = input.type.toLowerCase();
            _this.checked = input.checked;
            _this.value = getInputValue(input);
            if (_this.type === CHECKBOX || _this.type === RADIO) {
              _this.styles.backgroundColor = 3739148031;
              _this.styles.borderTopColor = _this.styles.borderRightColor = _this.styles.borderBottomColor = _this.styles.borderLeftColor = 2779096575;
              _this.styles.borderTopWidth = _this.styles.borderRightWidth = _this.styles.borderBottomWidth = _this.styles.borderLeftWidth = 1;
              _this.styles.borderTopStyle = _this.styles.borderRightStyle = _this.styles.borderBottomStyle = _this.styles.borderLeftStyle = 1;
              _this.styles.backgroundClip = [
                0
                /* BORDER_BOX */
              ];
              _this.styles.backgroundOrigin = [
                0
                /* BORDER_BOX */
              ];
              _this.bounds = reformatInputBounds(_this.bounds);
            }
            switch (_this.type) {
              case CHECKBOX:
                _this.styles.borderTopRightRadius = _this.styles.borderTopLeftRadius = _this.styles.borderBottomRightRadius = _this.styles.borderBottomLeftRadius = CHECKBOX_BORDER_RADIUS;
                break;
              case RADIO:
                _this.styles.borderTopRightRadius = _this.styles.borderTopLeftRadius = _this.styles.borderBottomRightRadius = _this.styles.borderBottomLeftRadius = RADIO_BORDER_RADIUS;
                break;
            }
            return _this;
          }
          return InputElementContainer2;
        }(ElementContainer)
      );
      var SelectElementContainer = (
        /** @class */
        function(_super) {
          __extends(SelectElementContainer2, _super);
          function SelectElementContainer2(context, element2) {
            var _this = _super.call(this, context, element2) || this;
            var option = element2.options[element2.selectedIndex || 0];
            _this.value = option ? option.text || "" : "";
            return _this;
          }
          return SelectElementContainer2;
        }(ElementContainer)
      );
      var TextareaElementContainer = (
        /** @class */
        function(_super) {
          __extends(TextareaElementContainer2, _super);
          function TextareaElementContainer2(context, element2) {
            var _this = _super.call(this, context, element2) || this;
            _this.value = element2.value;
            return _this;
          }
          return TextareaElementContainer2;
        }(ElementContainer)
      );
      var IFrameElementContainer = (
        /** @class */
        function(_super) {
          __extends(IFrameElementContainer2, _super);
          function IFrameElementContainer2(context, iframe) {
            var _this = _super.call(this, context, iframe) || this;
            _this.src = iframe.src;
            _this.width = parseInt(iframe.width, 10) || 0;
            _this.height = parseInt(iframe.height, 10) || 0;
            _this.backgroundColor = _this.styles.backgroundColor;
            try {
              if (iframe.contentWindow && iframe.contentWindow.document && iframe.contentWindow.document.documentElement) {
                _this.tree = parseTree(context, iframe.contentWindow.document.documentElement);
                var documentBackgroundColor = iframe.contentWindow.document.documentElement ? parseColor(context, getComputedStyle(iframe.contentWindow.document.documentElement).backgroundColor) : COLORS.TRANSPARENT;
                var bodyBackgroundColor = iframe.contentWindow.document.body ? parseColor(context, getComputedStyle(iframe.contentWindow.document.body).backgroundColor) : COLORS.TRANSPARENT;
                _this.backgroundColor = isTransparent(documentBackgroundColor) ? isTransparent(bodyBackgroundColor) ? _this.styles.backgroundColor : bodyBackgroundColor : documentBackgroundColor;
              }
            } catch (e3) {
            }
            return _this;
          }
          return IFrameElementContainer2;
        }(ElementContainer)
      );
      var LIST_OWNERS = ["OL", "UL", "MENU"];
      var parseNodeTree = function(context, node3, parent, root2) {
        for (var childNode = node3.firstChild, nextNode = void 0; childNode; childNode = nextNode) {
          nextNode = childNode.nextSibling;
          if (isTextNode(childNode) && childNode.data.trim().length > 0) {
            parent.textNodes.push(new TextContainer(context, childNode, parent.styles));
          } else if (isElementNode(childNode)) {
            if (isSlotElement(childNode) && childNode.assignedNodes) {
              childNode.assignedNodes().forEach(function(childNode2) {
                return parseNodeTree(context, childNode2, parent, root2);
              });
            } else {
              var container = createContainer(context, childNode);
              if (container.styles.isVisible()) {
                if (createsRealStackingContext(childNode, container, root2)) {
                  container.flags |= 4;
                } else if (createsStackingContext(container.styles)) {
                  container.flags |= 2;
                }
                if (LIST_OWNERS.indexOf(childNode.tagName) !== -1) {
                  container.flags |= 8;
                }
                parent.elements.push(container);
                childNode.slot;
                if (childNode.shadowRoot) {
                  parseNodeTree(context, childNode.shadowRoot, container, root2);
                } else if (!isTextareaElement(childNode) && !isSVGElement(childNode) && !isSelectElement(childNode)) {
                  parseNodeTree(context, childNode, container, root2);
                }
              }
            }
          }
        }
      };
      var createContainer = function(context, element2) {
        if (isImageElement(element2)) {
          return new ImageElementContainer(context, element2);
        }
        if (isCanvasElement(element2)) {
          return new CanvasElementContainer(context, element2);
        }
        if (isSVGElement(element2)) {
          return new SVGElementContainer(context, element2);
        }
        if (isLIElement(element2)) {
          return new LIElementContainer(context, element2);
        }
        if (isOLElement(element2)) {
          return new OLElementContainer(context, element2);
        }
        if (isInputElement(element2)) {
          return new InputElementContainer(context, element2);
        }
        if (isSelectElement(element2)) {
          return new SelectElementContainer(context, element2);
        }
        if (isTextareaElement(element2)) {
          return new TextareaElementContainer(context, element2);
        }
        if (isIFrameElement(element2)) {
          return new IFrameElementContainer(context, element2);
        }
        return new ElementContainer(context, element2);
      };
      var parseTree = function(context, element2) {
        var container = createContainer(context, element2);
        container.flags |= 4;
        parseNodeTree(context, element2, container, container);
        return container;
      };
      var createsRealStackingContext = function(node3, container, root2) {
        return container.styles.isPositionedWithZIndex() || container.styles.opacity < 1 || container.styles.isTransformed() || isBodyElement(node3) && root2.styles.isTransparent();
      };
      var createsStackingContext = function(styles) {
        return styles.isPositioned() || styles.isFloating();
      };
      var isTextNode = function(node3) {
        return node3.nodeType === Node.TEXT_NODE;
      };
      var isElementNode = function(node3) {
        return node3.nodeType === Node.ELEMENT_NODE;
      };
      var isHTMLElementNode = function(node3) {
        return isElementNode(node3) && typeof node3.style !== "undefined" && !isSVGElementNode(node3);
      };
      var isSVGElementNode = function(element2) {
        return typeof element2.className === "object";
      };
      var isLIElement = function(node3) {
        return node3.tagName === "LI";
      };
      var isOLElement = function(node3) {
        return node3.tagName === "OL";
      };
      var isInputElement = function(node3) {
        return node3.tagName === "INPUT";
      };
      var isHTMLElement = function(node3) {
        return node3.tagName === "HTML";
      };
      var isSVGElement = function(node3) {
        return node3.tagName === "svg";
      };
      var isBodyElement = function(node3) {
        return node3.tagName === "BODY";
      };
      var isCanvasElement = function(node3) {
        return node3.tagName === "CANVAS";
      };
      var isVideoElement = function(node3) {
        return node3.tagName === "VIDEO";
      };
      var isImageElement = function(node3) {
        return node3.tagName === "IMG";
      };
      var isIFrameElement = function(node3) {
        return node3.tagName === "IFRAME";
      };
      var isStyleElement = function(node3) {
        return node3.tagName === "STYLE";
      };
      var isScriptElement = function(node3) {
        return node3.tagName === "SCRIPT";
      };
      var isTextareaElement = function(node3) {
        return node3.tagName === "TEXTAREA";
      };
      var isSelectElement = function(node3) {
        return node3.tagName === "SELECT";
      };
      var isSlotElement = function(node3) {
        return node3.tagName === "SLOT";
      };
      var isCustomElement = function(node3) {
        return node3.tagName.indexOf("-") > 0;
      };
      var CounterState = (
        /** @class */
        function() {
          function CounterState2() {
            this.counters = {};
          }
          CounterState2.prototype.getCounterValue = function(name) {
            var counter = this.counters[name];
            if (counter && counter.length) {
              return counter[counter.length - 1];
            }
            return 1;
          };
          CounterState2.prototype.getCounterValues = function(name) {
            var counter = this.counters[name];
            return counter ? counter : [];
          };
          CounterState2.prototype.pop = function(counters) {
            var _this = this;
            counters.forEach(function(counter) {
              return _this.counters[counter].pop();
            });
          };
          CounterState2.prototype.parse = function(style) {
            var _this = this;
            var counterIncrement2 = style.counterIncrement;
            var counterReset2 = style.counterReset;
            var canReset = true;
            if (counterIncrement2 !== null) {
              counterIncrement2.forEach(function(entry) {
                var counter = _this.counters[entry.counter];
                if (counter && entry.increment !== 0) {
                  canReset = false;
                  if (!counter.length) {
                    counter.push(1);
                  }
                  counter[Math.max(0, counter.length - 1)] += entry.increment;
                }
              });
            }
            var counterNames = [];
            if (canReset) {
              counterReset2.forEach(function(entry) {
                var counter = _this.counters[entry.counter];
                counterNames.push(entry.counter);
                if (!counter) {
                  counter = _this.counters[entry.counter] = [];
                }
                counter.push(entry.reset);
              });
            }
            return counterNames;
          };
          return CounterState2;
        }()
      );
      var ROMAN_UPPER = {
        integers: [1e3, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1],
        values: ["M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I"]
      };
      var ARMENIAN = {
        integers: [
          9e3,
          8e3,
          7e3,
          6e3,
          5e3,
          4e3,
          3e3,
          2e3,
          1e3,
          900,
          800,
          700,
          600,
          500,
          400,
          300,
          200,
          100,
          90,
          80,
          70,
          60,
          50,
          40,
          30,
          20,
          10,
          9,
          8,
          7,
          6,
          5,
          4,
          3,
          2,
          1
        ],
        values: [
          "\u0554",
          "\u0553",
          "\u0552",
          "\u0551",
          "\u0550",
          "\u054F",
          "\u054E",
          "\u054D",
          "\u054C",
          "\u054B",
          "\u054A",
          "\u0549",
          "\u0548",
          "\u0547",
          "\u0546",
          "\u0545",
          "\u0544",
          "\u0543",
          "\u0542",
          "\u0541",
          "\u0540",
          "\u053F",
          "\u053E",
          "\u053D",
          "\u053C",
          "\u053B",
          "\u053A",
          "\u0539",
          "\u0538",
          "\u0537",
          "\u0536",
          "\u0535",
          "\u0534",
          "\u0533",
          "\u0532",
          "\u0531"
        ]
      };
      var HEBREW = {
        integers: [
          1e4,
          9e3,
          8e3,
          7e3,
          6e3,
          5e3,
          4e3,
          3e3,
          2e3,
          1e3,
          400,
          300,
          200,
          100,
          90,
          80,
          70,
          60,
          50,
          40,
          30,
          20,
          19,
          18,
          17,
          16,
          15,
          10,
          9,
          8,
          7,
          6,
          5,
          4,
          3,
          2,
          1
        ],
        values: [
          "\u05D9\u05F3",
          "\u05D8\u05F3",
          "\u05D7\u05F3",
          "\u05D6\u05F3",
          "\u05D5\u05F3",
          "\u05D4\u05F3",
          "\u05D3\u05F3",
          "\u05D2\u05F3",
          "\u05D1\u05F3",
          "\u05D0\u05F3",
          "\u05EA",
          "\u05E9",
          "\u05E8",
          "\u05E7",
          "\u05E6",
          "\u05E4",
          "\u05E2",
          "\u05E1",
          "\u05E0",
          "\u05DE",
          "\u05DC",
          "\u05DB",
          "\u05D9\u05D8",
          "\u05D9\u05D7",
          "\u05D9\u05D6",
          "\u05D8\u05D6",
          "\u05D8\u05D5",
          "\u05D9",
          "\u05D8",
          "\u05D7",
          "\u05D6",
          "\u05D5",
          "\u05D4",
          "\u05D3",
          "\u05D2",
          "\u05D1",
          "\u05D0"
        ]
      };
      var GEORGIAN = {
        integers: [
          1e4,
          9e3,
          8e3,
          7e3,
          6e3,
          5e3,
          4e3,
          3e3,
          2e3,
          1e3,
          900,
          800,
          700,
          600,
          500,
          400,
          300,
          200,
          100,
          90,
          80,
          70,
          60,
          50,
          40,
          30,
          20,
          10,
          9,
          8,
          7,
          6,
          5,
          4,
          3,
          2,
          1
        ],
        values: [
          "\u10F5",
          "\u10F0",
          "\u10EF",
          "\u10F4",
          "\u10EE",
          "\u10ED",
          "\u10EC",
          "\u10EB",
          "\u10EA",
          "\u10E9",
          "\u10E8",
          "\u10E7",
          "\u10E6",
          "\u10E5",
          "\u10E4",
          "\u10F3",
          "\u10E2",
          "\u10E1",
          "\u10E0",
          "\u10DF",
          "\u10DE",
          "\u10DD",
          "\u10F2",
          "\u10DC",
          "\u10DB",
          "\u10DA",
          "\u10D9",
          "\u10D8",
          "\u10D7",
          "\u10F1",
          "\u10D6",
          "\u10D5",
          "\u10D4",
          "\u10D3",
          "\u10D2",
          "\u10D1",
          "\u10D0"
        ]
      };
      var createAdditiveCounter = function(value, min5, max3, symbols, fallback, suffix) {
        if (value < min5 || value > max3) {
          return createCounterText(value, fallback, suffix.length > 0);
        }
        return symbols.integers.reduce(function(string3, integer, index3) {
          while (value >= integer) {
            value -= integer;
            string3 += symbols.values[index3];
          }
          return string3;
        }, "") + suffix;
      };
      var createCounterStyleWithSymbolResolver = function(value, codePointRangeLength, isNumeric, resolver2) {
        var string3 = "";
        do {
          if (!isNumeric) {
            value--;
          }
          string3 = resolver2(value) + string3;
          value /= codePointRangeLength;
        } while (value * codePointRangeLength >= codePointRangeLength);
        return string3;
      };
      var createCounterStyleFromRange = function(value, codePointRangeStart, codePointRangeEnd, isNumeric, suffix) {
        var codePointRangeLength = codePointRangeEnd - codePointRangeStart + 1;
        return (value < 0 ? "-" : "") + (createCounterStyleWithSymbolResolver(Math.abs(value), codePointRangeLength, isNumeric, function(codePoint) {
          return fromCodePoint$1(Math.floor(codePoint % codePointRangeLength) + codePointRangeStart);
        }) + suffix);
      };
      var createCounterStyleFromSymbols = function(value, symbols, suffix) {
        if (suffix === void 0) {
          suffix = ". ";
        }
        var codePointRangeLength = symbols.length;
        return createCounterStyleWithSymbolResolver(Math.abs(value), codePointRangeLength, false, function(codePoint) {
          return symbols[Math.floor(codePoint % codePointRangeLength)];
        }) + suffix;
      };
      var CJK_ZEROS = 1 << 0;
      var CJK_TEN_COEFFICIENTS = 1 << 1;
      var CJK_TEN_HIGH_COEFFICIENTS = 1 << 2;
      var CJK_HUNDRED_COEFFICIENTS = 1 << 3;
      var createCJKCounter = function(value, numbers, multipliers, negativeSign, suffix, flags) {
        if (value < -9999 || value > 9999) {
          return createCounterText(value, 4, suffix.length > 0);
        }
        var tmp = Math.abs(value);
        var string3 = suffix;
        if (tmp === 0) {
          return numbers[0] + string3;
        }
        for (var digit = 0; tmp > 0 && digit <= 4; digit++) {
          var coefficient = tmp % 10;
          if (coefficient === 0 && contains(flags, CJK_ZEROS) && string3 !== "") {
            string3 = numbers[coefficient] + string3;
          } else if (coefficient > 1 || coefficient === 1 && digit === 0 || coefficient === 1 && digit === 1 && contains(flags, CJK_TEN_COEFFICIENTS) || coefficient === 1 && digit === 1 && contains(flags, CJK_TEN_HIGH_COEFFICIENTS) && value > 100 || coefficient === 1 && digit > 1 && contains(flags, CJK_HUNDRED_COEFFICIENTS)) {
            string3 = numbers[coefficient] + (digit > 0 ? multipliers[digit - 1] : "") + string3;
          } else if (coefficient === 1 && digit > 0) {
            string3 = multipliers[digit - 1] + string3;
          }
          tmp = Math.floor(tmp / 10);
        }
        return (value < 0 ? negativeSign : "") + string3;
      };
      var CHINESE_INFORMAL_MULTIPLIERS = "\u5341\u767E\u5343\u842C";
      var CHINESE_FORMAL_MULTIPLIERS = "\u62FE\u4F70\u4EDF\u842C";
      var JAPANESE_NEGATIVE = "\u30DE\u30A4\u30CA\u30B9";
      var KOREAN_NEGATIVE = "\uB9C8\uC774\uB108\uC2A4";
      var createCounterText = function(value, type, appendSuffix) {
        var defaultSuffix = appendSuffix ? ". " : "";
        var cjkSuffix = appendSuffix ? "\u3001" : "";
        var koreanSuffix = appendSuffix ? ", " : "";
        var spaceSuffix = appendSuffix ? " " : "";
        switch (type) {
          case 0:
            return "\u2022" + spaceSuffix;
          case 1:
            return "\u25E6" + spaceSuffix;
          case 2:
            return "\u25FE" + spaceSuffix;
          case 5:
            var string3 = createCounterStyleFromRange(value, 48, 57, true, defaultSuffix);
            return string3.length < 4 ? "0" + string3 : string3;
          case 4:
            return createCounterStyleFromSymbols(value, "\u3007\u4E00\u4E8C\u4E09\u56DB\u4E94\u516D\u4E03\u516B\u4E5D", cjkSuffix);
          case 6:
            return createAdditiveCounter(value, 1, 3999, ROMAN_UPPER, 3, defaultSuffix).toLowerCase();
          case 7:
            return createAdditiveCounter(value, 1, 3999, ROMAN_UPPER, 3, defaultSuffix);
          case 8:
            return createCounterStyleFromRange(value, 945, 969, false, defaultSuffix);
          case 9:
            return createCounterStyleFromRange(value, 97, 122, false, defaultSuffix);
          case 10:
            return createCounterStyleFromRange(value, 65, 90, false, defaultSuffix);
          case 11:
            return createCounterStyleFromRange(value, 1632, 1641, true, defaultSuffix);
          case 12:
          case 49:
            return createAdditiveCounter(value, 1, 9999, ARMENIAN, 3, defaultSuffix);
          case 35:
            return createAdditiveCounter(value, 1, 9999, ARMENIAN, 3, defaultSuffix).toLowerCase();
          case 13:
            return createCounterStyleFromRange(value, 2534, 2543, true, defaultSuffix);
          case 14:
          case 30:
            return createCounterStyleFromRange(value, 6112, 6121, true, defaultSuffix);
          case 15:
            return createCounterStyleFromSymbols(value, "\u5B50\u4E11\u5BC5\u536F\u8FB0\u5DF3\u5348\u672A\u7533\u9149\u620C\u4EA5", cjkSuffix);
          case 16:
            return createCounterStyleFromSymbols(value, "\u7532\u4E59\u4E19\u4E01\u620A\u5DF1\u5E9A\u8F9B\u58EC\u7678", cjkSuffix);
          case 17:
          case 48:
            return createCJKCounter(value, "\u96F6\u4E00\u4E8C\u4E09\u56DB\u4E94\u516D\u4E03\u516B\u4E5D", CHINESE_INFORMAL_MULTIPLIERS, "\u8CA0", cjkSuffix, CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);
          case 47:
            return createCJKCounter(value, "\u96F6\u58F9\u8CB3\u53C3\u8086\u4F0D\u9678\u67D2\u634C\u7396", CHINESE_FORMAL_MULTIPLIERS, "\u8CA0", cjkSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);
          case 42:
            return createCJKCounter(value, "\u96F6\u4E00\u4E8C\u4E09\u56DB\u4E94\u516D\u4E03\u516B\u4E5D", CHINESE_INFORMAL_MULTIPLIERS, "\u8D1F", cjkSuffix, CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);
          case 41:
            return createCJKCounter(value, "\u96F6\u58F9\u8D30\u53C1\u8086\u4F0D\u9646\u67D2\u634C\u7396", CHINESE_FORMAL_MULTIPLIERS, "\u8D1F", cjkSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);
          case 26:
            return createCJKCounter(value, "\u3007\u4E00\u4E8C\u4E09\u56DB\u4E94\u516D\u4E03\u516B\u4E5D", "\u5341\u767E\u5343\u4E07", JAPANESE_NEGATIVE, cjkSuffix, 0);
          case 25:
            return createCJKCounter(value, "\u96F6\u58F1\u5F10\u53C2\u56DB\u4F0D\u516D\u4E03\u516B\u4E5D", "\u62FE\u767E\u5343\u4E07", JAPANESE_NEGATIVE, cjkSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS);
          case 31:
            return createCJKCounter(value, "\uC601\uC77C\uC774\uC0BC\uC0AC\uC624\uC721\uCE60\uD314\uAD6C", "\uC2ED\uBC31\uCC9C\uB9CC", KOREAN_NEGATIVE, koreanSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS);
          case 33:
            return createCJKCounter(value, "\u96F6\u4E00\u4E8C\u4E09\u56DB\u4E94\u516D\u4E03\u516B\u4E5D", "\u5341\u767E\u5343\u842C", KOREAN_NEGATIVE, koreanSuffix, 0);
          case 32:
            return createCJKCounter(value, "\u96F6\u58F9\u8CB3\u53C3\u56DB\u4E94\u516D\u4E03\u516B\u4E5D", "\u62FE\u767E\u5343", KOREAN_NEGATIVE, koreanSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS);
          case 18:
            return createCounterStyleFromRange(value, 2406, 2415, true, defaultSuffix);
          case 20:
            return createAdditiveCounter(value, 1, 19999, GEORGIAN, 3, defaultSuffix);
          case 21:
            return createCounterStyleFromRange(value, 2790, 2799, true, defaultSuffix);
          case 22:
            return createCounterStyleFromRange(value, 2662, 2671, true, defaultSuffix);
          case 22:
            return createAdditiveCounter(value, 1, 10999, HEBREW, 3, defaultSuffix);
          case 23:
            return createCounterStyleFromSymbols(value, "\u3042\u3044\u3046\u3048\u304A\u304B\u304D\u304F\u3051\u3053\u3055\u3057\u3059\u305B\u305D\u305F\u3061\u3064\u3066\u3068\u306A\u306B\u306C\u306D\u306E\u306F\u3072\u3075\u3078\u307B\u307E\u307F\u3080\u3081\u3082\u3084\u3086\u3088\u3089\u308A\u308B\u308C\u308D\u308F\u3090\u3091\u3092\u3093");
          case 24:
            return createCounterStyleFromSymbols(value, "\u3044\u308D\u306F\u306B\u307B\u3078\u3068\u3061\u308A\u306C\u308B\u3092\u308F\u304B\u3088\u305F\u308C\u305D\u3064\u306D\u306A\u3089\u3080\u3046\u3090\u306E\u304A\u304F\u3084\u307E\u3051\u3075\u3053\u3048\u3066\u3042\u3055\u304D\u3086\u3081\u307F\u3057\u3091\u3072\u3082\u305B\u3059");
          case 27:
            return createCounterStyleFromRange(value, 3302, 3311, true, defaultSuffix);
          case 28:
            return createCounterStyleFromSymbols(value, "\u30A2\u30A4\u30A6\u30A8\u30AA\u30AB\u30AD\u30AF\u30B1\u30B3\u30B5\u30B7\u30B9\u30BB\u30BD\u30BF\u30C1\u30C4\u30C6\u30C8\u30CA\u30CB\u30CC\u30CD\u30CE\u30CF\u30D2\u30D5\u30D8\u30DB\u30DE\u30DF\u30E0\u30E1\u30E2\u30E4\u30E6\u30E8\u30E9\u30EA\u30EB\u30EC\u30ED\u30EF\u30F0\u30F1\u30F2\u30F3", cjkSuffix);
          case 29:
            return createCounterStyleFromSymbols(value, "\u30A4\u30ED\u30CF\u30CB\u30DB\u30D8\u30C8\u30C1\u30EA\u30CC\u30EB\u30F2\u30EF\u30AB\u30E8\u30BF\u30EC\u30BD\u30C4\u30CD\u30CA\u30E9\u30E0\u30A6\u30F0\u30CE\u30AA\u30AF\u30E4\u30DE\u30B1\u30D5\u30B3\u30A8\u30C6\u30A2\u30B5\u30AD\u30E6\u30E1\u30DF\u30B7\u30F1\u30D2\u30E2\u30BB\u30B9", cjkSuffix);
          case 34:
            return createCounterStyleFromRange(value, 3792, 3801, true, defaultSuffix);
          case 37:
            return createCounterStyleFromRange(value, 6160, 6169, true, defaultSuffix);
          case 38:
            return createCounterStyleFromRange(value, 4160, 4169, true, defaultSuffix);
          case 39:
            return createCounterStyleFromRange(value, 2918, 2927, true, defaultSuffix);
          case 40:
            return createCounterStyleFromRange(value, 1776, 1785, true, defaultSuffix);
          case 43:
            return createCounterStyleFromRange(value, 3046, 3055, true, defaultSuffix);
          case 44:
            return createCounterStyleFromRange(value, 3174, 3183, true, defaultSuffix);
          case 45:
            return createCounterStyleFromRange(value, 3664, 3673, true, defaultSuffix);
          case 46:
            return createCounterStyleFromRange(value, 3872, 3881, true, defaultSuffix);
          case 3:
          default:
            return createCounterStyleFromRange(value, 48, 57, true, defaultSuffix);
        }
      };
      var IGNORE_ATTRIBUTE = "data-html2canvas-ignore";
      var DocumentCloner = (
        /** @class */
        function() {
          function DocumentCloner2(context, element2, options) {
            this.context = context;
            this.options = options;
            this.scrolledElements = [];
            this.referenceElement = element2;
            this.counters = new CounterState();
            this.quoteDepth = 0;
            if (!element2.ownerDocument) {
              throw new Error("Cloned element does not have an owner document");
            }
            this.documentElement = this.cloneNode(element2.ownerDocument.documentElement, false);
          }
          DocumentCloner2.prototype.toIFrame = function(ownerDocument, windowSize) {
            var _this = this;
            var iframe = createIFrameContainer(ownerDocument, windowSize);
            if (!iframe.contentWindow) {
              return Promise.reject("Unable to find iframe window");
            }
            var scrollX = ownerDocument.defaultView.pageXOffset;
            var scrollY = ownerDocument.defaultView.pageYOffset;
            var cloneWindow = iframe.contentWindow;
            var documentClone = cloneWindow.document;
            var iframeLoad = iframeLoader(iframe).then(function() {
              return __awaiter(_this, void 0, void 0, function() {
                var onclone, referenceElement;
                return __generator(this, function(_a2) {
                  switch (_a2.label) {
                    case 0:
                      this.scrolledElements.forEach(restoreNodeScroll);
                      if (cloneWindow) {
                        cloneWindow.scrollTo(windowSize.left, windowSize.top);
                        if (/(iPad|iPhone|iPod)/g.test(navigator.userAgent) && (cloneWindow.scrollY !== windowSize.top || cloneWindow.scrollX !== windowSize.left)) {
                          this.context.logger.warn("Unable to restore scroll position for cloned document");
                          this.context.windowBounds = this.context.windowBounds.add(cloneWindow.scrollX - windowSize.left, cloneWindow.scrollY - windowSize.top, 0, 0);
                        }
                      }
                      onclone = this.options.onclone;
                      referenceElement = this.clonedReferenceElement;
                      if (typeof referenceElement === "undefined") {
                        return [2, Promise.reject("Error finding the " + this.referenceElement.nodeName + " in the cloned document")];
                      }
                      if (!(documentClone.fonts && documentClone.fonts.ready))
                        return [3, 2];
                      return [4, documentClone.fonts.ready];
                    case 1:
                      _a2.sent();
                      _a2.label = 2;
                    case 2:
                      if (!/(AppleWebKit)/g.test(navigator.userAgent))
                        return [3, 4];
                      return [4, imagesReady(documentClone)];
                    case 3:
                      _a2.sent();
                      _a2.label = 4;
                    case 4:
                      if (typeof onclone === "function") {
                        return [2, Promise.resolve().then(function() {
                          return onclone(documentClone, referenceElement);
                        }).then(function() {
                          return iframe;
                        })];
                      }
                      return [2, iframe];
                  }
                });
              });
            });
            documentClone.open();
            documentClone.write(serializeDoctype(document.doctype) + "<html></html>");
            restoreOwnerScroll(this.referenceElement.ownerDocument, scrollX, scrollY);
            documentClone.replaceChild(documentClone.adoptNode(this.documentElement), documentClone.documentElement);
            documentClone.close();
            return iframeLoad;
          };
          DocumentCloner2.prototype.createElementClone = function(node3) {
            if (isDebugging(
              node3,
              2
              /* CLONE */
            )) {
              debugger;
            }
            if (isCanvasElement(node3)) {
              return this.createCanvasClone(node3);
            }
            if (isVideoElement(node3)) {
              return this.createVideoClone(node3);
            }
            if (isStyleElement(node3)) {
              return this.createStyleClone(node3);
            }
            var clone = node3.cloneNode(false);
            if (isImageElement(clone)) {
              if (isImageElement(node3) && node3.currentSrc && node3.currentSrc !== node3.src) {
                clone.src = node3.currentSrc;
                clone.srcset = "";
              }
              if (clone.loading === "lazy") {
                clone.loading = "eager";
              }
            }
            if (isCustomElement(clone)) {
              return this.createCustomElementClone(clone);
            }
            return clone;
          };
          DocumentCloner2.prototype.createCustomElementClone = function(node3) {
            var clone = document.createElement("html2canvascustomelement");
            copyCSSStyles(node3.style, clone);
            return clone;
          };
          DocumentCloner2.prototype.createStyleClone = function(node3) {
            try {
              var sheet = node3.sheet;
              if (sheet && sheet.cssRules) {
                var css2 = [].slice.call(sheet.cssRules, 0).reduce(function(css3, rule) {
                  if (rule && typeof rule.cssText === "string") {
                    return css3 + rule.cssText;
                  }
                  return css3;
                }, "");
                var style = node3.cloneNode(false);
                style.textContent = css2;
                return style;
              }
            } catch (e3) {
              this.context.logger.error("Unable to access cssRules property", e3);
              if (e3.name !== "SecurityError") {
                throw e3;
              }
            }
            return node3.cloneNode(false);
          };
          DocumentCloner2.prototype.createCanvasClone = function(canvas) {
            var _a2;
            if (this.options.inlineImages && canvas.ownerDocument) {
              var img = canvas.ownerDocument.createElement("img");
              try {
                img.src = canvas.toDataURL();
                return img;
              } catch (e3) {
                this.context.logger.info("Unable to inline canvas contents, canvas is tainted", canvas);
              }
            }
            var clonedCanvas = canvas.cloneNode(false);
            try {
              clonedCanvas.width = canvas.width;
              clonedCanvas.height = canvas.height;
              var ctx = canvas.getContext("2d");
              var clonedCtx = clonedCanvas.getContext("2d");
              if (clonedCtx) {
                if (!this.options.allowTaint && ctx) {
                  clonedCtx.putImageData(ctx.getImageData(0, 0, canvas.width, canvas.height), 0, 0);
                } else {
                  var gl = (_a2 = canvas.getContext("webgl2")) !== null && _a2 !== void 0 ? _a2 : canvas.getContext("webgl");
                  if (gl) {
                    var attribs = gl.getContextAttributes();
                    if ((attribs === null || attribs === void 0 ? void 0 : attribs.preserveDrawingBuffer) === false) {
                      this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false", canvas);
                    }
                  }
                  clonedCtx.drawImage(canvas, 0, 0);
                }
              }
              return clonedCanvas;
            } catch (e3) {
              this.context.logger.info("Unable to clone canvas as it is tainted", canvas);
            }
            return clonedCanvas;
          };
          DocumentCloner2.prototype.createVideoClone = function(video) {
            var canvas = video.ownerDocument.createElement("canvas");
            canvas.width = video.offsetWidth;
            canvas.height = video.offsetHeight;
            var ctx = canvas.getContext("2d");
            try {
              if (ctx) {
                ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
                if (!this.options.allowTaint) {
                  ctx.getImageData(0, 0, canvas.width, canvas.height);
                }
              }
              return canvas;
            } catch (e3) {
              this.context.logger.info("Unable to clone video as it is tainted", video);
            }
            var blankCanvas = video.ownerDocument.createElement("canvas");
            blankCanvas.width = video.offsetWidth;
            blankCanvas.height = video.offsetHeight;
            return blankCanvas;
          };
          DocumentCloner2.prototype.appendChildNode = function(clone, child, copyStyles) {
            if (!isElementNode(child) || !isScriptElement(child) && !child.hasAttribute(IGNORE_ATTRIBUTE) && (typeof this.options.ignoreElements !== "function" || !this.options.ignoreElements(child))) {
              if (!this.options.copyStyles || !isElementNode(child) || !isStyleElement(child)) {
                clone.appendChild(this.cloneNode(child, copyStyles));
              }
            }
          };
          DocumentCloner2.prototype.cloneChildNodes = function(node3, clone, copyStyles) {
            var _this = this;
            for (var child = node3.shadowRoot ? node3.shadowRoot.firstChild : node3.firstChild; child; child = child.nextSibling) {
              if (isElementNode(child) && isSlotElement(child) && typeof child.assignedNodes === "function") {
                var assignedNodes = child.assignedNodes();
                if (assignedNodes.length) {
                  assignedNodes.forEach(function(assignedNode) {
                    return _this.appendChildNode(clone, assignedNode, copyStyles);
                  });
                }
              } else {
                this.appendChildNode(clone, child, copyStyles);
              }
            }
          };
          DocumentCloner2.prototype.cloneNode = function(node3, copyStyles) {
            if (isTextNode(node3)) {
              return document.createTextNode(node3.data);
            }
            if (!node3.ownerDocument) {
              return node3.cloneNode(false);
            }
            var window2 = node3.ownerDocument.defaultView;
            if (window2 && isElementNode(node3) && (isHTMLElementNode(node3) || isSVGElementNode(node3))) {
              var clone = this.createElementClone(node3);
              clone.style.transitionProperty = "none";
              var style = window2.getComputedStyle(node3);
              var styleBefore = window2.getComputedStyle(node3, ":before");
              var styleAfter = window2.getComputedStyle(node3, ":after");
              if (this.referenceElement === node3 && isHTMLElementNode(clone)) {
                this.clonedReferenceElement = clone;
              }
              if (isBodyElement(clone)) {
                createPseudoHideStyles(clone);
              }
              var counters = this.counters.parse(new CSSParsedCounterDeclaration(this.context, style));
              var before2 = this.resolvePseudoContent(node3, clone, styleBefore, PseudoElementType.BEFORE);
              if (isCustomElement(node3)) {
                copyStyles = true;
              }
              if (!isVideoElement(node3)) {
                this.cloneChildNodes(node3, clone, copyStyles);
              }
              if (before2) {
                clone.insertBefore(before2, clone.firstChild);
              }
              var after2 = this.resolvePseudoContent(node3, clone, styleAfter, PseudoElementType.AFTER);
              if (after2) {
                clone.appendChild(after2);
              }
              this.counters.pop(counters);
              if (style && (this.options.copyStyles || isSVGElementNode(node3)) && !isIFrameElement(node3) || copyStyles) {
                copyCSSStyles(style, clone);
              }
              if (node3.scrollTop !== 0 || node3.scrollLeft !== 0) {
                this.scrolledElements.push([clone, node3.scrollLeft, node3.scrollTop]);
              }
              if ((isTextareaElement(node3) || isSelectElement(node3)) && (isTextareaElement(clone) || isSelectElement(clone))) {
                clone.value = node3.value;
              }
              return clone;
            }
            return node3.cloneNode(false);
          };
          DocumentCloner2.prototype.resolvePseudoContent = function(node3, clone, style, pseudoElt) {
            var _this = this;
            if (!style) {
              return;
            }
            var value = style.content;
            var document4 = clone.ownerDocument;
            if (!document4 || !value || value === "none" || value === "-moz-alt-content" || style.display === "none") {
              return;
            }
            this.counters.parse(new CSSParsedCounterDeclaration(this.context, style));
            var declaration = new CSSParsedPseudoDeclaration(this.context, style);
            var anonymousReplacedElement = document4.createElement("html2canvaspseudoelement");
            copyCSSStyles(style, anonymousReplacedElement);
            declaration.content.forEach(function(token) {
              if (token.type === 0) {
                anonymousReplacedElement.appendChild(document4.createTextNode(token.value));
              } else if (token.type === 22) {
                var img = document4.createElement("img");
                img.src = token.value;
                img.style.opacity = "1";
                anonymousReplacedElement.appendChild(img);
              } else if (token.type === 18) {
                if (token.name === "attr") {
                  var attr2 = token.values.filter(isIdentToken);
                  if (attr2.length) {
                    anonymousReplacedElement.appendChild(document4.createTextNode(node3.getAttribute(attr2[0].value) || ""));
                  }
                } else if (token.name === "counter") {
                  var _a2 = token.values.filter(nonFunctionArgSeparator), counter = _a2[0], counterStyle = _a2[1];
                  if (counter && isIdentToken(counter)) {
                    var counterState = _this.counters.getCounterValue(counter.value);
                    var counterType = counterStyle && isIdentToken(counterStyle) ? listStyleType.parse(_this.context, counterStyle.value) : 3;
                    anonymousReplacedElement.appendChild(document4.createTextNode(createCounterText(counterState, counterType, false)));
                  }
                } else if (token.name === "counters") {
                  var _b2 = token.values.filter(nonFunctionArgSeparator), counter = _b2[0], delim = _b2[1], counterStyle = _b2[2];
                  if (counter && isIdentToken(counter)) {
                    var counterStates = _this.counters.getCounterValues(counter.value);
                    var counterType_1 = counterStyle && isIdentToken(counterStyle) ? listStyleType.parse(_this.context, counterStyle.value) : 3;
                    var separator = delim && delim.type === 0 ? delim.value : "";
                    var text3 = counterStates.map(function(value2) {
                      return createCounterText(value2, counterType_1, false);
                    }).join(separator);
                    anonymousReplacedElement.appendChild(document4.createTextNode(text3));
                  }
                } else
                  ;
              } else if (token.type === 20) {
                switch (token.value) {
                  case "open-quote":
                    anonymousReplacedElement.appendChild(document4.createTextNode(getQuote(declaration.quotes, _this.quoteDepth++, true)));
                    break;
                  case "close-quote":
                    anonymousReplacedElement.appendChild(document4.createTextNode(getQuote(declaration.quotes, --_this.quoteDepth, false)));
                    break;
                  default:
                    anonymousReplacedElement.appendChild(document4.createTextNode(token.value));
                }
              }
            });
            anonymousReplacedElement.className = PSEUDO_HIDE_ELEMENT_CLASS_BEFORE + " " + PSEUDO_HIDE_ELEMENT_CLASS_AFTER;
            var newClassName = pseudoElt === PseudoElementType.BEFORE ? " " + PSEUDO_HIDE_ELEMENT_CLASS_BEFORE : " " + PSEUDO_HIDE_ELEMENT_CLASS_AFTER;
            if (isSVGElementNode(clone)) {
              clone.className.baseValue += newClassName;
            } else {
              clone.className += newClassName;
            }
            return anonymousReplacedElement;
          };
          DocumentCloner2.destroy = function(container) {
            if (container.parentNode) {
              container.parentNode.removeChild(container);
              return true;
            }
            return false;
          };
          return DocumentCloner2;
        }()
      );
      var PseudoElementType;
      (function(PseudoElementType2) {
        PseudoElementType2[PseudoElementType2["BEFORE"] = 0] = "BEFORE";
        PseudoElementType2[PseudoElementType2["AFTER"] = 1] = "AFTER";
      })(PseudoElementType || (PseudoElementType = {}));
      var createIFrameContainer = function(ownerDocument, bounds) {
        var cloneIframeContainer = ownerDocument.createElement("iframe");
        cloneIframeContainer.className = "html2canvas-container";
        cloneIframeContainer.style.visibility = "hidden";
        cloneIframeContainer.style.position = "fixed";
        cloneIframeContainer.style.left = "-10000px";
        cloneIframeContainer.style.top = "0px";
        cloneIframeContainer.style.border = "0";
        cloneIframeContainer.width = bounds.width.toString();
        cloneIframeContainer.height = bounds.height.toString();
        cloneIframeContainer.scrolling = "no";
        cloneIframeContainer.setAttribute(IGNORE_ATTRIBUTE, "true");
        ownerDocument.body.appendChild(cloneIframeContainer);
        return cloneIframeContainer;
      };
      var imageReady = function(img) {
        return new Promise(function(resolve) {
          if (img.complete) {
            resolve();
            return;
          }
          if (!img.src) {
            resolve();
            return;
          }
          img.onload = resolve;
          img.onerror = resolve;
        });
      };
      var imagesReady = function(document4) {
        return Promise.all([].slice.call(document4.images, 0).map(imageReady));
      };
      var iframeLoader = function(iframe) {
        return new Promise(function(resolve, reject) {
          var cloneWindow = iframe.contentWindow;
          if (!cloneWindow) {
            return reject("No window assigned for iframe");
          }
          var documentClone = cloneWindow.document;
          cloneWindow.onload = iframe.onload = function() {
            cloneWindow.onload = iframe.onload = null;
            var interval = setInterval(function() {
              if (documentClone.body.childNodes.length > 0 && documentClone.readyState === "complete") {
                clearInterval(interval);
                resolve(iframe);
              }
            }, 50);
          };
        });
      };
      var ignoredStyleProperties = [
        "all",
        "d",
        "content"
        // Safari shows pseudoelements if content is set
      ];
      var copyCSSStyles = function(style, target) {
        for (var i4 = style.length - 1; i4 >= 0; i4--) {
          var property = style.item(i4);
          if (ignoredStyleProperties.indexOf(property) === -1) {
            target.style.setProperty(property, style.getPropertyValue(property));
          }
        }
        return target;
      };
      var serializeDoctype = function(doctype) {
        var str = "";
        if (doctype) {
          str += "<!DOCTYPE ";
          if (doctype.name) {
            str += doctype.name;
          }
          if (doctype.internalSubset) {
            str += doctype.internalSubset;
          }
          if (doctype.publicId) {
            str += '"' + doctype.publicId + '"';
          }
          if (doctype.systemId) {
            str += '"' + doctype.systemId + '"';
          }
          str += ">";
        }
        return str;
      };
      var restoreOwnerScroll = function(ownerDocument, x3, y4) {
        if (ownerDocument && ownerDocument.defaultView && (x3 !== ownerDocument.defaultView.pageXOffset || y4 !== ownerDocument.defaultView.pageYOffset)) {
          ownerDocument.defaultView.scrollTo(x3, y4);
        }
      };
      var restoreNodeScroll = function(_a2) {
        var element2 = _a2[0], x3 = _a2[1], y4 = _a2[2];
        element2.scrollLeft = x3;
        element2.scrollTop = y4;
      };
      var PSEUDO_BEFORE = ":before";
      var PSEUDO_AFTER = ":after";
      var PSEUDO_HIDE_ELEMENT_CLASS_BEFORE = "___html2canvas___pseudoelement_before";
      var PSEUDO_HIDE_ELEMENT_CLASS_AFTER = "___html2canvas___pseudoelement_after";
      var PSEUDO_HIDE_ELEMENT_STYLE = '{\n    content: "" !important;\n    display: none !important;\n}';
      var createPseudoHideStyles = function(body) {
        createStyles(body, "." + PSEUDO_HIDE_ELEMENT_CLASS_BEFORE + PSEUDO_BEFORE + PSEUDO_HIDE_ELEMENT_STYLE + "\n         ." + PSEUDO_HIDE_ELEMENT_CLASS_AFTER + PSEUDO_AFTER + PSEUDO_HIDE_ELEMENT_STYLE);
      };
      var createStyles = function(body, styles) {
        var document4 = body.ownerDocument;
        if (document4) {
          var style = document4.createElement("style");
          style.textContent = styles;
          body.appendChild(style);
        }
      };
      var CacheStorage = (
        /** @class */
        function() {
          function CacheStorage2() {
          }
          CacheStorage2.getOrigin = function(url) {
            var link = CacheStorage2._link;
            if (!link) {
              return "about:blank";
            }
            link.href = url;
            link.href = link.href;
            return link.protocol + link.hostname + link.port;
          };
          CacheStorage2.isSameOrigin = function(src) {
            return CacheStorage2.getOrigin(src) === CacheStorage2._origin;
          };
          CacheStorage2.setContext = function(window2) {
            CacheStorage2._link = window2.document.createElement("a");
            CacheStorage2._origin = CacheStorage2.getOrigin(window2.location.href);
          };
          CacheStorage2._origin = "about:blank";
          return CacheStorage2;
        }()
      );
      var Cache = (
        /** @class */
        function() {
          function Cache2(context, _options) {
            this.context = context;
            this._options = _options;
            this._cache = {};
          }
          Cache2.prototype.addImage = function(src) {
            var result = Promise.resolve();
            if (this.has(src)) {
              return result;
            }
            if (isBlobImage(src) || isRenderable(src)) {
              (this._cache[src] = this.loadImage(src)).catch(function() {
              });
              return result;
            }
            return result;
          };
          Cache2.prototype.match = function(src) {
            return this._cache[src];
          };
          Cache2.prototype.loadImage = function(key) {
            return __awaiter(this, void 0, void 0, function() {
              var isSameOrigin, useCORS, useProxy, src;
              var _this = this;
              return __generator(this, function(_a2) {
                switch (_a2.label) {
                  case 0:
                    isSameOrigin = CacheStorage.isSameOrigin(key);
                    useCORS = !isInlineImage(key) && this._options.useCORS === true && FEATURES.SUPPORT_CORS_IMAGES && !isSameOrigin;
                    useProxy = !isInlineImage(key) && !isSameOrigin && !isBlobImage(key) && typeof this._options.proxy === "string" && FEATURES.SUPPORT_CORS_XHR && !useCORS;
                    if (!isSameOrigin && this._options.allowTaint === false && !isInlineImage(key) && !isBlobImage(key) && !useProxy && !useCORS) {
                      return [
                        2
                        /*return*/
                      ];
                    }
                    src = key;
                    if (!useProxy)
                      return [3, 2];
                    return [4, this.proxy(src)];
                  case 1:
                    src = _a2.sent();
                    _a2.label = 2;
                  case 2:
                    this.context.logger.debug("Added image " + key.substring(0, 256));
                    return [4, new Promise(function(resolve, reject) {
                      var img = new Image();
                      img.onload = function() {
                        return resolve(img);
                      };
                      img.onerror = reject;
                      if (isInlineBase64Image(src) || useCORS) {
                        img.crossOrigin = "anonymous";
                      }
                      img.src = src;
                      if (img.complete === true) {
                        setTimeout(function() {
                          return resolve(img);
                        }, 500);
                      }
                      if (_this._options.imageTimeout > 0) {
                        setTimeout(function() {
                          return reject("Timed out (" + _this._options.imageTimeout + "ms) loading image");
                        }, _this._options.imageTimeout);
                      }
                    })];
                  case 3:
                    return [2, _a2.sent()];
                }
              });
            });
          };
          Cache2.prototype.has = function(key) {
            return typeof this._cache[key] !== "undefined";
          };
          Cache2.prototype.keys = function() {
            return Promise.resolve(Object.keys(this._cache));
          };
          Cache2.prototype.proxy = function(src) {
            var _this = this;
            var proxy = this._options.proxy;
            if (!proxy) {
              throw new Error("No proxy defined");
            }
            var key = src.substring(0, 256);
            return new Promise(function(resolve, reject) {
              var responseType = FEATURES.SUPPORT_RESPONSE_TYPE ? "blob" : "text";
              var xhr = new XMLHttpRequest();
              xhr.onload = function() {
                if (xhr.status === 200) {
                  if (responseType === "text") {
                    resolve(xhr.response);
                  } else {
                    var reader_1 = new FileReader();
                    reader_1.addEventListener("load", function() {
                      return resolve(reader_1.result);
                    }, false);
                    reader_1.addEventListener("error", function(e3) {
                      return reject(e3);
                    }, false);
                    reader_1.readAsDataURL(xhr.response);
                  }
                } else {
                  reject("Failed to proxy resource " + key + " with status code " + xhr.status);
                }
              };
              xhr.onerror = reject;
              var queryString = proxy.indexOf("?") > -1 ? "&" : "?";
              xhr.open("GET", "" + proxy + queryString + "url=" + encodeURIComponent(src) + "&responseType=" + responseType);
              if (responseType !== "text" && xhr instanceof XMLHttpRequest) {
                xhr.responseType = responseType;
              }
              if (_this._options.imageTimeout) {
                var timeout_1 = _this._options.imageTimeout;
                xhr.timeout = timeout_1;
                xhr.ontimeout = function() {
                  return reject("Timed out (" + timeout_1 + "ms) proxying " + key);
                };
              }
              xhr.send();
            });
          };
          return Cache2;
        }()
      );
      var INLINE_SVG = /^data:image\/svg\+xml/i;
      var INLINE_BASE64 = /^data:image\/.*;base64,/i;
      var INLINE_IMG = /^data:image\/.*/i;
      var isRenderable = function(src) {
        return FEATURES.SUPPORT_SVG_DRAWING || !isSVG(src);
      };
      var isInlineImage = function(src) {
        return INLINE_IMG.test(src);
      };
      var isInlineBase64Image = function(src) {
        return INLINE_BASE64.test(src);
      };
      var isBlobImage = function(src) {
        return src.substr(0, 4) === "blob";
      };
      var isSVG = function(src) {
        return src.substr(-3).toLowerCase() === "svg" || INLINE_SVG.test(src);
      };
      var Vector = (
        /** @class */
        function() {
          function Vector2(x3, y4) {
            this.type = 0;
            this.x = x3;
            this.y = y4;
          }
          Vector2.prototype.add = function(deltaX, deltaY) {
            return new Vector2(this.x + deltaX, this.y + deltaY);
          };
          return Vector2;
        }()
      );
      var lerp = function(a4, b2, t3) {
        return new Vector(a4.x + (b2.x - a4.x) * t3, a4.y + (b2.y - a4.y) * t3);
      };
      var BezierCurve = (
        /** @class */
        function() {
          function BezierCurve2(start, startControl, endControl, end) {
            this.type = 1;
            this.start = start;
            this.startControl = startControl;
            this.endControl = endControl;
            this.end = end;
          }
          BezierCurve2.prototype.subdivide = function(t3, firstHalf) {
            var ab = lerp(this.start, this.startControl, t3);
            var bc = lerp(this.startControl, this.endControl, t3);
            var cd = lerp(this.endControl, this.end, t3);
            var abbc = lerp(ab, bc, t3);
            var bccd = lerp(bc, cd, t3);
            var dest = lerp(abbc, bccd, t3);
            return firstHalf ? new BezierCurve2(this.start, ab, abbc, dest) : new BezierCurve2(dest, bccd, cd, this.end);
          };
          BezierCurve2.prototype.add = function(deltaX, deltaY) {
            return new BezierCurve2(this.start.add(deltaX, deltaY), this.startControl.add(deltaX, deltaY), this.endControl.add(deltaX, deltaY), this.end.add(deltaX, deltaY));
          };
          BezierCurve2.prototype.reverse = function() {
            return new BezierCurve2(this.end, this.endControl, this.startControl, this.start);
          };
          return BezierCurve2;
        }()
      );
      var isBezierCurve = function(path) {
        return path.type === 1;
      };
      var BoundCurves = (
        /** @class */
        function() {
          function BoundCurves2(element2) {
            var styles = element2.styles;
            var bounds = element2.bounds;
            var _a2 = getAbsoluteValueForTuple(styles.borderTopLeftRadius, bounds.width, bounds.height), tlh = _a2[0], tlv = _a2[1];
            var _b2 = getAbsoluteValueForTuple(styles.borderTopRightRadius, bounds.width, bounds.height), trh = _b2[0], trv = _b2[1];
            var _c = getAbsoluteValueForTuple(styles.borderBottomRightRadius, bounds.width, bounds.height), brh = _c[0], brv = _c[1];
            var _d = getAbsoluteValueForTuple(styles.borderBottomLeftRadius, bounds.width, bounds.height), blh = _d[0], blv = _d[1];
            var factors = [];
            factors.push((tlh + trh) / bounds.width);
            factors.push((blh + brh) / bounds.width);
            factors.push((tlv + blv) / bounds.height);
            factors.push((trv + brv) / bounds.height);
            var maxFactor = Math.max.apply(Math, factors);
            if (maxFactor > 1) {
              tlh /= maxFactor;
              tlv /= maxFactor;
              trh /= maxFactor;
              trv /= maxFactor;
              brh /= maxFactor;
              brv /= maxFactor;
              blh /= maxFactor;
              blv /= maxFactor;
            }
            var topWidth = bounds.width - trh;
            var rightHeight = bounds.height - brv;
            var bottomWidth = bounds.width - brh;
            var leftHeight = bounds.height - blv;
            var borderTopWidth2 = styles.borderTopWidth;
            var borderRightWidth2 = styles.borderRightWidth;
            var borderBottomWidth2 = styles.borderBottomWidth;
            var borderLeftWidth2 = styles.borderLeftWidth;
            var paddingTop2 = getAbsoluteValue(styles.paddingTop, element2.bounds.width);
            var paddingRight2 = getAbsoluteValue(styles.paddingRight, element2.bounds.width);
            var paddingBottom2 = getAbsoluteValue(styles.paddingBottom, element2.bounds.width);
            var paddingLeft2 = getAbsoluteValue(styles.paddingLeft, element2.bounds.width);
            this.topLeftBorderDoubleOuterBox = tlh > 0 || tlv > 0 ? getCurvePoints(bounds.left + borderLeftWidth2 / 3, bounds.top + borderTopWidth2 / 3, tlh - borderLeftWidth2 / 3, tlv - borderTopWidth2 / 3, CORNER.TOP_LEFT) : new Vector(bounds.left + borderLeftWidth2 / 3, bounds.top + borderTopWidth2 / 3);
            this.topRightBorderDoubleOuterBox = tlh > 0 || tlv > 0 ? getCurvePoints(bounds.left + topWidth, bounds.top + borderTopWidth2 / 3, trh - borderRightWidth2 / 3, trv - borderTopWidth2 / 3, CORNER.TOP_RIGHT) : new Vector(bounds.left + bounds.width - borderRightWidth2 / 3, bounds.top + borderTopWidth2 / 3);
            this.bottomRightBorderDoubleOuterBox = brh > 0 || brv > 0 ? getCurvePoints(bounds.left + bottomWidth, bounds.top + rightHeight, brh - borderRightWidth2 / 3, brv - borderBottomWidth2 / 3, CORNER.BOTTOM_RIGHT) : new Vector(bounds.left + bounds.width - borderRightWidth2 / 3, bounds.top + bounds.height - borderBottomWidth2 / 3);
            this.bottomLeftBorderDoubleOuterBox = blh > 0 || blv > 0 ? getCurvePoints(bounds.left + borderLeftWidth2 / 3, bounds.top + leftHeight, blh - borderLeftWidth2 / 3, blv - borderBottomWidth2 / 3, CORNER.BOTTOM_LEFT) : new Vector(bounds.left + borderLeftWidth2 / 3, bounds.top + bounds.height - borderBottomWidth2 / 3);
            this.topLeftBorderDoubleInnerBox = tlh > 0 || tlv > 0 ? getCurvePoints(bounds.left + borderLeftWidth2 * 2 / 3, bounds.top + borderTopWidth2 * 2 / 3, tlh - borderLeftWidth2 * 2 / 3, tlv - borderTopWidth2 * 2 / 3, CORNER.TOP_LEFT) : new Vector(bounds.left + borderLeftWidth2 * 2 / 3, bounds.top + borderTopWidth2 * 2 / 3);
            this.topRightBorderDoubleInnerBox = tlh > 0 || tlv > 0 ? getCurvePoints(bounds.left + topWidth, bounds.top + borderTopWidth2 * 2 / 3, trh - borderRightWidth2 * 2 / 3, trv - borderTopWidth2 * 2 / 3, CORNER.TOP_RIGHT) : new Vector(bounds.left + bounds.width - borderRightWidth2 * 2 / 3, bounds.top + borderTopWidth2 * 2 / 3);
            this.bottomRightBorderDoubleInnerBox = brh > 0 || brv > 0 ? getCurvePoints(bounds.left + bottomWidth, bounds.top + rightHeight, brh - borderRightWidth2 * 2 / 3, brv - borderBottomWidth2 * 2 / 3, CORNER.BOTTOM_RIGHT) : new Vector(bounds.left + bounds.width - borderRightWidth2 * 2 / 3, bounds.top + bounds.height - borderBottomWidth2 * 2 / 3);
            this.bottomLeftBorderDoubleInnerBox = blh > 0 || blv > 0 ? getCurvePoints(bounds.left + borderLeftWidth2 * 2 / 3, bounds.top + leftHeight, blh - borderLeftWidth2 * 2 / 3, blv - borderBottomWidth2 * 2 / 3, CORNER.BOTTOM_LEFT) : new Vector(bounds.left + borderLeftWidth2 * 2 / 3, bounds.top + bounds.height - borderBottomWidth2 * 2 / 3);
            this.topLeftBorderStroke = tlh > 0 || tlv > 0 ? getCurvePoints(bounds.left + borderLeftWidth2 / 2, bounds.top + borderTopWidth2 / 2, tlh - borderLeftWidth2 / 2, tlv - borderTopWidth2 / 2, CORNER.TOP_LEFT) : new Vector(bounds.left + borderLeftWidth2 / 2, bounds.top + borderTopWidth2 / 2);
            this.topRightBorderStroke = tlh > 0 || tlv > 0 ? getCurvePoints(bounds.left + topWidth, bounds.top + borderTopWidth2 / 2, trh - borderRightWidth2 / 2, trv - borderTopWidth2 / 2, CORNER.TOP_RIGHT) : new Vector(bounds.left + bounds.width - borderRightWidth2 / 2, bounds.top + borderTopWidth2 / 2);
            this.bottomRightBorderStroke = brh > 0 || brv > 0 ? getCurvePoints(bounds.left + bottomWidth, bounds.top + rightHeight, brh - borderRightWidth2 / 2, brv - borderBottomWidth2 / 2, CORNER.BOTTOM_RIGHT) : new Vector(bounds.left + bounds.width - borderRightWidth2 / 2, bounds.top + bounds.height - borderBottomWidth2 / 2);
            this.bottomLeftBorderStroke = blh > 0 || blv > 0 ? getCurvePoints(bounds.left + borderLeftWidth2 / 2, bounds.top + leftHeight, blh - borderLeftWidth2 / 2, blv - borderBottomWidth2 / 2, CORNER.BOTTOM_LEFT) : new Vector(bounds.left + borderLeftWidth2 / 2, bounds.top + bounds.height - borderBottomWidth2 / 2);
            this.topLeftBorderBox = tlh > 0 || tlv > 0 ? getCurvePoints(bounds.left, bounds.top, tlh, tlv, CORNER.TOP_LEFT) : new Vector(bounds.left, bounds.top);
            this.topRightBorderBox = trh > 0 || trv > 0 ? getCurvePoints(bounds.left + topWidth, bounds.top, trh, trv, CORNER.TOP_RIGHT) : new Vector(bounds.left + bounds.width, bounds.top);
            this.bottomRightBorderBox = brh > 0 || brv > 0 ? getCurvePoints(bounds.left + bottomWidth, bounds.top + rightHeight, brh, brv, CORNER.BOTTOM_RIGHT) : new Vector(bounds.left + bounds.width, bounds.top + bounds.height);
            this.bottomLeftBorderBox = blh > 0 || blv > 0 ? getCurvePoints(bounds.left, bounds.top + leftHeight, blh, blv, CORNER.BOTTOM_LEFT) : new Vector(bounds.left, bounds.top + bounds.height);
            this.topLeftPaddingBox = tlh > 0 || tlv > 0 ? getCurvePoints(bounds.left + borderLeftWidth2, bounds.top + borderTopWidth2, Math.max(0, tlh - borderLeftWidth2), Math.max(0, tlv - borderTopWidth2), CORNER.TOP_LEFT) : new Vector(bounds.left + borderLeftWidth2, bounds.top + borderTopWidth2);
            this.topRightPaddingBox = trh > 0 || trv > 0 ? getCurvePoints(bounds.left + Math.min(topWidth, bounds.width - borderRightWidth2), bounds.top + borderTopWidth2, topWidth > bounds.width + borderRightWidth2 ? 0 : Math.max(0, trh - borderRightWidth2), Math.max(0, trv - borderTopWidth2), CORNER.TOP_RIGHT) : new Vector(bounds.left + bounds.width - borderRightWidth2, bounds.top + borderTopWidth2);
            this.bottomRightPaddingBox = brh > 0 || brv > 0 ? getCurvePoints(bounds.left + Math.min(bottomWidth, bounds.width - borderLeftWidth2), bounds.top + Math.min(rightHeight, bounds.height - borderBottomWidth2), Math.max(0, brh - borderRightWidth2), Math.max(0, brv - borderBottomWidth2), CORNER.BOTTOM_RIGHT) : new Vector(bounds.left + bounds.width - borderRightWidth2, bounds.top + bounds.height - borderBottomWidth2);
            this.bottomLeftPaddingBox = blh > 0 || blv > 0 ? getCurvePoints(bounds.left + borderLeftWidth2, bounds.top + Math.min(leftHeight, bounds.height - borderBottomWidth2), Math.max(0, blh - borderLeftWidth2), Math.max(0, blv - borderBottomWidth2), CORNER.BOTTOM_LEFT) : new Vector(bounds.left + borderLeftWidth2, bounds.top + bounds.height - borderBottomWidth2);
            this.topLeftContentBox = tlh > 0 || tlv > 0 ? getCurvePoints(bounds.left + borderLeftWidth2 + paddingLeft2, bounds.top + borderTopWidth2 + paddingTop2, Math.max(0, tlh - (borderLeftWidth2 + paddingLeft2)), Math.max(0, tlv - (borderTopWidth2 + paddingTop2)), CORNER.TOP_LEFT) : new Vector(bounds.left + borderLeftWidth2 + paddingLeft2, bounds.top + borderTopWidth2 + paddingTop2);
            this.topRightContentBox = trh > 0 || trv > 0 ? getCurvePoints(bounds.left + Math.min(topWidth, bounds.width + borderLeftWidth2 + paddingLeft2), bounds.top + borderTopWidth2 + paddingTop2, topWidth > bounds.width + borderLeftWidth2 + paddingLeft2 ? 0 : trh - borderLeftWidth2 + paddingLeft2, trv - (borderTopWidth2 + paddingTop2), CORNER.TOP_RIGHT) : new Vector(bounds.left + bounds.width - (borderRightWidth2 + paddingRight2), bounds.top + borderTopWidth2 + paddingTop2);
            this.bottomRightContentBox = brh > 0 || brv > 0 ? getCurvePoints(bounds.left + Math.min(bottomWidth, bounds.width - (borderLeftWidth2 + paddingLeft2)), bounds.top + Math.min(rightHeight, bounds.height + borderTopWidth2 + paddingTop2), Math.max(0, brh - (borderRightWidth2 + paddingRight2)), brv - (borderBottomWidth2 + paddingBottom2), CORNER.BOTTOM_RIGHT) : new Vector(bounds.left + bounds.width - (borderRightWidth2 + paddingRight2), bounds.top + bounds.height - (borderBottomWidth2 + paddingBottom2));
            this.bottomLeftContentBox = blh > 0 || blv > 0 ? getCurvePoints(bounds.left + borderLeftWidth2 + paddingLeft2, bounds.top + leftHeight, Math.max(0, blh - (borderLeftWidth2 + paddingLeft2)), blv - (borderBottomWidth2 + paddingBottom2), CORNER.BOTTOM_LEFT) : new Vector(bounds.left + borderLeftWidth2 + paddingLeft2, bounds.top + bounds.height - (borderBottomWidth2 + paddingBottom2));
          }
          return BoundCurves2;
        }()
      );
      var CORNER;
      (function(CORNER2) {
        CORNER2[CORNER2["TOP_LEFT"] = 0] = "TOP_LEFT";
        CORNER2[CORNER2["TOP_RIGHT"] = 1] = "TOP_RIGHT";
        CORNER2[CORNER2["BOTTOM_RIGHT"] = 2] = "BOTTOM_RIGHT";
        CORNER2[CORNER2["BOTTOM_LEFT"] = 3] = "BOTTOM_LEFT";
      })(CORNER || (CORNER = {}));
      var getCurvePoints = function(x3, y4, r1, r2, position4) {
        var kappa = 4 * ((Math.sqrt(2) - 1) / 3);
        var ox = r1 * kappa;
        var oy = r2 * kappa;
        var xm = x3 + r1;
        var ym = y4 + r2;
        switch (position4) {
          case CORNER.TOP_LEFT:
            return new BezierCurve(new Vector(x3, ym), new Vector(x3, ym - oy), new Vector(xm - ox, y4), new Vector(xm, y4));
          case CORNER.TOP_RIGHT:
            return new BezierCurve(new Vector(x3, y4), new Vector(x3 + ox, y4), new Vector(xm, ym - oy), new Vector(xm, ym));
          case CORNER.BOTTOM_RIGHT:
            return new BezierCurve(new Vector(xm, y4), new Vector(xm, y4 + oy), new Vector(x3 + ox, ym), new Vector(x3, ym));
          case CORNER.BOTTOM_LEFT:
          default:
            return new BezierCurve(new Vector(xm, ym), new Vector(xm - ox, ym), new Vector(x3, y4 + oy), new Vector(x3, y4));
        }
      };
      var calculateBorderBoxPath = function(curves) {
        return [curves.topLeftBorderBox, curves.topRightBorderBox, curves.bottomRightBorderBox, curves.bottomLeftBorderBox];
      };
      var calculateContentBoxPath = function(curves) {
        return [
          curves.topLeftContentBox,
          curves.topRightContentBox,
          curves.bottomRightContentBox,
          curves.bottomLeftContentBox
        ];
      };
      var calculatePaddingBoxPath = function(curves) {
        return [
          curves.topLeftPaddingBox,
          curves.topRightPaddingBox,
          curves.bottomRightPaddingBox,
          curves.bottomLeftPaddingBox
        ];
      };
      var TransformEffect = (
        /** @class */
        function() {
          function TransformEffect2(offsetX, offsetY, matrix2) {
            this.offsetX = offsetX;
            this.offsetY = offsetY;
            this.matrix = matrix2;
            this.type = 0;
            this.target = 2 | 4;
          }
          return TransformEffect2;
        }()
      );
      var ClipEffect = (
        /** @class */
        function() {
          function ClipEffect2(path, target) {
            this.path = path;
            this.target = target;
            this.type = 1;
          }
          return ClipEffect2;
        }()
      );
      var OpacityEffect = (
        /** @class */
        function() {
          function OpacityEffect2(opacity2) {
            this.opacity = opacity2;
            this.type = 2;
            this.target = 2 | 4;
          }
          return OpacityEffect2;
        }()
      );
      var isTransformEffect = function(effect) {
        return effect.type === 0;
      };
      var isClipEffect = function(effect) {
        return effect.type === 1;
      };
      var isOpacityEffect = function(effect) {
        return effect.type === 2;
      };
      var equalPath = function(a4, b2) {
        if (a4.length === b2.length) {
          return a4.some(function(v3, i4) {
            return v3 === b2[i4];
          });
        }
        return false;
      };
      var transformPath = function(path, deltaX, deltaY, deltaW, deltaH) {
        return path.map(function(point4, index3) {
          switch (index3) {
            case 0:
              return point4.add(deltaX, deltaY);
            case 1:
              return point4.add(deltaX + deltaW, deltaY);
            case 2:
              return point4.add(deltaX + deltaW, deltaY + deltaH);
            case 3:
              return point4.add(deltaX, deltaY + deltaH);
          }
          return point4;
        });
      };
      var StackingContext = (
        /** @class */
        function() {
          function StackingContext2(container) {
            this.element = container;
            this.inlineLevel = [];
            this.nonInlineLevel = [];
            this.negativeZIndex = [];
            this.zeroOrAutoZIndexOrTransformedOrOpacity = [];
            this.positiveZIndex = [];
            this.nonPositionedFloats = [];
            this.nonPositionedInlineLevel = [];
          }
          return StackingContext2;
        }()
      );
      var ElementPaint = (
        /** @class */
        function() {
          function ElementPaint2(container, parent) {
            this.container = container;
            this.parent = parent;
            this.effects = [];
            this.curves = new BoundCurves(this.container);
            if (this.container.styles.opacity < 1) {
              this.effects.push(new OpacityEffect(this.container.styles.opacity));
            }
            if (this.container.styles.transform !== null) {
              var offsetX = this.container.bounds.left + this.container.styles.transformOrigin[0].number;
              var offsetY = this.container.bounds.top + this.container.styles.transformOrigin[1].number;
              var matrix2 = this.container.styles.transform;
              this.effects.push(new TransformEffect(offsetX, offsetY, matrix2));
            }
            if (this.container.styles.overflowX !== 0) {
              var borderBox = calculateBorderBoxPath(this.curves);
              var paddingBox2 = calculatePaddingBoxPath(this.curves);
              if (equalPath(borderBox, paddingBox2)) {
                this.effects.push(new ClipEffect(
                  borderBox,
                  2 | 4
                  /* CONTENT */
                ));
              } else {
                this.effects.push(new ClipEffect(
                  borderBox,
                  2
                  /* BACKGROUND_BORDERS */
                ));
                this.effects.push(new ClipEffect(
                  paddingBox2,
                  4
                  /* CONTENT */
                ));
              }
            }
          }
          ElementPaint2.prototype.getEffects = function(target) {
            var inFlow = [
              2,
              3
              /* FIXED */
            ].indexOf(this.container.styles.position) === -1;
            var parent = this.parent;
            var effects = this.effects.slice(0);
            while (parent) {
              var croplessEffects = parent.effects.filter(function(effect) {
                return !isClipEffect(effect);
              });
              if (inFlow || parent.container.styles.position !== 0 || !parent.parent) {
                effects.unshift.apply(effects, croplessEffects);
                inFlow = [
                  2,
                  3
                  /* FIXED */
                ].indexOf(parent.container.styles.position) === -1;
                if (parent.container.styles.overflowX !== 0) {
                  var borderBox = calculateBorderBoxPath(parent.curves);
                  var paddingBox2 = calculatePaddingBoxPath(parent.curves);
                  if (!equalPath(borderBox, paddingBox2)) {
                    effects.unshift(new ClipEffect(
                      paddingBox2,
                      2 | 4
                      /* CONTENT */
                    ));
                  }
                }
              } else {
                effects.unshift.apply(effects, croplessEffects);
              }
              parent = parent.parent;
            }
            return effects.filter(function(effect) {
              return contains(effect.target, target);
            });
          };
          return ElementPaint2;
        }()
      );
      var parseStackTree = function(parent, stackingContext, realStackingContext, listItems) {
        parent.container.elements.forEach(function(child) {
          var treatAsRealStackingContext = contains(
            child.flags,
            4
            /* CREATES_REAL_STACKING_CONTEXT */
          );
          var createsStackingContext2 = contains(
            child.flags,
            2
            /* CREATES_STACKING_CONTEXT */
          );
          var paintContainer = new ElementPaint(child, parent);
          if (contains(
            child.styles.display,
            2048
            /* LIST_ITEM */
          )) {
            listItems.push(paintContainer);
          }
          var listOwnerItems = contains(
            child.flags,
            8
            /* IS_LIST_OWNER */
          ) ? [] : listItems;
          if (treatAsRealStackingContext || createsStackingContext2) {
            var parentStack = treatAsRealStackingContext || child.styles.isPositioned() ? realStackingContext : stackingContext;
            var stack = new StackingContext(paintContainer);
            if (child.styles.isPositioned() || child.styles.opacity < 1 || child.styles.isTransformed()) {
              var order_1 = child.styles.zIndex.order;
              if (order_1 < 0) {
                var index_1 = 0;
                parentStack.negativeZIndex.some(function(current, i4) {
                  if (order_1 > current.element.container.styles.zIndex.order) {
                    index_1 = i4;
                    return false;
                  } else if (index_1 > 0) {
                    return true;
                  }
                  return false;
                });
                parentStack.negativeZIndex.splice(index_1, 0, stack);
              } else if (order_1 > 0) {
                var index_2 = 0;
                parentStack.positiveZIndex.some(function(current, i4) {
                  if (order_1 >= current.element.container.styles.zIndex.order) {
                    index_2 = i4 + 1;
                    return false;
                  } else if (index_2 > 0) {
                    return true;
                  }
                  return false;
                });
                parentStack.positiveZIndex.splice(index_2, 0, stack);
              } else {
                parentStack.zeroOrAutoZIndexOrTransformedOrOpacity.push(stack);
              }
            } else {
              if (child.styles.isFloating()) {
                parentStack.nonPositionedFloats.push(stack);
              } else {
                parentStack.nonPositionedInlineLevel.push(stack);
              }
            }
            parseStackTree(paintContainer, stack, treatAsRealStackingContext ? stack : realStackingContext, listOwnerItems);
          } else {
            if (child.styles.isInlineLevel()) {
              stackingContext.inlineLevel.push(paintContainer);
            } else {
              stackingContext.nonInlineLevel.push(paintContainer);
            }
            parseStackTree(paintContainer, stackingContext, realStackingContext, listOwnerItems);
          }
          if (contains(
            child.flags,
            8
            /* IS_LIST_OWNER */
          )) {
            processListItems(child, listOwnerItems);
          }
        });
      };
      var processListItems = function(owner, elements3) {
        var numbering = owner instanceof OLElementContainer ? owner.start : 1;
        var reversed = owner instanceof OLElementContainer ? owner.reversed : false;
        for (var i4 = 0; i4 < elements3.length; i4++) {
          var item = elements3[i4];
          if (item.container instanceof LIElementContainer && typeof item.container.value === "number" && item.container.value !== 0) {
            numbering = item.container.value;
          }
          item.listValue = createCounterText(numbering, item.container.styles.listStyleType, true);
          numbering += reversed ? -1 : 1;
        }
      };
      var parseStackingContexts = function(container) {
        var paintContainer = new ElementPaint(container, null);
        var root2 = new StackingContext(paintContainer);
        var listItems = [];
        parseStackTree(paintContainer, root2, root2, listItems);
        processListItems(paintContainer.container, listItems);
        return root2;
      };
      var parsePathForBorder = function(curves, borderSide) {
        switch (borderSide) {
          case 0:
            return createPathFromCurves(curves.topLeftBorderBox, curves.topLeftPaddingBox, curves.topRightBorderBox, curves.topRightPaddingBox);
          case 1:
            return createPathFromCurves(curves.topRightBorderBox, curves.topRightPaddingBox, curves.bottomRightBorderBox, curves.bottomRightPaddingBox);
          case 2:
            return createPathFromCurves(curves.bottomRightBorderBox, curves.bottomRightPaddingBox, curves.bottomLeftBorderBox, curves.bottomLeftPaddingBox);
          case 3:
          default:
            return createPathFromCurves(curves.bottomLeftBorderBox, curves.bottomLeftPaddingBox, curves.topLeftBorderBox, curves.topLeftPaddingBox);
        }
      };
      var parsePathForBorderDoubleOuter = function(curves, borderSide) {
        switch (borderSide) {
          case 0:
            return createPathFromCurves(curves.topLeftBorderBox, curves.topLeftBorderDoubleOuterBox, curves.topRightBorderBox, curves.topRightBorderDoubleOuterBox);
          case 1:
            return createPathFromCurves(curves.topRightBorderBox, curves.topRightBorderDoubleOuterBox, curves.bottomRightBorderBox, curves.bottomRightBorderDoubleOuterBox);
          case 2:
            return createPathFromCurves(curves.bottomRightBorderBox, curves.bottomRightBorderDoubleOuterBox, curves.bottomLeftBorderBox, curves.bottomLeftBorderDoubleOuterBox);
          case 3:
          default:
            return createPathFromCurves(curves.bottomLeftBorderBox, curves.bottomLeftBorderDoubleOuterBox, curves.topLeftBorderBox, curves.topLeftBorderDoubleOuterBox);
        }
      };
      var parsePathForBorderDoubleInner = function(curves, borderSide) {
        switch (borderSide) {
          case 0:
            return createPathFromCurves(curves.topLeftBorderDoubleInnerBox, curves.topLeftPaddingBox, curves.topRightBorderDoubleInnerBox, curves.topRightPaddingBox);
          case 1:
            return createPathFromCurves(curves.topRightBorderDoubleInnerBox, curves.topRightPaddingBox, curves.bottomRightBorderDoubleInnerBox, curves.bottomRightPaddingBox);
          case 2:
            return createPathFromCurves(curves.bottomRightBorderDoubleInnerBox, curves.bottomRightPaddingBox, curves.bottomLeftBorderDoubleInnerBox, curves.bottomLeftPaddingBox);
          case 3:
          default:
            return createPathFromCurves(curves.bottomLeftBorderDoubleInnerBox, curves.bottomLeftPaddingBox, curves.topLeftBorderDoubleInnerBox, curves.topLeftPaddingBox);
        }
      };
      var parsePathForBorderStroke = function(curves, borderSide) {
        switch (borderSide) {
          case 0:
            return createStrokePathFromCurves(curves.topLeftBorderStroke, curves.topRightBorderStroke);
          case 1:
            return createStrokePathFromCurves(curves.topRightBorderStroke, curves.bottomRightBorderStroke);
          case 2:
            return createStrokePathFromCurves(curves.bottomRightBorderStroke, curves.bottomLeftBorderStroke);
          case 3:
          default:
            return createStrokePathFromCurves(curves.bottomLeftBorderStroke, curves.topLeftBorderStroke);
        }
      };
      var createStrokePathFromCurves = function(outer1, outer2) {
        var path = [];
        if (isBezierCurve(outer1)) {
          path.push(outer1.subdivide(0.5, false));
        } else {
          path.push(outer1);
        }
        if (isBezierCurve(outer2)) {
          path.push(outer2.subdivide(0.5, true));
        } else {
          path.push(outer2);
        }
        return path;
      };
      var createPathFromCurves = function(outer1, inner1, outer2, inner2) {
        var path = [];
        if (isBezierCurve(outer1)) {
          path.push(outer1.subdivide(0.5, false));
        } else {
          path.push(outer1);
        }
        if (isBezierCurve(outer2)) {
          path.push(outer2.subdivide(0.5, true));
        } else {
          path.push(outer2);
        }
        if (isBezierCurve(inner2)) {
          path.push(inner2.subdivide(0.5, true).reverse());
        } else {
          path.push(inner2);
        }
        if (isBezierCurve(inner1)) {
          path.push(inner1.subdivide(0.5, false).reverse());
        } else {
          path.push(inner1);
        }
        return path;
      };
      var paddingBox = function(element2) {
        var bounds = element2.bounds;
        var styles = element2.styles;
        return bounds.add(styles.borderLeftWidth, styles.borderTopWidth, -(styles.borderRightWidth + styles.borderLeftWidth), -(styles.borderTopWidth + styles.borderBottomWidth));
      };
      var contentBox = function(element2) {
        var styles = element2.styles;
        var bounds = element2.bounds;
        var paddingLeft2 = getAbsoluteValue(styles.paddingLeft, bounds.width);
        var paddingRight2 = getAbsoluteValue(styles.paddingRight, bounds.width);
        var paddingTop2 = getAbsoluteValue(styles.paddingTop, bounds.width);
        var paddingBottom2 = getAbsoluteValue(styles.paddingBottom, bounds.width);
        return bounds.add(paddingLeft2 + styles.borderLeftWidth, paddingTop2 + styles.borderTopWidth, -(styles.borderRightWidth + styles.borderLeftWidth + paddingLeft2 + paddingRight2), -(styles.borderTopWidth + styles.borderBottomWidth + paddingTop2 + paddingBottom2));
      };
      var calculateBackgroundPositioningArea = function(backgroundOrigin2, element2) {
        if (backgroundOrigin2 === 0) {
          return element2.bounds;
        }
        if (backgroundOrigin2 === 2) {
          return contentBox(element2);
        }
        return paddingBox(element2);
      };
      var calculateBackgroundPaintingArea = function(backgroundClip2, element2) {
        if (backgroundClip2 === 0) {
          return element2.bounds;
        }
        if (backgroundClip2 === 2) {
          return contentBox(element2);
        }
        return paddingBox(element2);
      };
      var calculateBackgroundRendering = function(container, index3, intrinsicSize) {
        var backgroundPositioningArea = calculateBackgroundPositioningArea(getBackgroundValueForIndex(container.styles.backgroundOrigin, index3), container);
        var backgroundPaintingArea = calculateBackgroundPaintingArea(getBackgroundValueForIndex(container.styles.backgroundClip, index3), container);
        var backgroundImageSize = calculateBackgroundSize(getBackgroundValueForIndex(container.styles.backgroundSize, index3), intrinsicSize, backgroundPositioningArea);
        var sizeWidth = backgroundImageSize[0], sizeHeight = backgroundImageSize[1];
        var position4 = getAbsoluteValueForTuple(getBackgroundValueForIndex(container.styles.backgroundPosition, index3), backgroundPositioningArea.width - sizeWidth, backgroundPositioningArea.height - sizeHeight);
        var path = calculateBackgroundRepeatPath(getBackgroundValueForIndex(container.styles.backgroundRepeat, index3), position4, backgroundImageSize, backgroundPositioningArea, backgroundPaintingArea);
        var offsetX = Math.round(backgroundPositioningArea.left + position4[0]);
        var offsetY = Math.round(backgroundPositioningArea.top + position4[1]);
        return [path, offsetX, offsetY, sizeWidth, sizeHeight];
      };
      var isAuto = function(token) {
        return isIdentToken(token) && token.value === BACKGROUND_SIZE.AUTO;
      };
      var hasIntrinsicValue = function(value) {
        return typeof value === "number";
      };
      var calculateBackgroundSize = function(size2, _a2, bounds) {
        var intrinsicWidth = _a2[0], intrinsicHeight = _a2[1], intrinsicProportion = _a2[2];
        var first = size2[0], second = size2[1];
        if (!first) {
          return [0, 0];
        }
        if (isLengthPercentage(first) && second && isLengthPercentage(second)) {
          return [getAbsoluteValue(first, bounds.width), getAbsoluteValue(second, bounds.height)];
        }
        var hasIntrinsicProportion = hasIntrinsicValue(intrinsicProportion);
        if (isIdentToken(first) && (first.value === BACKGROUND_SIZE.CONTAIN || first.value === BACKGROUND_SIZE.COVER)) {
          if (hasIntrinsicValue(intrinsicProportion)) {
            var targetRatio = bounds.width / bounds.height;
            return targetRatio < intrinsicProportion !== (first.value === BACKGROUND_SIZE.COVER) ? [bounds.width, bounds.width / intrinsicProportion] : [bounds.height * intrinsicProportion, bounds.height];
          }
          return [bounds.width, bounds.height];
        }
        var hasIntrinsicWidth = hasIntrinsicValue(intrinsicWidth);
        var hasIntrinsicHeight = hasIntrinsicValue(intrinsicHeight);
        var hasIntrinsicDimensions = hasIntrinsicWidth || hasIntrinsicHeight;
        if (isAuto(first) && (!second || isAuto(second))) {
          if (hasIntrinsicWidth && hasIntrinsicHeight) {
            return [intrinsicWidth, intrinsicHeight];
          }
          if (!hasIntrinsicProportion && !hasIntrinsicDimensions) {
            return [bounds.width, bounds.height];
          }
          if (hasIntrinsicDimensions && hasIntrinsicProportion) {
            var width_1 = hasIntrinsicWidth ? intrinsicWidth : intrinsicHeight * intrinsicProportion;
            var height_1 = hasIntrinsicHeight ? intrinsicHeight : intrinsicWidth / intrinsicProportion;
            return [width_1, height_1];
          }
          var width_2 = hasIntrinsicWidth ? intrinsicWidth : bounds.width;
          var height_2 = hasIntrinsicHeight ? intrinsicHeight : bounds.height;
          return [width_2, height_2];
        }
        if (hasIntrinsicProportion) {
          var width_3 = 0;
          var height_3 = 0;
          if (isLengthPercentage(first)) {
            width_3 = getAbsoluteValue(first, bounds.width);
          } else if (isLengthPercentage(second)) {
            height_3 = getAbsoluteValue(second, bounds.height);
          }
          if (isAuto(first)) {
            width_3 = height_3 * intrinsicProportion;
          } else if (!second || isAuto(second)) {
            height_3 = width_3 / intrinsicProportion;
          }
          return [width_3, height_3];
        }
        var width2 = null;
        var height2 = null;
        if (isLengthPercentage(first)) {
          width2 = getAbsoluteValue(first, bounds.width);
        } else if (second && isLengthPercentage(second)) {
          height2 = getAbsoluteValue(second, bounds.height);
        }
        if (width2 !== null && (!second || isAuto(second))) {
          height2 = hasIntrinsicWidth && hasIntrinsicHeight ? width2 / intrinsicWidth * intrinsicHeight : bounds.height;
        }
        if (height2 !== null && isAuto(first)) {
          width2 = hasIntrinsicWidth && hasIntrinsicHeight ? height2 / intrinsicHeight * intrinsicWidth : bounds.width;
        }
        if (width2 !== null && height2 !== null) {
          return [width2, height2];
        }
        throw new Error("Unable to calculate background-size for element");
      };
      var getBackgroundValueForIndex = function(values, index3) {
        var value = values[index3];
        if (typeof value === "undefined") {
          return values[0];
        }
        return value;
      };
      var calculateBackgroundRepeatPath = function(repeat, _a2, _b2, backgroundPositioningArea, backgroundPaintingArea) {
        var x3 = _a2[0], y4 = _a2[1];
        var width2 = _b2[0], height2 = _b2[1];
        switch (repeat) {
          case 2:
            return [
              new Vector(Math.round(backgroundPositioningArea.left), Math.round(backgroundPositioningArea.top + y4)),
              new Vector(Math.round(backgroundPositioningArea.left + backgroundPositioningArea.width), Math.round(backgroundPositioningArea.top + y4)),
              new Vector(Math.round(backgroundPositioningArea.left + backgroundPositioningArea.width), Math.round(height2 + backgroundPositioningArea.top + y4)),
              new Vector(Math.round(backgroundPositioningArea.left), Math.round(height2 + backgroundPositioningArea.top + y4))
            ];
          case 3:
            return [
              new Vector(Math.round(backgroundPositioningArea.left + x3), Math.round(backgroundPositioningArea.top)),
              new Vector(Math.round(backgroundPositioningArea.left + x3 + width2), Math.round(backgroundPositioningArea.top)),
              new Vector(Math.round(backgroundPositioningArea.left + x3 + width2), Math.round(backgroundPositioningArea.height + backgroundPositioningArea.top)),
              new Vector(Math.round(backgroundPositioningArea.left + x3), Math.round(backgroundPositioningArea.height + backgroundPositioningArea.top))
            ];
          case 1:
            return [
              new Vector(Math.round(backgroundPositioningArea.left + x3), Math.round(backgroundPositioningArea.top + y4)),
              new Vector(Math.round(backgroundPositioningArea.left + x3 + width2), Math.round(backgroundPositioningArea.top + y4)),
              new Vector(Math.round(backgroundPositioningArea.left + x3 + width2), Math.round(backgroundPositioningArea.top + y4 + height2)),
              new Vector(Math.round(backgroundPositioningArea.left + x3), Math.round(backgroundPositioningArea.top + y4 + height2))
            ];
          default:
            return [
              new Vector(Math.round(backgroundPaintingArea.left), Math.round(backgroundPaintingArea.top)),
              new Vector(Math.round(backgroundPaintingArea.left + backgroundPaintingArea.width), Math.round(backgroundPaintingArea.top)),
              new Vector(Math.round(backgroundPaintingArea.left + backgroundPaintingArea.width), Math.round(backgroundPaintingArea.height + backgroundPaintingArea.top)),
              new Vector(Math.round(backgroundPaintingArea.left), Math.round(backgroundPaintingArea.height + backgroundPaintingArea.top))
            ];
        }
      };
      var SMALL_IMAGE = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
      var SAMPLE_TEXT = "Hidden Text";
      var FontMetrics = (
        /** @class */
        function() {
          function FontMetrics2(document4) {
            this._data = {};
            this._document = document4;
          }
          FontMetrics2.prototype.parseMetrics = function(fontFamily2, fontSize2) {
            var container = this._document.createElement("div");
            var img = this._document.createElement("img");
            var span = this._document.createElement("span");
            var body = this._document.body;
            container.style.visibility = "hidden";
            container.style.fontFamily = fontFamily2;
            container.style.fontSize = fontSize2;
            container.style.margin = "0";
            container.style.padding = "0";
            container.style.whiteSpace = "nowrap";
            body.appendChild(container);
            img.src = SMALL_IMAGE;
            img.width = 1;
            img.height = 1;
            img.style.margin = "0";
            img.style.padding = "0";
            img.style.verticalAlign = "baseline";
            span.style.fontFamily = fontFamily2;
            span.style.fontSize = fontSize2;
            span.style.margin = "0";
            span.style.padding = "0";
            span.appendChild(this._document.createTextNode(SAMPLE_TEXT));
            container.appendChild(span);
            container.appendChild(img);
            var baseline = img.offsetTop - span.offsetTop + 2;
            container.removeChild(span);
            container.appendChild(this._document.createTextNode(SAMPLE_TEXT));
            container.style.lineHeight = "normal";
            img.style.verticalAlign = "super";
            var middle = img.offsetTop - container.offsetTop + 2;
            body.removeChild(container);
            return { baseline, middle };
          };
          FontMetrics2.prototype.getMetrics = function(fontFamily2, fontSize2) {
            var key = fontFamily2 + " " + fontSize2;
            if (typeof this._data[key] === "undefined") {
              this._data[key] = this.parseMetrics(fontFamily2, fontSize2);
            }
            return this._data[key];
          };
          return FontMetrics2;
        }()
      );
      var Renderer = (
        /** @class */
        function() {
          function Renderer2(context, options) {
            this.context = context;
            this.options = options;
          }
          return Renderer2;
        }()
      );
      var MASK_OFFSET = 1e4;
      var CanvasRenderer = (
        /** @class */
        function(_super) {
          __extends(CanvasRenderer2, _super);
          function CanvasRenderer2(context, options) {
            var _this = _super.call(this, context, options) || this;
            _this._activeEffects = [];
            _this.canvas = options.canvas ? options.canvas : document.createElement("canvas");
            _this.ctx = _this.canvas.getContext("2d");
            if (!options.canvas) {
              _this.canvas.width = Math.floor(options.width * options.scale);
              _this.canvas.height = Math.floor(options.height * options.scale);
              _this.canvas.style.width = options.width + "px";
              _this.canvas.style.height = options.height + "px";
            }
            _this.fontMetrics = new FontMetrics(document);
            _this.ctx.scale(_this.options.scale, _this.options.scale);
            _this.ctx.translate(-options.x, -options.y);
            _this.ctx.textBaseline = "bottom";
            _this._activeEffects = [];
            _this.context.logger.debug("Canvas renderer initialized (" + options.width + "x" + options.height + ") with scale " + options.scale);
            return _this;
          }
          CanvasRenderer2.prototype.applyEffects = function(effects) {
            var _this = this;
            while (this._activeEffects.length) {
              this.popEffect();
            }
            effects.forEach(function(effect) {
              return _this.applyEffect(effect);
            });
          };
          CanvasRenderer2.prototype.applyEffect = function(effect) {
            this.ctx.save();
            if (isOpacityEffect(effect)) {
              this.ctx.globalAlpha = effect.opacity;
            }
            if (isTransformEffect(effect)) {
              this.ctx.translate(effect.offsetX, effect.offsetY);
              this.ctx.transform(effect.matrix[0], effect.matrix[1], effect.matrix[2], effect.matrix[3], effect.matrix[4], effect.matrix[5]);
              this.ctx.translate(-effect.offsetX, -effect.offsetY);
            }
            if (isClipEffect(effect)) {
              this.path(effect.path);
              this.ctx.clip();
            }
            this._activeEffects.push(effect);
          };
          CanvasRenderer2.prototype.popEffect = function() {
            this._activeEffects.pop();
            this.ctx.restore();
          };
          CanvasRenderer2.prototype.renderStack = function(stack) {
            return __awaiter(this, void 0, void 0, function() {
              var styles;
              return __generator(this, function(_a2) {
                switch (_a2.label) {
                  case 0:
                    styles = stack.element.container.styles;
                    if (!styles.isVisible())
                      return [3, 2];
                    return [4, this.renderStackContent(stack)];
                  case 1:
                    _a2.sent();
                    _a2.label = 2;
                  case 2:
                    return [
                      2
                      /*return*/
                    ];
                }
              });
            });
          };
          CanvasRenderer2.prototype.renderNode = function(paint) {
            return __awaiter(this, void 0, void 0, function() {
              return __generator(this, function(_a2) {
                switch (_a2.label) {
                  case 0:
                    if (contains(
                      paint.container.flags,
                      16
                      /* DEBUG_RENDER */
                    )) {
                      debugger;
                    }
                    if (!paint.container.styles.isVisible())
                      return [3, 3];
                    return [4, this.renderNodeBackgroundAndBorders(paint)];
                  case 1:
                    _a2.sent();
                    return [4, this.renderNodeContent(paint)];
                  case 2:
                    _a2.sent();
                    _a2.label = 3;
                  case 3:
                    return [
                      2
                      /*return*/
                    ];
                }
              });
            });
          };
          CanvasRenderer2.prototype.renderTextWithLetterSpacing = function(text3, letterSpacing2, baseline) {
            var _this = this;
            if (letterSpacing2 === 0) {
              this.ctx.fillText(text3.text, text3.bounds.left, text3.bounds.top + baseline);
            } else {
              var letters = segmentGraphemes(text3.text);
              letters.reduce(function(left, letter) {
                _this.ctx.fillText(letter, left, text3.bounds.top + baseline);
                return left + _this.ctx.measureText(letter).width;
              }, text3.bounds.left);
            }
          };
          CanvasRenderer2.prototype.createFontStyle = function(styles) {
            var fontVariant2 = styles.fontVariant.filter(function(variant) {
              return variant === "normal" || variant === "small-caps";
            }).join("");
            var fontFamily2 = fixIOSSystemFonts(styles.fontFamily).join(", ");
            var fontSize2 = isDimensionToken(styles.fontSize) ? "" + styles.fontSize.number + styles.fontSize.unit : styles.fontSize.number + "px";
            return [
              [styles.fontStyle, fontVariant2, styles.fontWeight, fontSize2, fontFamily2].join(" "),
              fontFamily2,
              fontSize2
            ];
          };
          CanvasRenderer2.prototype.renderTextNode = function(text3, styles) {
            return __awaiter(this, void 0, void 0, function() {
              var _a2, font, fontFamily2, fontSize2, _b2, baseline, middle, paintOrder2;
              var _this = this;
              return __generator(this, function(_c) {
                _a2 = this.createFontStyle(styles), font = _a2[0], fontFamily2 = _a2[1], fontSize2 = _a2[2];
                this.ctx.font = font;
                this.ctx.direction = styles.direction === 1 ? "rtl" : "ltr";
                this.ctx.textAlign = "left";
                this.ctx.textBaseline = "alphabetic";
                _b2 = this.fontMetrics.getMetrics(fontFamily2, fontSize2), baseline = _b2.baseline, middle = _b2.middle;
                paintOrder2 = styles.paintOrder;
                text3.textBounds.forEach(function(text4) {
                  paintOrder2.forEach(function(paintOrderLayer) {
                    switch (paintOrderLayer) {
                      case 0:
                        _this.ctx.fillStyle = asString(styles.color);
                        _this.renderTextWithLetterSpacing(text4, styles.letterSpacing, baseline);
                        var textShadows = styles.textShadow;
                        if (textShadows.length && text4.text.trim().length) {
                          textShadows.slice(0).reverse().forEach(function(textShadow2) {
                            _this.ctx.shadowColor = asString(textShadow2.color);
                            _this.ctx.shadowOffsetX = textShadow2.offsetX.number * _this.options.scale;
                            _this.ctx.shadowOffsetY = textShadow2.offsetY.number * _this.options.scale;
                            _this.ctx.shadowBlur = textShadow2.blur.number;
                            _this.renderTextWithLetterSpacing(text4, styles.letterSpacing, baseline);
                          });
                          _this.ctx.shadowColor = "";
                          _this.ctx.shadowOffsetX = 0;
                          _this.ctx.shadowOffsetY = 0;
                          _this.ctx.shadowBlur = 0;
                        }
                        if (styles.textDecorationLine.length) {
                          _this.ctx.fillStyle = asString(styles.textDecorationColor || styles.color);
                          styles.textDecorationLine.forEach(function(textDecorationLine2) {
                            switch (textDecorationLine2) {
                              case 1:
                                _this.ctx.fillRect(text4.bounds.left, Math.round(text4.bounds.top + baseline), text4.bounds.width, 1);
                                break;
                              case 2:
                                _this.ctx.fillRect(text4.bounds.left, Math.round(text4.bounds.top), text4.bounds.width, 1);
                                break;
                              case 3:
                                _this.ctx.fillRect(text4.bounds.left, Math.ceil(text4.bounds.top + middle), text4.bounds.width, 1);
                                break;
                            }
                          });
                        }
                        break;
                      case 1:
                        if (styles.webkitTextStrokeWidth && text4.text.trim().length) {
                          _this.ctx.strokeStyle = asString(styles.webkitTextStrokeColor);
                          _this.ctx.lineWidth = styles.webkitTextStrokeWidth;
                          _this.ctx.lineJoin = !!window.chrome ? "miter" : "round";
                          _this.ctx.strokeText(text4.text, text4.bounds.left, text4.bounds.top + baseline);
                        }
                        _this.ctx.strokeStyle = "";
                        _this.ctx.lineWidth = 0;
                        _this.ctx.lineJoin = "miter";
                        break;
                    }
                  });
                });
                return [
                  2
                  /*return*/
                ];
              });
            });
          };
          CanvasRenderer2.prototype.renderReplacedElement = function(container, curves, image2) {
            if (image2 && container.intrinsicWidth > 0 && container.intrinsicHeight > 0) {
              var box = contentBox(container);
              var path = calculatePaddingBoxPath(curves);
              this.path(path);
              this.ctx.save();
              this.ctx.clip();
              this.ctx.drawImage(image2, 0, 0, container.intrinsicWidth, container.intrinsicHeight, box.left, box.top, box.width, box.height);
              this.ctx.restore();
            }
          };
          CanvasRenderer2.prototype.renderNodeContent = function(paint) {
            return __awaiter(this, void 0, void 0, function() {
              var container, curves, styles, _i, _a2, child, image2, image2, iframeRenderer, canvas, size2, _b2, fontFamily2, fontSize2, baseline, bounds, x3, textBounds, img, image2, url, fontFamily2, bounds;
              return __generator(this, function(_c) {
                switch (_c.label) {
                  case 0:
                    this.applyEffects(paint.getEffects(
                      4
                      /* CONTENT */
                    ));
                    container = paint.container;
                    curves = paint.curves;
                    styles = container.styles;
                    _i = 0, _a2 = container.textNodes;
                    _c.label = 1;
                  case 1:
                    if (!(_i < _a2.length))
                      return [3, 4];
                    child = _a2[_i];
                    return [4, this.renderTextNode(child, styles)];
                  case 2:
                    _c.sent();
                    _c.label = 3;
                  case 3:
                    _i++;
                    return [3, 1];
                  case 4:
                    if (!(container instanceof ImageElementContainer))
                      return [3, 8];
                    _c.label = 5;
                  case 5:
                    _c.trys.push([5, 7, , 8]);
                    return [4, this.context.cache.match(container.src)];
                  case 6:
                    image2 = _c.sent();
                    this.renderReplacedElement(container, curves, image2);
                    return [3, 8];
                  case 7:
                    _c.sent();
                    this.context.logger.error("Error loading image " + container.src);
                    return [3, 8];
                  case 8:
                    if (container instanceof CanvasElementContainer) {
                      this.renderReplacedElement(container, curves, container.canvas);
                    }
                    if (!(container instanceof SVGElementContainer))
                      return [3, 12];
                    _c.label = 9;
                  case 9:
                    _c.trys.push([9, 11, , 12]);
                    return [4, this.context.cache.match(container.svg)];
                  case 10:
                    image2 = _c.sent();
                    this.renderReplacedElement(container, curves, image2);
                    return [3, 12];
                  case 11:
                    _c.sent();
                    this.context.logger.error("Error loading svg " + container.svg.substring(0, 255));
                    return [3, 12];
                  case 12:
                    if (!(container instanceof IFrameElementContainer && container.tree))
                      return [3, 14];
                    iframeRenderer = new CanvasRenderer2(this.context, {
                      scale: this.options.scale,
                      backgroundColor: container.backgroundColor,
                      x: 0,
                      y: 0,
                      width: container.width,
                      height: container.height
                    });
                    return [4, iframeRenderer.render(container.tree)];
                  case 13:
                    canvas = _c.sent();
                    if (container.width && container.height) {
                      this.ctx.drawImage(canvas, 0, 0, container.width, container.height, container.bounds.left, container.bounds.top, container.bounds.width, container.bounds.height);
                    }
                    _c.label = 14;
                  case 14:
                    if (container instanceof InputElementContainer) {
                      size2 = Math.min(container.bounds.width, container.bounds.height);
                      if (container.type === CHECKBOX) {
                        if (container.checked) {
                          this.ctx.save();
                          this.path([
                            new Vector(container.bounds.left + size2 * 0.39363, container.bounds.top + size2 * 0.79),
                            new Vector(container.bounds.left + size2 * 0.16, container.bounds.top + size2 * 0.5549),
                            new Vector(container.bounds.left + size2 * 0.27347, container.bounds.top + size2 * 0.44071),
                            new Vector(container.bounds.left + size2 * 0.39694, container.bounds.top + size2 * 0.5649),
                            new Vector(container.bounds.left + size2 * 0.72983, container.bounds.top + size2 * 0.23),
                            new Vector(container.bounds.left + size2 * 0.84, container.bounds.top + size2 * 0.34085),
                            new Vector(container.bounds.left + size2 * 0.39363, container.bounds.top + size2 * 0.79)
                          ]);
                          this.ctx.fillStyle = asString(INPUT_COLOR);
                          this.ctx.fill();
                          this.ctx.restore();
                        }
                      } else if (container.type === RADIO) {
                        if (container.checked) {
                          this.ctx.save();
                          this.ctx.beginPath();
                          this.ctx.arc(container.bounds.left + size2 / 2, container.bounds.top + size2 / 2, size2 / 4, 0, Math.PI * 2, true);
                          this.ctx.fillStyle = asString(INPUT_COLOR);
                          this.ctx.fill();
                          this.ctx.restore();
                        }
                      }
                    }
                    if (isTextInputElement(container) && container.value.length) {
                      _b2 = this.createFontStyle(styles), fontFamily2 = _b2[0], fontSize2 = _b2[1];
                      baseline = this.fontMetrics.getMetrics(fontFamily2, fontSize2).baseline;
                      this.ctx.font = fontFamily2;
                      this.ctx.fillStyle = asString(styles.color);
                      this.ctx.textBaseline = "alphabetic";
                      this.ctx.textAlign = canvasTextAlign(container.styles.textAlign);
                      bounds = contentBox(container);
                      x3 = 0;
                      switch (container.styles.textAlign) {
                        case 1:
                          x3 += bounds.width / 2;
                          break;
                        case 2:
                          x3 += bounds.width;
                          break;
                      }
                      textBounds = bounds.add(x3, 0, 0, -bounds.height / 2 + 1);
                      this.ctx.save();
                      this.path([
                        new Vector(bounds.left, bounds.top),
                        new Vector(bounds.left + bounds.width, bounds.top),
                        new Vector(bounds.left + bounds.width, bounds.top + bounds.height),
                        new Vector(bounds.left, bounds.top + bounds.height)
                      ]);
                      this.ctx.clip();
                      this.renderTextWithLetterSpacing(new TextBounds(container.value, textBounds), styles.letterSpacing, baseline);
                      this.ctx.restore();
                      this.ctx.textBaseline = "alphabetic";
                      this.ctx.textAlign = "left";
                    }
                    if (!contains(
                      container.styles.display,
                      2048
                      /* LIST_ITEM */
                    ))
                      return [3, 20];
                    if (!(container.styles.listStyleImage !== null))
                      return [3, 19];
                    img = container.styles.listStyleImage;
                    if (!(img.type === 0))
                      return [3, 18];
                    image2 = void 0;
                    url = img.url;
                    _c.label = 15;
                  case 15:
                    _c.trys.push([15, 17, , 18]);
                    return [4, this.context.cache.match(url)];
                  case 16:
                    image2 = _c.sent();
                    this.ctx.drawImage(image2, container.bounds.left - (image2.width + 10), container.bounds.top);
                    return [3, 18];
                  case 17:
                    _c.sent();
                    this.context.logger.error("Error loading list-style-image " + url);
                    return [3, 18];
                  case 18:
                    return [3, 20];
                  case 19:
                    if (paint.listValue && container.styles.listStyleType !== -1) {
                      fontFamily2 = this.createFontStyle(styles)[0];
                      this.ctx.font = fontFamily2;
                      this.ctx.fillStyle = asString(styles.color);
                      this.ctx.textBaseline = "middle";
                      this.ctx.textAlign = "right";
                      bounds = new Bounds(container.bounds.left, container.bounds.top + getAbsoluteValue(container.styles.paddingTop, container.bounds.width), container.bounds.width, computeLineHeight(styles.lineHeight, styles.fontSize.number) / 2 + 1);
                      this.renderTextWithLetterSpacing(new TextBounds(paint.listValue, bounds), styles.letterSpacing, computeLineHeight(styles.lineHeight, styles.fontSize.number) / 2 + 2);
                      this.ctx.textBaseline = "bottom";
                      this.ctx.textAlign = "left";
                    }
                    _c.label = 20;
                  case 20:
                    return [
                      2
                      /*return*/
                    ];
                }
              });
            });
          };
          CanvasRenderer2.prototype.renderStackContent = function(stack) {
            return __awaiter(this, void 0, void 0, function() {
              var _i, _a2, child, _b2, _c, child, _d, _e, child, _f, _g, child, _h, _j, child, _k, _l, child, _m, _o, child;
              return __generator(this, function(_p) {
                switch (_p.label) {
                  case 0:
                    if (contains(
                      stack.element.container.flags,
                      16
                      /* DEBUG_RENDER */
                    )) {
                      debugger;
                    }
                    return [4, this.renderNodeBackgroundAndBorders(stack.element)];
                  case 1:
                    _p.sent();
                    _i = 0, _a2 = stack.negativeZIndex;
                    _p.label = 2;
                  case 2:
                    if (!(_i < _a2.length))
                      return [3, 5];
                    child = _a2[_i];
                    return [4, this.renderStack(child)];
                  case 3:
                    _p.sent();
                    _p.label = 4;
                  case 4:
                    _i++;
                    return [3, 2];
                  case 5:
                    return [4, this.renderNodeContent(stack.element)];
                  case 6:
                    _p.sent();
                    _b2 = 0, _c = stack.nonInlineLevel;
                    _p.label = 7;
                  case 7:
                    if (!(_b2 < _c.length))
                      return [3, 10];
                    child = _c[_b2];
                    return [4, this.renderNode(child)];
                  case 8:
                    _p.sent();
                    _p.label = 9;
                  case 9:
                    _b2++;
                    return [3, 7];
                  case 10:
                    _d = 0, _e = stack.nonPositionedFloats;
                    _p.label = 11;
                  case 11:
                    if (!(_d < _e.length))
                      return [3, 14];
                    child = _e[_d];
                    return [4, this.renderStack(child)];
                  case 12:
                    _p.sent();
                    _p.label = 13;
                  case 13:
                    _d++;
                    return [3, 11];
                  case 14:
                    _f = 0, _g = stack.nonPositionedInlineLevel;
                    _p.label = 15;
                  case 15:
                    if (!(_f < _g.length))
                      return [3, 18];
                    child = _g[_f];
                    return [4, this.renderStack(child)];
                  case 16:
                    _p.sent();
                    _p.label = 17;
                  case 17:
                    _f++;
                    return [3, 15];
                  case 18:
                    _h = 0, _j = stack.inlineLevel;
                    _p.label = 19;
                  case 19:
                    if (!(_h < _j.length))
                      return [3, 22];
                    child = _j[_h];
                    return [4, this.renderNode(child)];
                  case 20:
                    _p.sent();
                    _p.label = 21;
                  case 21:
                    _h++;
                    return [3, 19];
                  case 22:
                    _k = 0, _l = stack.zeroOrAutoZIndexOrTransformedOrOpacity;
                    _p.label = 23;
                  case 23:
                    if (!(_k < _l.length))
                      return [3, 26];
                    child = _l[_k];
                    return [4, this.renderStack(child)];
                  case 24:
                    _p.sent();
                    _p.label = 25;
                  case 25:
                    _k++;
                    return [3, 23];
                  case 26:
                    _m = 0, _o = stack.positiveZIndex;
                    _p.label = 27;
                  case 27:
                    if (!(_m < _o.length))
                      return [3, 30];
                    child = _o[_m];
                    return [4, this.renderStack(child)];
                  case 28:
                    _p.sent();
                    _p.label = 29;
                  case 29:
                    _m++;
                    return [3, 27];
                  case 30:
                    return [
                      2
                      /*return*/
                    ];
                }
              });
            });
          };
          CanvasRenderer2.prototype.mask = function(paths) {
            this.ctx.beginPath();
            this.ctx.moveTo(0, 0);
            this.ctx.lineTo(this.canvas.width, 0);
            this.ctx.lineTo(this.canvas.width, this.canvas.height);
            this.ctx.lineTo(0, this.canvas.height);
            this.ctx.lineTo(0, 0);
            this.formatPath(paths.slice(0).reverse());
            this.ctx.closePath();
          };
          CanvasRenderer2.prototype.path = function(paths) {
            this.ctx.beginPath();
            this.formatPath(paths);
            this.ctx.closePath();
          };
          CanvasRenderer2.prototype.formatPath = function(paths) {
            var _this = this;
            paths.forEach(function(point4, index3) {
              var start = isBezierCurve(point4) ? point4.start : point4;
              if (index3 === 0) {
                _this.ctx.moveTo(start.x, start.y);
              } else {
                _this.ctx.lineTo(start.x, start.y);
              }
              if (isBezierCurve(point4)) {
                _this.ctx.bezierCurveTo(point4.startControl.x, point4.startControl.y, point4.endControl.x, point4.endControl.y, point4.end.x, point4.end.y);
              }
            });
          };
          CanvasRenderer2.prototype.renderRepeat = function(path, pattern, offsetX, offsetY) {
            this.path(path);
            this.ctx.fillStyle = pattern;
            this.ctx.translate(offsetX, offsetY);
            this.ctx.fill();
            this.ctx.translate(-offsetX, -offsetY);
          };
          CanvasRenderer2.prototype.resizeImage = function(image2, width2, height2) {
            var _a2;
            if (image2.width === width2 && image2.height === height2) {
              return image2;
            }
            var ownerDocument = (_a2 = this.canvas.ownerDocument) !== null && _a2 !== void 0 ? _a2 : document;
            var canvas = ownerDocument.createElement("canvas");
            canvas.width = Math.max(1, width2);
            canvas.height = Math.max(1, height2);
            var ctx = canvas.getContext("2d");
            ctx.drawImage(image2, 0, 0, image2.width, image2.height, 0, 0, width2, height2);
            return canvas;
          };
          CanvasRenderer2.prototype.renderBackgroundImage = function(container) {
            return __awaiter(this, void 0, void 0, function() {
              var index3, _loop_1, this_1, _i, _a2, backgroundImage2;
              return __generator(this, function(_b2) {
                switch (_b2.label) {
                  case 0:
                    index3 = container.styles.backgroundImage.length - 1;
                    _loop_1 = function(backgroundImage3) {
                      var image2, url, _c, path, x3, y4, width2, height2, pattern, _d, path, x3, y4, width2, height2, _e, lineLength, x0, x1, y0, y1, canvas, ctx, gradient_1, pattern, _f, path, left, top_1, width2, height2, position4, x3, y4, _g, rx2, ry2, radialGradient_1, midX, midY, f4, invF;
                      return __generator(this, function(_h) {
                        switch (_h.label) {
                          case 0:
                            if (!(backgroundImage3.type === 0))
                              return [3, 5];
                            image2 = void 0;
                            url = backgroundImage3.url;
                            _h.label = 1;
                          case 1:
                            _h.trys.push([1, 3, , 4]);
                            return [4, this_1.context.cache.match(url)];
                          case 2:
                            image2 = _h.sent();
                            return [3, 4];
                          case 3:
                            _h.sent();
                            this_1.context.logger.error("Error loading background-image " + url);
                            return [3, 4];
                          case 4:
                            if (image2) {
                              _c = calculateBackgroundRendering(container, index3, [
                                image2.width,
                                image2.height,
                                image2.width / image2.height
                              ]), path = _c[0], x3 = _c[1], y4 = _c[2], width2 = _c[3], height2 = _c[4];
                              pattern = this_1.ctx.createPattern(this_1.resizeImage(image2, width2, height2), "repeat");
                              this_1.renderRepeat(path, pattern, x3, y4);
                            }
                            return [3, 6];
                          case 5:
                            if (isLinearGradient(backgroundImage3)) {
                              _d = calculateBackgroundRendering(container, index3, [null, null, null]), path = _d[0], x3 = _d[1], y4 = _d[2], width2 = _d[3], height2 = _d[4];
                              _e = calculateGradientDirection(backgroundImage3.angle, width2, height2), lineLength = _e[0], x0 = _e[1], x1 = _e[2], y0 = _e[3], y1 = _e[4];
                              canvas = document.createElement("canvas");
                              canvas.width = width2;
                              canvas.height = height2;
                              ctx = canvas.getContext("2d");
                              gradient_1 = ctx.createLinearGradient(x0, y0, x1, y1);
                              processColorStops(backgroundImage3.stops, lineLength).forEach(function(colorStop) {
                                return gradient_1.addColorStop(colorStop.stop, asString(colorStop.color));
                              });
                              ctx.fillStyle = gradient_1;
                              ctx.fillRect(0, 0, width2, height2);
                              if (width2 > 0 && height2 > 0) {
                                pattern = this_1.ctx.createPattern(canvas, "repeat");
                                this_1.renderRepeat(path, pattern, x3, y4);
                              }
                            } else if (isRadialGradient(backgroundImage3)) {
                              _f = calculateBackgroundRendering(container, index3, [
                                null,
                                null,
                                null
                              ]), path = _f[0], left = _f[1], top_1 = _f[2], width2 = _f[3], height2 = _f[4];
                              position4 = backgroundImage3.position.length === 0 ? [FIFTY_PERCENT] : backgroundImage3.position;
                              x3 = getAbsoluteValue(position4[0], width2);
                              y4 = getAbsoluteValue(position4[position4.length - 1], height2);
                              _g = calculateRadius(backgroundImage3, x3, y4, width2, height2), rx2 = _g[0], ry2 = _g[1];
                              if (rx2 > 0 && ry2 > 0) {
                                radialGradient_1 = this_1.ctx.createRadialGradient(left + x3, top_1 + y4, 0, left + x3, top_1 + y4, rx2);
                                processColorStops(backgroundImage3.stops, rx2 * 2).forEach(function(colorStop) {
                                  return radialGradient_1.addColorStop(colorStop.stop, asString(colorStop.color));
                                });
                                this_1.path(path);
                                this_1.ctx.fillStyle = radialGradient_1;
                                if (rx2 !== ry2) {
                                  midX = container.bounds.left + 0.5 * container.bounds.width;
                                  midY = container.bounds.top + 0.5 * container.bounds.height;
                                  f4 = ry2 / rx2;
                                  invF = 1 / f4;
                                  this_1.ctx.save();
                                  this_1.ctx.translate(midX, midY);
                                  this_1.ctx.transform(1, 0, 0, f4, 0, 0);
                                  this_1.ctx.translate(-midX, -midY);
                                  this_1.ctx.fillRect(left, invF * (top_1 - midY) + midY, width2, height2 * invF);
                                  this_1.ctx.restore();
                                } else {
                                  this_1.ctx.fill();
                                }
                              }
                            }
                            _h.label = 6;
                          case 6:
                            index3--;
                            return [
                              2
                              /*return*/
                            ];
                        }
                      });
                    };
                    this_1 = this;
                    _i = 0, _a2 = container.styles.backgroundImage.slice(0).reverse();
                    _b2.label = 1;
                  case 1:
                    if (!(_i < _a2.length))
                      return [3, 4];
                    backgroundImage2 = _a2[_i];
                    return [5, _loop_1(backgroundImage2)];
                  case 2:
                    _b2.sent();
                    _b2.label = 3;
                  case 3:
                    _i++;
                    return [3, 1];
                  case 4:
                    return [
                      2
                      /*return*/
                    ];
                }
              });
            });
          };
          CanvasRenderer2.prototype.renderSolidBorder = function(color2, side, curvePoints) {
            return __awaiter(this, void 0, void 0, function() {
              return __generator(this, function(_a2) {
                this.path(parsePathForBorder(curvePoints, side));
                this.ctx.fillStyle = asString(color2);
                this.ctx.fill();
                return [
                  2
                  /*return*/
                ];
              });
            });
          };
          CanvasRenderer2.prototype.renderDoubleBorder = function(color2, width2, side, curvePoints) {
            return __awaiter(this, void 0, void 0, function() {
              var outerPaths, innerPaths;
              return __generator(this, function(_a2) {
                switch (_a2.label) {
                  case 0:
                    if (!(width2 < 3))
                      return [3, 2];
                    return [4, this.renderSolidBorder(color2, side, curvePoints)];
                  case 1:
                    _a2.sent();
                    return [
                      2
                      /*return*/
                    ];
                  case 2:
                    outerPaths = parsePathForBorderDoubleOuter(curvePoints, side);
                    this.path(outerPaths);
                    this.ctx.fillStyle = asString(color2);
                    this.ctx.fill();
                    innerPaths = parsePathForBorderDoubleInner(curvePoints, side);
                    this.path(innerPaths);
                    this.ctx.fill();
                    return [
                      2
                      /*return*/
                    ];
                }
              });
            });
          };
          CanvasRenderer2.prototype.renderNodeBackgroundAndBorders = function(paint) {
            return __awaiter(this, void 0, void 0, function() {
              var styles, hasBackground, borders, backgroundPaintingArea, side, _i, borders_1, border;
              var _this = this;
              return __generator(this, function(_a2) {
                switch (_a2.label) {
                  case 0:
                    this.applyEffects(paint.getEffects(
                      2
                      /* BACKGROUND_BORDERS */
                    ));
                    styles = paint.container.styles;
                    hasBackground = !isTransparent(styles.backgroundColor) || styles.backgroundImage.length;
                    borders = [
                      { style: styles.borderTopStyle, color: styles.borderTopColor, width: styles.borderTopWidth },
                      { style: styles.borderRightStyle, color: styles.borderRightColor, width: styles.borderRightWidth },
                      { style: styles.borderBottomStyle, color: styles.borderBottomColor, width: styles.borderBottomWidth },
                      { style: styles.borderLeftStyle, color: styles.borderLeftColor, width: styles.borderLeftWidth }
                    ];
                    backgroundPaintingArea = calculateBackgroundCurvedPaintingArea(getBackgroundValueForIndex(styles.backgroundClip, 0), paint.curves);
                    if (!(hasBackground || styles.boxShadow.length))
                      return [3, 2];
                    this.ctx.save();
                    this.path(backgroundPaintingArea);
                    this.ctx.clip();
                    if (!isTransparent(styles.backgroundColor)) {
                      this.ctx.fillStyle = asString(styles.backgroundColor);
                      this.ctx.fill();
                    }
                    return [4, this.renderBackgroundImage(paint.container)];
                  case 1:
                    _a2.sent();
                    this.ctx.restore();
                    styles.boxShadow.slice(0).reverse().forEach(function(shadow) {
                      _this.ctx.save();
                      var borderBoxArea = calculateBorderBoxPath(paint.curves);
                      var maskOffset = shadow.inset ? 0 : MASK_OFFSET;
                      var shadowPaintingArea = transformPath(borderBoxArea, -maskOffset + (shadow.inset ? 1 : -1) * shadow.spread.number, (shadow.inset ? 1 : -1) * shadow.spread.number, shadow.spread.number * (shadow.inset ? -2 : 2), shadow.spread.number * (shadow.inset ? -2 : 2));
                      if (shadow.inset) {
                        _this.path(borderBoxArea);
                        _this.ctx.clip();
                        _this.mask(shadowPaintingArea);
                      } else {
                        _this.mask(borderBoxArea);
                        _this.ctx.clip();
                        _this.path(shadowPaintingArea);
                      }
                      _this.ctx.shadowOffsetX = shadow.offsetX.number + maskOffset;
                      _this.ctx.shadowOffsetY = shadow.offsetY.number;
                      _this.ctx.shadowColor = asString(shadow.color);
                      _this.ctx.shadowBlur = shadow.blur.number;
                      _this.ctx.fillStyle = shadow.inset ? asString(shadow.color) : "rgba(0,0,0,1)";
                      _this.ctx.fill();
                      _this.ctx.restore();
                    });
                    _a2.label = 2;
                  case 2:
                    side = 0;
                    _i = 0, borders_1 = borders;
                    _a2.label = 3;
                  case 3:
                    if (!(_i < borders_1.length))
                      return [3, 13];
                    border = borders_1[_i];
                    if (!(border.style !== 0 && !isTransparent(border.color) && border.width > 0))
                      return [3, 11];
                    if (!(border.style === 2))
                      return [3, 5];
                    return [4, this.renderDashedDottedBorder(
                      border.color,
                      border.width,
                      side,
                      paint.curves,
                      2
                      /* DASHED */
                    )];
                  case 4:
                    _a2.sent();
                    return [3, 11];
                  case 5:
                    if (!(border.style === 3))
                      return [3, 7];
                    return [4, this.renderDashedDottedBorder(
                      border.color,
                      border.width,
                      side,
                      paint.curves,
                      3
                      /* DOTTED */
                    )];
                  case 6:
                    _a2.sent();
                    return [3, 11];
                  case 7:
                    if (!(border.style === 4))
                      return [3, 9];
                    return [4, this.renderDoubleBorder(border.color, border.width, side, paint.curves)];
                  case 8:
                    _a2.sent();
                    return [3, 11];
                  case 9:
                    return [4, this.renderSolidBorder(border.color, side, paint.curves)];
                  case 10:
                    _a2.sent();
                    _a2.label = 11;
                  case 11:
                    side++;
                    _a2.label = 12;
                  case 12:
                    _i++;
                    return [3, 3];
                  case 13:
                    return [
                      2
                      /*return*/
                    ];
                }
              });
            });
          };
          CanvasRenderer2.prototype.renderDashedDottedBorder = function(color2, width2, side, curvePoints, style) {
            return __awaiter(this, void 0, void 0, function() {
              var strokePaths, boxPaths, startX, startY, endX, endY, length2, dashLength, spaceLength, useLineDash, multiplier, numberOfDashes, minSpace, maxSpace, path1, path2, path1, path2;
              return __generator(this, function(_a2) {
                this.ctx.save();
                strokePaths = parsePathForBorderStroke(curvePoints, side);
                boxPaths = parsePathForBorder(curvePoints, side);
                if (style === 2) {
                  this.path(boxPaths);
                  this.ctx.clip();
                }
                if (isBezierCurve(boxPaths[0])) {
                  startX = boxPaths[0].start.x;
                  startY = boxPaths[0].start.y;
                } else {
                  startX = boxPaths[0].x;
                  startY = boxPaths[0].y;
                }
                if (isBezierCurve(boxPaths[1])) {
                  endX = boxPaths[1].end.x;
                  endY = boxPaths[1].end.y;
                } else {
                  endX = boxPaths[1].x;
                  endY = boxPaths[1].y;
                }
                if (side === 0 || side === 2) {
                  length2 = Math.abs(startX - endX);
                } else {
                  length2 = Math.abs(startY - endY);
                }
                this.ctx.beginPath();
                if (style === 3) {
                  this.formatPath(strokePaths);
                } else {
                  this.formatPath(boxPaths.slice(0, 2));
                }
                dashLength = width2 < 3 ? width2 * 3 : width2 * 2;
                spaceLength = width2 < 3 ? width2 * 2 : width2;
                if (style === 3) {
                  dashLength = width2;
                  spaceLength = width2;
                }
                useLineDash = true;
                if (length2 <= dashLength * 2) {
                  useLineDash = false;
                } else if (length2 <= dashLength * 2 + spaceLength) {
                  multiplier = length2 / (2 * dashLength + spaceLength);
                  dashLength *= multiplier;
                  spaceLength *= multiplier;
                } else {
                  numberOfDashes = Math.floor((length2 + spaceLength) / (dashLength + spaceLength));
                  minSpace = (length2 - numberOfDashes * dashLength) / (numberOfDashes - 1);
                  maxSpace = (length2 - (numberOfDashes + 1) * dashLength) / numberOfDashes;
                  spaceLength = maxSpace <= 0 || Math.abs(spaceLength - minSpace) < Math.abs(spaceLength - maxSpace) ? minSpace : maxSpace;
                }
                if (useLineDash) {
                  if (style === 3) {
                    this.ctx.setLineDash([0, dashLength + spaceLength]);
                  } else {
                    this.ctx.setLineDash([dashLength, spaceLength]);
                  }
                }
                if (style === 3) {
                  this.ctx.lineCap = "round";
                  this.ctx.lineWidth = width2;
                } else {
                  this.ctx.lineWidth = width2 * 2 + 1.1;
                }
                this.ctx.strokeStyle = asString(color2);
                this.ctx.stroke();
                this.ctx.setLineDash([]);
                if (style === 2) {
                  if (isBezierCurve(boxPaths[0])) {
                    path1 = boxPaths[3];
                    path2 = boxPaths[0];
                    this.ctx.beginPath();
                    this.formatPath([new Vector(path1.end.x, path1.end.y), new Vector(path2.start.x, path2.start.y)]);
                    this.ctx.stroke();
                  }
                  if (isBezierCurve(boxPaths[1])) {
                    path1 = boxPaths[1];
                    path2 = boxPaths[2];
                    this.ctx.beginPath();
                    this.formatPath([new Vector(path1.end.x, path1.end.y), new Vector(path2.start.x, path2.start.y)]);
                    this.ctx.stroke();
                  }
                }
                this.ctx.restore();
                return [
                  2
                  /*return*/
                ];
              });
            });
          };
          CanvasRenderer2.prototype.render = function(element2) {
            return __awaiter(this, void 0, void 0, function() {
              var stack;
              return __generator(this, function(_a2) {
                switch (_a2.label) {
                  case 0:
                    if (this.options.backgroundColor) {
                      this.ctx.fillStyle = asString(this.options.backgroundColor);
                      this.ctx.fillRect(this.options.x, this.options.y, this.options.width, this.options.height);
                    }
                    stack = parseStackingContexts(element2);
                    return [4, this.renderStack(stack)];
                  case 1:
                    _a2.sent();
                    this.applyEffects([]);
                    return [2, this.canvas];
                }
              });
            });
          };
          return CanvasRenderer2;
        }(Renderer)
      );
      var isTextInputElement = function(container) {
        if (container instanceof TextareaElementContainer) {
          return true;
        } else if (container instanceof SelectElementContainer) {
          return true;
        } else if (container instanceof InputElementContainer && container.type !== RADIO && container.type !== CHECKBOX) {
          return true;
        }
        return false;
      };
      var calculateBackgroundCurvedPaintingArea = function(clip, curves) {
        switch (clip) {
          case 0:
            return calculateBorderBoxPath(curves);
          case 2:
            return calculateContentBoxPath(curves);
          case 1:
          default:
            return calculatePaddingBoxPath(curves);
        }
      };
      var canvasTextAlign = function(textAlign2) {
        switch (textAlign2) {
          case 1:
            return "center";
          case 2:
            return "right";
          case 0:
          default:
            return "left";
        }
      };
      var iOSBrokenFonts = ["-apple-system", "system-ui"];
      var fixIOSSystemFonts = function(fontFamilies) {
        return /iPhone OS 15_(0|1)/.test(window.navigator.userAgent) ? fontFamilies.filter(function(fontFamily2) {
          return iOSBrokenFonts.indexOf(fontFamily2) === -1;
        }) : fontFamilies;
      };
      var ForeignObjectRenderer = (
        /** @class */
        function(_super) {
          __extends(ForeignObjectRenderer2, _super);
          function ForeignObjectRenderer2(context, options) {
            var _this = _super.call(this, context, options) || this;
            _this.canvas = options.canvas ? options.canvas : document.createElement("canvas");
            _this.ctx = _this.canvas.getContext("2d");
            _this.options = options;
            _this.canvas.width = Math.floor(options.width * options.scale);
            _this.canvas.height = Math.floor(options.height * options.scale);
            _this.canvas.style.width = options.width + "px";
            _this.canvas.style.height = options.height + "px";
            _this.ctx.scale(_this.options.scale, _this.options.scale);
            _this.ctx.translate(-options.x, -options.y);
            _this.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized (" + options.width + "x" + options.height + " at " + options.x + "," + options.y + ") with scale " + options.scale);
            return _this;
          }
          ForeignObjectRenderer2.prototype.render = function(element2) {
            return __awaiter(this, void 0, void 0, function() {
              var svg2, img;
              return __generator(this, function(_a2) {
                switch (_a2.label) {
                  case 0:
                    svg2 = createForeignObjectSVG(this.options.width * this.options.scale, this.options.height * this.options.scale, this.options.scale, this.options.scale, element2);
                    return [4, loadSerializedSVG(svg2)];
                  case 1:
                    img = _a2.sent();
                    if (this.options.backgroundColor) {
                      this.ctx.fillStyle = asString(this.options.backgroundColor);
                      this.ctx.fillRect(0, 0, this.options.width * this.options.scale, this.options.height * this.options.scale);
                    }
                    this.ctx.drawImage(img, -this.options.x * this.options.scale, -this.options.y * this.options.scale);
                    return [2, this.canvas];
                }
              });
            });
          };
          return ForeignObjectRenderer2;
        }(Renderer)
      );
      var loadSerializedSVG = function(svg2) {
        return new Promise(function(resolve, reject) {
          var img = new Image();
          img.onload = function() {
            resolve(img);
          };
          img.onerror = reject;
          img.src = "data:image/svg+xml;charset=utf-8," + encodeURIComponent(new XMLSerializer().serializeToString(svg2));
        });
      };
      var Logger = (
        /** @class */
        function() {
          function Logger2(_a2) {
            var id = _a2.id, enabled = _a2.enabled;
            this.id = id;
            this.enabled = enabled;
            this.start = Date.now();
          }
          Logger2.prototype.debug = function() {
            var args = [];
            for (var _i = 0; _i < arguments.length; _i++) {
              args[_i] = arguments[_i];
            }
            if (this.enabled) {
              if (typeof window !== "undefined" && window.console && typeof console.debug === "function") {
                console.debug.apply(console, __spreadArray([this.id, this.getTime() + "ms"], args));
              } else {
                this.info.apply(this, args);
              }
            }
          };
          Logger2.prototype.getTime = function() {
            return Date.now() - this.start;
          };
          Logger2.prototype.info = function() {
            var args = [];
            for (var _i = 0; _i < arguments.length; _i++) {
              args[_i] = arguments[_i];
            }
            if (this.enabled) {
              if (typeof window !== "undefined" && window.console && typeof console.info === "function") {
                console.info.apply(console, __spreadArray([this.id, this.getTime() + "ms"], args));
              }
            }
          };
          Logger2.prototype.warn = function() {
            var args = [];
            for (var _i = 0; _i < arguments.length; _i++) {
              args[_i] = arguments[_i];
            }
            if (this.enabled) {
              if (typeof window !== "undefined" && window.console && typeof console.warn === "function") {
                console.warn.apply(console, __spreadArray([this.id, this.getTime() + "ms"], args));
              } else {
                this.info.apply(this, args);
              }
            }
          };
          Logger2.prototype.error = function() {
            var args = [];
            for (var _i = 0; _i < arguments.length; _i++) {
              args[_i] = arguments[_i];
            }
            if (this.enabled) {
              if (typeof window !== "undefined" && window.console && typeof console.error === "function") {
                console.error.apply(console, __spreadArray([this.id, this.getTime() + "ms"], args));
              } else {
                this.info.apply(this, args);
              }
            }
          };
          Logger2.instances = {};
          return Logger2;
        }()
      );
      var Context = (
        /** @class */
        function() {
          function Context2(options, windowBounds) {
            var _a2;
            this.windowBounds = windowBounds;
            this.instanceName = "#" + Context2.instanceCount++;
            this.logger = new Logger({ id: this.instanceName, enabled: options.logging });
            this.cache = (_a2 = options.cache) !== null && _a2 !== void 0 ? _a2 : new Cache(this, options);
          }
          Context2.instanceCount = 1;
          return Context2;
        }()
      );
      var html2canvas2 = function(element2, options) {
        if (options === void 0) {
          options = {};
        }
        return renderElement(element2, options);
      };
      if (typeof window !== "undefined") {
        CacheStorage.setContext(window);
      }
      var renderElement = function(element2, opts) {
        return __awaiter(void 0, void 0, void 0, function() {
          var ownerDocument, defaultView, resourceOptions, contextOptions, windowOptions, windowBounds, context, foreignObjectRendering, cloneOptions, documentCloner, clonedElement, container, _a2, width2, height2, left, top, backgroundColor2, renderOptions, canvas, renderer, root2, renderer;
          var _b2, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t2;
          return __generator(this, function(_u) {
            switch (_u.label) {
              case 0:
                if (!element2 || typeof element2 !== "object") {
                  return [2, Promise.reject("Invalid element provided as first argument")];
                }
                ownerDocument = element2.ownerDocument;
                if (!ownerDocument) {
                  throw new Error("Element is not attached to a Document");
                }
                defaultView = ownerDocument.defaultView;
                if (!defaultView) {
                  throw new Error("Document is not attached to a Window");
                }
                resourceOptions = {
                  allowTaint: (_b2 = opts.allowTaint) !== null && _b2 !== void 0 ? _b2 : false,
                  imageTimeout: (_c = opts.imageTimeout) !== null && _c !== void 0 ? _c : 15e3,
                  proxy: opts.proxy,
                  useCORS: (_d = opts.useCORS) !== null && _d !== void 0 ? _d : false
                };
                contextOptions = __assign({ logging: (_e = opts.logging) !== null && _e !== void 0 ? _e : true, cache: opts.cache }, resourceOptions);
                windowOptions = {
                  windowWidth: (_f = opts.windowWidth) !== null && _f !== void 0 ? _f : defaultView.innerWidth,
                  windowHeight: (_g = opts.windowHeight) !== null && _g !== void 0 ? _g : defaultView.innerHeight,
                  scrollX: (_h = opts.scrollX) !== null && _h !== void 0 ? _h : defaultView.pageXOffset,
                  scrollY: (_j = opts.scrollY) !== null && _j !== void 0 ? _j : defaultView.pageYOffset
                };
                windowBounds = new Bounds(windowOptions.scrollX, windowOptions.scrollY, windowOptions.windowWidth, windowOptions.windowHeight);
                context = new Context(contextOptions, windowBounds);
                foreignObjectRendering = (_k = opts.foreignObjectRendering) !== null && _k !== void 0 ? _k : false;
                cloneOptions = {
                  allowTaint: (_l = opts.allowTaint) !== null && _l !== void 0 ? _l : false,
                  onclone: opts.onclone,
                  ignoreElements: opts.ignoreElements,
                  inlineImages: foreignObjectRendering,
                  copyStyles: foreignObjectRendering
                };
                context.logger.debug("Starting document clone with size " + windowBounds.width + "x" + windowBounds.height + " scrolled to " + -windowBounds.left + "," + -windowBounds.top);
                documentCloner = new DocumentCloner(context, element2, cloneOptions);
                clonedElement = documentCloner.clonedReferenceElement;
                if (!clonedElement) {
                  return [2, Promise.reject("Unable to find element in cloned iframe")];
                }
                return [4, documentCloner.toIFrame(ownerDocument, windowBounds)];
              case 1:
                container = _u.sent();
                _a2 = isBodyElement(clonedElement) || isHTMLElement(clonedElement) ? parseDocumentSize(clonedElement.ownerDocument) : parseBounds(context, clonedElement), width2 = _a2.width, height2 = _a2.height, left = _a2.left, top = _a2.top;
                backgroundColor2 = parseBackgroundColor(context, clonedElement, opts.backgroundColor);
                renderOptions = {
                  canvas: opts.canvas,
                  backgroundColor: backgroundColor2,
                  scale: (_o = (_m = opts.scale) !== null && _m !== void 0 ? _m : defaultView.devicePixelRatio) !== null && _o !== void 0 ? _o : 1,
                  x: ((_p = opts.x) !== null && _p !== void 0 ? _p : 0) + left,
                  y: ((_q = opts.y) !== null && _q !== void 0 ? _q : 0) + top,
                  width: (_r = opts.width) !== null && _r !== void 0 ? _r : Math.ceil(width2),
                  height: (_s = opts.height) !== null && _s !== void 0 ? _s : Math.ceil(height2)
                };
                if (!foreignObjectRendering)
                  return [3, 3];
                context.logger.debug("Document cloned, using foreign object rendering");
                renderer = new ForeignObjectRenderer(context, renderOptions);
                return [4, renderer.render(clonedElement)];
              case 2:
                canvas = _u.sent();
                return [3, 5];
              case 3:
                context.logger.debug("Document cloned, element located at " + left + "," + top + " with size " + width2 + "x" + height2 + " using computed rendering");
                context.logger.debug("Starting DOM parsing");
                root2 = parseTree(context, clonedElement);
                if (backgroundColor2 === root2.styles.backgroundColor) {
                  root2.styles.backgroundColor = COLORS.TRANSPARENT;
                }
                context.logger.debug("Starting renderer for element at " + renderOptions.x + "," + renderOptions.y + " with size " + renderOptions.width + "x" + renderOptions.height);
                renderer = new CanvasRenderer(context, renderOptions);
                return [4, renderer.render(root2)];
              case 4:
                canvas = _u.sent();
                _u.label = 5;
              case 5:
                if ((_t2 = opts.removeContainer) !== null && _t2 !== void 0 ? _t2 : true) {
                  if (!DocumentCloner.destroy(container)) {
                    context.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore");
                  }
                }
                context.logger.debug("Finished rendering");
                return [2, canvas];
            }
          });
        });
      };
      var parseBackgroundColor = function(context, element2, backgroundColorOverride) {
        var ownerDocument = element2.ownerDocument;
        var documentBackgroundColor = ownerDocument.documentElement ? parseColor(context, getComputedStyle(ownerDocument.documentElement).backgroundColor) : COLORS.TRANSPARENT;
        var bodyBackgroundColor = ownerDocument.body ? parseColor(context, getComputedStyle(ownerDocument.body).backgroundColor) : COLORS.TRANSPARENT;
        var defaultBackgroundColor = typeof backgroundColorOverride === "string" ? parseColor(context, backgroundColorOverride) : backgroundColorOverride === null ? COLORS.TRANSPARENT : 4294967295;
        return element2 === ownerDocument.documentElement ? isTransparent(documentBackgroundColor) ? isTransparent(bodyBackgroundColor) ? defaultBackgroundColor : bodyBackgroundColor : documentBackgroundColor : defaultBackgroundColor;
      };
      return html2canvas2;
    });
  }
});

// ../simple-mind-map/node_modules/dompurify/dist/purify.js
var require_purify = __commonJS({
  "../simple-mind-map/node_modules/dompurify/dist/purify.js"(exports, module) {
    (function(global3, factory) {
      typeof exports === "object" && typeof module !== "undefined" ? module.exports = factory() : typeof define === "function" && define.amd ? define(factory) : (global3 = typeof globalThis !== "undefined" ? globalThis : global3 || self, global3.DOMPurify = factory());
    })(exports, function() {
      "use strict";
      function _typeof3(obj) {
        "@babel/helpers - typeof";
        return _typeof3 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
          return typeof obj2;
        } : function(obj2) {
          return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
        }, _typeof3(obj);
      }
      function _setPrototypeOf(o3, p3) {
        _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o4, p4) {
          o4.__proto__ = p4;
          return o4;
        };
        return _setPrototypeOf(o3, p3);
      }
      function _isNativeReflectConstruct() {
        if (typeof Reflect === "undefined" || !Reflect.construct)
          return false;
        if (Reflect.construct.sham)
          return false;
        if (typeof Proxy === "function")
          return true;
        try {
          Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
          }));
          return true;
        } catch (e2) {
          return false;
        }
      }
      function _construct(Parent, args, Class) {
        if (_isNativeReflectConstruct()) {
          _construct = Reflect.construct;
        } else {
          _construct = function _construct2(Parent2, args2, Class2) {
            var a3 = [null];
            a3.push.apply(a3, args2);
            var Constructor = Function.bind.apply(Parent2, a3);
            var instance = new Constructor();
            if (Class2)
              _setPrototypeOf(instance, Class2.prototype);
            return instance;
          };
        }
        return _construct.apply(null, arguments);
      }
      function _toConsumableArray(arr) {
        return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
      }
      function _arrayWithoutHoles(arr) {
        if (Array.isArray(arr))
          return _arrayLikeToArray(arr);
      }
      function _iterableToArray(iter) {
        if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
          return Array.from(iter);
      }
      function _unsupportedIterableToArray(o3, minLen) {
        if (!o3)
          return;
        if (typeof o3 === "string")
          return _arrayLikeToArray(o3, minLen);
        var n3 = Object.prototype.toString.call(o3).slice(8, -1);
        if (n3 === "Object" && o3.constructor)
          n3 = o3.constructor.name;
        if (n3 === "Map" || n3 === "Set")
          return Array.from(o3);
        if (n3 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n3))
          return _arrayLikeToArray(o3, minLen);
      }
      function _arrayLikeToArray(arr, len) {
        if (len == null || len > arr.length)
          len = arr.length;
        for (var i3 = 0, arr2 = new Array(len); i3 < len; i3++)
          arr2[i3] = arr[i3];
        return arr2;
      }
      function _nonIterableSpread() {
        throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
      }
      var hasOwnProperty2 = Object.hasOwnProperty, setPrototypeOf = Object.setPrototypeOf, isFrozen = Object.isFrozen, getPrototypeOf = Object.getPrototypeOf, getOwnPropertyDescriptor3 = Object.getOwnPropertyDescriptor;
      var freeze = Object.freeze, seal = Object.seal, create2 = Object.create;
      var _ref = typeof Reflect !== "undefined" && Reflect, apply3 = _ref.apply, construct = _ref.construct;
      if (!apply3) {
        apply3 = function apply4(fun, thisValue, args) {
          return fun.apply(thisValue, args);
        };
      }
      if (!freeze) {
        freeze = function freeze2(x3) {
          return x3;
        };
      }
      if (!seal) {
        seal = function seal2(x3) {
          return x3;
        };
      }
      if (!construct) {
        construct = function construct2(Func, args) {
          return _construct(Func, _toConsumableArray(args));
        };
      }
      var arrayForEach = unapply(Array.prototype.forEach);
      var arrayPop = unapply(Array.prototype.pop);
      var arrayPush = unapply(Array.prototype.push);
      var stringToLowerCase = unapply(String.prototype.toLowerCase);
      var stringToString = unapply(String.prototype.toString);
      var stringMatch = unapply(String.prototype.match);
      var stringReplace = unapply(String.prototype.replace);
      var stringIndexOf3 = unapply(String.prototype.indexOf);
      var stringTrim = unapply(String.prototype.trim);
      var regExpTest = unapply(RegExp.prototype.test);
      var typeErrorCreate = unconstruct(TypeError);
      function unapply(func) {
        return function(thisArg) {
          for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
            args[_key - 1] = arguments[_key];
          }
          return apply3(func, thisArg, args);
        };
      }
      function unconstruct(func) {
        return function() {
          for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
            args[_key2] = arguments[_key2];
          }
          return construct(func, args);
        };
      }
      function addToSet(set, array2, transformCaseFunc) {
        transformCaseFunc = transformCaseFunc ? transformCaseFunc : stringToLowerCase;
        if (setPrototypeOf) {
          setPrototypeOf(set, null);
        }
        var l3 = array2.length;
        while (l3--) {
          var element2 = array2[l3];
          if (typeof element2 === "string") {
            var lcElement = transformCaseFunc(element2);
            if (lcElement !== element2) {
              if (!isFrozen(array2)) {
                array2[l3] = lcElement;
              }
              element2 = lcElement;
            }
          }
          set[element2] = true;
        }
        return set;
      }
      function clone(object) {
        var newObject = create2(null);
        var property;
        for (property in object) {
          if (apply3(hasOwnProperty2, object, [property])) {
            newObject[property] = object[property];
          }
        }
        return newObject;
      }
      function lookupGetter(object, prop) {
        while (object !== null) {
          var desc = getOwnPropertyDescriptor3(object, prop);
          if (desc) {
            if (desc.get) {
              return unapply(desc.get);
            }
            if (typeof desc.value === "function") {
              return unapply(desc.value);
            }
          }
          object = getPrototypeOf(object);
        }
        function fallbackValue(element2) {
          console.warn("fallback value for", element2);
          return null;
        }
        return fallbackValue;
      }
      var html$1 = freeze(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "section", "select", "shadow", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]);
      var svg$1 = freeze(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]);
      var svgFilters = freeze(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]);
      var svgDisallowed = freeze(["animate", "color-profile", "cursor", "discard", "fedropshadow", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]);
      var mathMl$1 = freeze(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover"]);
      var mathMlDisallowed = freeze(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]);
      var text3 = freeze(["#text"]);
      var html2 = freeze(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "pattern", "placeholder", "playsinline", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "xmlns", "slot"]);
      var svg2 = freeze(["accent-height", "accumulate", "additive", "alignment-baseline", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]);
      var mathMl = freeze(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]);
      var xml = freeze(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]);
      var MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm);
      var ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm);
      var TMPLIT_EXPR = seal(/\${[\w\W]*}/gm);
      var DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]/);
      var ARIA_ATTR = seal(/^aria-[\-\w]+$/);
      var IS_ALLOWED_URI = seal(
        /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
        // eslint-disable-line no-useless-escape
      );
      var IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i);
      var ATTR_WHITESPACE = seal(
        /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
        // eslint-disable-line no-control-regex
      );
      var DOCTYPE_NAME = seal(/^html$/i);
      var getGlobal = function getGlobal2() {
        return typeof window === "undefined" ? null : window;
      };
      var _createTrustedTypesPolicy = function _createTrustedTypesPolicy2(trustedTypes, document4) {
        if (_typeof3(trustedTypes) !== "object" || typeof trustedTypes.createPolicy !== "function") {
          return null;
        }
        var suffix = null;
        var ATTR_NAME = "data-tt-policy-suffix";
        if (document4.currentScript && document4.currentScript.hasAttribute(ATTR_NAME)) {
          suffix = document4.currentScript.getAttribute(ATTR_NAME);
        }
        var policyName = "dompurify" + (suffix ? "#" + suffix : "");
        try {
          return trustedTypes.createPolicy(policyName, {
            createHTML: function createHTML(html3) {
              return html3;
            },
            createScriptURL: function createScriptURL(scriptUrl) {
              return scriptUrl;
            }
          });
        } catch (_3) {
          console.warn("TrustedTypes policy " + policyName + " could not be created.");
          return null;
        }
      };
      function createDOMPurify() {
        var window2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getGlobal();
        var DOMPurify = function DOMPurify2(root2) {
          return createDOMPurify(root2);
        };
        DOMPurify.version = "2.4.1";
        DOMPurify.removed = [];
        if (!window2 || !window2.document || window2.document.nodeType !== 9) {
          DOMPurify.isSupported = false;
          return DOMPurify;
        }
        var originalDocument = window2.document;
        var document4 = window2.document;
        var DocumentFragment = window2.DocumentFragment, HTMLTemplateElement = window2.HTMLTemplateElement, Node3 = window2.Node, Element3 = window2.Element, NodeFilter = window2.NodeFilter, _window$NamedNodeMap = window2.NamedNodeMap, NamedNodeMap = _window$NamedNodeMap === void 0 ? window2.NamedNodeMap || window2.MozNamedAttrMap : _window$NamedNodeMap, HTMLFormElement = window2.HTMLFormElement, DOMParser2 = window2.DOMParser, trustedTypes = window2.trustedTypes;
        var ElementPrototype = Element3.prototype;
        var cloneNode = lookupGetter(ElementPrototype, "cloneNode");
        var getNextSibling = lookupGetter(ElementPrototype, "nextSibling");
        var getChildNodes = lookupGetter(ElementPrototype, "childNodes");
        var getParentNode = lookupGetter(ElementPrototype, "parentNode");
        if (typeof HTMLTemplateElement === "function") {
          var template = document4.createElement("template");
          if (template.content && template.content.ownerDocument) {
            document4 = template.content.ownerDocument;
          }
        }
        var trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, originalDocument);
        var emptyHTML = trustedTypesPolicy ? trustedTypesPolicy.createHTML("") : "";
        var _document = document4, implementation = _document.implementation, createNodeIterator = _document.createNodeIterator, createDocumentFragment = _document.createDocumentFragment, getElementsByTagName = _document.getElementsByTagName;
        var importNode = originalDocument.importNode;
        var documentMode = {};
        try {
          documentMode = clone(document4).documentMode ? document4.documentMode : {};
        } catch (_3) {
        }
        var hooks2 = {};
        DOMPurify.isSupported = typeof getParentNode === "function" && implementation && typeof implementation.createHTMLDocument !== "undefined" && documentMode !== 9;
        var MUSTACHE_EXPR$1 = MUSTACHE_EXPR, ERB_EXPR$1 = ERB_EXPR, TMPLIT_EXPR$1 = TMPLIT_EXPR, DATA_ATTR$1 = DATA_ATTR, ARIA_ATTR$1 = ARIA_ATTR, IS_SCRIPT_OR_DATA$1 = IS_SCRIPT_OR_DATA, ATTR_WHITESPACE$1 = ATTR_WHITESPACE;
        var IS_ALLOWED_URI$1 = IS_ALLOWED_URI;
        var ALLOWED_TAGS = null;
        var DEFAULT_ALLOWED_TAGS = addToSet({}, [].concat(_toConsumableArray(html$1), _toConsumableArray(svg$1), _toConsumableArray(svgFilters), _toConsumableArray(mathMl$1), _toConsumableArray(text3)));
        var ALLOWED_ATTR = null;
        var DEFAULT_ALLOWED_ATTR = addToSet({}, [].concat(_toConsumableArray(html2), _toConsumableArray(svg2), _toConsumableArray(mathMl), _toConsumableArray(xml)));
        var CUSTOM_ELEMENT_HANDLING = Object.seal(Object.create(null, {
          tagNameCheck: {
            writable: true,
            configurable: false,
            enumerable: true,
            value: null
          },
          attributeNameCheck: {
            writable: true,
            configurable: false,
            enumerable: true,
            value: null
          },
          allowCustomizedBuiltInElements: {
            writable: true,
            configurable: false,
            enumerable: true,
            value: false
          }
        }));
        var FORBID_TAGS = null;
        var FORBID_ATTR = null;
        var ALLOW_ARIA_ATTR = true;
        var ALLOW_DATA_ATTR = true;
        var ALLOW_UNKNOWN_PROTOCOLS = false;
        var SAFE_FOR_TEMPLATES = false;
        var WHOLE_DOCUMENT = false;
        var SET_CONFIG = false;
        var FORCE_BODY = false;
        var RETURN_DOM = false;
        var RETURN_DOM_FRAGMENT = false;
        var RETURN_TRUSTED_TYPE = false;
        var SANITIZE_DOM = true;
        var SANITIZE_NAMED_PROPS = false;
        var SANITIZE_NAMED_PROPS_PREFIX = "user-content-";
        var KEEP_CONTENT = true;
        var IN_PLACE = false;
        var USE_PROFILES = {};
        var FORBID_CONTENTS = null;
        var DEFAULT_FORBID_CONTENTS = addToSet({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
        var DATA_URI_TAGS = null;
        var DEFAULT_DATA_URI_TAGS = addToSet({}, ["audio", "video", "img", "source", "image", "track"]);
        var URI_SAFE_ATTRIBUTES = null;
        var DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]);
        var MATHML_NAMESPACE = "http://www.w3.org/1998/Math/MathML";
        var SVG_NAMESPACE = "http://www.w3.org/2000/svg";
        var HTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
        var NAMESPACE = HTML_NAMESPACE;
        var IS_EMPTY_INPUT = false;
        var ALLOWED_NAMESPACES = null;
        var DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);
        var PARSER_MEDIA_TYPE;
        var SUPPORTED_PARSER_MEDIA_TYPES = ["application/xhtml+xml", "text/html"];
        var DEFAULT_PARSER_MEDIA_TYPE = "text/html";
        var transformCaseFunc;
        var CONFIG = null;
        var formElement = document4.createElement("form");
        var isRegexOrFunction = function isRegexOrFunction2(testValue) {
          return testValue instanceof RegExp || testValue instanceof Function;
        };
        var _parseConfig = function _parseConfig2(cfg) {
          if (CONFIG && CONFIG === cfg) {
            return;
          }
          if (!cfg || _typeof3(cfg) !== "object") {
            cfg = {};
          }
          cfg = clone(cfg);
          PARSER_MEDIA_TYPE = // eslint-disable-next-line unicorn/prefer-includes
          SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? PARSER_MEDIA_TYPE = DEFAULT_PARSER_MEDIA_TYPE : PARSER_MEDIA_TYPE = cfg.PARSER_MEDIA_TYPE;
          transformCaseFunc = PARSER_MEDIA_TYPE === "application/xhtml+xml" ? stringToString : stringToLowerCase;
          ALLOWED_TAGS = "ALLOWED_TAGS" in cfg ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;
          ALLOWED_ATTR = "ALLOWED_ATTR" in cfg ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;
          ALLOWED_NAMESPACES = "ALLOWED_NAMESPACES" in cfg ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;
          URI_SAFE_ATTRIBUTES = "ADD_URI_SAFE_ATTR" in cfg ? addToSet(
            clone(DEFAULT_URI_SAFE_ATTRIBUTES),
            // eslint-disable-line indent
            cfg.ADD_URI_SAFE_ATTR,
            // eslint-disable-line indent
            transformCaseFunc
            // eslint-disable-line indent
          ) : DEFAULT_URI_SAFE_ATTRIBUTES;
          DATA_URI_TAGS = "ADD_DATA_URI_TAGS" in cfg ? addToSet(
            clone(DEFAULT_DATA_URI_TAGS),
            // eslint-disable-line indent
            cfg.ADD_DATA_URI_TAGS,
            // eslint-disable-line indent
            transformCaseFunc
            // eslint-disable-line indent
          ) : DEFAULT_DATA_URI_TAGS;
          FORBID_CONTENTS = "FORBID_CONTENTS" in cfg ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;
          FORBID_TAGS = "FORBID_TAGS" in cfg ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : {};
          FORBID_ATTR = "FORBID_ATTR" in cfg ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : {};
          USE_PROFILES = "USE_PROFILES" in cfg ? cfg.USE_PROFILES : false;
          ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false;
          ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false;
          ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false;
          SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false;
          WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false;
          RETURN_DOM = cfg.RETURN_DOM || false;
          RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false;
          RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false;
          FORCE_BODY = cfg.FORCE_BODY || false;
          SANITIZE_DOM = cfg.SANITIZE_DOM !== false;
          SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false;
          KEEP_CONTENT = cfg.KEEP_CONTENT !== false;
          IN_PLACE = cfg.IN_PLACE || false;
          IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI$1;
          NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;
          if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {
            CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;
          }
          if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) {
            CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;
          }
          if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === "boolean") {
            CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;
          }
          if (SAFE_FOR_TEMPLATES) {
            ALLOW_DATA_ATTR = false;
          }
          if (RETURN_DOM_FRAGMENT) {
            RETURN_DOM = true;
          }
          if (USE_PROFILES) {
            ALLOWED_TAGS = addToSet({}, _toConsumableArray(text3));
            ALLOWED_ATTR = [];
            if (USE_PROFILES.html === true) {
              addToSet(ALLOWED_TAGS, html$1);
              addToSet(ALLOWED_ATTR, html2);
            }
            if (USE_PROFILES.svg === true) {
              addToSet(ALLOWED_TAGS, svg$1);
              addToSet(ALLOWED_ATTR, svg2);
              addToSet(ALLOWED_ATTR, xml);
            }
            if (USE_PROFILES.svgFilters === true) {
              addToSet(ALLOWED_TAGS, svgFilters);
              addToSet(ALLOWED_ATTR, svg2);
              addToSet(ALLOWED_ATTR, xml);
            }
            if (USE_PROFILES.mathMl === true) {
              addToSet(ALLOWED_TAGS, mathMl$1);
              addToSet(ALLOWED_ATTR, mathMl);
              addToSet(ALLOWED_ATTR, xml);
            }
          }
          if (cfg.ADD_TAGS) {
            if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {
              ALLOWED_TAGS = clone(ALLOWED_TAGS);
            }
            addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);
          }
          if (cfg.ADD_ATTR) {
            if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {
              ALLOWED_ATTR = clone(ALLOWED_ATTR);
            }
            addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);
          }
          if (cfg.ADD_URI_SAFE_ATTR) {
            addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);
          }
          if (cfg.FORBID_CONTENTS) {
            if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {
              FORBID_CONTENTS = clone(FORBID_CONTENTS);
            }
            addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);
          }
          if (KEEP_CONTENT) {
            ALLOWED_TAGS["#text"] = true;
          }
          if (WHOLE_DOCUMENT) {
            addToSet(ALLOWED_TAGS, ["html", "head", "body"]);
          }
          if (ALLOWED_TAGS.table) {
            addToSet(ALLOWED_TAGS, ["tbody"]);
            delete FORBID_TAGS.tbody;
          }
          if (freeze) {
            freeze(cfg);
          }
          CONFIG = cfg;
        };
        var MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ["mi", "mo", "mn", "ms", "mtext"]);
        var HTML_INTEGRATION_POINTS = addToSet({}, ["foreignobject", "desc", "title", "annotation-xml"]);
        var COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ["title", "style", "font", "a", "script"]);
        var ALL_SVG_TAGS = addToSet({}, svg$1);
        addToSet(ALL_SVG_TAGS, svgFilters);
        addToSet(ALL_SVG_TAGS, svgDisallowed);
        var ALL_MATHML_TAGS = addToSet({}, mathMl$1);
        addToSet(ALL_MATHML_TAGS, mathMlDisallowed);
        var _checkValidNamespace = function _checkValidNamespace2(element2) {
          var parent = getParentNode(element2);
          if (!parent || !parent.tagName) {
            parent = {
              namespaceURI: NAMESPACE,
              tagName: "template"
            };
          }
          var tagName = stringToLowerCase(element2.tagName);
          var parentTagName = stringToLowerCase(parent.tagName);
          if (!ALLOWED_NAMESPACES[element2.namespaceURI]) {
            return false;
          }
          if (element2.namespaceURI === SVG_NAMESPACE) {
            if (parent.namespaceURI === HTML_NAMESPACE) {
              return tagName === "svg";
            }
            if (parent.namespaceURI === MATHML_NAMESPACE) {
              return tagName === "svg" && (parentTagName === "annotation-xml" || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
            }
            return Boolean(ALL_SVG_TAGS[tagName]);
          }
          if (element2.namespaceURI === MATHML_NAMESPACE) {
            if (parent.namespaceURI === HTML_NAMESPACE) {
              return tagName === "math";
            }
            if (parent.namespaceURI === SVG_NAMESPACE) {
              return tagName === "math" && HTML_INTEGRATION_POINTS[parentTagName];
            }
            return Boolean(ALL_MATHML_TAGS[tagName]);
          }
          if (element2.namespaceURI === HTML_NAMESPACE) {
            if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {
              return false;
            }
            if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {
              return false;
            }
            return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);
          }
          if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && ALLOWED_NAMESPACES[element2.namespaceURI]) {
            return true;
          }
          return false;
        };
        var _forceRemove = function _forceRemove2(node3) {
          arrayPush(DOMPurify.removed, {
            element: node3
          });
          try {
            node3.parentNode.removeChild(node3);
          } catch (_3) {
            try {
              node3.outerHTML = emptyHTML;
            } catch (_4) {
              node3.remove();
            }
          }
        };
        var _removeAttribute = function _removeAttribute2(name, node3) {
          try {
            arrayPush(DOMPurify.removed, {
              attribute: node3.getAttributeNode(name),
              from: node3
            });
          } catch (_3) {
            arrayPush(DOMPurify.removed, {
              attribute: null,
              from: node3
            });
          }
          node3.removeAttribute(name);
          if (name === "is" && !ALLOWED_ATTR[name]) {
            if (RETURN_DOM || RETURN_DOM_FRAGMENT) {
              try {
                _forceRemove(node3);
              } catch (_3) {
              }
            } else {
              try {
                node3.setAttribute(name, "");
              } catch (_3) {
              }
            }
          }
        };
        var _initDocument = function _initDocument2(dirty) {
          var doc;
          var leadingWhitespace;
          if (FORCE_BODY) {
            dirty = "<remove></remove>" + dirty;
          } else {
            var matches = stringMatch(dirty, /^[\r\n\t ]+/);
            leadingWhitespace = matches && matches[0];
          }
          if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && NAMESPACE === HTML_NAMESPACE) {
            dirty = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + dirty + "</body></html>";
          }
          var dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;
          if (NAMESPACE === HTML_NAMESPACE) {
            try {
              doc = new DOMParser2().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);
            } catch (_3) {
            }
          }
          if (!doc || !doc.documentElement) {
            doc = implementation.createDocument(NAMESPACE, "template", null);
            try {
              doc.documentElement.innerHTML = IS_EMPTY_INPUT ? "" : dirtyPayload;
            } catch (_3) {
            }
          }
          var body = doc.body || doc.documentElement;
          if (dirty && leadingWhitespace) {
            body.insertBefore(document4.createTextNode(leadingWhitespace), body.childNodes[0] || null);
          }
          if (NAMESPACE === HTML_NAMESPACE) {
            return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? "html" : "body")[0];
          }
          return WHOLE_DOCUMENT ? doc.documentElement : body;
        };
        var _createIterator = function _createIterator2(root2) {
          return createNodeIterator.call(
            root2.ownerDocument || root2,
            root2,
            // eslint-disable-next-line no-bitwise
            NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT,
            null,
            false
          );
        };
        var _isClobbered = function _isClobbered2(elm) {
          return elm instanceof HTMLFormElement && (typeof elm.nodeName !== "string" || typeof elm.textContent !== "string" || typeof elm.removeChild !== "function" || !(elm.attributes instanceof NamedNodeMap) || typeof elm.removeAttribute !== "function" || typeof elm.setAttribute !== "function" || typeof elm.namespaceURI !== "string" || typeof elm.insertBefore !== "function" || typeof elm.hasChildNodes !== "function");
        };
        var _isNode = function _isNode2(object) {
          return _typeof3(Node3) === "object" ? object instanceof Node3 : object && _typeof3(object) === "object" && typeof object.nodeType === "number" && typeof object.nodeName === "string";
        };
        var _executeHook = function _executeHook2(entryPoint, currentNode, data2) {
          if (!hooks2[entryPoint]) {
            return;
          }
          arrayForEach(hooks2[entryPoint], function(hook) {
            hook.call(DOMPurify, currentNode, data2, CONFIG);
          });
        };
        var _sanitizeElements = function _sanitizeElements2(currentNode) {
          var content3;
          _executeHook("beforeSanitizeElements", currentNode, null);
          if (_isClobbered(currentNode)) {
            _forceRemove(currentNode);
            return true;
          }
          if (regExpTest(/[\u0080-\uFFFF]/, currentNode.nodeName)) {
            _forceRemove(currentNode);
            return true;
          }
          var tagName = transformCaseFunc(currentNode.nodeName);
          _executeHook("uponSanitizeElement", currentNode, {
            tagName,
            allowedTags: ALLOWED_TAGS
          });
          if (currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && (!_isNode(currentNode.content) || !_isNode(currentNode.content.firstElementChild)) && regExpTest(/<[/\w]/g, currentNode.innerHTML) && regExpTest(/<[/\w]/g, currentNode.textContent)) {
            _forceRemove(currentNode);
            return true;
          }
          if (tagName === "select" && regExpTest(/<template/i, currentNode.innerHTML)) {
            _forceRemove(currentNode);
            return true;
          }
          if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
            if (!FORBID_TAGS[tagName] && _basicCustomElementTest(tagName)) {
              if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName))
                return false;
              if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName))
                return false;
            }
            if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
              var parentNode = getParentNode(currentNode) || currentNode.parentNode;
              var childNodes = getChildNodes(currentNode) || currentNode.childNodes;
              if (childNodes && parentNode) {
                var childCount = childNodes.length;
                for (var i3 = childCount - 1; i3 >= 0; --i3) {
                  parentNode.insertBefore(cloneNode(childNodes[i3], true), getNextSibling(currentNode));
                }
              }
            }
            _forceRemove(currentNode);
            return true;
          }
          if (currentNode instanceof Element3 && !_checkValidNamespace(currentNode)) {
            _forceRemove(currentNode);
            return true;
          }
          if ((tagName === "noscript" || tagName === "noembed") && regExpTest(/<\/no(script|embed)/i, currentNode.innerHTML)) {
            _forceRemove(currentNode);
            return true;
          }
          if (SAFE_FOR_TEMPLATES && currentNode.nodeType === 3) {
            content3 = currentNode.textContent;
            content3 = stringReplace(content3, MUSTACHE_EXPR$1, " ");
            content3 = stringReplace(content3, ERB_EXPR$1, " ");
            content3 = stringReplace(content3, TMPLIT_EXPR$1, " ");
            if (currentNode.textContent !== content3) {
              arrayPush(DOMPurify.removed, {
                element: currentNode.cloneNode()
              });
              currentNode.textContent = content3;
            }
          }
          _executeHook("afterSanitizeElements", currentNode, null);
          return false;
        };
        var _isValidAttribute = function _isValidAttribute2(lcTag, lcName, value) {
          if (SANITIZE_DOM && (lcName === "id" || lcName === "name") && (value in document4 || value in formElement)) {
            return false;
          }
          if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR$1, lcName))
            ;
          else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR$1, lcName))
            ;
          else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {
            if (
              // First condition does a very basic check if a) it's basically a valid custom element tagname AND
              // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
              // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
              _basicCustomElementTest(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName)) || // Alternative, second condition checks if it's an `is`-attribute, AND
              // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
              lcName === "is" && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))
            )
              ;
            else {
              return false;
            }
          } else if (URI_SAFE_ATTRIBUTES[lcName])
            ;
          else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE$1, "")))
            ;
          else if ((lcName === "src" || lcName === "xlink:href" || lcName === "href") && lcTag !== "script" && stringIndexOf3(value, "data:") === 0 && DATA_URI_TAGS[lcTag])
            ;
          else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA$1, stringReplace(value, ATTR_WHITESPACE$1, "")))
            ;
          else if (!value)
            ;
          else {
            return false;
          }
          return true;
        };
        var _basicCustomElementTest = function _basicCustomElementTest2(tagName) {
          return tagName.indexOf("-") > 0;
        };
        var _sanitizeAttributes = function _sanitizeAttributes2(currentNode) {
          var attr2;
          var value;
          var lcName;
          var l3;
          _executeHook("beforeSanitizeAttributes", currentNode, null);
          var attributes = currentNode.attributes;
          if (!attributes) {
            return;
          }
          var hookEvent = {
            attrName: "",
            attrValue: "",
            keepAttr: true,
            allowedAttributes: ALLOWED_ATTR
          };
          l3 = attributes.length;
          while (l3--) {
            attr2 = attributes[l3];
            var _attr = attr2, name = _attr.name, namespaceURI = _attr.namespaceURI;
            value = name === "value" ? attr2.value : stringTrim(attr2.value);
            lcName = transformCaseFunc(name);
            hookEvent.attrName = lcName;
            hookEvent.attrValue = value;
            hookEvent.keepAttr = true;
            hookEvent.forceKeepAttr = void 0;
            _executeHook("uponSanitizeAttribute", currentNode, hookEvent);
            value = hookEvent.attrValue;
            if (hookEvent.forceKeepAttr) {
              continue;
            }
            _removeAttribute(name, currentNode);
            if (!hookEvent.keepAttr) {
              continue;
            }
            if (regExpTest(/\/>/i, value)) {
              _removeAttribute(name, currentNode);
              continue;
            }
            if (SAFE_FOR_TEMPLATES) {
              value = stringReplace(value, MUSTACHE_EXPR$1, " ");
              value = stringReplace(value, ERB_EXPR$1, " ");
              value = stringReplace(value, TMPLIT_EXPR$1, " ");
            }
            var lcTag = transformCaseFunc(currentNode.nodeName);
            if (!_isValidAttribute(lcTag, lcName, value)) {
              continue;
            }
            if (SANITIZE_NAMED_PROPS && (lcName === "id" || lcName === "name")) {
              _removeAttribute(name, currentNode);
              value = SANITIZE_NAMED_PROPS_PREFIX + value;
            }
            if (trustedTypesPolicy && _typeof3(trustedTypes) === "object" && typeof trustedTypes.getAttributeType === "function") {
              if (namespaceURI)
                ;
              else {
                switch (trustedTypes.getAttributeType(lcTag, lcName)) {
                  case "TrustedHTML":
                    value = trustedTypesPolicy.createHTML(value);
                    break;
                  case "TrustedScriptURL":
                    value = trustedTypesPolicy.createScriptURL(value);
                    break;
                }
              }
            }
            try {
              if (namespaceURI) {
                currentNode.setAttributeNS(namespaceURI, name, value);
              } else {
                currentNode.setAttribute(name, value);
              }
              arrayPop(DOMPurify.removed);
            } catch (_3) {
            }
          }
          _executeHook("afterSanitizeAttributes", currentNode, null);
        };
        var _sanitizeShadowDOM = function _sanitizeShadowDOM2(fragment) {
          var shadowNode;
          var shadowIterator = _createIterator(fragment);
          _executeHook("beforeSanitizeShadowDOM", fragment, null);
          while (shadowNode = shadowIterator.nextNode()) {
            _executeHook("uponSanitizeShadowNode", shadowNode, null);
            if (_sanitizeElements(shadowNode)) {
              continue;
            }
            if (shadowNode.content instanceof DocumentFragment) {
              _sanitizeShadowDOM2(shadowNode.content);
            }
            _sanitizeAttributes(shadowNode);
          }
          _executeHook("afterSanitizeShadowDOM", fragment, null);
        };
        DOMPurify.sanitize = function(dirty) {
          var cfg = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
          var body;
          var importedNode;
          var currentNode;
          var oldNode;
          var returnNode;
          IS_EMPTY_INPUT = !dirty;
          if (IS_EMPTY_INPUT) {
            dirty = "<!-->";
          }
          if (typeof dirty !== "string" && !_isNode(dirty)) {
            if (typeof dirty.toString !== "function") {
              throw typeErrorCreate("toString is not a function");
            } else {
              dirty = dirty.toString();
              if (typeof dirty !== "string") {
                throw typeErrorCreate("dirty is not a string, aborting");
              }
            }
          }
          if (!DOMPurify.isSupported) {
            if (_typeof3(window2.toStaticHTML) === "object" || typeof window2.toStaticHTML === "function") {
              if (typeof dirty === "string") {
                return window2.toStaticHTML(dirty);
              }
              if (_isNode(dirty)) {
                return window2.toStaticHTML(dirty.outerHTML);
              }
            }
            return dirty;
          }
          if (!SET_CONFIG) {
            _parseConfig(cfg);
          }
          DOMPurify.removed = [];
          if (typeof dirty === "string") {
            IN_PLACE = false;
          }
          if (IN_PLACE) {
            if (dirty.nodeName) {
              var tagName = transformCaseFunc(dirty.nodeName);
              if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
                throw typeErrorCreate("root node is forbidden and cannot be sanitized in-place");
              }
            }
          } else if (dirty instanceof Node3) {
            body = _initDocument("<!---->");
            importedNode = body.ownerDocument.importNode(dirty, true);
            if (importedNode.nodeType === 1 && importedNode.nodeName === "BODY") {
              body = importedNode;
            } else if (importedNode.nodeName === "HTML") {
              body = importedNode;
            } else {
              body.appendChild(importedNode);
            }
          } else {
            if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT && // eslint-disable-next-line unicorn/prefer-includes
            dirty.indexOf("<") === -1) {
              return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;
            }
            body = _initDocument(dirty);
            if (!body) {
              return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : "";
            }
          }
          if (body && FORCE_BODY) {
            _forceRemove(body.firstChild);
          }
          var nodeIterator = _createIterator(IN_PLACE ? dirty : body);
          while (currentNode = nodeIterator.nextNode()) {
            if (currentNode.nodeType === 3 && currentNode === oldNode) {
              continue;
            }
            if (_sanitizeElements(currentNode)) {
              continue;
            }
            if (currentNode.content instanceof DocumentFragment) {
              _sanitizeShadowDOM(currentNode.content);
            }
            _sanitizeAttributes(currentNode);
            oldNode = currentNode;
          }
          oldNode = null;
          if (IN_PLACE) {
            return dirty;
          }
          if (RETURN_DOM) {
            if (RETURN_DOM_FRAGMENT) {
              returnNode = createDocumentFragment.call(body.ownerDocument);
              while (body.firstChild) {
                returnNode.appendChild(body.firstChild);
              }
            } else {
              returnNode = body;
            }
            if (ALLOWED_ATTR.shadowroot) {
              returnNode = importNode.call(originalDocument, returnNode, true);
            }
            return returnNode;
          }
          var serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;
          if (WHOLE_DOCUMENT && ALLOWED_TAGS["!doctype"] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {
            serializedHTML = "<!DOCTYPE " + body.ownerDocument.doctype.name + ">\n" + serializedHTML;
          }
          if (SAFE_FOR_TEMPLATES) {
            serializedHTML = stringReplace(serializedHTML, MUSTACHE_EXPR$1, " ");
            serializedHTML = stringReplace(serializedHTML, ERB_EXPR$1, " ");
            serializedHTML = stringReplace(serializedHTML, TMPLIT_EXPR$1, " ");
          }
          return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;
        };
        DOMPurify.setConfig = function(cfg) {
          _parseConfig(cfg);
          SET_CONFIG = true;
        };
        DOMPurify.clearConfig = function() {
          CONFIG = null;
          SET_CONFIG = false;
        };
        DOMPurify.isValidAttribute = function(tag, attr2, value) {
          if (!CONFIG) {
            _parseConfig({});
          }
          var lcTag = transformCaseFunc(tag);
          var lcName = transformCaseFunc(attr2);
          return _isValidAttribute(lcTag, lcName, value);
        };
        DOMPurify.addHook = function(entryPoint, hookFunction) {
          if (typeof hookFunction !== "function") {
            return;
          }
          hooks2[entryPoint] = hooks2[entryPoint] || [];
          arrayPush(hooks2[entryPoint], hookFunction);
        };
        DOMPurify.removeHook = function(entryPoint) {
          if (hooks2[entryPoint]) {
            return arrayPop(hooks2[entryPoint]);
          }
        };
        DOMPurify.removeHooks = function(entryPoint) {
          if (hooks2[entryPoint]) {
            hooks2[entryPoint] = [];
          }
        };
        DOMPurify.removeAllHooks = function() {
          hooks2 = {};
        };
        return DOMPurify;
      }
      var purify = createDOMPurify();
      return purify;
    });
  }
});

// ../simple-mind-map/node_modules/core-js/internals/global.js
var require_global = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/global.js"(exports, module) {
    var check = function(it2) {
      return it2 && it2.Math == Math && it2;
    };
    module.exports = // eslint-disable-next-line es/no-global-this -- safe
    check(typeof globalThis == "object" && globalThis) || check(typeof window == "object" && window) || // eslint-disable-next-line no-restricted-globals -- safe
    check(typeof self == "object" && self) || check(typeof global == "object" && global) || // eslint-disable-next-line no-new-func -- fallback
    function() {
      return this;
    }() || Function("return this")();
  }
});

// ../simple-mind-map/node_modules/core-js/internals/fails.js
var require_fails = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/fails.js"(exports, module) {
    module.exports = function(exec2) {
      try {
        return !!exec2();
      } catch (error) {
        return true;
      }
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/descriptors.js
var require_descriptors = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/descriptors.js"(exports, module) {
    var fails4 = require_fails();
    module.exports = !fails4(function() {
      return Object.defineProperty({}, 1, { get: function() {
        return 7;
      } })[1] != 7;
    });
  }
});

// ../simple-mind-map/node_modules/core-js/internals/function-bind-native.js
var require_function_bind_native = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/function-bind-native.js"(exports, module) {
    var fails4 = require_fails();
    module.exports = !fails4(function() {
      var test2 = function() {
      }.bind();
      return typeof test2 != "function" || test2.hasOwnProperty("prototype");
    });
  }
});

// ../simple-mind-map/node_modules/core-js/internals/function-call.js
var require_function_call = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/function-call.js"(exports, module) {
    var NATIVE_BIND = require_function_bind_native();
    var call4 = Function.prototype.call;
    module.exports = NATIVE_BIND ? call4.bind(call4) : function() {
      return call4.apply(call4, arguments);
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/object-property-is-enumerable.js
var require_object_property_is_enumerable = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/object-property-is-enumerable.js"(exports) {
    "use strict";
    var $propertyIsEnumerable = {}.propertyIsEnumerable;
    var getOwnPropertyDescriptor3 = Object.getOwnPropertyDescriptor;
    var NASHORN_BUG = getOwnPropertyDescriptor3 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
    exports.f = NASHORN_BUG ? function propertyIsEnumerable(V2) {
      var descriptor = getOwnPropertyDescriptor3(this, V2);
      return !!descriptor && descriptor.enumerable;
    } : $propertyIsEnumerable;
  }
});

// ../simple-mind-map/node_modules/core-js/internals/create-property-descriptor.js
var require_create_property_descriptor = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/create-property-descriptor.js"(exports, module) {
    module.exports = function(bitmap, value) {
      return {
        enumerable: !(bitmap & 1),
        configurable: !(bitmap & 2),
        writable: !(bitmap & 4),
        value
      };
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/function-uncurry-this.js
var require_function_uncurry_this = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/function-uncurry-this.js"(exports, module) {
    var NATIVE_BIND = require_function_bind_native();
    var FunctionPrototype = Function.prototype;
    var call4 = FunctionPrototype.call;
    var uncurryThisWithBind = NATIVE_BIND && FunctionPrototype.bind.bind(call4, call4);
    module.exports = NATIVE_BIND ? uncurryThisWithBind : function(fn) {
      return function() {
        return call4.apply(fn, arguments);
      };
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/classof-raw.js
var require_classof_raw = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/classof-raw.js"(exports, module) {
    var uncurryThis8 = require_function_uncurry_this();
    var toString8 = uncurryThis8({}.toString);
    var stringSlice4 = uncurryThis8("".slice);
    module.exports = function(it2) {
      return stringSlice4(toString8(it2), 8, -1);
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/indexed-object.js
var require_indexed_object = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/indexed-object.js"(exports, module) {
    var uncurryThis8 = require_function_uncurry_this();
    var fails4 = require_fails();
    var classof = require_classof_raw();
    var $Object = Object;
    var split = uncurryThis8("".split);
    module.exports = fails4(function() {
      return !$Object("z").propertyIsEnumerable(0);
    }) ? function(it2) {
      return classof(it2) == "String" ? split(it2, "") : $Object(it2);
    } : $Object;
  }
});

// ../simple-mind-map/node_modules/core-js/internals/is-null-or-undefined.js
var require_is_null_or_undefined = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/is-null-or-undefined.js"(exports, module) {
    module.exports = function(it2) {
      return it2 === null || it2 === void 0;
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/require-object-coercible.js
var require_require_object_coercible = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/require-object-coercible.js"(exports, module) {
    var isNullOrUndefined4 = require_is_null_or_undefined();
    var $TypeError = TypeError;
    module.exports = function(it2) {
      if (isNullOrUndefined4(it2))
        throw $TypeError("Can't call method on " + it2);
      return it2;
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/to-indexed-object.js
var require_to_indexed_object = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/to-indexed-object.js"(exports, module) {
    var IndexedObject = require_indexed_object();
    var requireObjectCoercible7 = require_require_object_coercible();
    module.exports = function(it2) {
      return IndexedObject(requireObjectCoercible7(it2));
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/document-all.js
var require_document_all = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/document-all.js"(exports, module) {
    var documentAll = typeof document == "object" && document.all;
    var IS_HTMLDDA = typeof documentAll == "undefined" && documentAll !== void 0;
    module.exports = {
      all: documentAll,
      IS_HTMLDDA
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/is-callable.js
var require_is_callable = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/is-callable.js"(exports, module) {
    var $documentAll = require_document_all();
    var documentAll = $documentAll.all;
    module.exports = $documentAll.IS_HTMLDDA ? function(argument) {
      return typeof argument == "function" || argument === documentAll;
    } : function(argument) {
      return typeof argument == "function";
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/is-object.js
var require_is_object = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/is-object.js"(exports, module) {
    var isCallable2 = require_is_callable();
    var $documentAll = require_document_all();
    var documentAll = $documentAll.all;
    module.exports = $documentAll.IS_HTMLDDA ? function(it2) {
      return typeof it2 == "object" ? it2 !== null : isCallable2(it2) || it2 === documentAll;
    } : function(it2) {
      return typeof it2 == "object" ? it2 !== null : isCallable2(it2);
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/get-built-in.js
var require_get_built_in = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/get-built-in.js"(exports, module) {
    var global3 = require_global();
    var isCallable2 = require_is_callable();
    var aFunction = function(argument) {
      return isCallable2(argument) ? argument : void 0;
    };
    module.exports = function(namespace, method) {
      return arguments.length < 2 ? aFunction(global3[namespace]) : global3[namespace] && global3[namespace][method];
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/object-is-prototype-of.js
var require_object_is_prototype_of = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/object-is-prototype-of.js"(exports, module) {
    var uncurryThis8 = require_function_uncurry_this();
    module.exports = uncurryThis8({}.isPrototypeOf);
  }
});

// ../simple-mind-map/node_modules/core-js/internals/engine-user-agent.js
var require_engine_user_agent = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/engine-user-agent.js"(exports, module) {
    var getBuiltIn = require_get_built_in();
    module.exports = getBuiltIn("navigator", "userAgent") || "";
  }
});

// ../simple-mind-map/node_modules/core-js/internals/engine-v8-version.js
var require_engine_v8_version = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/engine-v8-version.js"(exports, module) {
    var global3 = require_global();
    var userAgent = require_engine_user_agent();
    var process2 = global3.process;
    var Deno2 = global3.Deno;
    var versions = process2 && process2.versions || Deno2 && Deno2.version;
    var v8 = versions && versions.v8;
    var match;
    var version;
    if (v8) {
      match = v8.split(".");
      version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
    }
    if (!version && userAgent) {
      match = userAgent.match(/Edge\/(\d+)/);
      if (!match || match[1] >= 74) {
        match = userAgent.match(/Chrome\/(\d+)/);
        if (match)
          version = +match[1];
      }
    }
    module.exports = version;
  }
});

// ../simple-mind-map/node_modules/core-js/internals/symbol-constructor-detection.js
var require_symbol_constructor_detection = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/symbol-constructor-detection.js"(exports, module) {
    var V8_VERSION = require_engine_v8_version();
    var fails4 = require_fails();
    module.exports = !!Object.getOwnPropertySymbols && !fails4(function() {
      var symbol = Symbol();
      return !String(symbol) || !(Object(symbol) instanceof Symbol) || // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
      !Symbol.sham && V8_VERSION && V8_VERSION < 41;
    });
  }
});

// ../simple-mind-map/node_modules/core-js/internals/use-symbol-as-uid.js
var require_use_symbol_as_uid = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/use-symbol-as-uid.js"(exports, module) {
    var NATIVE_SYMBOL = require_symbol_constructor_detection();
    module.exports = NATIVE_SYMBOL && !Symbol.sham && typeof Symbol.iterator == "symbol";
  }
});

// ../simple-mind-map/node_modules/core-js/internals/is-symbol.js
var require_is_symbol = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/is-symbol.js"(exports, module) {
    var getBuiltIn = require_get_built_in();
    var isCallable2 = require_is_callable();
    var isPrototypeOf = require_object_is_prototype_of();
    var USE_SYMBOL_AS_UID = require_use_symbol_as_uid();
    var $Object = Object;
    module.exports = USE_SYMBOL_AS_UID ? function(it2) {
      return typeof it2 == "symbol";
    } : function(it2) {
      var $Symbol = getBuiltIn("Symbol");
      return isCallable2($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it2));
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/try-to-string.js
var require_try_to_string = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/try-to-string.js"(exports, module) {
    var $String = String;
    module.exports = function(argument) {
      try {
        return $String(argument);
      } catch (error) {
        return "Object";
      }
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/a-callable.js
var require_a_callable = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/a-callable.js"(exports, module) {
    var isCallable2 = require_is_callable();
    var tryToString = require_try_to_string();
    var $TypeError = TypeError;
    module.exports = function(argument) {
      if (isCallable2(argument))
        return argument;
      throw $TypeError(tryToString(argument) + " is not a function");
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/get-method.js
var require_get_method = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/get-method.js"(exports, module) {
    var aCallable = require_a_callable();
    var isNullOrUndefined4 = require_is_null_or_undefined();
    module.exports = function(V2, P2) {
      var func = V2[P2];
      return isNullOrUndefined4(func) ? void 0 : aCallable(func);
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/ordinary-to-primitive.js
var require_ordinary_to_primitive = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/ordinary-to-primitive.js"(exports, module) {
    var call4 = require_function_call();
    var isCallable2 = require_is_callable();
    var isObject = require_is_object();
    var $TypeError = TypeError;
    module.exports = function(input, pref) {
      var fn, val;
      if (pref === "string" && isCallable2(fn = input.toString) && !isObject(val = call4(fn, input)))
        return val;
      if (isCallable2(fn = input.valueOf) && !isObject(val = call4(fn, input)))
        return val;
      if (pref !== "string" && isCallable2(fn = input.toString) && !isObject(val = call4(fn, input)))
        return val;
      throw $TypeError("Can't convert object to primitive value");
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/is-pure.js
var require_is_pure = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/is-pure.js"(exports, module) {
    module.exports = false;
  }
});

// ../simple-mind-map/node_modules/core-js/internals/define-global-property.js
var require_define_global_property = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/define-global-property.js"(exports, module) {
    var global3 = require_global();
    var defineProperty = Object.defineProperty;
    module.exports = function(key, value) {
      try {
        defineProperty(global3, key, { value, configurable: true, writable: true });
      } catch (error) {
        global3[key] = value;
      }
      return value;
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/shared-store.js
var require_shared_store = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/shared-store.js"(exports, module) {
    var global3 = require_global();
    var defineGlobalProperty = require_define_global_property();
    var SHARED = "__core-js_shared__";
    var store = global3[SHARED] || defineGlobalProperty(SHARED, {});
    module.exports = store;
  }
});

// ../simple-mind-map/node_modules/core-js/internals/shared.js
var require_shared = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/shared.js"(exports, module) {
    var IS_PURE3 = require_is_pure();
    var store = require_shared_store();
    (module.exports = function(key, value) {
      return store[key] || (store[key] = value !== void 0 ? value : {});
    })("versions", []).push({
      version: "3.27.1",
      mode: IS_PURE3 ? "pure" : "global",
      copyright: "\xA9 2014-2022 Denis Pushkarev (zloirock.ru)",
      license: "https://github.com/zloirock/core-js/blob/v3.27.1/LICENSE",
      source: "https://github.com/zloirock/core-js"
    });
  }
});

// ../simple-mind-map/node_modules/core-js/internals/to-object.js
var require_to_object = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/to-object.js"(exports, module) {
    var requireObjectCoercible7 = require_require_object_coercible();
    var $Object = Object;
    module.exports = function(argument) {
      return $Object(requireObjectCoercible7(argument));
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/has-own-property.js
var require_has_own_property = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/has-own-property.js"(exports, module) {
    var uncurryThis8 = require_function_uncurry_this();
    var toObject = require_to_object();
    var hasOwnProperty2 = uncurryThis8({}.hasOwnProperty);
    module.exports = Object.hasOwn || function hasOwn(it2, key) {
      return hasOwnProperty2(toObject(it2), key);
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/uid.js
var require_uid = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/uid.js"(exports, module) {
    var uncurryThis8 = require_function_uncurry_this();
    var id = 0;
    var postfix = Math.random();
    var toString8 = uncurryThis8(1 .toString);
    module.exports = function(key) {
      return "Symbol(" + (key === void 0 ? "" : key) + ")_" + toString8(++id + postfix, 36);
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/well-known-symbol.js
var require_well_known_symbol = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/well-known-symbol.js"(exports, module) {
    var global3 = require_global();
    var shared = require_shared();
    var hasOwn = require_has_own_property();
    var uid = require_uid();
    var NATIVE_SYMBOL = require_symbol_constructor_detection();
    var USE_SYMBOL_AS_UID = require_use_symbol_as_uid();
    var WellKnownSymbolsStore = shared("wks");
    var Symbol3 = global3.Symbol;
    var symbolFor = Symbol3 && Symbol3["for"];
    var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol3 : Symbol3 && Symbol3.withoutSetter || uid;
    module.exports = function(name) {
      if (!hasOwn(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == "string")) {
        var description = "Symbol." + name;
        if (NATIVE_SYMBOL && hasOwn(Symbol3, name)) {
          WellKnownSymbolsStore[name] = Symbol3[name];
        } else if (USE_SYMBOL_AS_UID && symbolFor) {
          WellKnownSymbolsStore[name] = symbolFor(description);
        } else {
          WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
        }
      }
      return WellKnownSymbolsStore[name];
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/to-primitive.js
var require_to_primitive = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/to-primitive.js"(exports, module) {
    var call4 = require_function_call();
    var isObject = require_is_object();
    var isSymbol = require_is_symbol();
    var getMethod4 = require_get_method();
    var ordinaryToPrimitive = require_ordinary_to_primitive();
    var wellKnownSymbol3 = require_well_known_symbol();
    var $TypeError = TypeError;
    var TO_PRIMITIVE = wellKnownSymbol3("toPrimitive");
    module.exports = function(input, pref) {
      if (!isObject(input) || isSymbol(input))
        return input;
      var exoticToPrim = getMethod4(input, TO_PRIMITIVE);
      var result;
      if (exoticToPrim) {
        if (pref === void 0)
          pref = "default";
        result = call4(exoticToPrim, input, pref);
        if (!isObject(result) || isSymbol(result))
          return result;
        throw $TypeError("Can't convert object to primitive value");
      }
      if (pref === void 0)
        pref = "number";
      return ordinaryToPrimitive(input, pref);
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/to-property-key.js
var require_to_property_key = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/to-property-key.js"(exports, module) {
    var toPrimitive = require_to_primitive();
    var isSymbol = require_is_symbol();
    module.exports = function(argument) {
      var key = toPrimitive(argument, "string");
      return isSymbol(key) ? key : key + "";
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/document-create-element.js
var require_document_create_element = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/document-create-element.js"(exports, module) {
    var global3 = require_global();
    var isObject = require_is_object();
    var document4 = global3.document;
    var EXISTS = isObject(document4) && isObject(document4.createElement);
    module.exports = function(it2) {
      return EXISTS ? document4.createElement(it2) : {};
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/ie8-dom-define.js
var require_ie8_dom_define = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/ie8-dom-define.js"(exports, module) {
    var DESCRIPTORS = require_descriptors();
    var fails4 = require_fails();
    var createElement = require_document_create_element();
    module.exports = !DESCRIPTORS && !fails4(function() {
      return Object.defineProperty(createElement("div"), "a", {
        get: function() {
          return 7;
        }
      }).a != 7;
    });
  }
});

// ../simple-mind-map/node_modules/core-js/internals/object-get-own-property-descriptor.js
var require_object_get_own_property_descriptor = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/object-get-own-property-descriptor.js"(exports) {
    var DESCRIPTORS = require_descriptors();
    var call4 = require_function_call();
    var propertyIsEnumerableModule = require_object_property_is_enumerable();
    var createPropertyDescriptor = require_create_property_descriptor();
    var toIndexedObject = require_to_indexed_object();
    var toPropertyKey = require_to_property_key();
    var hasOwn = require_has_own_property();
    var IE8_DOM_DEFINE = require_ie8_dom_define();
    var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
    exports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor3(O3, P2) {
      O3 = toIndexedObject(O3);
      P2 = toPropertyKey(P2);
      if (IE8_DOM_DEFINE)
        try {
          return $getOwnPropertyDescriptor(O3, P2);
        } catch (error) {
        }
      if (hasOwn(O3, P2))
        return createPropertyDescriptor(!call4(propertyIsEnumerableModule.f, O3, P2), O3[P2]);
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/v8-prototype-define-bug.js
var require_v8_prototype_define_bug = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/v8-prototype-define-bug.js"(exports, module) {
    var DESCRIPTORS = require_descriptors();
    var fails4 = require_fails();
    module.exports = DESCRIPTORS && fails4(function() {
      return Object.defineProperty(function() {
      }, "prototype", {
        value: 42,
        writable: false
      }).prototype != 42;
    });
  }
});

// ../simple-mind-map/node_modules/core-js/internals/an-object.js
var require_an_object = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/an-object.js"(exports, module) {
    var isObject = require_is_object();
    var $String = String;
    var $TypeError = TypeError;
    module.exports = function(argument) {
      if (isObject(argument))
        return argument;
      throw $TypeError($String(argument) + " is not an object");
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/object-define-property.js
var require_object_define_property = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/object-define-property.js"(exports) {
    var DESCRIPTORS = require_descriptors();
    var IE8_DOM_DEFINE = require_ie8_dom_define();
    var V8_PROTOTYPE_DEFINE_BUG = require_v8_prototype_define_bug();
    var anObject5 = require_an_object();
    var toPropertyKey = require_to_property_key();
    var $TypeError = TypeError;
    var $defineProperty = Object.defineProperty;
    var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
    var ENUMERABLE = "enumerable";
    var CONFIGURABLE = "configurable";
    var WRITABLE = "writable";
    exports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O3, P2, Attributes) {
      anObject5(O3);
      P2 = toPropertyKey(P2);
      anObject5(Attributes);
      if (typeof O3 === "function" && P2 === "prototype" && "value" in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
        var current = $getOwnPropertyDescriptor(O3, P2);
        if (current && current[WRITABLE]) {
          O3[P2] = Attributes.value;
          Attributes = {
            configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],
            enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
            writable: false
          };
        }
      }
      return $defineProperty(O3, P2, Attributes);
    } : $defineProperty : function defineProperty(O3, P2, Attributes) {
      anObject5(O3);
      P2 = toPropertyKey(P2);
      anObject5(Attributes);
      if (IE8_DOM_DEFINE)
        try {
          return $defineProperty(O3, P2, Attributes);
        } catch (error) {
        }
      if ("get" in Attributes || "set" in Attributes)
        throw $TypeError("Accessors not supported");
      if ("value" in Attributes)
        O3[P2] = Attributes.value;
      return O3;
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/create-non-enumerable-property.js
var require_create_non_enumerable_property = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/create-non-enumerable-property.js"(exports, module) {
    var DESCRIPTORS = require_descriptors();
    var definePropertyModule = require_object_define_property();
    var createPropertyDescriptor = require_create_property_descriptor();
    module.exports = DESCRIPTORS ? function(object, key, value) {
      return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
    } : function(object, key, value) {
      object[key] = value;
      return object;
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/function-name.js
var require_function_name = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/function-name.js"(exports, module) {
    var DESCRIPTORS = require_descriptors();
    var hasOwn = require_has_own_property();
    var FunctionPrototype = Function.prototype;
    var getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;
    var EXISTS = hasOwn(FunctionPrototype, "name");
    var PROPER = EXISTS && function something() {
    }.name === "something";
    var CONFIGURABLE = EXISTS && (!DESCRIPTORS || DESCRIPTORS && getDescriptor(FunctionPrototype, "name").configurable);
    module.exports = {
      EXISTS,
      PROPER,
      CONFIGURABLE
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/inspect-source.js
var require_inspect_source = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/inspect-source.js"(exports, module) {
    var uncurryThis8 = require_function_uncurry_this();
    var isCallable2 = require_is_callable();
    var store = require_shared_store();
    var functionToString = uncurryThis8(Function.toString);
    if (!isCallable2(store.inspectSource)) {
      store.inspectSource = function(it2) {
        return functionToString(it2);
      };
    }
    module.exports = store.inspectSource;
  }
});

// ../simple-mind-map/node_modules/core-js/internals/weak-map-basic-detection.js
var require_weak_map_basic_detection = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/weak-map-basic-detection.js"(exports, module) {
    var global3 = require_global();
    var isCallable2 = require_is_callable();
    var WeakMap = global3.WeakMap;
    module.exports = isCallable2(WeakMap) && /native code/.test(String(WeakMap));
  }
});

// ../simple-mind-map/node_modules/core-js/internals/shared-key.js
var require_shared_key = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/shared-key.js"(exports, module) {
    var shared = require_shared();
    var uid = require_uid();
    var keys = shared("keys");
    module.exports = function(key) {
      return keys[key] || (keys[key] = uid(key));
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/hidden-keys.js
var require_hidden_keys = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/hidden-keys.js"(exports, module) {
    module.exports = {};
  }
});

// ../simple-mind-map/node_modules/core-js/internals/internal-state.js
var require_internal_state = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/internal-state.js"(exports, module) {
    var NATIVE_WEAK_MAP = require_weak_map_basic_detection();
    var global3 = require_global();
    var isObject = require_is_object();
    var createNonEnumerableProperty2 = require_create_non_enumerable_property();
    var hasOwn = require_has_own_property();
    var shared = require_shared_store();
    var sharedKey = require_shared_key();
    var hiddenKeys = require_hidden_keys();
    var OBJECT_ALREADY_INITIALIZED = "Object already initialized";
    var TypeError2 = global3.TypeError;
    var WeakMap = global3.WeakMap;
    var set;
    var get;
    var has;
    var enforce = function(it2) {
      return has(it2) ? get(it2) : set(it2, {});
    };
    var getterFor = function(TYPE) {
      return function(it2) {
        var state;
        if (!isObject(it2) || (state = get(it2)).type !== TYPE) {
          throw TypeError2("Incompatible receiver, " + TYPE + " required");
        }
        return state;
      };
    };
    if (NATIVE_WEAK_MAP || shared.state) {
      store = shared.state || (shared.state = new WeakMap());
      store.get = store.get;
      store.has = store.has;
      store.set = store.set;
      set = function(it2, metadata) {
        if (store.has(it2))
          throw TypeError2(OBJECT_ALREADY_INITIALIZED);
        metadata.facade = it2;
        store.set(it2, metadata);
        return metadata;
      };
      get = function(it2) {
        return store.get(it2) || {};
      };
      has = function(it2) {
        return store.has(it2);
      };
    } else {
      STATE = sharedKey("state");
      hiddenKeys[STATE] = true;
      set = function(it2, metadata) {
        if (hasOwn(it2, STATE))
          throw TypeError2(OBJECT_ALREADY_INITIALIZED);
        metadata.facade = it2;
        createNonEnumerableProperty2(it2, STATE, metadata);
        return metadata;
      };
      get = function(it2) {
        return hasOwn(it2, STATE) ? it2[STATE] : {};
      };
      has = function(it2) {
        return hasOwn(it2, STATE);
      };
    }
    var store;
    var STATE;
    module.exports = {
      set,
      get,
      has,
      enforce,
      getterFor
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/make-built-in.js
var require_make_built_in = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/make-built-in.js"(exports, module) {
    var fails4 = require_fails();
    var isCallable2 = require_is_callable();
    var hasOwn = require_has_own_property();
    var DESCRIPTORS = require_descriptors();
    var CONFIGURABLE_FUNCTION_NAME = require_function_name().CONFIGURABLE;
    var inspectSource = require_inspect_source();
    var InternalStateModule = require_internal_state();
    var enforceInternalState = InternalStateModule.enforce;
    var getInternalState = InternalStateModule.get;
    var defineProperty = Object.defineProperty;
    var CONFIGURABLE_LENGTH = DESCRIPTORS && !fails4(function() {
      return defineProperty(function() {
      }, "length", { value: 8 }).length !== 8;
    });
    var TEMPLATE = String(String).split("String");
    var makeBuiltIn = module.exports = function(value, name, options) {
      if (String(name).slice(0, 7) === "Symbol(") {
        name = "[" + String(name).replace(/^Symbol\(([^)]*)\)/, "$1") + "]";
      }
      if (options && options.getter)
        name = "get " + name;
      if (options && options.setter)
        name = "set " + name;
      if (!hasOwn(value, "name") || CONFIGURABLE_FUNCTION_NAME && value.name !== name) {
        if (DESCRIPTORS)
          defineProperty(value, "name", { value: name, configurable: true });
        else
          value.name = name;
      }
      if (CONFIGURABLE_LENGTH && options && hasOwn(options, "arity") && value.length !== options.arity) {
        defineProperty(value, "length", { value: options.arity });
      }
      try {
        if (options && hasOwn(options, "constructor") && options.constructor) {
          if (DESCRIPTORS)
            defineProperty(value, "prototype", { writable: false });
        } else if (value.prototype)
          value.prototype = void 0;
      } catch (error) {
      }
      var state = enforceInternalState(value);
      if (!hasOwn(state, "source")) {
        state.source = TEMPLATE.join(typeof name == "string" ? name : "");
      }
      return value;
    };
    Function.prototype.toString = makeBuiltIn(function toString8() {
      return isCallable2(this) && getInternalState(this).source || inspectSource(this);
    }, "toString");
  }
});

// ../simple-mind-map/node_modules/core-js/internals/define-built-in.js
var require_define_built_in = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/define-built-in.js"(exports, module) {
    var isCallable2 = require_is_callable();
    var definePropertyModule = require_object_define_property();
    var makeBuiltIn = require_make_built_in();
    var defineGlobalProperty = require_define_global_property();
    module.exports = function(O3, key, value, options) {
      if (!options)
        options = {};
      var simple = options.enumerable;
      var name = options.name !== void 0 ? options.name : key;
      if (isCallable2(value))
        makeBuiltIn(value, name, options);
      if (options.global) {
        if (simple)
          O3[key] = value;
        else
          defineGlobalProperty(key, value);
      } else {
        try {
          if (!options.unsafe)
            delete O3[key];
          else if (O3[key])
            simple = true;
        } catch (error) {
        }
        if (simple)
          O3[key] = value;
        else
          definePropertyModule.f(O3, key, {
            value,
            enumerable: false,
            configurable: !options.nonConfigurable,
            writable: !options.nonWritable
          });
      }
      return O3;
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/math-trunc.js
var require_math_trunc = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/math-trunc.js"(exports, module) {
    var ceil = Math.ceil;
    var floor = Math.floor;
    module.exports = Math.trunc || function trunc(x3) {
      var n3 = +x3;
      return (n3 > 0 ? floor : ceil)(n3);
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/to-integer-or-infinity.js
var require_to_integer_or_infinity = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/to-integer-or-infinity.js"(exports, module) {
    var trunc = require_math_trunc();
    module.exports = function(argument) {
      var number = +argument;
      return number !== number || number === 0 ? 0 : trunc(number);
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/to-absolute-index.js
var require_to_absolute_index = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/to-absolute-index.js"(exports, module) {
    var toIntegerOrInfinity2 = require_to_integer_or_infinity();
    var max3 = Math.max;
    var min5 = Math.min;
    module.exports = function(index3, length2) {
      var integer = toIntegerOrInfinity2(index3);
      return integer < 0 ? max3(integer + length2, 0) : min5(integer, length2);
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/to-length.js
var require_to_length = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/to-length.js"(exports, module) {
    var toIntegerOrInfinity2 = require_to_integer_or_infinity();
    var min5 = Math.min;
    module.exports = function(argument) {
      return argument > 0 ? min5(toIntegerOrInfinity2(argument), 9007199254740991) : 0;
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/length-of-array-like.js
var require_length_of_array_like = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/length-of-array-like.js"(exports, module) {
    var toLength6 = require_to_length();
    module.exports = function(obj) {
      return toLength6(obj.length);
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/array-includes.js
var require_array_includes = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/array-includes.js"(exports, module) {
    var toIndexedObject = require_to_indexed_object();
    var toAbsoluteIndex = require_to_absolute_index();
    var lengthOfArrayLike = require_length_of_array_like();
    var createMethod = function(IS_INCLUDES) {
      return function($this, el2, fromIndex) {
        var O3 = toIndexedObject($this);
        var length2 = lengthOfArrayLike(O3);
        var index3 = toAbsoluteIndex(fromIndex, length2);
        var value;
        if (IS_INCLUDES && el2 != el2)
          while (length2 > index3) {
            value = O3[index3++];
            if (value != value)
              return true;
          }
        else
          for (; length2 > index3; index3++) {
            if ((IS_INCLUDES || index3 in O3) && O3[index3] === el2)
              return IS_INCLUDES || index3 || 0;
          }
        return !IS_INCLUDES && -1;
      };
    };
    module.exports = {
      // `Array.prototype.includes` method
      // https://tc39.es/ecma262/#sec-array.prototype.includes
      includes: createMethod(true),
      // `Array.prototype.indexOf` method
      // https://tc39.es/ecma262/#sec-array.prototype.indexof
      indexOf: createMethod(false)
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/object-keys-internal.js
var require_object_keys_internal = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/object-keys-internal.js"(exports, module) {
    var uncurryThis8 = require_function_uncurry_this();
    var hasOwn = require_has_own_property();
    var toIndexedObject = require_to_indexed_object();
    var indexOf2 = require_array_includes().indexOf;
    var hiddenKeys = require_hidden_keys();
    var push4 = uncurryThis8([].push);
    module.exports = function(object, names2) {
      var O3 = toIndexedObject(object);
      var i3 = 0;
      var result = [];
      var key;
      for (key in O3)
        !hasOwn(hiddenKeys, key) && hasOwn(O3, key) && push4(result, key);
      while (names2.length > i3)
        if (hasOwn(O3, key = names2[i3++])) {
          ~indexOf2(result, key) || push4(result, key);
        }
      return result;
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/enum-bug-keys.js
var require_enum_bug_keys = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/enum-bug-keys.js"(exports, module) {
    module.exports = [
      "constructor",
      "hasOwnProperty",
      "isPrototypeOf",
      "propertyIsEnumerable",
      "toLocaleString",
      "toString",
      "valueOf"
    ];
  }
});

// ../simple-mind-map/node_modules/core-js/internals/object-get-own-property-names.js
var require_object_get_own_property_names = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/object-get-own-property-names.js"(exports) {
    var internalObjectKeys = require_object_keys_internal();
    var enumBugKeys = require_enum_bug_keys();
    var hiddenKeys = enumBugKeys.concat("length", "prototype");
    exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O3) {
      return internalObjectKeys(O3, hiddenKeys);
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/object-get-own-property-symbols.js
var require_object_get_own_property_symbols = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/object-get-own-property-symbols.js"(exports) {
    exports.f = Object.getOwnPropertySymbols;
  }
});

// ../simple-mind-map/node_modules/core-js/internals/own-keys.js
var require_own_keys = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/own-keys.js"(exports, module) {
    var getBuiltIn = require_get_built_in();
    var uncurryThis8 = require_function_uncurry_this();
    var getOwnPropertyNamesModule = require_object_get_own_property_names();
    var getOwnPropertySymbolsModule = require_object_get_own_property_symbols();
    var anObject5 = require_an_object();
    var concat2 = uncurryThis8([].concat);
    module.exports = getBuiltIn("Reflect", "ownKeys") || function ownKeys2(it2) {
      var keys = getOwnPropertyNamesModule.f(anObject5(it2));
      var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
      return getOwnPropertySymbols ? concat2(keys, getOwnPropertySymbols(it2)) : keys;
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/copy-constructor-properties.js
var require_copy_constructor_properties = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/copy-constructor-properties.js"(exports, module) {
    var hasOwn = require_has_own_property();
    var ownKeys2 = require_own_keys();
    var getOwnPropertyDescriptorModule = require_object_get_own_property_descriptor();
    var definePropertyModule = require_object_define_property();
    module.exports = function(target, source, exceptions) {
      var keys = ownKeys2(source);
      var defineProperty = definePropertyModule.f;
      var getOwnPropertyDescriptor3 = getOwnPropertyDescriptorModule.f;
      for (var i3 = 0; i3 < keys.length; i3++) {
        var key = keys[i3];
        if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {
          defineProperty(target, key, getOwnPropertyDescriptor3(source, key));
        }
      }
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/is-forced.js
var require_is_forced = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/is-forced.js"(exports, module) {
    var fails4 = require_fails();
    var isCallable2 = require_is_callable();
    var replacement = /#|\.prototype\./;
    var isForced = function(feature, detection) {
      var value = data2[normalize(feature)];
      return value == POLYFILL ? true : value == NATIVE ? false : isCallable2(detection) ? fails4(detection) : !!detection;
    };
    var normalize = isForced.normalize = function(string3) {
      return String(string3).replace(replacement, ".").toLowerCase();
    };
    var data2 = isForced.data = {};
    var NATIVE = isForced.NATIVE = "N";
    var POLYFILL = isForced.POLYFILL = "P";
    module.exports = isForced;
  }
});

// ../simple-mind-map/node_modules/core-js/internals/export.js
var require_export = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/export.js"(exports, module) {
    var global3 = require_global();
    var getOwnPropertyDescriptor3 = require_object_get_own_property_descriptor().f;
    var createNonEnumerableProperty2 = require_create_non_enumerable_property();
    var defineBuiltIn2 = require_define_built_in();
    var defineGlobalProperty = require_define_global_property();
    var copyConstructorProperties = require_copy_constructor_properties();
    var isForced = require_is_forced();
    module.exports = function(options, source) {
      var TARGET = options.target;
      var GLOBAL = options.global;
      var STATIC = options.stat;
      var FORCED, target, key, targetProperty, sourceProperty, descriptor;
      if (GLOBAL) {
        target = global3;
      } else if (STATIC) {
        target = global3[TARGET] || defineGlobalProperty(TARGET, {});
      } else {
        target = (global3[TARGET] || {}).prototype;
      }
      if (target)
        for (key in source) {
          sourceProperty = source[key];
          if (options.dontCallGetSet) {
            descriptor = getOwnPropertyDescriptor3(target, key);
            targetProperty = descriptor && descriptor.value;
          } else
            targetProperty = target[key];
          FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? "." : "#") + key, options.forced);
          if (!FORCED && targetProperty !== void 0) {
            if (typeof sourceProperty == typeof targetProperty)
              continue;
            copyConstructorProperties(sourceProperty, targetProperty);
          }
          if (options.sham || targetProperty && targetProperty.sham) {
            createNonEnumerableProperty2(sourceProperty, "sham", true);
          }
          defineBuiltIn2(target, key, sourceProperty, options);
        }
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/engine-is-node.js
var require_engine_is_node = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/engine-is-node.js"(exports, module) {
    var classof = require_classof_raw();
    var global3 = require_global();
    module.exports = classof(global3.process) == "process";
  }
});

// ../simple-mind-map/node_modules/core-js/internals/a-possible-prototype.js
var require_a_possible_prototype = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/a-possible-prototype.js"(exports, module) {
    var isCallable2 = require_is_callable();
    var $String = String;
    var $TypeError = TypeError;
    module.exports = function(argument) {
      if (typeof argument == "object" || isCallable2(argument))
        return argument;
      throw $TypeError("Can't set " + $String(argument) + " as a prototype");
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/object-set-prototype-of.js
var require_object_set_prototype_of = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/object-set-prototype-of.js"(exports, module) {
    var uncurryThis8 = require_function_uncurry_this();
    var anObject5 = require_an_object();
    var aPossiblePrototype = require_a_possible_prototype();
    module.exports = Object.setPrototypeOf || ("__proto__" in {} ? function() {
      var CORRECT_SETTER = false;
      var test2 = {};
      var setter;
      try {
        setter = uncurryThis8(Object.getOwnPropertyDescriptor(Object.prototype, "__proto__").set);
        setter(test2, []);
        CORRECT_SETTER = test2 instanceof Array;
      } catch (error) {
      }
      return function setPrototypeOf(O3, proto) {
        anObject5(O3);
        aPossiblePrototype(proto);
        if (CORRECT_SETTER)
          setter(O3, proto);
        else
          O3.__proto__ = proto;
        return O3;
      };
    }() : void 0);
  }
});

// ../simple-mind-map/node_modules/core-js/internals/set-to-string-tag.js
var require_set_to_string_tag = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/set-to-string-tag.js"(exports, module) {
    var defineProperty = require_object_define_property().f;
    var hasOwn = require_has_own_property();
    var wellKnownSymbol3 = require_well_known_symbol();
    var TO_STRING_TAG2 = wellKnownSymbol3("toStringTag");
    module.exports = function(target, TAG, STATIC) {
      if (target && !STATIC)
        target = target.prototype;
      if (target && !hasOwn(target, TO_STRING_TAG2)) {
        defineProperty(target, TO_STRING_TAG2, { configurable: true, value: TAG });
      }
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/set-species.js
var require_set_species = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/set-species.js"(exports, module) {
    "use strict";
    var getBuiltIn = require_get_built_in();
    var definePropertyModule = require_object_define_property();
    var wellKnownSymbol3 = require_well_known_symbol();
    var DESCRIPTORS = require_descriptors();
    var SPECIES = wellKnownSymbol3("species");
    module.exports = function(CONSTRUCTOR_NAME) {
      var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
      var defineProperty = definePropertyModule.f;
      if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) {
        defineProperty(Constructor, SPECIES, {
          configurable: true,
          get: function() {
            return this;
          }
        });
      }
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/an-instance.js
var require_an_instance = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/an-instance.js"(exports, module) {
    var isPrototypeOf = require_object_is_prototype_of();
    var $TypeError = TypeError;
    module.exports = function(it2, Prototype) {
      if (isPrototypeOf(Prototype, it2))
        return it2;
      throw $TypeError("Incorrect invocation");
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/to-string-tag-support.js
var require_to_string_tag_support = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/to-string-tag-support.js"(exports, module) {
    var wellKnownSymbol3 = require_well_known_symbol();
    var TO_STRING_TAG2 = wellKnownSymbol3("toStringTag");
    var test2 = {};
    test2[TO_STRING_TAG2] = "z";
    module.exports = String(test2) === "[object z]";
  }
});

// ../simple-mind-map/node_modules/core-js/internals/classof.js
var require_classof = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/classof.js"(exports, module) {
    var TO_STRING_TAG_SUPPORT = require_to_string_tag_support();
    var isCallable2 = require_is_callable();
    var classofRaw = require_classof_raw();
    var wellKnownSymbol3 = require_well_known_symbol();
    var TO_STRING_TAG2 = wellKnownSymbol3("toStringTag");
    var $Object = Object;
    var CORRECT_ARGUMENTS = classofRaw(function() {
      return arguments;
    }()) == "Arguments";
    var tryGet = function(it2, key) {
      try {
        return it2[key];
      } catch (error) {
      }
    };
    module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function(it2) {
      var O3, tag, result;
      return it2 === void 0 ? "Undefined" : it2 === null ? "Null" : typeof (tag = tryGet(O3 = $Object(it2), TO_STRING_TAG2)) == "string" ? tag : CORRECT_ARGUMENTS ? classofRaw(O3) : (result = classofRaw(O3)) == "Object" && isCallable2(O3.callee) ? "Arguments" : result;
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/is-constructor.js
var require_is_constructor = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/is-constructor.js"(exports, module) {
    var uncurryThis8 = require_function_uncurry_this();
    var fails4 = require_fails();
    var isCallable2 = require_is_callable();
    var classof = require_classof();
    var getBuiltIn = require_get_built_in();
    var inspectSource = require_inspect_source();
    var noop3 = function() {
    };
    var empty = [];
    var construct = getBuiltIn("Reflect", "construct");
    var constructorRegExp = /^\s*(?:class|function)\b/;
    var exec2 = uncurryThis8(constructorRegExp.exec);
    var INCORRECT_TO_STRING = !constructorRegExp.exec(noop3);
    var isConstructorModern = function isConstructor(argument) {
      if (!isCallable2(argument))
        return false;
      try {
        construct(noop3, empty, argument);
        return true;
      } catch (error) {
        return false;
      }
    };
    var isConstructorLegacy = function isConstructor(argument) {
      if (!isCallable2(argument))
        return false;
      switch (classof(argument)) {
        case "AsyncFunction":
        case "GeneratorFunction":
        case "AsyncGeneratorFunction":
          return false;
      }
      try {
        return INCORRECT_TO_STRING || !!exec2(constructorRegExp, inspectSource(argument));
      } catch (error) {
        return true;
      }
    };
    isConstructorLegacy.sham = true;
    module.exports = !construct || fails4(function() {
      var called;
      return isConstructorModern(isConstructorModern.call) || !isConstructorModern(Object) || !isConstructorModern(function() {
        called = true;
      }) || called;
    }) ? isConstructorLegacy : isConstructorModern;
  }
});

// ../simple-mind-map/node_modules/core-js/internals/a-constructor.js
var require_a_constructor = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/a-constructor.js"(exports, module) {
    var isConstructor = require_is_constructor();
    var tryToString = require_try_to_string();
    var $TypeError = TypeError;
    module.exports = function(argument) {
      if (isConstructor(argument))
        return argument;
      throw $TypeError(tryToString(argument) + " is not a constructor");
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/species-constructor.js
var require_species_constructor = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/species-constructor.js"(exports, module) {
    var anObject5 = require_an_object();
    var aConstructor = require_a_constructor();
    var isNullOrUndefined4 = require_is_null_or_undefined();
    var wellKnownSymbol3 = require_well_known_symbol();
    var SPECIES = wellKnownSymbol3("species");
    module.exports = function(O3, defaultConstructor) {
      var C2 = anObject5(O3).constructor;
      var S2;
      return C2 === void 0 || isNullOrUndefined4(S2 = anObject5(C2)[SPECIES]) ? defaultConstructor : aConstructor(S2);
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/function-apply.js
var require_function_apply = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/function-apply.js"(exports, module) {
    var NATIVE_BIND = require_function_bind_native();
    var FunctionPrototype = Function.prototype;
    var apply3 = FunctionPrototype.apply;
    var call4 = FunctionPrototype.call;
    module.exports = typeof Reflect == "object" && Reflect.apply || (NATIVE_BIND ? call4.bind(apply3) : function() {
      return call4.apply(apply3, arguments);
    });
  }
});

// ../simple-mind-map/node_modules/core-js/internals/function-uncurry-this-clause.js
var require_function_uncurry_this_clause = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/function-uncurry-this-clause.js"(exports, module) {
    var classofRaw = require_classof_raw();
    var uncurryThis8 = require_function_uncurry_this();
    module.exports = function(fn) {
      if (classofRaw(fn) === "Function")
        return uncurryThis8(fn);
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/function-bind-context.js
var require_function_bind_context = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/function-bind-context.js"(exports, module) {
    var uncurryThis8 = require_function_uncurry_this_clause();
    var aCallable = require_a_callable();
    var NATIVE_BIND = require_function_bind_native();
    var bind = uncurryThis8(uncurryThis8.bind);
    module.exports = function(fn, that) {
      aCallable(fn);
      return that === void 0 ? fn : NATIVE_BIND ? bind(fn, that) : function() {
        return fn.apply(that, arguments);
      };
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/html.js
var require_html = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/html.js"(exports, module) {
    var getBuiltIn = require_get_built_in();
    module.exports = getBuiltIn("document", "documentElement");
  }
});

// ../simple-mind-map/node_modules/core-js/internals/array-slice.js
var require_array_slice = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/array-slice.js"(exports, module) {
    var uncurryThis8 = require_function_uncurry_this();
    module.exports = uncurryThis8([].slice);
  }
});

// ../simple-mind-map/node_modules/core-js/internals/validate-arguments-length.js
var require_validate_arguments_length = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/validate-arguments-length.js"(exports, module) {
    var $TypeError = TypeError;
    module.exports = function(passed, required) {
      if (passed < required)
        throw $TypeError("Not enough arguments");
      return passed;
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/engine-is-ios.js
var require_engine_is_ios = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/engine-is-ios.js"(exports, module) {
    var userAgent = require_engine_user_agent();
    module.exports = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent);
  }
});

// ../simple-mind-map/node_modules/core-js/internals/task.js
var require_task = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/task.js"(exports, module) {
    var global3 = require_global();
    var apply3 = require_function_apply();
    var bind = require_function_bind_context();
    var isCallable2 = require_is_callable();
    var hasOwn = require_has_own_property();
    var fails4 = require_fails();
    var html2 = require_html();
    var arraySlice2 = require_array_slice();
    var createElement = require_document_create_element();
    var validateArgumentsLength = require_validate_arguments_length();
    var IS_IOS = require_engine_is_ios();
    var IS_NODE2 = require_engine_is_node();
    var set = global3.setImmediate;
    var clear2 = global3.clearImmediate;
    var process2 = global3.process;
    var Dispatch = global3.Dispatch;
    var Function2 = global3.Function;
    var MessageChannel2 = global3.MessageChannel;
    var String2 = global3.String;
    var counter = 0;
    var queue = {};
    var ONREADYSTATECHANGE = "onreadystatechange";
    var $location;
    var defer;
    var channel;
    var port;
    try {
      $location = global3.location;
    } catch (error) {
    }
    var run = function(id) {
      if (hasOwn(queue, id)) {
        var fn = queue[id];
        delete queue[id];
        fn();
      }
    };
    var runner = function(id) {
      return function() {
        run(id);
      };
    };
    var listener = function(event) {
      run(event.data);
    };
    var post = function(id) {
      global3.postMessage(String2(id), $location.protocol + "//" + $location.host);
    };
    if (!set || !clear2) {
      set = function setImmediate2(handler) {
        validateArgumentsLength(arguments.length, 1);
        var fn = isCallable2(handler) ? handler : Function2(handler);
        var args = arraySlice2(arguments, 1);
        queue[++counter] = function() {
          apply3(fn, void 0, args);
        };
        defer(counter);
        return counter;
      };
      clear2 = function clearImmediate(id) {
        delete queue[id];
      };
      if (IS_NODE2) {
        defer = function(id) {
          process2.nextTick(runner(id));
        };
      } else if (Dispatch && Dispatch.now) {
        defer = function(id) {
          Dispatch.now(runner(id));
        };
      } else if (MessageChannel2 && !IS_IOS) {
        channel = new MessageChannel2();
        port = channel.port2;
        channel.port1.onmessage = listener;
        defer = bind(port.postMessage, port);
      } else if (global3.addEventListener && isCallable2(global3.postMessage) && !global3.importScripts && $location && $location.protocol !== "file:" && !fails4(post)) {
        defer = post;
        global3.addEventListener("message", listener, false);
      } else if (ONREADYSTATECHANGE in createElement("script")) {
        defer = function(id) {
          html2.appendChild(createElement("script"))[ONREADYSTATECHANGE] = function() {
            html2.removeChild(this);
            run(id);
          };
        };
      } else {
        defer = function(id) {
          setTimeout(runner(id), 0);
        };
      }
    }
    module.exports = {
      set,
      clear: clear2
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/engine-is-ios-pebble.js
var require_engine_is_ios_pebble = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/engine-is-ios-pebble.js"(exports, module) {
    var userAgent = require_engine_user_agent();
    var global3 = require_global();
    module.exports = /ipad|iphone|ipod/i.test(userAgent) && global3.Pebble !== void 0;
  }
});

// ../simple-mind-map/node_modules/core-js/internals/engine-is-webos-webkit.js
var require_engine_is_webos_webkit = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/engine-is-webos-webkit.js"(exports, module) {
    var userAgent = require_engine_user_agent();
    module.exports = /web0s(?!.*chrome)/i.test(userAgent);
  }
});

// ../simple-mind-map/node_modules/core-js/internals/microtask.js
var require_microtask = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/microtask.js"(exports, module) {
    var global3 = require_global();
    var bind = require_function_bind_context();
    var getOwnPropertyDescriptor3 = require_object_get_own_property_descriptor().f;
    var macrotask = require_task().set;
    var IS_IOS = require_engine_is_ios();
    var IS_IOS_PEBBLE = require_engine_is_ios_pebble();
    var IS_WEBOS_WEBKIT = require_engine_is_webos_webkit();
    var IS_NODE2 = require_engine_is_node();
    var MutationObserver2 = global3.MutationObserver || global3.WebKitMutationObserver;
    var document4 = global3.document;
    var process2 = global3.process;
    var Promise2 = global3.Promise;
    var queueMicrotaskDescriptor = getOwnPropertyDescriptor3(global3, "queueMicrotask");
    var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
    var flush;
    var head;
    var last;
    var notify;
    var toggle;
    var node3;
    var promise;
    var then;
    if (!queueMicrotask) {
      flush = function() {
        var parent, fn;
        if (IS_NODE2 && (parent = process2.domain))
          parent.exit();
        while (head) {
          fn = head.fn;
          head = head.next;
          try {
            fn();
          } catch (error) {
            if (head)
              notify();
            else
              last = void 0;
            throw error;
          }
        }
        last = void 0;
        if (parent)
          parent.enter();
      };
      if (!IS_IOS && !IS_NODE2 && !IS_WEBOS_WEBKIT && MutationObserver2 && document4) {
        toggle = true;
        node3 = document4.createTextNode("");
        new MutationObserver2(flush).observe(node3, { characterData: true });
        notify = function() {
          node3.data = toggle = !toggle;
        };
      } else if (!IS_IOS_PEBBLE && Promise2 && Promise2.resolve) {
        promise = Promise2.resolve(void 0);
        promise.constructor = Promise2;
        then = bind(promise.then, promise);
        notify = function() {
          then(flush);
        };
      } else if (IS_NODE2) {
        notify = function() {
          process2.nextTick(flush);
        };
      } else {
        macrotask = bind(macrotask, global3);
        notify = function() {
          macrotask(flush);
        };
      }
    }
    module.exports = queueMicrotask || function(fn) {
      var task = { fn, next: void 0 };
      if (last)
        last.next = task;
      if (!head) {
        head = task;
        notify();
      }
      last = task;
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/host-report-errors.js
var require_host_report_errors = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/host-report-errors.js"(exports, module) {
    var global3 = require_global();
    module.exports = function(a3, b2) {
      var console2 = global3.console;
      if (console2 && console2.error) {
        arguments.length == 1 ? console2.error(a3) : console2.error(a3, b2);
      }
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/perform.js
var require_perform = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/perform.js"(exports, module) {
    module.exports = function(exec2) {
      try {
        return { error: false, value: exec2() };
      } catch (error) {
        return { error: true, value: error };
      }
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/queue.js
var require_queue = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/queue.js"(exports, module) {
    var Queue2 = function() {
      this.head = null;
      this.tail = null;
    };
    Queue2.prototype = {
      add: function(item) {
        var entry = { item, next: null };
        if (this.head)
          this.tail.next = entry;
        else
          this.head = entry;
        this.tail = entry;
      },
      get: function() {
        var entry = this.head;
        if (entry) {
          this.head = entry.next;
          if (this.tail === entry)
            this.tail = null;
          return entry.item;
        }
      }
    };
    module.exports = Queue2;
  }
});

// ../simple-mind-map/node_modules/core-js/internals/promise-native-constructor.js
var require_promise_native_constructor = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/promise-native-constructor.js"(exports, module) {
    var global3 = require_global();
    module.exports = global3.Promise;
  }
});

// ../simple-mind-map/node_modules/core-js/internals/engine-is-deno.js
var require_engine_is_deno = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/engine-is-deno.js"(exports, module) {
    module.exports = typeof Deno == "object" && Deno && typeof Deno.version == "object";
  }
});

// ../simple-mind-map/node_modules/core-js/internals/engine-is-browser.js
var require_engine_is_browser = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/engine-is-browser.js"(exports, module) {
    var IS_DENO = require_engine_is_deno();
    var IS_NODE2 = require_engine_is_node();
    module.exports = !IS_DENO && !IS_NODE2 && typeof window == "object" && typeof document == "object";
  }
});

// ../simple-mind-map/node_modules/core-js/internals/promise-constructor-detection.js
var require_promise_constructor_detection = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/promise-constructor-detection.js"(exports, module) {
    var global3 = require_global();
    var NativePromiseConstructor = require_promise_native_constructor();
    var isCallable2 = require_is_callable();
    var isForced = require_is_forced();
    var inspectSource = require_inspect_source();
    var wellKnownSymbol3 = require_well_known_symbol();
    var IS_BROWSER = require_engine_is_browser();
    var IS_DENO = require_engine_is_deno();
    var IS_PURE3 = require_is_pure();
    var V8_VERSION = require_engine_v8_version();
    var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
    var SPECIES = wellKnownSymbol3("species");
    var SUBCLASSING = false;
    var NATIVE_PROMISE_REJECTION_EVENT = isCallable2(global3.PromiseRejectionEvent);
    var FORCED_PROMISE_CONSTRUCTOR = isForced("Promise", function() {
      var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(NativePromiseConstructor);
      var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(NativePromiseConstructor);
      if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66)
        return true;
      if (IS_PURE3 && !(NativePromisePrototype["catch"] && NativePromisePrototype["finally"]))
        return true;
      if (!V8_VERSION || V8_VERSION < 51 || !/native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) {
        var promise = new NativePromiseConstructor(function(resolve) {
          resolve(1);
        });
        var FakePromise = function(exec2) {
          exec2(function() {
          }, function() {
          });
        };
        var constructor = promise.constructor = {};
        constructor[SPECIES] = FakePromise;
        SUBCLASSING = promise.then(function() {
        }) instanceof FakePromise;
        if (!SUBCLASSING)
          return true;
      }
      return !GLOBAL_CORE_JS_PROMISE && (IS_BROWSER || IS_DENO) && !NATIVE_PROMISE_REJECTION_EVENT;
    });
    module.exports = {
      CONSTRUCTOR: FORCED_PROMISE_CONSTRUCTOR,
      REJECTION_EVENT: NATIVE_PROMISE_REJECTION_EVENT,
      SUBCLASSING
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/new-promise-capability.js
var require_new_promise_capability = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/new-promise-capability.js"(exports, module) {
    "use strict";
    var aCallable = require_a_callable();
    var $TypeError = TypeError;
    var PromiseCapability = function(C2) {
      var resolve, reject;
      this.promise = new C2(function($$resolve, $$reject) {
        if (resolve !== void 0 || reject !== void 0)
          throw $TypeError("Bad Promise constructor");
        resolve = $$resolve;
        reject = $$reject;
      });
      this.resolve = aCallable(resolve);
      this.reject = aCallable(reject);
    };
    module.exports.f = function(C2) {
      return new PromiseCapability(C2);
    };
  }
});

// ../simple-mind-map/node_modules/core-js/modules/es.promise.constructor.js
var require_es_promise_constructor = __commonJS({
  "../simple-mind-map/node_modules/core-js/modules/es.promise.constructor.js"() {
    "use strict";
    var $9 = require_export();
    var IS_PURE3 = require_is_pure();
    var IS_NODE2 = require_engine_is_node();
    var global3 = require_global();
    var call4 = require_function_call();
    var defineBuiltIn2 = require_define_built_in();
    var setPrototypeOf = require_object_set_prototype_of();
    var setToStringTag = require_set_to_string_tag();
    var setSpecies = require_set_species();
    var aCallable = require_a_callable();
    var isCallable2 = require_is_callable();
    var isObject = require_is_object();
    var anInstance = require_an_instance();
    var speciesConstructor2 = require_species_constructor();
    var task = require_task().set;
    var microtask = require_microtask();
    var hostReportErrors = require_host_report_errors();
    var perform = require_perform();
    var Queue2 = require_queue();
    var InternalStateModule = require_internal_state();
    var NativePromiseConstructor = require_promise_native_constructor();
    var PromiseConstructorDetection = require_promise_constructor_detection();
    var newPromiseCapabilityModule = require_new_promise_capability();
    var PROMISE = "Promise";
    var FORCED_PROMISE_CONSTRUCTOR = PromiseConstructorDetection.CONSTRUCTOR;
    var NATIVE_PROMISE_REJECTION_EVENT = PromiseConstructorDetection.REJECTION_EVENT;
    var NATIVE_PROMISE_SUBCLASSING = PromiseConstructorDetection.SUBCLASSING;
    var getInternalPromiseState = InternalStateModule.getterFor(PROMISE);
    var setInternalState = InternalStateModule.set;
    var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
    var PromiseConstructor = NativePromiseConstructor;
    var PromisePrototype = NativePromisePrototype;
    var TypeError2 = global3.TypeError;
    var document4 = global3.document;
    var process2 = global3.process;
    var newPromiseCapability = newPromiseCapabilityModule.f;
    var newGenericPromiseCapability = newPromiseCapability;
    var DISPATCH_EVENT = !!(document4 && document4.createEvent && global3.dispatchEvent);
    var UNHANDLED_REJECTION = "unhandledrejection";
    var REJECTION_HANDLED = "rejectionhandled";
    var PENDING = 0;
    var FULFILLED = 1;
    var REJECTED = 2;
    var HANDLED = 1;
    var UNHANDLED = 2;
    var Internal;
    var OwnPromiseCapability;
    var PromiseWrapper;
    var nativeThen;
    var isThenable = function(it2) {
      var then;
      return isObject(it2) && isCallable2(then = it2.then) ? then : false;
    };
    var callReaction = function(reaction, state) {
      var value = state.value;
      var ok = state.state == FULFILLED;
      var handler = ok ? reaction.ok : reaction.fail;
      var resolve = reaction.resolve;
      var reject = reaction.reject;
      var domain = reaction.domain;
      var result, then, exited;
      try {
        if (handler) {
          if (!ok) {
            if (state.rejection === UNHANDLED)
              onHandleUnhandled(state);
            state.rejection = HANDLED;
          }
          if (handler === true)
            result = value;
          else {
            if (domain)
              domain.enter();
            result = handler(value);
            if (domain) {
              domain.exit();
              exited = true;
            }
          }
          if (result === reaction.promise) {
            reject(TypeError2("Promise-chain cycle"));
          } else if (then = isThenable(result)) {
            call4(then, result, resolve, reject);
          } else
            resolve(result);
        } else
          reject(value);
      } catch (error) {
        if (domain && !exited)
          domain.exit();
        reject(error);
      }
    };
    var notify = function(state, isReject) {
      if (state.notified)
        return;
      state.notified = true;
      microtask(function() {
        var reactions = state.reactions;
        var reaction;
        while (reaction = reactions.get()) {
          callReaction(reaction, state);
        }
        state.notified = false;
        if (isReject && !state.rejection)
          onUnhandled(state);
      });
    };
    var dispatchEvent = function(name, promise, reason) {
      var event, handler;
      if (DISPATCH_EVENT) {
        event = document4.createEvent("Event");
        event.promise = promise;
        event.reason = reason;
        event.initEvent(name, false, true);
        global3.dispatchEvent(event);
      } else
        event = { promise, reason };
      if (!NATIVE_PROMISE_REJECTION_EVENT && (handler = global3["on" + name]))
        handler(event);
      else if (name === UNHANDLED_REJECTION)
        hostReportErrors("Unhandled promise rejection", reason);
    };
    var onUnhandled = function(state) {
      call4(task, global3, function() {
        var promise = state.facade;
        var value = state.value;
        var IS_UNHANDLED = isUnhandled(state);
        var result;
        if (IS_UNHANDLED) {
          result = perform(function() {
            if (IS_NODE2) {
              process2.emit("unhandledRejection", value, promise);
            } else
              dispatchEvent(UNHANDLED_REJECTION, promise, value);
          });
          state.rejection = IS_NODE2 || isUnhandled(state) ? UNHANDLED : HANDLED;
          if (result.error)
            throw result.value;
        }
      });
    };
    var isUnhandled = function(state) {
      return state.rejection !== HANDLED && !state.parent;
    };
    var onHandleUnhandled = function(state) {
      call4(task, global3, function() {
        var promise = state.facade;
        if (IS_NODE2) {
          process2.emit("rejectionHandled", promise);
        } else
          dispatchEvent(REJECTION_HANDLED, promise, state.value);
      });
    };
    var bind = function(fn, state, unwrap) {
      return function(value) {
        fn(state, value, unwrap);
      };
    };
    var internalReject = function(state, value, unwrap) {
      if (state.done)
        return;
      state.done = true;
      if (unwrap)
        state = unwrap;
      state.value = value;
      state.state = REJECTED;
      notify(state, true);
    };
    var internalResolve = function(state, value, unwrap) {
      if (state.done)
        return;
      state.done = true;
      if (unwrap)
        state = unwrap;
      try {
        if (state.facade === value)
          throw TypeError2("Promise can't be resolved itself");
        var then = isThenable(value);
        if (then) {
          microtask(function() {
            var wrapper = { done: false };
            try {
              call4(
                then,
                value,
                bind(internalResolve, wrapper, state),
                bind(internalReject, wrapper, state)
              );
            } catch (error) {
              internalReject(wrapper, error, state);
            }
          });
        } else {
          state.value = value;
          state.state = FULFILLED;
          notify(state, false);
        }
      } catch (error) {
        internalReject({ done: false }, error, state);
      }
    };
    if (FORCED_PROMISE_CONSTRUCTOR) {
      PromiseConstructor = function Promise2(executor) {
        anInstance(this, PromisePrototype);
        aCallable(executor);
        call4(Internal, this);
        var state = getInternalPromiseState(this);
        try {
          executor(bind(internalResolve, state), bind(internalReject, state));
        } catch (error) {
          internalReject(state, error);
        }
      };
      PromisePrototype = PromiseConstructor.prototype;
      Internal = function Promise2(executor) {
        setInternalState(this, {
          type: PROMISE,
          done: false,
          notified: false,
          parent: false,
          reactions: new Queue2(),
          rejection: false,
          state: PENDING,
          value: void 0
        });
      };
      Internal.prototype = defineBuiltIn2(PromisePrototype, "then", function then(onFulfilled, onRejected) {
        var state = getInternalPromiseState(this);
        var reaction = newPromiseCapability(speciesConstructor2(this, PromiseConstructor));
        state.parent = true;
        reaction.ok = isCallable2(onFulfilled) ? onFulfilled : true;
        reaction.fail = isCallable2(onRejected) && onRejected;
        reaction.domain = IS_NODE2 ? process2.domain : void 0;
        if (state.state == PENDING)
          state.reactions.add(reaction);
        else
          microtask(function() {
            callReaction(reaction, state);
          });
        return reaction.promise;
      });
      OwnPromiseCapability = function() {
        var promise = new Internal();
        var state = getInternalPromiseState(promise);
        this.promise = promise;
        this.resolve = bind(internalResolve, state);
        this.reject = bind(internalReject, state);
      };
      newPromiseCapabilityModule.f = newPromiseCapability = function(C2) {
        return C2 === PromiseConstructor || C2 === PromiseWrapper ? new OwnPromiseCapability(C2) : newGenericPromiseCapability(C2);
      };
      if (!IS_PURE3 && isCallable2(NativePromiseConstructor) && NativePromisePrototype !== Object.prototype) {
        nativeThen = NativePromisePrototype.then;
        if (!NATIVE_PROMISE_SUBCLASSING) {
          defineBuiltIn2(NativePromisePrototype, "then", function then(onFulfilled, onRejected) {
            var that = this;
            return new PromiseConstructor(function(resolve, reject) {
              call4(nativeThen, that, resolve, reject);
            }).then(onFulfilled, onRejected);
          }, { unsafe: true });
        }
        try {
          delete NativePromisePrototype.constructor;
        } catch (error) {
        }
        if (setPrototypeOf) {
          setPrototypeOf(NativePromisePrototype, PromisePrototype);
        }
      }
    }
    $9({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
      Promise: PromiseConstructor
    });
    setToStringTag(PromiseConstructor, PROMISE, false, true);
    setSpecies(PROMISE);
  }
});

// ../simple-mind-map/node_modules/core-js/internals/iterators.js
var require_iterators = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/iterators.js"(exports, module) {
    module.exports = {};
  }
});

// ../simple-mind-map/node_modules/core-js/internals/is-array-iterator-method.js
var require_is_array_iterator_method = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/is-array-iterator-method.js"(exports, module) {
    var wellKnownSymbol3 = require_well_known_symbol();
    var Iterators = require_iterators();
    var ITERATOR2 = wellKnownSymbol3("iterator");
    var ArrayPrototype = Array.prototype;
    module.exports = function(it2) {
      return it2 !== void 0 && (Iterators.Array === it2 || ArrayPrototype[ITERATOR2] === it2);
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/get-iterator-method.js
var require_get_iterator_method = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/get-iterator-method.js"(exports, module) {
    var classof = require_classof();
    var getMethod4 = require_get_method();
    var isNullOrUndefined4 = require_is_null_or_undefined();
    var Iterators = require_iterators();
    var wellKnownSymbol3 = require_well_known_symbol();
    var ITERATOR2 = wellKnownSymbol3("iterator");
    module.exports = function(it2) {
      if (!isNullOrUndefined4(it2))
        return getMethod4(it2, ITERATOR2) || getMethod4(it2, "@@iterator") || Iterators[classof(it2)];
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/get-iterator.js
var require_get_iterator = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/get-iterator.js"(exports, module) {
    var call4 = require_function_call();
    var aCallable = require_a_callable();
    var anObject5 = require_an_object();
    var tryToString = require_try_to_string();
    var getIteratorMethod = require_get_iterator_method();
    var $TypeError = TypeError;
    module.exports = function(argument, usingIterator) {
      var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
      if (aCallable(iteratorMethod))
        return anObject5(call4(iteratorMethod, argument));
      throw $TypeError(tryToString(argument) + " is not iterable");
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/iterator-close.js
var require_iterator_close = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/iterator-close.js"(exports, module) {
    var call4 = require_function_call();
    var anObject5 = require_an_object();
    var getMethod4 = require_get_method();
    module.exports = function(iterator, kind, value) {
      var innerResult, innerError;
      anObject5(iterator);
      try {
        innerResult = getMethod4(iterator, "return");
        if (!innerResult) {
          if (kind === "throw")
            throw value;
          return value;
        }
        innerResult = call4(innerResult, iterator);
      } catch (error) {
        innerError = true;
        innerResult = error;
      }
      if (kind === "throw")
        throw value;
      if (innerError)
        throw innerResult;
      anObject5(innerResult);
      return value;
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/iterate.js
var require_iterate = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/iterate.js"(exports, module) {
    var bind = require_function_bind_context();
    var call4 = require_function_call();
    var anObject5 = require_an_object();
    var tryToString = require_try_to_string();
    var isArrayIteratorMethod = require_is_array_iterator_method();
    var lengthOfArrayLike = require_length_of_array_like();
    var isPrototypeOf = require_object_is_prototype_of();
    var getIterator = require_get_iterator();
    var getIteratorMethod = require_get_iterator_method();
    var iteratorClose = require_iterator_close();
    var $TypeError = TypeError;
    var Result = function(stopped, result) {
      this.stopped = stopped;
      this.result = result;
    };
    var ResultPrototype = Result.prototype;
    module.exports = function(iterable, unboundFunction, options) {
      var that = options && options.that;
      var AS_ENTRIES = !!(options && options.AS_ENTRIES);
      var IS_RECORD = !!(options && options.IS_RECORD);
      var IS_ITERATOR = !!(options && options.IS_ITERATOR);
      var INTERRUPTED = !!(options && options.INTERRUPTED);
      var fn = bind(unboundFunction, that);
      var iterator, iterFn, index3, length2, result, next2, step;
      var stop = function(condition) {
        if (iterator)
          iteratorClose(iterator, "normal", condition);
        return new Result(true, condition);
      };
      var callFn = function(value) {
        if (AS_ENTRIES) {
          anObject5(value);
          return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
        }
        return INTERRUPTED ? fn(value, stop) : fn(value);
      };
      if (IS_RECORD) {
        iterator = iterable.iterator;
      } else if (IS_ITERATOR) {
        iterator = iterable;
      } else {
        iterFn = getIteratorMethod(iterable);
        if (!iterFn)
          throw $TypeError(tryToString(iterable) + " is not iterable");
        if (isArrayIteratorMethod(iterFn)) {
          for (index3 = 0, length2 = lengthOfArrayLike(iterable); length2 > index3; index3++) {
            result = callFn(iterable[index3]);
            if (result && isPrototypeOf(ResultPrototype, result))
              return result;
          }
          return new Result(false);
        }
        iterator = getIterator(iterable, iterFn);
      }
      next2 = IS_RECORD ? iterable.next : iterator.next;
      while (!(step = call4(next2, iterator)).done) {
        try {
          result = callFn(step.value);
        } catch (error) {
          iteratorClose(iterator, "throw", error);
        }
        if (typeof result == "object" && result && isPrototypeOf(ResultPrototype, result))
          return result;
      }
      return new Result(false);
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/check-correctness-of-iteration.js
var require_check_correctness_of_iteration = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/check-correctness-of-iteration.js"(exports, module) {
    var wellKnownSymbol3 = require_well_known_symbol();
    var ITERATOR2 = wellKnownSymbol3("iterator");
    var SAFE_CLOSING = false;
    try {
      called = 0;
      iteratorWithReturn = {
        next: function() {
          return { done: !!called++ };
        },
        "return": function() {
          SAFE_CLOSING = true;
        }
      };
      iteratorWithReturn[ITERATOR2] = function() {
        return this;
      };
      Array.from(iteratorWithReturn, function() {
        throw 2;
      });
    } catch (error) {
    }
    var called;
    var iteratorWithReturn;
    module.exports = function(exec2, SKIP_CLOSING) {
      if (!SKIP_CLOSING && !SAFE_CLOSING)
        return false;
      var ITERATION_SUPPORT = false;
      try {
        var object = {};
        object[ITERATOR2] = function() {
          return {
            next: function() {
              return { done: ITERATION_SUPPORT = true };
            }
          };
        };
        exec2(object);
      } catch (error) {
      }
      return ITERATION_SUPPORT;
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/promise-statics-incorrect-iteration.js
var require_promise_statics_incorrect_iteration = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/promise-statics-incorrect-iteration.js"(exports, module) {
    var NativePromiseConstructor = require_promise_native_constructor();
    var checkCorrectnessOfIteration = require_check_correctness_of_iteration();
    var FORCED_PROMISE_CONSTRUCTOR = require_promise_constructor_detection().CONSTRUCTOR;
    module.exports = FORCED_PROMISE_CONSTRUCTOR || !checkCorrectnessOfIteration(function(iterable) {
      NativePromiseConstructor.all(iterable).then(void 0, function() {
      });
    });
  }
});

// ../simple-mind-map/node_modules/core-js/modules/es.promise.all.js
var require_es_promise_all = __commonJS({
  "../simple-mind-map/node_modules/core-js/modules/es.promise.all.js"() {
    "use strict";
    var $9 = require_export();
    var call4 = require_function_call();
    var aCallable = require_a_callable();
    var newPromiseCapabilityModule = require_new_promise_capability();
    var perform = require_perform();
    var iterate = require_iterate();
    var PROMISE_STATICS_INCORRECT_ITERATION = require_promise_statics_incorrect_iteration();
    $9({ target: "Promise", stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
      all: function all2(iterable) {
        var C2 = this;
        var capability = newPromiseCapabilityModule.f(C2);
        var resolve = capability.resolve;
        var reject = capability.reject;
        var result = perform(function() {
          var $promiseResolve = aCallable(C2.resolve);
          var values = [];
          var counter = 0;
          var remaining = 1;
          iterate(iterable, function(promise) {
            var index3 = counter++;
            var alreadyCalled = false;
            remaining++;
            call4($promiseResolve, C2, promise).then(function(value) {
              if (alreadyCalled)
                return;
              alreadyCalled = true;
              values[index3] = value;
              --remaining || resolve(values);
            }, reject);
          });
          --remaining || resolve(values);
        });
        if (result.error)
          reject(result.value);
        return capability.promise;
      }
    });
  }
});

// ../simple-mind-map/node_modules/core-js/modules/es.promise.catch.js
var require_es_promise_catch = __commonJS({
  "../simple-mind-map/node_modules/core-js/modules/es.promise.catch.js"() {
    "use strict";
    var $9 = require_export();
    var IS_PURE3 = require_is_pure();
    var FORCED_PROMISE_CONSTRUCTOR = require_promise_constructor_detection().CONSTRUCTOR;
    var NativePromiseConstructor = require_promise_native_constructor();
    var getBuiltIn = require_get_built_in();
    var isCallable2 = require_is_callable();
    var defineBuiltIn2 = require_define_built_in();
    var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
    $9({ target: "Promise", proto: true, forced: FORCED_PROMISE_CONSTRUCTOR, real: true }, {
      "catch": function(onRejected) {
        return this.then(void 0, onRejected);
      }
    });
    if (!IS_PURE3 && isCallable2(NativePromiseConstructor)) {
      method = getBuiltIn("Promise").prototype["catch"];
      if (NativePromisePrototype["catch"] !== method) {
        defineBuiltIn2(NativePromisePrototype, "catch", method, { unsafe: true });
      }
    }
    var method;
  }
});

// ../simple-mind-map/node_modules/core-js/modules/es.promise.race.js
var require_es_promise_race = __commonJS({
  "../simple-mind-map/node_modules/core-js/modules/es.promise.race.js"() {
    "use strict";
    var $9 = require_export();
    var call4 = require_function_call();
    var aCallable = require_a_callable();
    var newPromiseCapabilityModule = require_new_promise_capability();
    var perform = require_perform();
    var iterate = require_iterate();
    var PROMISE_STATICS_INCORRECT_ITERATION = require_promise_statics_incorrect_iteration();
    $9({ target: "Promise", stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
      race: function race(iterable) {
        var C2 = this;
        var capability = newPromiseCapabilityModule.f(C2);
        var reject = capability.reject;
        var result = perform(function() {
          var $promiseResolve = aCallable(C2.resolve);
          iterate(iterable, function(promise) {
            call4($promiseResolve, C2, promise).then(capability.resolve, reject);
          });
        });
        if (result.error)
          reject(result.value);
        return capability.promise;
      }
    });
  }
});

// ../simple-mind-map/node_modules/core-js/modules/es.promise.reject.js
var require_es_promise_reject = __commonJS({
  "../simple-mind-map/node_modules/core-js/modules/es.promise.reject.js"() {
    "use strict";
    var $9 = require_export();
    var call4 = require_function_call();
    var newPromiseCapabilityModule = require_new_promise_capability();
    var FORCED_PROMISE_CONSTRUCTOR = require_promise_constructor_detection().CONSTRUCTOR;
    $9({ target: "Promise", stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
      reject: function reject(r2) {
        var capability = newPromiseCapabilityModule.f(this);
        call4(capability.reject, void 0, r2);
        return capability.promise;
      }
    });
  }
});

// ../simple-mind-map/node_modules/core-js/internals/promise-resolve.js
var require_promise_resolve = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/promise-resolve.js"(exports, module) {
    var anObject5 = require_an_object();
    var isObject = require_is_object();
    var newPromiseCapability = require_new_promise_capability();
    module.exports = function(C2, x3) {
      anObject5(C2);
      if (isObject(x3) && x3.constructor === C2)
        return x3;
      var promiseCapability = newPromiseCapability.f(C2);
      var resolve = promiseCapability.resolve;
      resolve(x3);
      return promiseCapability.promise;
    };
  }
});

// ../simple-mind-map/node_modules/core-js/modules/es.promise.resolve.js
var require_es_promise_resolve = __commonJS({
  "../simple-mind-map/node_modules/core-js/modules/es.promise.resolve.js"() {
    "use strict";
    var $9 = require_export();
    var getBuiltIn = require_get_built_in();
    var IS_PURE3 = require_is_pure();
    var NativePromiseConstructor = require_promise_native_constructor();
    var FORCED_PROMISE_CONSTRUCTOR = require_promise_constructor_detection().CONSTRUCTOR;
    var promiseResolve = require_promise_resolve();
    var PromiseConstructorWrapper = getBuiltIn("Promise");
    var CHECK_WRAPPER = IS_PURE3 && !FORCED_PROMISE_CONSTRUCTOR;
    $9({ target: "Promise", stat: true, forced: IS_PURE3 || FORCED_PROMISE_CONSTRUCTOR }, {
      resolve: function resolve(x3) {
        return promiseResolve(CHECK_WRAPPER && this === PromiseConstructorWrapper ? NativePromiseConstructor : this, x3);
      }
    });
  }
});

// ../simple-mind-map/node_modules/core-js/modules/es.promise.js
var init_es_promise = __esm({
  "../simple-mind-map/node_modules/core-js/modules/es.promise.js"() {
    require_es_promise_constructor();
    require_es_promise_all();
    require_es_promise_catch();
    require_es_promise_race();
    require_es_promise_reject();
    require_es_promise_resolve();
  }
});

// ../simple-mind-map/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
  try {
    var info = gen[key](arg);
    var value = info.value;
  } catch (error) {
    reject(error);
    return;
  }
  if (info.done) {
    resolve(value);
  } else {
    Promise.resolve(value).then(_next, _throw);
  }
}
function _asyncToGenerator(fn) {
  return function() {
    var self2 = this, args = arguments;
    return new Promise(function(resolve, reject) {
      var gen = fn.apply(self2, args);
      function _next(value) {
        asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
      }
      function _throw(err) {
        asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
      }
      _next(void 0);
    });
  };
}
var init_asyncToGenerator = __esm({
  "../simple-mind-map/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"() {
  }
});

// ../simple-mind-map/node_modules/core-js/internals/to-string.js
var require_to_string = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/to-string.js"(exports, module) {
    var classof = require_classof();
    var $String = String;
    module.exports = function(argument) {
      if (classof(argument) === "Symbol")
        throw TypeError("Cannot convert a Symbol value to a string");
      return $String(argument);
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/regexp-flags.js
var require_regexp_flags = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/regexp-flags.js"(exports, module) {
    "use strict";
    var anObject5 = require_an_object();
    module.exports = function() {
      var that = anObject5(this);
      var result = "";
      if (that.hasIndices)
        result += "d";
      if (that.global)
        result += "g";
      if (that.ignoreCase)
        result += "i";
      if (that.multiline)
        result += "m";
      if (that.dotAll)
        result += "s";
      if (that.unicode)
        result += "u";
      if (that.unicodeSets)
        result += "v";
      if (that.sticky)
        result += "y";
      return result;
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/regexp-sticky-helpers.js
var require_regexp_sticky_helpers = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/regexp-sticky-helpers.js"(exports, module) {
    var fails4 = require_fails();
    var global3 = require_global();
    var $RegExp = global3.RegExp;
    var UNSUPPORTED_Y2 = fails4(function() {
      var re2 = $RegExp("a", "y");
      re2.lastIndex = 2;
      return re2.exec("abcd") != null;
    });
    var MISSED_STICKY = UNSUPPORTED_Y2 || fails4(function() {
      return !$RegExp("a", "y").sticky;
    });
    var BROKEN_CARET = UNSUPPORTED_Y2 || fails4(function() {
      var re2 = $RegExp("^r", "gy");
      re2.lastIndex = 2;
      return re2.exec("str") != null;
    });
    module.exports = {
      BROKEN_CARET,
      MISSED_STICKY,
      UNSUPPORTED_Y: UNSUPPORTED_Y2
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/object-keys.js
var require_object_keys = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/object-keys.js"(exports, module) {
    var internalObjectKeys = require_object_keys_internal();
    var enumBugKeys = require_enum_bug_keys();
    module.exports = Object.keys || function keys(O3) {
      return internalObjectKeys(O3, enumBugKeys);
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/object-define-properties.js
var require_object_define_properties = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/object-define-properties.js"(exports) {
    var DESCRIPTORS = require_descriptors();
    var V8_PROTOTYPE_DEFINE_BUG = require_v8_prototype_define_bug();
    var definePropertyModule = require_object_define_property();
    var anObject5 = require_an_object();
    var toIndexedObject = require_to_indexed_object();
    var objectKeys = require_object_keys();
    exports.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O3, Properties) {
      anObject5(O3);
      var props = toIndexedObject(Properties);
      var keys = objectKeys(Properties);
      var length2 = keys.length;
      var index3 = 0;
      var key;
      while (length2 > index3)
        definePropertyModule.f(O3, key = keys[index3++], props[key]);
      return O3;
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/object-create.js
var require_object_create = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/object-create.js"(exports, module) {
    var anObject5 = require_an_object();
    var definePropertiesModule = require_object_define_properties();
    var enumBugKeys = require_enum_bug_keys();
    var hiddenKeys = require_hidden_keys();
    var html2 = require_html();
    var documentCreateElement = require_document_create_element();
    var sharedKey = require_shared_key();
    var GT = ">";
    var LT = "<";
    var PROTOTYPE = "prototype";
    var SCRIPT = "script";
    var IE_PROTO = sharedKey("IE_PROTO");
    var EmptyConstructor = function() {
    };
    var scriptTag = function(content3) {
      return LT + SCRIPT + GT + content3 + LT + "/" + SCRIPT + GT;
    };
    var NullProtoObjectViaActiveX = function(activeXDocument2) {
      activeXDocument2.write(scriptTag(""));
      activeXDocument2.close();
      var temp = activeXDocument2.parentWindow.Object;
      activeXDocument2 = null;
      return temp;
    };
    var NullProtoObjectViaIFrame = function() {
      var iframe = documentCreateElement("iframe");
      var JS = "java" + SCRIPT + ":";
      var iframeDocument;
      iframe.style.display = "none";
      html2.appendChild(iframe);
      iframe.src = String(JS);
      iframeDocument = iframe.contentWindow.document;
      iframeDocument.open();
      iframeDocument.write(scriptTag("document.F=Object"));
      iframeDocument.close();
      return iframeDocument.F;
    };
    var activeXDocument;
    var NullProtoObject = function() {
      try {
        activeXDocument = new ActiveXObject("htmlfile");
      } catch (error) {
      }
      NullProtoObject = typeof document != "undefined" ? document.domain && activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame() : NullProtoObjectViaActiveX(activeXDocument);
      var length2 = enumBugKeys.length;
      while (length2--)
        delete NullProtoObject[PROTOTYPE][enumBugKeys[length2]];
      return NullProtoObject();
    };
    hiddenKeys[IE_PROTO] = true;
    module.exports = Object.create || function create2(O3, Properties) {
      var result;
      if (O3 !== null) {
        EmptyConstructor[PROTOTYPE] = anObject5(O3);
        result = new EmptyConstructor();
        EmptyConstructor[PROTOTYPE] = null;
        result[IE_PROTO] = O3;
      } else
        result = NullProtoObject();
      return Properties === void 0 ? result : definePropertiesModule.f(result, Properties);
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/regexp-unsupported-dot-all.js
var require_regexp_unsupported_dot_all = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/regexp-unsupported-dot-all.js"(exports, module) {
    var fails4 = require_fails();
    var global3 = require_global();
    var $RegExp = global3.RegExp;
    module.exports = fails4(function() {
      var re2 = $RegExp(".", "s");
      return !(re2.dotAll && re2.exec("\n") && re2.flags === "s");
    });
  }
});

// ../simple-mind-map/node_modules/core-js/internals/regexp-unsupported-ncg.js
var require_regexp_unsupported_ncg = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/regexp-unsupported-ncg.js"(exports, module) {
    var fails4 = require_fails();
    var global3 = require_global();
    var $RegExp = global3.RegExp;
    module.exports = fails4(function() {
      var re2 = $RegExp("(?<a>b)", "g");
      return re2.exec("b").groups.a !== "b" || "b".replace(re2, "$<a>c") !== "bc";
    });
  }
});

// ../simple-mind-map/node_modules/core-js/internals/regexp-exec.js
var require_regexp_exec = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/regexp-exec.js"(exports, module) {
    "use strict";
    var call4 = require_function_call();
    var uncurryThis8 = require_function_uncurry_this();
    var toString8 = require_to_string();
    var regexpFlags = require_regexp_flags();
    var stickyHelpers2 = require_regexp_sticky_helpers();
    var shared = require_shared();
    var create2 = require_object_create();
    var getInternalState = require_internal_state().get;
    var UNSUPPORTED_DOT_ALL = require_regexp_unsupported_dot_all();
    var UNSUPPORTED_NCG = require_regexp_unsupported_ncg();
    var nativeReplace = shared("native-string-replace", String.prototype.replace);
    var nativeExec = RegExp.prototype.exec;
    var patchedExec = nativeExec;
    var charAt = uncurryThis8("".charAt);
    var indexOf2 = uncurryThis8("".indexOf);
    var replace = uncurryThis8("".replace);
    var stringSlice4 = uncurryThis8("".slice);
    var UPDATES_LAST_INDEX_WRONG = function() {
      var re1 = /a/;
      var re2 = /b*/g;
      call4(nativeExec, re1, "a");
      call4(nativeExec, re2, "a");
      return re1.lastIndex !== 0 || re2.lastIndex !== 0;
    }();
    var UNSUPPORTED_Y2 = stickyHelpers2.BROKEN_CARET;
    var NPCG_INCLUDED = /()??/.exec("")[1] !== void 0;
    var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y2 || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG;
    if (PATCH) {
      patchedExec = function exec2(string3) {
        var re2 = this;
        var state = getInternalState(re2);
        var str = toString8(string3);
        var raw = state.raw;
        var result, reCopy, lastIndex, match, i3, object, group;
        if (raw) {
          raw.lastIndex = re2.lastIndex;
          result = call4(patchedExec, raw, str);
          re2.lastIndex = raw.lastIndex;
          return result;
        }
        var groups = state.groups;
        var sticky = UNSUPPORTED_Y2 && re2.sticky;
        var flags = call4(regexpFlags, re2);
        var source = re2.source;
        var charsAdded = 0;
        var strCopy = str;
        if (sticky) {
          flags = replace(flags, "y", "");
          if (indexOf2(flags, "g") === -1) {
            flags += "g";
          }
          strCopy = stringSlice4(str, re2.lastIndex);
          if (re2.lastIndex > 0 && (!re2.multiline || re2.multiline && charAt(str, re2.lastIndex - 1) !== "\n")) {
            source = "(?: " + source + ")";
            strCopy = " " + strCopy;
            charsAdded++;
          }
          reCopy = new RegExp("^(?:" + source + ")", flags);
        }
        if (NPCG_INCLUDED) {
          reCopy = new RegExp("^" + source + "$(?!\\s)", flags);
        }
        if (UPDATES_LAST_INDEX_WRONG)
          lastIndex = re2.lastIndex;
        match = call4(nativeExec, sticky ? reCopy : re2, strCopy);
        if (sticky) {
          if (match) {
            match.input = stringSlice4(match.input, charsAdded);
            match[0] = stringSlice4(match[0], charsAdded);
            match.index = re2.lastIndex;
            re2.lastIndex += match[0].length;
          } else
            re2.lastIndex = 0;
        } else if (UPDATES_LAST_INDEX_WRONG && match) {
          re2.lastIndex = re2.global ? match.index + match[0].length : lastIndex;
        }
        if (NPCG_INCLUDED && match && match.length > 1) {
          call4(nativeReplace, match[0], reCopy, function() {
            for (i3 = 1; i3 < arguments.length - 2; i3++) {
              if (arguments[i3] === void 0)
                match[i3] = void 0;
            }
          });
        }
        if (match && groups) {
          match.groups = object = create2(null);
          for (i3 = 0; i3 < groups.length; i3++) {
            group = groups[i3];
            object[group[0]] = match[group[1]];
          }
        }
        return match;
      };
    }
    module.exports = patchedExec;
  }
});

// ../simple-mind-map/node_modules/core-js/modules/es.regexp.exec.js
var require_es_regexp_exec = __commonJS({
  "../simple-mind-map/node_modules/core-js/modules/es.regexp.exec.js"() {
    "use strict";
    var $9 = require_export();
    var exec2 = require_regexp_exec();
    $9({ target: "RegExp", proto: true, forced: /./.exec !== exec2 }, {
      exec: exec2
    });
  }
});

// ../simple-mind-map/node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js
var require_fix_regexp_well_known_symbol_logic = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js"(exports, module) {
    "use strict";
    require_es_regexp_exec();
    var uncurryThis8 = require_function_uncurry_this_clause();
    var defineBuiltIn2 = require_define_built_in();
    var regexpExec2 = require_regexp_exec();
    var fails4 = require_fails();
    var wellKnownSymbol3 = require_well_known_symbol();
    var createNonEnumerableProperty2 = require_create_non_enumerable_property();
    var SPECIES = wellKnownSymbol3("species");
    var RegExpPrototype2 = RegExp.prototype;
    module.exports = function(KEY, exec2, FORCED, SHAM) {
      var SYMBOL = wellKnownSymbol3(KEY);
      var DELEGATES_TO_SYMBOL = !fails4(function() {
        var O3 = {};
        O3[SYMBOL] = function() {
          return 7;
        };
        return ""[KEY](O3) != 7;
      });
      var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails4(function() {
        var execCalled = false;
        var re2 = /a/;
        if (KEY === "split") {
          re2 = {};
          re2.constructor = {};
          re2.constructor[SPECIES] = function() {
            return re2;
          };
          re2.flags = "";
          re2[SYMBOL] = /./[SYMBOL];
        }
        re2.exec = function() {
          execCalled = true;
          return null;
        };
        re2[SYMBOL]("");
        return !execCalled;
      });
      if (!DELEGATES_TO_SYMBOL || !DELEGATES_TO_EXEC || FORCED) {
        var uncurriedNativeRegExpMethod = uncurryThis8(/./[SYMBOL]);
        var methods2 = exec2(SYMBOL, ""[KEY], function(nativeMethod, regexp, str, arg2, forceStringMethod) {
          var uncurriedNativeMethod = uncurryThis8(nativeMethod);
          var $exec = regexp.exec;
          if ($exec === regexpExec2 || $exec === RegExpPrototype2.exec) {
            if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
              return { done: true, value: uncurriedNativeRegExpMethod(regexp, str, arg2) };
            }
            return { done: true, value: uncurriedNativeMethod(str, regexp, arg2) };
          }
          return { done: false };
        });
        defineBuiltIn2(String.prototype, KEY, methods2[0]);
        defineBuiltIn2(RegExpPrototype2, SYMBOL, methods2[1]);
      }
      if (SHAM)
        createNonEnumerableProperty2(RegExpPrototype2[SYMBOL], "sham", true);
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/string-multibyte.js
var require_string_multibyte = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/string-multibyte.js"(exports, module) {
    var uncurryThis8 = require_function_uncurry_this();
    var toIntegerOrInfinity2 = require_to_integer_or_infinity();
    var toString8 = require_to_string();
    var requireObjectCoercible7 = require_require_object_coercible();
    var charAt = uncurryThis8("".charAt);
    var charCodeAt = uncurryThis8("".charCodeAt);
    var stringSlice4 = uncurryThis8("".slice);
    var createMethod = function(CONVERT_TO_STRING) {
      return function($this, pos) {
        var S2 = toString8(requireObjectCoercible7($this));
        var position3 = toIntegerOrInfinity2(pos);
        var size2 = S2.length;
        var first, second;
        if (position3 < 0 || position3 >= size2)
          return CONVERT_TO_STRING ? "" : void 0;
        first = charCodeAt(S2, position3);
        return first < 55296 || first > 56319 || position3 + 1 === size2 || (second = charCodeAt(S2, position3 + 1)) < 56320 || second > 57343 ? CONVERT_TO_STRING ? charAt(S2, position3) : first : CONVERT_TO_STRING ? stringSlice4(S2, position3, position3 + 2) : (first - 55296 << 10) + (second - 56320) + 65536;
      };
    };
    module.exports = {
      // `String.prototype.codePointAt` method
      // https://tc39.es/ecma262/#sec-string.prototype.codepointat
      codeAt: createMethod(false),
      // `String.prototype.at` method
      // https://github.com/mathiasbynens/String.prototype.at
      charAt: createMethod(true)
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/advance-string-index.js
var require_advance_string_index = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/advance-string-index.js"(exports, module) {
    "use strict";
    var charAt = require_string_multibyte().charAt;
    module.exports = function(S2, index3, unicode) {
      return index3 + (unicode ? charAt(S2, index3).length : 1);
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/regexp-exec-abstract.js
var require_regexp_exec_abstract = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/regexp-exec-abstract.js"(exports, module) {
    var call4 = require_function_call();
    var anObject5 = require_an_object();
    var isCallable2 = require_is_callable();
    var classof = require_classof_raw();
    var regexpExec2 = require_regexp_exec();
    var $TypeError = TypeError;
    module.exports = function(R2, S2) {
      var exec2 = R2.exec;
      if (isCallable2(exec2)) {
        var result = call4(exec2, R2, S2);
        if (result !== null)
          anObject5(result);
        return result;
      }
      if (classof(R2) === "RegExp")
        return call4(regexpExec2, R2, S2);
      throw $TypeError("RegExp#exec called on incompatible receiver");
    };
  }
});

// ../simple-mind-map/node_modules/core-js/modules/es.string.match.js
var call, fixRegExpWellKnownSymbolLogic, anObject, isNullOrUndefined, toLength, toString, requireObjectCoercible, getMethod, advanceStringIndex, regExpExec;
var init_es_string_match = __esm({
  "../simple-mind-map/node_modules/core-js/modules/es.string.match.js"() {
    "use strict";
    call = require_function_call();
    fixRegExpWellKnownSymbolLogic = require_fix_regexp_well_known_symbol_logic();
    anObject = require_an_object();
    isNullOrUndefined = require_is_null_or_undefined();
    toLength = require_to_length();
    toString = require_to_string();
    requireObjectCoercible = require_require_object_coercible();
    getMethod = require_get_method();
    advanceStringIndex = require_advance_string_index();
    regExpExec = require_regexp_exec_abstract();
    fixRegExpWellKnownSymbolLogic("match", function(MATCH, nativeMatch, maybeCallNative) {
      return [
        // `String.prototype.match` method
        // https://tc39.es/ecma262/#sec-string.prototype.match
        function match(regexp) {
          var O3 = requireObjectCoercible(this);
          var matcher = isNullOrUndefined(regexp) ? void 0 : getMethod(regexp, MATCH);
          return matcher ? call(matcher, regexp, O3) : new RegExp(regexp)[MATCH](toString(O3));
        },
        // `RegExp.prototype[@@match]` method
        // https://tc39.es/ecma262/#sec-regexp.prototype-@@match
        function(string3) {
          var rx2 = anObject(this);
          var S2 = toString(string3);
          var res = maybeCallNative(nativeMatch, rx2, S2);
          if (res.done)
            return res.value;
          if (!rx2.global)
            return regExpExec(rx2, S2);
          var fullUnicode = rx2.unicode;
          rx2.lastIndex = 0;
          var A3 = [];
          var n3 = 0;
          var result;
          while ((result = regExpExec(rx2, S2)) !== null) {
            var matchStr = toString(result[0]);
            A3[n3] = matchStr;
            if (matchStr === "")
              rx2.lastIndex = advanceStringIndex(S2, toLength(rx2.lastIndex), fullUnicode);
            n3++;
          }
          return n3 === 0 ? null : A3;
        }
      ];
    });
  }
});

// ../simple-mind-map/node_modules/core-js/internals/get-substitution.js
var require_get_substitution = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/get-substitution.js"(exports, module) {
    var uncurryThis8 = require_function_uncurry_this();
    var toObject = require_to_object();
    var floor = Math.floor;
    var charAt = uncurryThis8("".charAt);
    var replace = uncurryThis8("".replace);
    var stringSlice4 = uncurryThis8("".slice);
    var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
    var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
    module.exports = function(matched, str, position3, captures, namedCaptures, replacement) {
      var tailPos = position3 + matched.length;
      var m4 = captures.length;
      var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
      if (namedCaptures !== void 0) {
        namedCaptures = toObject(namedCaptures);
        symbols = SUBSTITUTION_SYMBOLS;
      }
      return replace(replacement, symbols, function(match, ch) {
        var capture;
        switch (charAt(ch, 0)) {
          case "$":
            return "$";
          case "&":
            return matched;
          case "`":
            return stringSlice4(str, 0, position3);
          case "'":
            return stringSlice4(str, tailPos);
          case "<":
            capture = namedCaptures[stringSlice4(ch, 1, -1)];
            break;
          default:
            var n3 = +ch;
            if (n3 === 0)
              return match;
            if (n3 > m4) {
              var f3 = floor(n3 / 10);
              if (f3 === 0)
                return match;
              if (f3 <= m4)
                return captures[f3 - 1] === void 0 ? charAt(ch, 1) : captures[f3 - 1] + charAt(ch, 1);
              return match;
            }
            capture = captures[n3 - 1];
        }
        return capture === void 0 ? "" : capture;
      });
    };
  }
});

// ../simple-mind-map/node_modules/core-js/modules/es.string.replace.js
var apply, call2, uncurryThis, fixRegExpWellKnownSymbolLogic2, fails, anObject2, isCallable, isNullOrUndefined2, toIntegerOrInfinity, toLength2, toString2, requireObjectCoercible2, advanceStringIndex2, getMethod2, getSubstitution, regExpExec2, wellKnownSymbol, REPLACE, max2, min, concat, push, stringIndexOf, stringSlice, maybeToString, REPLACE_KEEPS_$0, REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE, REPLACE_SUPPORTS_NAMED_GROUPS;
var init_es_string_replace = __esm({
  "../simple-mind-map/node_modules/core-js/modules/es.string.replace.js"() {
    "use strict";
    apply = require_function_apply();
    call2 = require_function_call();
    uncurryThis = require_function_uncurry_this();
    fixRegExpWellKnownSymbolLogic2 = require_fix_regexp_well_known_symbol_logic();
    fails = require_fails();
    anObject2 = require_an_object();
    isCallable = require_is_callable();
    isNullOrUndefined2 = require_is_null_or_undefined();
    toIntegerOrInfinity = require_to_integer_or_infinity();
    toLength2 = require_to_length();
    toString2 = require_to_string();
    requireObjectCoercible2 = require_require_object_coercible();
    advanceStringIndex2 = require_advance_string_index();
    getMethod2 = require_get_method();
    getSubstitution = require_get_substitution();
    regExpExec2 = require_regexp_exec_abstract();
    wellKnownSymbol = require_well_known_symbol();
    REPLACE = wellKnownSymbol("replace");
    max2 = Math.max;
    min = Math.min;
    concat = uncurryThis([].concat);
    push = uncurryThis([].push);
    stringIndexOf = uncurryThis("".indexOf);
    stringSlice = uncurryThis("".slice);
    maybeToString = function(it2) {
      return it2 === void 0 ? it2 : String(it2);
    };
    REPLACE_KEEPS_$0 = function() {
      return "a".replace(/./, "$0") === "$0";
    }();
    REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = function() {
      if (/./[REPLACE]) {
        return /./[REPLACE]("a", "$0") === "";
      }
      return false;
    }();
    REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function() {
      var re2 = /./;
      re2.exec = function() {
        var result = [];
        result.groups = { a: "7" };
        return result;
      };
      return "".replace(re2, "$<a>") !== "7";
    });
    fixRegExpWellKnownSymbolLogic2("replace", function(_3, nativeReplace, maybeCallNative) {
      var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? "$" : "$0";
      return [
        // `String.prototype.replace` method
        // https://tc39.es/ecma262/#sec-string.prototype.replace
        function replace(searchValue, replaceValue) {
          var O3 = requireObjectCoercible2(this);
          var replacer = isNullOrUndefined2(searchValue) ? void 0 : getMethod2(searchValue, REPLACE);
          return replacer ? call2(replacer, searchValue, O3, replaceValue) : call2(nativeReplace, toString2(O3), searchValue, replaceValue);
        },
        // `RegExp.prototype[@@replace]` method
        // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
        function(string3, replaceValue) {
          var rx2 = anObject2(this);
          var S2 = toString2(string3);
          if (typeof replaceValue == "string" && stringIndexOf(replaceValue, UNSAFE_SUBSTITUTE) === -1 && stringIndexOf(replaceValue, "$<") === -1) {
            var res = maybeCallNative(nativeReplace, rx2, S2, replaceValue);
            if (res.done)
              return res.value;
          }
          var functionalReplace = isCallable(replaceValue);
          if (!functionalReplace)
            replaceValue = toString2(replaceValue);
          var global3 = rx2.global;
          if (global3) {
            var fullUnicode = rx2.unicode;
            rx2.lastIndex = 0;
          }
          var results = [];
          while (true) {
            var result = regExpExec2(rx2, S2);
            if (result === null)
              break;
            push(results, result);
            if (!global3)
              break;
            var matchStr = toString2(result[0]);
            if (matchStr === "")
              rx2.lastIndex = advanceStringIndex2(S2, toLength2(rx2.lastIndex), fullUnicode);
          }
          var accumulatedResult = "";
          var nextSourcePosition = 0;
          for (var i3 = 0; i3 < results.length; i3++) {
            result = results[i3];
            var matched = toString2(result[0]);
            var position3 = max2(min(toIntegerOrInfinity(result.index), S2.length), 0);
            var captures = [];
            for (var j2 = 1; j2 < result.length; j2++)
              push(captures, maybeToString(result[j2]));
            var namedCaptures = result.groups;
            if (functionalReplace) {
              var replacerArgs = concat([matched], captures, position3, S2);
              if (namedCaptures !== void 0)
                push(replacerArgs, namedCaptures);
              var replacement = toString2(apply(replaceValue, void 0, replacerArgs));
            } else {
              replacement = getSubstitution(matched, S2, position3, captures, namedCaptures, replaceValue);
            }
            if (position3 >= nextSourcePosition) {
              accumulatedResult += stringSlice(S2, nextSourcePosition, position3) + replacement;
              nextSourcePosition = position3 + matched.length;
            }
          }
          return accumulatedResult + stringSlice(S2, nextSourcePosition);
        }
      ];
    }, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);
  }
});

// ../simple-mind-map/node_modules/core-js/internals/is-regexp.js
var require_is_regexp = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/is-regexp.js"(exports, module) {
    var isObject = require_is_object();
    var classof = require_classof_raw();
    var wellKnownSymbol3 = require_well_known_symbol();
    var MATCH = wellKnownSymbol3("match");
    module.exports = function(it2) {
      var isRegExp2;
      return isObject(it2) && ((isRegExp2 = it2[MATCH]) !== void 0 ? !!isRegExp2 : classof(it2) == "RegExp");
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/not-a-regexp.js
var require_not_a_regexp = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/not-a-regexp.js"(exports, module) {
    var isRegExp2 = require_is_regexp();
    var $TypeError = TypeError;
    module.exports = function(it2) {
      if (isRegExp2(it2)) {
        throw $TypeError("The method doesn't accept regular expressions");
      }
      return it2;
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/correct-is-regexp-logic.js
var require_correct_is_regexp_logic = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/correct-is-regexp-logic.js"(exports, module) {
    var wellKnownSymbol3 = require_well_known_symbol();
    var MATCH = wellKnownSymbol3("match");
    module.exports = function(METHOD_NAME) {
      var regexp = /./;
      try {
        "/./"[METHOD_NAME](regexp);
      } catch (error1) {
        try {
          regexp[MATCH] = false;
          return "/./"[METHOD_NAME](regexp);
        } catch (error2) {
        }
      }
      return false;
    };
  }
});

// ../simple-mind-map/node_modules/core-js/modules/es.string.starts-with.js
var $, uncurryThis2, getOwnPropertyDescriptor, toLength3, toString3, notARegExp, requireObjectCoercible3, correctIsRegExpLogic, IS_PURE, nativeStartsWith, stringSlice2, min2, CORRECT_IS_REGEXP_LOGIC, MDN_POLYFILL_BUG;
var init_es_string_starts_with = __esm({
  "../simple-mind-map/node_modules/core-js/modules/es.string.starts-with.js"() {
    "use strict";
    $ = require_export();
    uncurryThis2 = require_function_uncurry_this_clause();
    getOwnPropertyDescriptor = require_object_get_own_property_descriptor().f;
    toLength3 = require_to_length();
    toString3 = require_to_string();
    notARegExp = require_not_a_regexp();
    requireObjectCoercible3 = require_require_object_coercible();
    correctIsRegExpLogic = require_correct_is_regexp_logic();
    IS_PURE = require_is_pure();
    nativeStartsWith = uncurryThis2("".startsWith);
    stringSlice2 = uncurryThis2("".slice);
    min2 = Math.min;
    CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic("startsWith");
    MDN_POLYFILL_BUG = !IS_PURE && !CORRECT_IS_REGEXP_LOGIC && !!function() {
      var descriptor = getOwnPropertyDescriptor(String.prototype, "startsWith");
      return descriptor && !descriptor.writable;
    }();
    $({ target: "String", proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, {
      startsWith: function startsWith(searchString) {
        var that = toString3(requireObjectCoercible3(this));
        notARegExp(searchString);
        var index3 = toLength3(min2(arguments.length > 1 ? arguments[1] : void 0, that.length));
        var search2 = toString3(searchString);
        return nativeStartsWith ? nativeStartsWith(that, search2, index3) : stringSlice2(that, index3, index3 + search2.length) === search2;
      }
    });
  }
});

// ../simple-mind-map/node_modules/core-js/internals/add-to-unscopables.js
var require_add_to_unscopables = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/add-to-unscopables.js"(exports, module) {
    var wellKnownSymbol3 = require_well_known_symbol();
    var create2 = require_object_create();
    var defineProperty = require_object_define_property().f;
    var UNSCOPABLES = wellKnownSymbol3("unscopables");
    var ArrayPrototype = Array.prototype;
    if (ArrayPrototype[UNSCOPABLES] == void 0) {
      defineProperty(ArrayPrototype, UNSCOPABLES, {
        configurable: true,
        value: create2(null)
      });
    }
    module.exports = function(key) {
      ArrayPrototype[UNSCOPABLES][key] = true;
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/correct-prototype-getter.js
var require_correct_prototype_getter = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/correct-prototype-getter.js"(exports, module) {
    var fails4 = require_fails();
    module.exports = !fails4(function() {
      function F2() {
      }
      F2.prototype.constructor = null;
      return Object.getPrototypeOf(new F2()) !== F2.prototype;
    });
  }
});

// ../simple-mind-map/node_modules/core-js/internals/object-get-prototype-of.js
var require_object_get_prototype_of = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/object-get-prototype-of.js"(exports, module) {
    var hasOwn = require_has_own_property();
    var isCallable2 = require_is_callable();
    var toObject = require_to_object();
    var sharedKey = require_shared_key();
    var CORRECT_PROTOTYPE_GETTER = require_correct_prototype_getter();
    var IE_PROTO = sharedKey("IE_PROTO");
    var $Object = Object;
    var ObjectPrototype = $Object.prototype;
    module.exports = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function(O3) {
      var object = toObject(O3);
      if (hasOwn(object, IE_PROTO))
        return object[IE_PROTO];
      var constructor = object.constructor;
      if (isCallable2(constructor) && object instanceof constructor) {
        return constructor.prototype;
      }
      return object instanceof $Object ? ObjectPrototype : null;
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/iterators-core.js
var require_iterators_core = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/iterators-core.js"(exports, module) {
    "use strict";
    var fails4 = require_fails();
    var isCallable2 = require_is_callable();
    var isObject = require_is_object();
    var create2 = require_object_create();
    var getPrototypeOf = require_object_get_prototype_of();
    var defineBuiltIn2 = require_define_built_in();
    var wellKnownSymbol3 = require_well_known_symbol();
    var IS_PURE3 = require_is_pure();
    var ITERATOR2 = wellKnownSymbol3("iterator");
    var BUGGY_SAFARI_ITERATORS = false;
    var IteratorPrototype;
    var PrototypeOfArrayIteratorPrototype;
    var arrayIterator;
    if ([].keys) {
      arrayIterator = [].keys();
      if (!("next" in arrayIterator))
        BUGGY_SAFARI_ITERATORS = true;
      else {
        PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));
        if (PrototypeOfArrayIteratorPrototype !== Object.prototype)
          IteratorPrototype = PrototypeOfArrayIteratorPrototype;
      }
    }
    var NEW_ITERATOR_PROTOTYPE = !isObject(IteratorPrototype) || fails4(function() {
      var test2 = {};
      return IteratorPrototype[ITERATOR2].call(test2) !== test2;
    });
    if (NEW_ITERATOR_PROTOTYPE)
      IteratorPrototype = {};
    else if (IS_PURE3)
      IteratorPrototype = create2(IteratorPrototype);
    if (!isCallable2(IteratorPrototype[ITERATOR2])) {
      defineBuiltIn2(IteratorPrototype, ITERATOR2, function() {
        return this;
      });
    }
    module.exports = {
      IteratorPrototype,
      BUGGY_SAFARI_ITERATORS
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/iterator-create-constructor.js
var require_iterator_create_constructor = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/iterator-create-constructor.js"(exports, module) {
    "use strict";
    var IteratorPrototype = require_iterators_core().IteratorPrototype;
    var create2 = require_object_create();
    var createPropertyDescriptor = require_create_property_descriptor();
    var setToStringTag = require_set_to_string_tag();
    var Iterators = require_iterators();
    var returnThis = function() {
      return this;
    };
    module.exports = function(IteratorConstructor, NAME, next2, ENUMERABLE_NEXT) {
      var TO_STRING_TAG2 = NAME + " Iterator";
      IteratorConstructor.prototype = create2(IteratorPrototype, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next2) });
      setToStringTag(IteratorConstructor, TO_STRING_TAG2, false, true);
      Iterators[TO_STRING_TAG2] = returnThis;
      return IteratorConstructor;
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/iterator-define.js
var require_iterator_define = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/iterator-define.js"(exports, module) {
    "use strict";
    var $9 = require_export();
    var call4 = require_function_call();
    var IS_PURE3 = require_is_pure();
    var FunctionName = require_function_name();
    var isCallable2 = require_is_callable();
    var createIteratorConstructor = require_iterator_create_constructor();
    var getPrototypeOf = require_object_get_prototype_of();
    var setPrototypeOf = require_object_set_prototype_of();
    var setToStringTag = require_set_to_string_tag();
    var createNonEnumerableProperty2 = require_create_non_enumerable_property();
    var defineBuiltIn2 = require_define_built_in();
    var wellKnownSymbol3 = require_well_known_symbol();
    var Iterators = require_iterators();
    var IteratorsCore = require_iterators_core();
    var PROPER_FUNCTION_NAME2 = FunctionName.PROPER;
    var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
    var IteratorPrototype = IteratorsCore.IteratorPrototype;
    var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
    var ITERATOR2 = wellKnownSymbol3("iterator");
    var KEYS = "keys";
    var VALUES = "values";
    var ENTRIES = "entries";
    var returnThis = function() {
      return this;
    };
    module.exports = function(Iterable, NAME, IteratorConstructor, next2, DEFAULT, IS_SET, FORCED) {
      createIteratorConstructor(IteratorConstructor, NAME, next2);
      var getIterationMethod = function(KIND) {
        if (KIND === DEFAULT && defaultIterator)
          return defaultIterator;
        if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype)
          return IterablePrototype[KIND];
        switch (KIND) {
          case KEYS:
            return function keys() {
              return new IteratorConstructor(this, KIND);
            };
          case VALUES:
            return function values() {
              return new IteratorConstructor(this, KIND);
            };
          case ENTRIES:
            return function entries() {
              return new IteratorConstructor(this, KIND);
            };
        }
        return function() {
          return new IteratorConstructor(this);
        };
      };
      var TO_STRING_TAG2 = NAME + " Iterator";
      var INCORRECT_VALUES_NAME = false;
      var IterablePrototype = Iterable.prototype;
      var nativeIterator = IterablePrototype[ITERATOR2] || IterablePrototype["@@iterator"] || DEFAULT && IterablePrototype[DEFAULT];
      var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
      var anyNativeIterator = NAME == "Array" ? IterablePrototype.entries || nativeIterator : nativeIterator;
      var CurrentIteratorPrototype, methods2, KEY;
      if (anyNativeIterator) {
        CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
        if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
          if (!IS_PURE3 && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
            if (setPrototypeOf) {
              setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
            } else if (!isCallable2(CurrentIteratorPrototype[ITERATOR2])) {
              defineBuiltIn2(CurrentIteratorPrototype, ITERATOR2, returnThis);
            }
          }
          setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG2, true, true);
          if (IS_PURE3)
            Iterators[TO_STRING_TAG2] = returnThis;
        }
      }
      if (PROPER_FUNCTION_NAME2 && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
        if (!IS_PURE3 && CONFIGURABLE_FUNCTION_NAME) {
          createNonEnumerableProperty2(IterablePrototype, "name", VALUES);
        } else {
          INCORRECT_VALUES_NAME = true;
          defaultIterator = function values() {
            return call4(nativeIterator, this);
          };
        }
      }
      if (DEFAULT) {
        methods2 = {
          values: getIterationMethod(VALUES),
          keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
          entries: getIterationMethod(ENTRIES)
        };
        if (FORCED)
          for (KEY in methods2) {
            if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
              defineBuiltIn2(IterablePrototype, KEY, methods2[KEY]);
            }
          }
        else
          $9({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods2);
      }
      if ((!IS_PURE3 || FORCED) && IterablePrototype[ITERATOR2] !== defaultIterator) {
        defineBuiltIn2(IterablePrototype, ITERATOR2, defaultIterator, { name: DEFAULT });
      }
      Iterators[NAME] = defaultIterator;
      return methods2;
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/create-iter-result-object.js
var require_create_iter_result_object = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/create-iter-result-object.js"(exports, module) {
    module.exports = function(value, done) {
      return { value, done };
    };
  }
});

// ../simple-mind-map/node_modules/core-js/modules/es.array.iterator.js
var require_es_array_iterator = __commonJS({
  "../simple-mind-map/node_modules/core-js/modules/es.array.iterator.js"(exports, module) {
    "use strict";
    var toIndexedObject = require_to_indexed_object();
    var addToUnscopables = require_add_to_unscopables();
    var Iterators = require_iterators();
    var InternalStateModule = require_internal_state();
    var defineProperty = require_object_define_property().f;
    var defineIterator = require_iterator_define();
    var createIterResultObject = require_create_iter_result_object();
    var IS_PURE3 = require_is_pure();
    var DESCRIPTORS = require_descriptors();
    var ARRAY_ITERATOR = "Array Iterator";
    var setInternalState = InternalStateModule.set;
    var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
    module.exports = defineIterator(Array, "Array", function(iterated, kind) {
      setInternalState(this, {
        type: ARRAY_ITERATOR,
        target: toIndexedObject(iterated),
        // target
        index: 0,
        // next index
        kind
        // kind
      });
    }, function() {
      var state = getInternalState(this);
      var target = state.target;
      var kind = state.kind;
      var index3 = state.index++;
      if (!target || index3 >= target.length) {
        state.target = void 0;
        return createIterResultObject(void 0, true);
      }
      if (kind == "keys")
        return createIterResultObject(index3, false);
      if (kind == "values")
        return createIterResultObject(target[index3], false);
      return createIterResultObject([index3, target[index3]], false);
    }, "values");
    var values = Iterators.Arguments = Iterators.Array;
    addToUnscopables("keys");
    addToUnscopables("values");
    addToUnscopables("entries");
    if (!IS_PURE3 && DESCRIPTORS && values.name !== "values")
      try {
        defineProperty(values, "name", { value: "values" });
      } catch (error) {
      }
  }
});

// ../simple-mind-map/node_modules/core-js/internals/dom-iterables.js
var require_dom_iterables = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/dom-iterables.js"(exports, module) {
    module.exports = {
      CSSRuleList: 0,
      CSSStyleDeclaration: 0,
      CSSValueList: 0,
      ClientRectList: 0,
      DOMRectList: 0,
      DOMStringList: 0,
      DOMTokenList: 1,
      DataTransferItemList: 0,
      FileList: 0,
      HTMLAllCollection: 0,
      HTMLCollection: 0,
      HTMLFormElement: 0,
      HTMLSelectElement: 0,
      MediaList: 0,
      MimeTypeArray: 0,
      NamedNodeMap: 0,
      NodeList: 1,
      PaintRequestList: 0,
      Plugin: 0,
      PluginArray: 0,
      SVGLengthList: 0,
      SVGNumberList: 0,
      SVGPathSegList: 0,
      SVGPointList: 0,
      SVGStringList: 0,
      SVGTransformList: 0,
      SourceBufferList: 0,
      StyleSheetList: 0,
      TextTrackCueList: 0,
      TextTrackList: 0,
      TouchList: 0
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/dom-token-list-prototype.js
var require_dom_token_list_prototype = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/dom-token-list-prototype.js"(exports, module) {
    var documentCreateElement = require_document_create_element();
    var classList = documentCreateElement("span").classList;
    var DOMTokenListPrototype2 = classList && classList.constructor && classList.constructor.prototype;
    module.exports = DOMTokenListPrototype2 === Object.prototype ? void 0 : DOMTokenListPrototype2;
  }
});

// ../simple-mind-map/node_modules/core-js/modules/web.dom-collections.iterator.js
var global2, DOMIterables, DOMTokenListPrototype, ArrayIteratorMethods, createNonEnumerableProperty, wellKnownSymbol2, ITERATOR, TO_STRING_TAG, ArrayValues, handlePrototype, COLLECTION_NAME;
var init_web_dom_collections_iterator = __esm({
  "../simple-mind-map/node_modules/core-js/modules/web.dom-collections.iterator.js"() {
    global2 = require_global();
    DOMIterables = require_dom_iterables();
    DOMTokenListPrototype = require_dom_token_list_prototype();
    ArrayIteratorMethods = require_es_array_iterator();
    createNonEnumerableProperty = require_create_non_enumerable_property();
    wellKnownSymbol2 = require_well_known_symbol();
    ITERATOR = wellKnownSymbol2("iterator");
    TO_STRING_TAG = wellKnownSymbol2("toStringTag");
    ArrayValues = ArrayIteratorMethods.values;
    handlePrototype = function(CollectionPrototype, COLLECTION_NAME) {
      if (CollectionPrototype) {
        if (CollectionPrototype[ITERATOR] !== ArrayValues)
          try {
            createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);
          } catch (error) {
            CollectionPrototype[ITERATOR] = ArrayValues;
          }
        if (!CollectionPrototype[TO_STRING_TAG]) {
          createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);
        }
        if (DOMIterables[COLLECTION_NAME])
          for (var METHOD_NAME in ArrayIteratorMethods) {
            if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME])
              try {
                createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
              } catch (error) {
                CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
              }
          }
      }
    };
    for (COLLECTION_NAME in DOMIterables) {
      handlePrototype(global2[COLLECTION_NAME] && global2[COLLECTION_NAME].prototype, COLLECTION_NAME);
    }
    handlePrototype(DOMTokenListPrototype, "DOMTokenList");
  }
});

// ../simple-mind-map/node_modules/@babel/runtime/helpers/esm/toPrimitive.js
function _toPrimitive(input, hint) {
  if (_typeof(input) !== "object" || input === null)
    return input;
  var prim = input[Symbol.toPrimitive];
  if (prim !== void 0) {
    var res = prim.call(input, hint || "default");
    if (_typeof(res) !== "object")
      return res;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (hint === "string" ? String : Number)(input);
}
var init_toPrimitive = __esm({
  "../simple-mind-map/node_modules/@babel/runtime/helpers/esm/toPrimitive.js"() {
    init_typeof();
  }
});

// ../simple-mind-map/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
function _toPropertyKey(arg) {
  var key = _toPrimitive(arg, "string");
  return _typeof(key) === "symbol" ? key : String(key);
}
var init_toPropertyKey = __esm({
  "../simple-mind-map/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js"() {
    init_typeof();
    init_toPrimitive();
  }
});

// ../simple-mind-map/node_modules/@babel/runtime/helpers/esm/defineProperty.js
function _defineProperty(obj, key, value) {
  key = _toPropertyKey(key);
  if (key in obj) {
    Object.defineProperty(obj, key, {
      value,
      enumerable: true,
      configurable: true,
      writable: true
    });
  } else {
    obj[key] = value;
  }
  return obj;
}
var init_defineProperty = __esm({
  "../simple-mind-map/node_modules/@babel/runtime/helpers/esm/defineProperty.js"() {
    init_toPropertyKey();
  }
});

// ../simple-mind-map/node_modules/core-js/internals/array-reduce.js
var require_array_reduce = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/array-reduce.js"(exports, module) {
    var aCallable = require_a_callable();
    var toObject = require_to_object();
    var IndexedObject = require_indexed_object();
    var lengthOfArrayLike = require_length_of_array_like();
    var $TypeError = TypeError;
    var createMethod = function(IS_RIGHT) {
      return function(that, callbackfn, argumentsLength, memo) {
        aCallable(callbackfn);
        var O3 = toObject(that);
        var self2 = IndexedObject(O3);
        var length2 = lengthOfArrayLike(O3);
        var index3 = IS_RIGHT ? length2 - 1 : 0;
        var i3 = IS_RIGHT ? -1 : 1;
        if (argumentsLength < 2)
          while (true) {
            if (index3 in self2) {
              memo = self2[index3];
              index3 += i3;
              break;
            }
            index3 += i3;
            if (IS_RIGHT ? index3 < 0 : length2 <= index3) {
              throw $TypeError("Reduce of empty array with no initial value");
            }
          }
        for (; IS_RIGHT ? index3 >= 0 : length2 > index3; index3 += i3)
          if (index3 in self2) {
            memo = callbackfn(memo, self2[index3], index3, O3);
          }
        return memo;
      };
    };
    module.exports = {
      // `Array.prototype.reduce` method
      // https://tc39.es/ecma262/#sec-array.prototype.reduce
      left: createMethod(false),
      // `Array.prototype.reduceRight` method
      // https://tc39.es/ecma262/#sec-array.prototype.reduceright
      right: createMethod(true)
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/array-method-is-strict.js
var require_array_method_is_strict = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/array-method-is-strict.js"(exports, module) {
    "use strict";
    var fails4 = require_fails();
    module.exports = function(METHOD_NAME, argument) {
      var method = [][METHOD_NAME];
      return !!method && fails4(function() {
        method.call(null, argument || function() {
          return 1;
        }, 1);
      });
    };
  }
});

// ../simple-mind-map/node_modules/core-js/modules/es.array.reduce.js
var $2, $reduce, arrayMethodIsStrict, CHROME_VERSION, IS_NODE, STRICT_METHOD, CHROME_BUG;
var init_es_array_reduce = __esm({
  "../simple-mind-map/node_modules/core-js/modules/es.array.reduce.js"() {
    "use strict";
    $2 = require_export();
    $reduce = require_array_reduce().left;
    arrayMethodIsStrict = require_array_method_is_strict();
    CHROME_VERSION = require_engine_v8_version();
    IS_NODE = require_engine_is_node();
    STRICT_METHOD = arrayMethodIsStrict("reduce");
    CHROME_BUG = !IS_NODE && CHROME_VERSION > 79 && CHROME_VERSION < 83;
    $2({ target: "Array", proto: true, forced: !STRICT_METHOD || CHROME_BUG }, {
      reduce: function reduce(callbackfn) {
        var length2 = arguments.length;
        return $reduce(this, callbackfn, length2, length2 > 1 ? arguments[1] : void 0);
      }
    });
  }
});

// ../simple-mind-map/node_modules/core-js/modules/es.string.ends-with.js
var $3, uncurryThis3, getOwnPropertyDescriptor2, toLength4, toString4, notARegExp2, requireObjectCoercible4, correctIsRegExpLogic2, IS_PURE2, nativeEndsWith, slice, min3, CORRECT_IS_REGEXP_LOGIC2, MDN_POLYFILL_BUG2;
var init_es_string_ends_with = __esm({
  "../simple-mind-map/node_modules/core-js/modules/es.string.ends-with.js"() {
    "use strict";
    $3 = require_export();
    uncurryThis3 = require_function_uncurry_this_clause();
    getOwnPropertyDescriptor2 = require_object_get_own_property_descriptor().f;
    toLength4 = require_to_length();
    toString4 = require_to_string();
    notARegExp2 = require_not_a_regexp();
    requireObjectCoercible4 = require_require_object_coercible();
    correctIsRegExpLogic2 = require_correct_is_regexp_logic();
    IS_PURE2 = require_is_pure();
    nativeEndsWith = uncurryThis3("".endsWith);
    slice = uncurryThis3("".slice);
    min3 = Math.min;
    CORRECT_IS_REGEXP_LOGIC2 = correctIsRegExpLogic2("endsWith");
    MDN_POLYFILL_BUG2 = !IS_PURE2 && !CORRECT_IS_REGEXP_LOGIC2 && !!function() {
      var descriptor = getOwnPropertyDescriptor2(String.prototype, "endsWith");
      return descriptor && !descriptor.writable;
    }();
    $3({ target: "String", proto: true, forced: !MDN_POLYFILL_BUG2 && !CORRECT_IS_REGEXP_LOGIC2 }, {
      endsWith: function endsWith(searchString) {
        var that = toString4(requireObjectCoercible4(this));
        notARegExp2(searchString);
        var endPosition = arguments.length > 1 ? arguments[1] : void 0;
        var len = that.length;
        var end = endPosition === void 0 ? len : min3(toLength4(endPosition), len);
        var search2 = toString4(searchString);
        return nativeEndsWith ? nativeEndsWith(that, search2, end) : slice(that, end - search2.length, end) === search2;
      }
    });
  }
});

// ../simple-mind-map/node_modules/core-js/internals/create-property.js
var require_create_property = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/create-property.js"(exports, module) {
    "use strict";
    var toPropertyKey = require_to_property_key();
    var definePropertyModule = require_object_define_property();
    var createPropertyDescriptor = require_create_property_descriptor();
    module.exports = function(object, key, value) {
      var propertyKey = toPropertyKey(key);
      if (propertyKey in object)
        definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));
      else
        object[propertyKey] = value;
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/array-slice-simple.js
var require_array_slice_simple = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/array-slice-simple.js"(exports, module) {
    var toAbsoluteIndex = require_to_absolute_index();
    var lengthOfArrayLike = require_length_of_array_like();
    var createProperty = require_create_property();
    var $Array = Array;
    var max3 = Math.max;
    module.exports = function(O3, start, end) {
      var length2 = lengthOfArrayLike(O3);
      var k2 = toAbsoluteIndex(start, length2);
      var fin = toAbsoluteIndex(end === void 0 ? length2 : end, length2);
      var result = $Array(max3(fin - k2, 0));
      for (var n3 = 0; k2 < fin; k2++, n3++)
        createProperty(result, n3, O3[k2]);
      result.length = n3;
      return result;
    };
  }
});

// ../simple-mind-map/node_modules/core-js/modules/es.string.split.js
var apply2, call3, uncurryThis4, fixRegExpWellKnownSymbolLogic3, anObject3, isNullOrUndefined3, isRegExp, requireObjectCoercible5, speciesConstructor, advanceStringIndex3, toLength5, toString5, getMethod3, arraySlice, callRegExpExec, regexpExec, stickyHelpers, fails2, UNSUPPORTED_Y, MAX_UINT32, min4, $push, exec, push2, stringSlice3, SPLIT_WORKS_WITH_OVERWRITTEN_EXEC;
var init_es_string_split = __esm({
  "../simple-mind-map/node_modules/core-js/modules/es.string.split.js"() {
    "use strict";
    apply2 = require_function_apply();
    call3 = require_function_call();
    uncurryThis4 = require_function_uncurry_this();
    fixRegExpWellKnownSymbolLogic3 = require_fix_regexp_well_known_symbol_logic();
    anObject3 = require_an_object();
    isNullOrUndefined3 = require_is_null_or_undefined();
    isRegExp = require_is_regexp();
    requireObjectCoercible5 = require_require_object_coercible();
    speciesConstructor = require_species_constructor();
    advanceStringIndex3 = require_advance_string_index();
    toLength5 = require_to_length();
    toString5 = require_to_string();
    getMethod3 = require_get_method();
    arraySlice = require_array_slice_simple();
    callRegExpExec = require_regexp_exec_abstract();
    regexpExec = require_regexp_exec();
    stickyHelpers = require_regexp_sticky_helpers();
    fails2 = require_fails();
    UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y;
    MAX_UINT32 = 4294967295;
    min4 = Math.min;
    $push = [].push;
    exec = uncurryThis4(/./.exec);
    push2 = uncurryThis4($push);
    stringSlice3 = uncurryThis4("".slice);
    SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails2(function() {
      var re2 = /(?:)/;
      var originalExec = re2.exec;
      re2.exec = function() {
        return originalExec.apply(this, arguments);
      };
      var result = "ab".split(re2);
      return result.length !== 2 || result[0] !== "a" || result[1] !== "b";
    });
    fixRegExpWellKnownSymbolLogic3("split", function(SPLIT, nativeSplit, maybeCallNative) {
      var internalSplit;
      if ("abbc".split(/(b)*/)[1] == "c" || // eslint-disable-next-line regexp/no-empty-group -- required for testing
      "test".split(/(?:)/, -1).length != 4 || "ab".split(/(?:ab)*/).length != 2 || ".".split(/(.?)(.?)/).length != 4 || // eslint-disable-next-line regexp/no-empty-capturing-group, regexp/no-empty-group -- required for testing
      ".".split(/()()/).length > 1 || "".split(/.?/).length) {
        internalSplit = function(separator, limit) {
          var string3 = toString5(requireObjectCoercible5(this));
          var lim = limit === void 0 ? MAX_UINT32 : limit >>> 0;
          if (lim === 0)
            return [];
          if (separator === void 0)
            return [string3];
          if (!isRegExp(separator)) {
            return call3(nativeSplit, string3, separator, lim);
          }
          var output = [];
          var flags = (separator.ignoreCase ? "i" : "") + (separator.multiline ? "m" : "") + (separator.unicode ? "u" : "") + (separator.sticky ? "y" : "");
          var lastLastIndex = 0;
          var separatorCopy = new RegExp(separator.source, flags + "g");
          var match, lastIndex, lastLength;
          while (match = call3(regexpExec, separatorCopy, string3)) {
            lastIndex = separatorCopy.lastIndex;
            if (lastIndex > lastLastIndex) {
              push2(output, stringSlice3(string3, lastLastIndex, match.index));
              if (match.length > 1 && match.index < string3.length)
                apply2($push, output, arraySlice(match, 1));
              lastLength = match[0].length;
              lastLastIndex = lastIndex;
              if (output.length >= lim)
                break;
            }
            if (separatorCopy.lastIndex === match.index)
              separatorCopy.lastIndex++;
          }
          if (lastLastIndex === string3.length) {
            if (lastLength || !exec(separatorCopy, ""))
              push2(output, "");
          } else
            push2(output, stringSlice3(string3, lastLastIndex));
          return output.length > lim ? arraySlice(output, 0, lim) : output;
        };
      } else if ("0".split(void 0, 0).length) {
        internalSplit = function(separator, limit) {
          return separator === void 0 && limit === 0 ? [] : call3(nativeSplit, this, separator, limit);
        };
      } else
        internalSplit = nativeSplit;
      return [
        // `String.prototype.split` method
        // https://tc39.es/ecma262/#sec-string.prototype.split
        function split(separator, limit) {
          var O3 = requireObjectCoercible5(this);
          var splitter = isNullOrUndefined3(separator) ? void 0 : getMethod3(separator, SPLIT);
          return splitter ? call3(splitter, separator, O3, limit) : call3(internalSplit, toString5(O3), separator, limit);
        },
        // `RegExp.prototype[@@split]` method
        // https://tc39.es/ecma262/#sec-regexp.prototype-@@split
        //
        // NOTE: This cannot be properly polyfilled in engines that don't support
        // the 'y' flag.
        function(string3, limit) {
          var rx2 = anObject3(this);
          var S2 = toString5(string3);
          var res = maybeCallNative(internalSplit, rx2, S2, limit, internalSplit !== nativeSplit);
          if (res.done)
            return res.value;
          var C2 = speciesConstructor(rx2, RegExp);
          var unicodeMatching = rx2.unicode;
          var flags = (rx2.ignoreCase ? "i" : "") + (rx2.multiline ? "m" : "") + (rx2.unicode ? "u" : "") + (UNSUPPORTED_Y ? "g" : "y");
          var splitter = new C2(UNSUPPORTED_Y ? "^(?:" + rx2.source + ")" : rx2, flags);
          var lim = limit === void 0 ? MAX_UINT32 : limit >>> 0;
          if (lim === 0)
            return [];
          if (S2.length === 0)
            return callRegExpExec(splitter, S2) === null ? [S2] : [];
          var p3 = 0;
          var q2 = 0;
          var A3 = [];
          while (q2 < S2.length) {
            splitter.lastIndex = UNSUPPORTED_Y ? 0 : q2;
            var z2 = callRegExpExec(splitter, UNSUPPORTED_Y ? stringSlice3(S2, q2) : S2);
            var e2;
            if (z2 === null || (e2 = min4(toLength5(splitter.lastIndex + (UNSUPPORTED_Y ? q2 : 0)), S2.length)) === p3) {
              q2 = advanceStringIndex3(S2, q2, unicodeMatching);
            } else {
              push2(A3, stringSlice3(S2, p3, q2));
              if (A3.length === lim)
                return A3;
              for (var i3 = 1; i3 <= z2.length - 1; i3++) {
                push2(A3, z2[i3]);
                if (A3.length === lim)
                  return A3;
              }
              q2 = p3 = e2;
            }
          }
          push2(A3, stringSlice3(S2, p3));
          return A3;
        }
      ];
    }, !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y);
  }
});

// ../simple-mind-map/node_modules/performance-now/lib/performance-now.js
var require_performance_now = __commonJS({
  "../simple-mind-map/node_modules/performance-now/lib/performance-now.js"(exports, module) {
    (function() {
      var getNanoSeconds, hrtime, loadTime, moduleLoadTime, nodeLoadTime, upTime;
      if (typeof performance !== "undefined" && performance !== null && performance.now) {
        module.exports = function() {
          return performance.now();
        };
      } else if (typeof process !== "undefined" && process !== null && process.hrtime) {
        module.exports = function() {
          return (getNanoSeconds() - nodeLoadTime) / 1e6;
        };
        hrtime = process.hrtime;
        getNanoSeconds = function() {
          var hr;
          hr = hrtime();
          return hr[0] * 1e9 + hr[1];
        };
        moduleLoadTime = getNanoSeconds();
        upTime = process.uptime() * 1e9;
        nodeLoadTime = moduleLoadTime - upTime;
      } else if (Date.now) {
        module.exports = function() {
          return Date.now() - loadTime;
        };
        loadTime = Date.now();
      } else {
        module.exports = function() {
          return (/* @__PURE__ */ new Date()).getTime() - loadTime;
        };
        loadTime = (/* @__PURE__ */ new Date()).getTime();
      }
    }).call(exports);
  }
});

// ../simple-mind-map/node_modules/raf/index.js
var require_raf = __commonJS({
  "../simple-mind-map/node_modules/raf/index.js"(exports, module) {
    var now = require_performance_now();
    var root2 = typeof window === "undefined" ? global : window;
    var vendors = ["moz", "webkit"];
    var suffix = "AnimationFrame";
    var raf = root2["request" + suffix];
    var caf = root2["cancel" + suffix] || root2["cancelRequest" + suffix];
    for (i3 = 0; !raf && i3 < vendors.length; i3++) {
      raf = root2[vendors[i3] + "Request" + suffix];
      caf = root2[vendors[i3] + "Cancel" + suffix] || root2[vendors[i3] + "CancelRequest" + suffix];
    }
    var i3;
    if (!raf || !caf) {
      last = 0, id = 0, queue = [], frameDuration = 1e3 / 60;
      raf = function(callback) {
        if (queue.length === 0) {
          var _now = now(), next2 = Math.max(0, frameDuration - (_now - last));
          last = next2 + _now;
          setTimeout(function() {
            var cp = queue.slice(0);
            queue.length = 0;
            for (var i4 = 0; i4 < cp.length; i4++) {
              if (!cp[i4].cancelled) {
                try {
                  cp[i4].callback(last);
                } catch (e2) {
                  setTimeout(function() {
                    throw e2;
                  }, 0);
                }
              }
            }
          }, Math.round(next2));
        }
        queue.push({
          handle: ++id,
          callback,
          cancelled: false
        });
        return id;
      };
      caf = function(handle) {
        for (var i4 = 0; i4 < queue.length; i4++) {
          if (queue[i4].handle === handle) {
            queue[i4].cancelled = true;
          }
        }
      };
    }
    var last;
    var id;
    var queue;
    var frameDuration;
    module.exports = function(fn) {
      return raf.call(root2, fn);
    };
    module.exports.cancel = function() {
      caf.apply(root2, arguments);
    };
    module.exports.polyfill = function(object) {
      if (!object) {
        object = root2;
      }
      object.requestAnimationFrame = raf;
      object.cancelAnimationFrame = caf;
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/whitespaces.js
var require_whitespaces = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/whitespaces.js"(exports, module) {
    module.exports = "	\n\v\f\r \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF";
  }
});

// ../simple-mind-map/node_modules/core-js/internals/string-trim.js
var require_string_trim = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/string-trim.js"(exports, module) {
    var uncurryThis8 = require_function_uncurry_this();
    var requireObjectCoercible7 = require_require_object_coercible();
    var toString8 = require_to_string();
    var whitespaces = require_whitespaces();
    var replace = uncurryThis8("".replace);
    var whitespace2 = "[" + whitespaces + "]";
    var ltrim = RegExp("^" + whitespace2 + whitespace2 + "*");
    var rtrim = RegExp(whitespace2 + whitespace2 + "*$");
    var createMethod = function(TYPE) {
      return function($this) {
        var string3 = toString8(requireObjectCoercible7($this));
        if (TYPE & 1)
          string3 = replace(string3, ltrim, "");
        if (TYPE & 2)
          string3 = replace(string3, rtrim, "");
        return string3;
      };
    };
    module.exports = {
      // `String.prototype.{ trimLeft, trimStart }` methods
      // https://tc39.es/ecma262/#sec-string.prototype.trimstart
      start: createMethod(1),
      // `String.prototype.{ trimRight, trimEnd }` methods
      // https://tc39.es/ecma262/#sec-string.prototype.trimend
      end: createMethod(2),
      // `String.prototype.trim` method
      // https://tc39.es/ecma262/#sec-string.prototype.trim
      trim: createMethod(3)
    };
  }
});

// ../simple-mind-map/node_modules/core-js/internals/string-trim-forced.js
var require_string_trim_forced = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/string-trim-forced.js"(exports, module) {
    var PROPER_FUNCTION_NAME2 = require_function_name().PROPER;
    var fails4 = require_fails();
    var whitespaces = require_whitespaces();
    var non = "\u200B\x85\u180E";
    module.exports = function(METHOD_NAME) {
      return fails4(function() {
        return !!whitespaces[METHOD_NAME]() || non[METHOD_NAME]() !== non || PROPER_FUNCTION_NAME2 && whitespaces[METHOD_NAME].name !== METHOD_NAME;
      });
    };
  }
});

// ../simple-mind-map/node_modules/core-js/modules/es.string.trim.js
var $4, $trim, forcedStringTrimMethod;
var init_es_string_trim = __esm({
  "../simple-mind-map/node_modules/core-js/modules/es.string.trim.js"() {
    "use strict";
    $4 = require_export();
    $trim = require_string_trim().trim;
    forcedStringTrimMethod = require_string_trim_forced();
    $4({ target: "String", proto: true, forced: forcedStringTrimMethod("trim") }, {
      trim: function trim() {
        return $trim(this);
      }
    });
  }
});

// ../simple-mind-map/node_modules/rgbcolor/index.js
var require_rgbcolor = __commonJS({
  "../simple-mind-map/node_modules/rgbcolor/index.js"(exports, module) {
    module.exports = function(color_string) {
      this.ok = false;
      this.alpha = 1;
      if (color_string.charAt(0) == "#") {
        color_string = color_string.substr(1, 6);
      }
      color_string = color_string.replace(/ /g, "");
      color_string = color_string.toLowerCase();
      var simple_colors = {
        aliceblue: "f0f8ff",
        antiquewhite: "faebd7",
        aqua: "00ffff",
        aquamarine: "7fffd4",
        azure: "f0ffff",
        beige: "f5f5dc",
        bisque: "ffe4c4",
        black: "000000",
        blanchedalmond: "ffebcd",
        blue: "0000ff",
        blueviolet: "8a2be2",
        brown: "a52a2a",
        burlywood: "deb887",
        cadetblue: "5f9ea0",
        chartreuse: "7fff00",
        chocolate: "d2691e",
        coral: "ff7f50",
        cornflowerblue: "6495ed",
        cornsilk: "fff8dc",
        crimson: "dc143c",
        cyan: "00ffff",
        darkblue: "00008b",
        darkcyan: "008b8b",
        darkgoldenrod: "b8860b",
        darkgray: "a9a9a9",
        darkgreen: "006400",
        darkkhaki: "bdb76b",
        darkmagenta: "8b008b",
        darkolivegreen: "556b2f",
        darkorange: "ff8c00",
        darkorchid: "9932cc",
        darkred: "8b0000",
        darksalmon: "e9967a",
        darkseagreen: "8fbc8f",
        darkslateblue: "483d8b",
        darkslategray: "2f4f4f",
        darkturquoise: "00ced1",
        darkviolet: "9400d3",
        deeppink: "ff1493",
        deepskyblue: "00bfff",
        dimgray: "696969",
        dodgerblue: "1e90ff",
        feldspar: "d19275",
        firebrick: "b22222",
        floralwhite: "fffaf0",
        forestgreen: "228b22",
        fuchsia: "ff00ff",
        gainsboro: "dcdcdc",
        ghostwhite: "f8f8ff",
        gold: "ffd700",
        goldenrod: "daa520",
        gray: "808080",
        green: "008000",
        greenyellow: "adff2f",
        honeydew: "f0fff0",
        hotpink: "ff69b4",
        indianred: "cd5c5c",
        indigo: "4b0082",
        ivory: "fffff0",
        khaki: "f0e68c",
        lavender: "e6e6fa",
        lavenderblush: "fff0f5",
        lawngreen: "7cfc00",
        lemonchiffon: "fffacd",
        lightblue: "add8e6",
        lightcoral: "f08080",
        lightcyan: "e0ffff",
        lightgoldenrodyellow: "fafad2",
        lightgrey: "d3d3d3",
        lightgreen: "90ee90",
        lightpink: "ffb6c1",
        lightsalmon: "ffa07a",
        lightseagreen: "20b2aa",
        lightskyblue: "87cefa",
        lightslateblue: "8470ff",
        lightslategray: "778899",
        lightsteelblue: "b0c4de",
        lightyellow: "ffffe0",
        lime: "00ff00",
        limegreen: "32cd32",
        linen: "faf0e6",
        magenta: "ff00ff",
        maroon: "800000",
        mediumaquamarine: "66cdaa",
        mediumblue: "0000cd",
        mediumorchid: "ba55d3",
        mediumpurple: "9370d8",
        mediumseagreen: "3cb371",
        mediumslateblue: "7b68ee",
        mediumspringgreen: "00fa9a",
        mediumturquoise: "48d1cc",
        mediumvioletred: "c71585",
        midnightblue: "191970",
        mintcream: "f5fffa",
        mistyrose: "ffe4e1",
        moccasin: "ffe4b5",
        navajowhite: "ffdead",
        navy: "000080",
        oldlace: "fdf5e6",
        olive: "808000",
        olivedrab: "6b8e23",
        orange: "ffa500",
        orangered: "ff4500",
        orchid: "da70d6",
        palegoldenrod: "eee8aa",
        palegreen: "98fb98",
        paleturquoise: "afeeee",
        palevioletred: "d87093",
        papayawhip: "ffefd5",
        peachpuff: "ffdab9",
        peru: "cd853f",
        pink: "ffc0cb",
        plum: "dda0dd",
        powderblue: "b0e0e6",
        purple: "800080",
        rebeccapurple: "663399",
        red: "ff0000",
        rosybrown: "bc8f8f",
        royalblue: "4169e1",
        saddlebrown: "8b4513",
        salmon: "fa8072",
        sandybrown: "f4a460",
        seagreen: "2e8b57",
        seashell: "fff5ee",
        sienna: "a0522d",
        silver: "c0c0c0",
        skyblue: "87ceeb",
        slateblue: "6a5acd",
        slategray: "708090",
        snow: "fffafa",
        springgreen: "00ff7f",
        steelblue: "4682b4",
        tan: "d2b48c",
        teal: "008080",
        thistle: "d8bfd8",
        tomato: "ff6347",
        turquoise: "40e0d0",
        violet: "ee82ee",
        violetred: "d02090",
        wheat: "f5deb3",
        white: "ffffff",
        whitesmoke: "f5f5f5",
        yellow: "ffff00",
        yellowgreen: "9acd32"
      };
      color_string = simple_colors[color_string] || color_string;
      var color_defs = [
        {
          re: /^rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*((?:\d?\.)?\d)\)$/,
          example: ["rgba(123, 234, 45, 0.8)", "rgba(255,234,245,1.0)"],
          process: function(bits3) {
            return [
              parseInt(bits3[1]),
              parseInt(bits3[2]),
              parseInt(bits3[3]),
              parseFloat(bits3[4])
            ];
          }
        },
        {
          re: /^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,
          example: ["rgb(123, 234, 45)", "rgb(255,234,245)"],
          process: function(bits3) {
            return [
              parseInt(bits3[1]),
              parseInt(bits3[2]),
              parseInt(bits3[3])
            ];
          }
        },
        {
          re: /^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
          example: ["#00ff00", "336699"],
          process: function(bits3) {
            return [
              parseInt(bits3[1], 16),
              parseInt(bits3[2], 16),
              parseInt(bits3[3], 16)
            ];
          }
        },
        {
          re: /^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
          example: ["#fb0", "f0f"],
          process: function(bits3) {
            return [
              parseInt(bits3[1] + bits3[1], 16),
              parseInt(bits3[2] + bits3[2], 16),
              parseInt(bits3[3] + bits3[3], 16)
            ];
          }
        }
      ];
      for (var i3 = 0; i3 < color_defs.length; i3++) {
        var re2 = color_defs[i3].re;
        var processor = color_defs[i3].process;
        var bits2 = re2.exec(color_string);
        if (bits2) {
          var channels = processor(bits2);
          this.r = channels[0];
          this.g = channels[1];
          this.b = channels[2];
          if (channels.length > 3) {
            this.alpha = channels[3];
          }
          this.ok = true;
        }
      }
      this.r = this.r < 0 || isNaN(this.r) ? 0 : this.r > 255 ? 255 : this.r;
      this.g = this.g < 0 || isNaN(this.g) ? 0 : this.g > 255 ? 255 : this.g;
      this.b = this.b < 0 || isNaN(this.b) ? 0 : this.b > 255 ? 255 : this.b;
      this.alpha = this.alpha < 0 ? 0 : this.alpha > 1 || isNaN(this.alpha) ? 1 : this.alpha;
      this.toRGB = function() {
        return "rgb(" + this.r + ", " + this.g + ", " + this.b + ")";
      };
      this.toRGBA = function() {
        return "rgba(" + this.r + ", " + this.g + ", " + this.b + ", " + this.alpha + ")";
      };
      this.toHex = function() {
        var r2 = this.r.toString(16);
        var g2 = this.g.toString(16);
        var b2 = this.b.toString(16);
        if (r2.length == 1)
          r2 = "0" + r2;
        if (g2.length == 1)
          g2 = "0" + g2;
        if (b2.length == 1)
          b2 = "0" + b2;
        return "#" + r2 + g2 + b2;
      };
      this.getHelpXML = function() {
        var examples = new Array();
        for (var i4 = 0; i4 < color_defs.length; i4++) {
          var example = color_defs[i4].example;
          for (var j2 = 0; j2 < example.length; j2++) {
            examples[examples.length] = example[j2];
          }
        }
        for (var sc in simple_colors) {
          examples[examples.length] = sc;
        }
        var xml = document.createElement("ul");
        xml.setAttribute("id", "rgbcolor-examples");
        for (var i4 = 0; i4 < examples.length; i4++) {
          try {
            var list_item = document.createElement("li");
            var list_color = new RGBColor(examples[i4]);
            var example_div = document.createElement("div");
            example_div.style.cssText = "margin: 3px; border: 1px solid black; background:" + list_color.toHex() + "; color:" + list_color.toHex();
            example_div.appendChild(document.createTextNode("test"));
            var list_item_value = document.createTextNode(
              " " + examples[i4] + " -> " + list_color.toRGB() + " -> " + list_color.toHex()
            );
            list_item.appendChild(example_div);
            list_item.appendChild(list_item_value);
            xml.appendChild(list_item);
          } catch (e2) {
          }
        }
        return xml;
      };
    };
  }
});

// ../simple-mind-map/node_modules/core-js/modules/es.array.index-of.js
var $5, uncurryThis5, $indexOf, arrayMethodIsStrict2, nativeIndexOf, NEGATIVE_ZERO, STRICT_METHOD2;
var init_es_array_index_of = __esm({
  "../simple-mind-map/node_modules/core-js/modules/es.array.index-of.js"() {
    "use strict";
    $5 = require_export();
    uncurryThis5 = require_function_uncurry_this_clause();
    $indexOf = require_array_includes().indexOf;
    arrayMethodIsStrict2 = require_array_method_is_strict();
    nativeIndexOf = uncurryThis5([].indexOf);
    NEGATIVE_ZERO = !!nativeIndexOf && 1 / nativeIndexOf([1], 1, -0) < 0;
    STRICT_METHOD2 = arrayMethodIsStrict2("indexOf");
    $5({ target: "Array", proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD2 }, {
      indexOf: function indexOf(searchElement) {
        var fromIndex = arguments.length > 1 ? arguments[1] : void 0;
        return NEGATIVE_ZERO ? nativeIndexOf(this, searchElement, fromIndex) || 0 : $indexOf(this, searchElement, fromIndex);
      }
    });
  }
});

// ../simple-mind-map/node_modules/core-js/modules/es.string.includes.js
var $6, uncurryThis6, notARegExp3, requireObjectCoercible6, toString6, correctIsRegExpLogic3, stringIndexOf2;
var init_es_string_includes = __esm({
  "../simple-mind-map/node_modules/core-js/modules/es.string.includes.js"() {
    "use strict";
    $6 = require_export();
    uncurryThis6 = require_function_uncurry_this();
    notARegExp3 = require_not_a_regexp();
    requireObjectCoercible6 = require_require_object_coercible();
    toString6 = require_to_string();
    correctIsRegExpLogic3 = require_correct_is_regexp_logic();
    stringIndexOf2 = uncurryThis6("".indexOf);
    $6({ target: "String", proto: true, forced: !correctIsRegExpLogic3("includes") }, {
      includes: function includes(searchString) {
        return !!~stringIndexOf2(
          toString6(requireObjectCoercible6(this)),
          toString6(notARegExp3(searchString)),
          arguments.length > 1 ? arguments[1] : void 0
        );
      }
    });
  }
});

// ../simple-mind-map/node_modules/core-js/internals/is-array.js
var require_is_array = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/is-array.js"(exports, module) {
    var classof = require_classof_raw();
    module.exports = Array.isArray || function isArray2(argument) {
      return classof(argument) == "Array";
    };
  }
});

// ../simple-mind-map/node_modules/core-js/modules/es.array.reverse.js
var $7, uncurryThis7, isArray, nativeReverse, test;
var init_es_array_reverse = __esm({
  "../simple-mind-map/node_modules/core-js/modules/es.array.reverse.js"() {
    "use strict";
    $7 = require_export();
    uncurryThis7 = require_function_uncurry_this();
    isArray = require_is_array();
    nativeReverse = uncurryThis7([].reverse);
    test = [1, 2];
    $7({ target: "Array", proto: true, forced: String(test) === String(test.reverse()) }, {
      reverse: function reverse() {
        if (isArray(this))
          this.length = this.length;
        return nativeReverse(this);
      }
    });
  }
});

// ../simple-mind-map/node_modules/svg-pathdata/lib/SVGPathData.module.js
function r(r2, e2) {
  if ("function" != typeof e2 && null !== e2)
    throw new TypeError("Class extends value " + String(e2) + " is not a constructor or null");
  function i3() {
    this.constructor = r2;
  }
  t(r2, e2), r2.prototype = null === e2 ? Object.create(e2) : (i3.prototype = e2.prototype, new i3());
}
function e(t3) {
  var r2 = "";
  Array.isArray(t3) || (t3 = [t3]);
  for (var e2 = 0; e2 < t3.length; e2++) {
    var i3 = t3[e2];
    if (i3.type === _.CLOSE_PATH)
      r2 += "z";
    else if (i3.type === _.HORIZ_LINE_TO)
      r2 += (i3.relative ? "h" : "H") + i3.x;
    else if (i3.type === _.VERT_LINE_TO)
      r2 += (i3.relative ? "v" : "V") + i3.y;
    else if (i3.type === _.MOVE_TO)
      r2 += (i3.relative ? "m" : "M") + i3.x + " " + i3.y;
    else if (i3.type === _.LINE_TO)
      r2 += (i3.relative ? "l" : "L") + i3.x + " " + i3.y;
    else if (i3.type === _.CURVE_TO)
      r2 += (i3.relative ? "c" : "C") + i3.x1 + " " + i3.y1 + " " + i3.x2 + " " + i3.y2 + " " + i3.x + " " + i3.y;
    else if (i3.type === _.SMOOTH_CURVE_TO)
      r2 += (i3.relative ? "s" : "S") + i3.x2 + " " + i3.y2 + " " + i3.x + " " + i3.y;
    else if (i3.type === _.QUAD_TO)
      r2 += (i3.relative ? "q" : "Q") + i3.x1 + " " + i3.y1 + " " + i3.x + " " + i3.y;
    else if (i3.type === _.SMOOTH_QUAD_TO)
      r2 += (i3.relative ? "t" : "T") + i3.x + " " + i3.y;
    else {
      if (i3.type !== _.ARC)
        throw new Error('Unexpected command type "' + i3.type + '" at index ' + e2 + ".");
      r2 += (i3.relative ? "a" : "A") + i3.rX + " " + i3.rY + " " + i3.xRot + " " + +i3.lArcFlag + " " + +i3.sweepFlag + " " + i3.x + " " + i3.y;
    }
  }
  return r2;
}
function i(t3, r2) {
  var e2 = t3[0], i3 = t3[1];
  return [e2 * Math.cos(r2) - i3 * Math.sin(r2), e2 * Math.sin(r2) + i3 * Math.cos(r2)];
}
function a() {
  for (var t3 = [], r2 = 0; r2 < arguments.length; r2++)
    t3[r2] = arguments[r2];
  for (var e2 = 0; e2 < t3.length; e2++)
    if ("number" != typeof t3[e2])
      throw new Error("assertNumbers arguments[" + e2 + "] is not a number. " + typeof t3[e2] + " == typeof " + t3[e2]);
  return true;
}
function o(t3, r2, e2) {
  t3.lArcFlag = 0 === t3.lArcFlag ? 0 : 1, t3.sweepFlag = 0 === t3.sweepFlag ? 0 : 1;
  var a3 = t3.rX, o3 = t3.rY, s3 = t3.x, u3 = t3.y;
  a3 = Math.abs(t3.rX), o3 = Math.abs(t3.rY);
  var h3 = i([(r2 - s3) / 2, (e2 - u3) / 2], -t3.xRot / 180 * n), c4 = h3[0], y4 = h3[1], p3 = Math.pow(c4, 2) / Math.pow(a3, 2) + Math.pow(y4, 2) / Math.pow(o3, 2);
  1 < p3 && (a3 *= Math.sqrt(p3), o3 *= Math.sqrt(p3)), t3.rX = a3, t3.rY = o3;
  var m4 = Math.pow(a3, 2) * Math.pow(y4, 2) + Math.pow(o3, 2) * Math.pow(c4, 2), O3 = (t3.lArcFlag !== t3.sweepFlag ? 1 : -1) * Math.sqrt(Math.max(0, (Math.pow(a3, 2) * Math.pow(o3, 2) - m4) / m4)), l3 = a3 * y4 / o3 * O3, T3 = -o3 * c4 / a3 * O3, v3 = i([l3, T3], t3.xRot / 180 * n);
  t3.cX = v3[0] + (r2 + s3) / 2, t3.cY = v3[1] + (e2 + u3) / 2, t3.phi1 = Math.atan2((y4 - T3) / o3, (c4 - l3) / a3), t3.phi2 = Math.atan2((-y4 - T3) / o3, (-c4 - l3) / a3), 0 === t3.sweepFlag && t3.phi2 > t3.phi1 && (t3.phi2 -= 2 * n), 1 === t3.sweepFlag && t3.phi2 < t3.phi1 && (t3.phi2 += 2 * n), t3.phi1 *= 180 / n, t3.phi2 *= 180 / n;
}
function s(t3, r2, e2) {
  a(t3, r2, e2);
  var i3 = t3 * t3 + r2 * r2 - e2 * e2;
  if (0 > i3)
    return [];
  if (0 === i3)
    return [[t3 * e2 / (t3 * t3 + r2 * r2), r2 * e2 / (t3 * t3 + r2 * r2)]];
  var n3 = Math.sqrt(i3);
  return [[(t3 * e2 + r2 * n3) / (t3 * t3 + r2 * r2), (r2 * e2 - t3 * n3) / (t3 * t3 + r2 * r2)], [(t3 * e2 - r2 * n3) / (t3 * t3 + r2 * r2), (r2 * e2 + t3 * n3) / (t3 * t3 + r2 * r2)]];
}
function c(t3, r2, e2) {
  return (1 - e2) * t3 + e2 * r2;
}
function y2(t3, r2, e2, i3) {
  return t3 + Math.cos(i3 / 180 * n) * r2 + Math.sin(i3 / 180 * n) * e2;
}
function p(t3, r2, e2, i3) {
  var a3 = 1e-6, n3 = r2 - t3, o3 = e2 - r2, s3 = 3 * n3 + 3 * (i3 - e2) - 6 * o3, u3 = 6 * (o3 - n3), h3 = 3 * n3;
  return Math.abs(s3) < a3 ? [-h3 / u3] : function(t4, r3, e3) {
    void 0 === e3 && (e3 = 1e-6);
    var i4 = t4 * t4 / 4 - r3;
    if (i4 < -e3)
      return [];
    if (i4 <= e3)
      return [-t4 / 2];
    var a4 = Math.sqrt(i4);
    return [-t4 / 2 - a4, -t4 / 2 + a4];
  }(u3 / s3, h3 / s3, a3);
}
function m(t3, r2, e2, i3, a3) {
  var n3 = 1 - a3;
  return t3 * (n3 * n3 * n3) + r2 * (3 * n3 * n3 * a3) + e2 * (3 * n3 * a3 * a3) + i3 * (a3 * a3 * a3);
}
var t, n, u, h, O, l, T, v, f, _, N;
var init_SVGPathData_module = __esm({
  "../simple-mind-map/node_modules/svg-pathdata/lib/SVGPathData.module.js"() {
    t = function(r2, e2) {
      return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t3, r3) {
        t3.__proto__ = r3;
      } || function(t3, r3) {
        for (var e3 in r3)
          Object.prototype.hasOwnProperty.call(r3, e3) && (t3[e3] = r3[e3]);
      })(r2, e2);
    };
    n = Math.PI;
    h = Math.PI / 180;
    !function(t3) {
      function r2() {
        return u3(function(t4, r3, e3) {
          return t4.relative && (void 0 !== t4.x1 && (t4.x1 += r3), void 0 !== t4.y1 && (t4.y1 += e3), void 0 !== t4.x2 && (t4.x2 += r3), void 0 !== t4.y2 && (t4.y2 += e3), void 0 !== t4.x && (t4.x += r3), void 0 !== t4.y && (t4.y += e3), t4.relative = false), t4;
        });
      }
      function e2() {
        var t4 = NaN, r3 = NaN, e3 = NaN, i3 = NaN;
        return u3(function(a3, n4, o3) {
          return a3.type & _.SMOOTH_CURVE_TO && (a3.type = _.CURVE_TO, t4 = isNaN(t4) ? n4 : t4, r3 = isNaN(r3) ? o3 : r3, a3.x1 = a3.relative ? n4 - t4 : 2 * n4 - t4, a3.y1 = a3.relative ? o3 - r3 : 2 * o3 - r3), a3.type & _.CURVE_TO ? (t4 = a3.relative ? n4 + a3.x2 : a3.x2, r3 = a3.relative ? o3 + a3.y2 : a3.y2) : (t4 = NaN, r3 = NaN), a3.type & _.SMOOTH_QUAD_TO && (a3.type = _.QUAD_TO, e3 = isNaN(e3) ? n4 : e3, i3 = isNaN(i3) ? o3 : i3, a3.x1 = a3.relative ? n4 - e3 : 2 * n4 - e3, a3.y1 = a3.relative ? o3 - i3 : 2 * o3 - i3), a3.type & _.QUAD_TO ? (e3 = a3.relative ? n4 + a3.x1 : a3.x1, i3 = a3.relative ? o3 + a3.y1 : a3.y1) : (e3 = NaN, i3 = NaN), a3;
        });
      }
      function n3() {
        var t4 = NaN, r3 = NaN;
        return u3(function(e3, i3, a3) {
          if (e3.type & _.SMOOTH_QUAD_TO && (e3.type = _.QUAD_TO, t4 = isNaN(t4) ? i3 : t4, r3 = isNaN(r3) ? a3 : r3, e3.x1 = e3.relative ? i3 - t4 : 2 * i3 - t4, e3.y1 = e3.relative ? a3 - r3 : 2 * a3 - r3), e3.type & _.QUAD_TO) {
            t4 = e3.relative ? i3 + e3.x1 : e3.x1, r3 = e3.relative ? a3 + e3.y1 : e3.y1;
            var n4 = e3.x1, o3 = e3.y1;
            e3.type = _.CURVE_TO, e3.x1 = ((e3.relative ? 0 : i3) + 2 * n4) / 3, e3.y1 = ((e3.relative ? 0 : a3) + 2 * o3) / 3, e3.x2 = (e3.x + 2 * n4) / 3, e3.y2 = (e3.y + 2 * o3) / 3;
          } else
            t4 = NaN, r3 = NaN;
          return e3;
        });
      }
      function u3(t4) {
        var r3 = 0, e3 = 0, i3 = NaN, a3 = NaN;
        return function(n4) {
          if (isNaN(i3) && !(n4.type & _.MOVE_TO))
            throw new Error("path must start with moveto");
          var o3 = t4(n4, r3, e3, i3, a3);
          return n4.type & _.CLOSE_PATH && (r3 = i3, e3 = a3), void 0 !== n4.x && (r3 = n4.relative ? r3 + n4.x : n4.x), void 0 !== n4.y && (e3 = n4.relative ? e3 + n4.y : n4.y), n4.type & _.MOVE_TO && (i3 = r3, a3 = e3), o3;
        };
      }
      function O3(t4, r3, e3, i3, n4, o3) {
        return a(t4, r3, e3, i3, n4, o3), u3(function(a3, s3, u4, h3) {
          var c4 = a3.x1, y4 = a3.x2, p3 = a3.relative && !isNaN(h3), m4 = void 0 !== a3.x ? a3.x : p3 ? 0 : s3, O4 = void 0 !== a3.y ? a3.y : p3 ? 0 : u4;
          function l4(t5) {
            return t5 * t5;
          }
          a3.type & _.HORIZ_LINE_TO && 0 !== r3 && (a3.type = _.LINE_TO, a3.y = a3.relative ? 0 : u4), a3.type & _.VERT_LINE_TO && 0 !== e3 && (a3.type = _.LINE_TO, a3.x = a3.relative ? 0 : s3), void 0 !== a3.x && (a3.x = a3.x * t4 + O4 * e3 + (p3 ? 0 : n4)), void 0 !== a3.y && (a3.y = m4 * r3 + a3.y * i3 + (p3 ? 0 : o3)), void 0 !== a3.x1 && (a3.x1 = a3.x1 * t4 + a3.y1 * e3 + (p3 ? 0 : n4)), void 0 !== a3.y1 && (a3.y1 = c4 * r3 + a3.y1 * i3 + (p3 ? 0 : o3)), void 0 !== a3.x2 && (a3.x2 = a3.x2 * t4 + a3.y2 * e3 + (p3 ? 0 : n4)), void 0 !== a3.y2 && (a3.y2 = y4 * r3 + a3.y2 * i3 + (p3 ? 0 : o3));
          var T3 = t4 * i3 - r3 * e3;
          if (void 0 !== a3.xRot && (1 !== t4 || 0 !== r3 || 0 !== e3 || 1 !== i3))
            if (0 === T3)
              delete a3.rX, delete a3.rY, delete a3.xRot, delete a3.lArcFlag, delete a3.sweepFlag, a3.type = _.LINE_TO;
            else {
              var v3 = a3.xRot * Math.PI / 180, f3 = Math.sin(v3), N3 = Math.cos(v3), x3 = 1 / l4(a3.rX), d2 = 1 / l4(a3.rY), E2 = l4(N3) * x3 + l4(f3) * d2, A3 = 2 * f3 * N3 * (x3 - d2), C2 = l4(f3) * x3 + l4(N3) * d2, M2 = E2 * i3 * i3 - A3 * r3 * i3 + C2 * r3 * r3, R2 = A3 * (t4 * i3 + r3 * e3) - 2 * (E2 * e3 * i3 + C2 * t4 * r3), g2 = E2 * e3 * e3 - A3 * t4 * e3 + C2 * t4 * t4, I2 = (Math.atan2(R2, M2 - g2) + Math.PI) % Math.PI / 2, S2 = Math.sin(I2), L2 = Math.cos(I2);
              a3.rX = Math.abs(T3) / Math.sqrt(M2 * l4(L2) + R2 * S2 * L2 + g2 * l4(S2)), a3.rY = Math.abs(T3) / Math.sqrt(M2 * l4(S2) - R2 * S2 * L2 + g2 * l4(L2)), a3.xRot = 180 * I2 / Math.PI;
            }
          return void 0 !== a3.sweepFlag && 0 > T3 && (a3.sweepFlag = +!a3.sweepFlag), a3;
        });
      }
      function l3() {
        return function(t4) {
          var r3 = {};
          for (var e3 in t4)
            r3[e3] = t4[e3];
          return r3;
        };
      }
      t3.ROUND = function(t4) {
        function r3(r4) {
          return Math.round(r4 * t4) / t4;
        }
        return void 0 === t4 && (t4 = 1e13), a(t4), function(t5) {
          return void 0 !== t5.x1 && (t5.x1 = r3(t5.x1)), void 0 !== t5.y1 && (t5.y1 = r3(t5.y1)), void 0 !== t5.x2 && (t5.x2 = r3(t5.x2)), void 0 !== t5.y2 && (t5.y2 = r3(t5.y2)), void 0 !== t5.x && (t5.x = r3(t5.x)), void 0 !== t5.y && (t5.y = r3(t5.y)), void 0 !== t5.rX && (t5.rX = r3(t5.rX)), void 0 !== t5.rY && (t5.rY = r3(t5.rY)), t5;
        };
      }, t3.TO_ABS = r2, t3.TO_REL = function() {
        return u3(function(t4, r3, e3) {
          return t4.relative || (void 0 !== t4.x1 && (t4.x1 -= r3), void 0 !== t4.y1 && (t4.y1 -= e3), void 0 !== t4.x2 && (t4.x2 -= r3), void 0 !== t4.y2 && (t4.y2 -= e3), void 0 !== t4.x && (t4.x -= r3), void 0 !== t4.y && (t4.y -= e3), t4.relative = true), t4;
        });
      }, t3.NORMALIZE_HVZ = function(t4, r3, e3) {
        return void 0 === t4 && (t4 = true), void 0 === r3 && (r3 = true), void 0 === e3 && (e3 = true), u3(function(i3, a3, n4, o3, s3) {
          if (isNaN(o3) && !(i3.type & _.MOVE_TO))
            throw new Error("path must start with moveto");
          return r3 && i3.type & _.HORIZ_LINE_TO && (i3.type = _.LINE_TO, i3.y = i3.relative ? 0 : n4), e3 && i3.type & _.VERT_LINE_TO && (i3.type = _.LINE_TO, i3.x = i3.relative ? 0 : a3), t4 && i3.type & _.CLOSE_PATH && (i3.type = _.LINE_TO, i3.x = i3.relative ? o3 - a3 : o3, i3.y = i3.relative ? s3 - n4 : s3), i3.type & _.ARC && (0 === i3.rX || 0 === i3.rY) && (i3.type = _.LINE_TO, delete i3.rX, delete i3.rY, delete i3.xRot, delete i3.lArcFlag, delete i3.sweepFlag), i3;
        });
      }, t3.NORMALIZE_ST = e2, t3.QT_TO_C = n3, t3.INFO = u3, t3.SANITIZE = function(t4) {
        void 0 === t4 && (t4 = 0), a(t4);
        var r3 = NaN, e3 = NaN, i3 = NaN, n4 = NaN;
        return u3(function(a3, o3, s3, u4, h3) {
          var c4 = Math.abs, y4 = false, p3 = 0, m4 = 0;
          if (a3.type & _.SMOOTH_CURVE_TO && (p3 = isNaN(r3) ? 0 : o3 - r3, m4 = isNaN(e3) ? 0 : s3 - e3), a3.type & (_.CURVE_TO | _.SMOOTH_CURVE_TO) ? (r3 = a3.relative ? o3 + a3.x2 : a3.x2, e3 = a3.relative ? s3 + a3.y2 : a3.y2) : (r3 = NaN, e3 = NaN), a3.type & _.SMOOTH_QUAD_TO ? (i3 = isNaN(i3) ? o3 : 2 * o3 - i3, n4 = isNaN(n4) ? s3 : 2 * s3 - n4) : a3.type & _.QUAD_TO ? (i3 = a3.relative ? o3 + a3.x1 : a3.x1, n4 = a3.relative ? s3 + a3.y1 : a3.y2) : (i3 = NaN, n4 = NaN), a3.type & _.LINE_COMMANDS || a3.type & _.ARC && (0 === a3.rX || 0 === a3.rY || !a3.lArcFlag) || a3.type & _.CURVE_TO || a3.type & _.SMOOTH_CURVE_TO || a3.type & _.QUAD_TO || a3.type & _.SMOOTH_QUAD_TO) {
            var O4 = void 0 === a3.x ? 0 : a3.relative ? a3.x : a3.x - o3, l4 = void 0 === a3.y ? 0 : a3.relative ? a3.y : a3.y - s3;
            p3 = isNaN(i3) ? void 0 === a3.x1 ? p3 : a3.relative ? a3.x : a3.x1 - o3 : i3 - o3, m4 = isNaN(n4) ? void 0 === a3.y1 ? m4 : a3.relative ? a3.y : a3.y1 - s3 : n4 - s3;
            var T3 = void 0 === a3.x2 ? 0 : a3.relative ? a3.x : a3.x2 - o3, v3 = void 0 === a3.y2 ? 0 : a3.relative ? a3.y : a3.y2 - s3;
            c4(O4) <= t4 && c4(l4) <= t4 && c4(p3) <= t4 && c4(m4) <= t4 && c4(T3) <= t4 && c4(v3) <= t4 && (y4 = true);
          }
          return a3.type & _.CLOSE_PATH && c4(o3 - u4) <= t4 && c4(s3 - h3) <= t4 && (y4 = true), y4 ? [] : a3;
        });
      }, t3.MATRIX = O3, t3.ROTATE = function(t4, r3, e3) {
        void 0 === r3 && (r3 = 0), void 0 === e3 && (e3 = 0), a(t4, r3, e3);
        var i3 = Math.sin(t4), n4 = Math.cos(t4);
        return O3(n4, i3, -i3, n4, r3 - r3 * n4 + e3 * i3, e3 - r3 * i3 - e3 * n4);
      }, t3.TRANSLATE = function(t4, r3) {
        return void 0 === r3 && (r3 = 0), a(t4, r3), O3(1, 0, 0, 1, t4, r3);
      }, t3.SCALE = function(t4, r3) {
        return void 0 === r3 && (r3 = t4), a(t4, r3), O3(t4, 0, 0, r3, 0, 0);
      }, t3.SKEW_X = function(t4) {
        return a(t4), O3(1, 0, Math.atan(t4), 1, 0, 0);
      }, t3.SKEW_Y = function(t4) {
        return a(t4), O3(1, Math.atan(t4), 0, 1, 0, 0);
      }, t3.X_AXIS_SYMMETRY = function(t4) {
        return void 0 === t4 && (t4 = 0), a(t4), O3(-1, 0, 0, 1, t4, 0);
      }, t3.Y_AXIS_SYMMETRY = function(t4) {
        return void 0 === t4 && (t4 = 0), a(t4), O3(1, 0, 0, -1, 0, t4);
      }, t3.A_TO_C = function() {
        return u3(function(t4, r3, e3) {
          return _.ARC === t4.type ? function(t5, r4, e4) {
            var a3, n4, s3, u4;
            t5.cX || o(t5, r4, e4);
            for (var y4 = Math.min(t5.phi1, t5.phi2), p3 = Math.max(t5.phi1, t5.phi2) - y4, m4 = Math.ceil(p3 / 90), O4 = new Array(m4), l4 = r4, T3 = e4, v3 = 0; v3 < m4; v3++) {
              var f3 = c(t5.phi1, t5.phi2, v3 / m4), N3 = c(t5.phi1, t5.phi2, (v3 + 1) / m4), x3 = N3 - f3, d2 = 4 / 3 * Math.tan(x3 * h / 4), E2 = [Math.cos(f3 * h) - d2 * Math.sin(f3 * h), Math.sin(f3 * h) + d2 * Math.cos(f3 * h)], A3 = E2[0], C2 = E2[1], M2 = [Math.cos(N3 * h), Math.sin(N3 * h)], R2 = M2[0], g2 = M2[1], I2 = [R2 + d2 * Math.sin(N3 * h), g2 - d2 * Math.cos(N3 * h)], S2 = I2[0], L2 = I2[1];
              O4[v3] = { relative: t5.relative, type: _.CURVE_TO };
              var H2 = function(r5, e5) {
                var a4 = i([r5 * t5.rX, e5 * t5.rY], t5.xRot), n5 = a4[0], o3 = a4[1];
                return [t5.cX + n5, t5.cY + o3];
              };
              a3 = H2(A3, C2), O4[v3].x1 = a3[0], O4[v3].y1 = a3[1], n4 = H2(S2, L2), O4[v3].x2 = n4[0], O4[v3].y2 = n4[1], s3 = H2(R2, g2), O4[v3].x = s3[0], O4[v3].y = s3[1], t5.relative && (O4[v3].x1 -= l4, O4[v3].y1 -= T3, O4[v3].x2 -= l4, O4[v3].y2 -= T3, O4[v3].x -= l4, O4[v3].y -= T3), l4 = (u4 = [O4[v3].x, O4[v3].y])[0], T3 = u4[1];
            }
            return O4;
          }(t4, t4.relative ? 0 : r3, t4.relative ? 0 : e3) : t4;
        });
      }, t3.ANNOTATE_ARCS = function() {
        return u3(function(t4, r3, e3) {
          return t4.relative && (r3 = 0, e3 = 0), _.ARC === t4.type && o(t4, r3, e3), t4;
        });
      }, t3.CLONE = l3, t3.CALCULATE_BOUNDS = function() {
        var t4 = function(t5) {
          var r3 = {};
          for (var e3 in t5)
            r3[e3] = t5[e3];
          return r3;
        }, i3 = r2(), a3 = n3(), h3 = e2(), c4 = u3(function(r3, e3, n4) {
          var u4 = h3(a3(i3(t4(r3))));
          function O4(t5) {
            t5 > c4.maxX && (c4.maxX = t5), t5 < c4.minX && (c4.minX = t5);
          }
          function l4(t5) {
            t5 > c4.maxY && (c4.maxY = t5), t5 < c4.minY && (c4.minY = t5);
          }
          if (u4.type & _.DRAWING_COMMANDS && (O4(e3), l4(n4)), u4.type & _.HORIZ_LINE_TO && O4(u4.x), u4.type & _.VERT_LINE_TO && l4(u4.y), u4.type & _.LINE_TO && (O4(u4.x), l4(u4.y)), u4.type & _.CURVE_TO) {
            O4(u4.x), l4(u4.y);
            for (var T3 = 0, v3 = p(e3, u4.x1, u4.x2, u4.x); T3 < v3.length; T3++) {
              0 < (w2 = v3[T3]) && 1 > w2 && O4(m(e3, u4.x1, u4.x2, u4.x, w2));
            }
            for (var f3 = 0, N3 = p(n4, u4.y1, u4.y2, u4.y); f3 < N3.length; f3++) {
              0 < (w2 = N3[f3]) && 1 > w2 && l4(m(n4, u4.y1, u4.y2, u4.y, w2));
            }
          }
          if (u4.type & _.ARC) {
            O4(u4.x), l4(u4.y), o(u4, e3, n4);
            for (var x3 = u4.xRot / 180 * Math.PI, d2 = Math.cos(x3) * u4.rX, E2 = Math.sin(x3) * u4.rX, A3 = -Math.sin(x3) * u4.rY, C2 = Math.cos(x3) * u4.rY, M2 = u4.phi1 < u4.phi2 ? [u4.phi1, u4.phi2] : -180 > u4.phi2 ? [u4.phi2 + 360, u4.phi1 + 360] : [u4.phi2, u4.phi1], R2 = M2[0], g2 = M2[1], I2 = function(t5) {
              var r4 = t5[0], e4 = t5[1], i4 = 180 * Math.atan2(e4, r4) / Math.PI;
              return i4 < R2 ? i4 + 360 : i4;
            }, S2 = 0, L2 = s(A3, -d2, 0).map(I2); S2 < L2.length; S2++) {
              (w2 = L2[S2]) > R2 && w2 < g2 && O4(y2(u4.cX, d2, A3, w2));
            }
            for (var H2 = 0, U2 = s(C2, -E2, 0).map(I2); H2 < U2.length; H2++) {
              var w2;
              (w2 = U2[H2]) > R2 && w2 < g2 && l4(y2(u4.cY, E2, C2, w2));
            }
          }
          return r3;
        });
        return c4.minX = 1 / 0, c4.maxX = -1 / 0, c4.minY = 1 / 0, c4.maxY = -1 / 0, c4;
      };
    }(u || (u = {}));
    l = function() {
      function t3() {
      }
      return t3.prototype.round = function(t4) {
        return this.transform(u.ROUND(t4));
      }, t3.prototype.toAbs = function() {
        return this.transform(u.TO_ABS());
      }, t3.prototype.toRel = function() {
        return this.transform(u.TO_REL());
      }, t3.prototype.normalizeHVZ = function(t4, r2, e2) {
        return this.transform(u.NORMALIZE_HVZ(t4, r2, e2));
      }, t3.prototype.normalizeST = function() {
        return this.transform(u.NORMALIZE_ST());
      }, t3.prototype.qtToC = function() {
        return this.transform(u.QT_TO_C());
      }, t3.prototype.aToC = function() {
        return this.transform(u.A_TO_C());
      }, t3.prototype.sanitize = function(t4) {
        return this.transform(u.SANITIZE(t4));
      }, t3.prototype.translate = function(t4, r2) {
        return this.transform(u.TRANSLATE(t4, r2));
      }, t3.prototype.scale = function(t4, r2) {
        return this.transform(u.SCALE(t4, r2));
      }, t3.prototype.rotate = function(t4, r2, e2) {
        return this.transform(u.ROTATE(t4, r2, e2));
      }, t3.prototype.matrix = function(t4, r2, e2, i3, a3, n3) {
        return this.transform(u.MATRIX(t4, r2, e2, i3, a3, n3));
      }, t3.prototype.skewX = function(t4) {
        return this.transform(u.SKEW_X(t4));
      }, t3.prototype.skewY = function(t4) {
        return this.transform(u.SKEW_Y(t4));
      }, t3.prototype.xSymmetry = function(t4) {
        return this.transform(u.X_AXIS_SYMMETRY(t4));
      }, t3.prototype.ySymmetry = function(t4) {
        return this.transform(u.Y_AXIS_SYMMETRY(t4));
      }, t3.prototype.annotateArcs = function() {
        return this.transform(u.ANNOTATE_ARCS());
      }, t3;
    }();
    T = function(t3) {
      return " " === t3 || "	" === t3 || "\r" === t3 || "\n" === t3;
    };
    v = function(t3) {
      return "0".charCodeAt(0) <= t3.charCodeAt(0) && t3.charCodeAt(0) <= "9".charCodeAt(0);
    };
    f = function(t3) {
      function e2() {
        var r2 = t3.call(this) || this;
        return r2.curNumber = "", r2.curCommandType = -1, r2.curCommandRelative = false, r2.canParseCommandOrComma = true, r2.curNumberHasExp = false, r2.curNumberHasExpDigits = false, r2.curNumberHasDecimal = false, r2.curArgs = [], r2;
      }
      return r(e2, t3), e2.prototype.finish = function(t4) {
        if (void 0 === t4 && (t4 = []), this.parse(" ", t4), 0 !== this.curArgs.length || !this.canParseCommandOrComma)
          throw new SyntaxError("Unterminated command at the path end.");
        return t4;
      }, e2.prototype.parse = function(t4, r2) {
        var e3 = this;
        void 0 === r2 && (r2 = []);
        for (var i3 = function(t5) {
          r2.push(t5), e3.curArgs.length = 0, e3.canParseCommandOrComma = true;
        }, a3 = 0; a3 < t4.length; a3++) {
          var n3 = t4[a3], o3 = !(this.curCommandType !== _.ARC || 3 !== this.curArgs.length && 4 !== this.curArgs.length || 1 !== this.curNumber.length || "0" !== this.curNumber && "1" !== this.curNumber), s3 = v(n3) && ("0" === this.curNumber && "0" === n3 || o3);
          if (!v(n3) || s3)
            if ("e" !== n3 && "E" !== n3)
              if ("-" !== n3 && "+" !== n3 || !this.curNumberHasExp || this.curNumberHasExpDigits)
                if ("." !== n3 || this.curNumberHasExp || this.curNumberHasDecimal || o3) {
                  if (this.curNumber && -1 !== this.curCommandType) {
                    var u3 = Number(this.curNumber);
                    if (isNaN(u3))
                      throw new SyntaxError("Invalid number ending at " + a3);
                    if (this.curCommandType === _.ARC) {
                      if (0 === this.curArgs.length || 1 === this.curArgs.length) {
                        if (0 > u3)
                          throw new SyntaxError('Expected positive number, got "' + u3 + '" at index "' + a3 + '"');
                      } else if ((3 === this.curArgs.length || 4 === this.curArgs.length) && "0" !== this.curNumber && "1" !== this.curNumber)
                        throw new SyntaxError('Expected a flag, got "' + this.curNumber + '" at index "' + a3 + '"');
                    }
                    this.curArgs.push(u3), this.curArgs.length === N[this.curCommandType] && (_.HORIZ_LINE_TO === this.curCommandType ? i3({ type: _.HORIZ_LINE_TO, relative: this.curCommandRelative, x: u3 }) : _.VERT_LINE_TO === this.curCommandType ? i3({ type: _.VERT_LINE_TO, relative: this.curCommandRelative, y: u3 }) : this.curCommandType === _.MOVE_TO || this.curCommandType === _.LINE_TO || this.curCommandType === _.SMOOTH_QUAD_TO ? (i3({ type: this.curCommandType, relative: this.curCommandRelative, x: this.curArgs[0], y: this.curArgs[1] }), _.MOVE_TO === this.curCommandType && (this.curCommandType = _.LINE_TO)) : this.curCommandType === _.CURVE_TO ? i3({ type: _.CURVE_TO, relative: this.curCommandRelative, x1: this.curArgs[0], y1: this.curArgs[1], x2: this.curArgs[2], y2: this.curArgs[3], x: this.curArgs[4], y: this.curArgs[5] }) : this.curCommandType === _.SMOOTH_CURVE_TO ? i3({ type: _.SMOOTH_CURVE_TO, relative: this.curCommandRelative, x2: this.curArgs[0], y2: this.curArgs[1], x: this.curArgs[2], y: this.curArgs[3] }) : this.curCommandType === _.QUAD_TO ? i3({ type: _.QUAD_TO, relative: this.curCommandRelative, x1: this.curArgs[0], y1: this.curArgs[1], x: this.curArgs[2], y: this.curArgs[3] }) : this.curCommandType === _.ARC && i3({ type: _.ARC, relative: this.curCommandRelative, rX: this.curArgs[0], rY: this.curArgs[1], xRot: this.curArgs[2], lArcFlag: this.curArgs[3], sweepFlag: this.curArgs[4], x: this.curArgs[5], y: this.curArgs[6] })), this.curNumber = "", this.curNumberHasExpDigits = false, this.curNumberHasExp = false, this.curNumberHasDecimal = false, this.canParseCommandOrComma = true;
                  }
                  if (!T(n3))
                    if ("," === n3 && this.canParseCommandOrComma)
                      this.canParseCommandOrComma = false;
                    else if ("+" !== n3 && "-" !== n3 && "." !== n3)
                      if (s3)
                        this.curNumber = n3, this.curNumberHasDecimal = false;
                      else {
                        if (0 !== this.curArgs.length)
                          throw new SyntaxError("Unterminated command at index " + a3 + ".");
                        if (!this.canParseCommandOrComma)
                          throw new SyntaxError('Unexpected character "' + n3 + '" at index ' + a3 + ". Command cannot follow comma");
                        if (this.canParseCommandOrComma = false, "z" !== n3 && "Z" !== n3)
                          if ("h" === n3 || "H" === n3)
                            this.curCommandType = _.HORIZ_LINE_TO, this.curCommandRelative = "h" === n3;
                          else if ("v" === n3 || "V" === n3)
                            this.curCommandType = _.VERT_LINE_TO, this.curCommandRelative = "v" === n3;
                          else if ("m" === n3 || "M" === n3)
                            this.curCommandType = _.MOVE_TO, this.curCommandRelative = "m" === n3;
                          else if ("l" === n3 || "L" === n3)
                            this.curCommandType = _.LINE_TO, this.curCommandRelative = "l" === n3;
                          else if ("c" === n3 || "C" === n3)
                            this.curCommandType = _.CURVE_TO, this.curCommandRelative = "c" === n3;
                          else if ("s" === n3 || "S" === n3)
                            this.curCommandType = _.SMOOTH_CURVE_TO, this.curCommandRelative = "s" === n3;
                          else if ("q" === n3 || "Q" === n3)
                            this.curCommandType = _.QUAD_TO, this.curCommandRelative = "q" === n3;
                          else if ("t" === n3 || "T" === n3)
                            this.curCommandType = _.SMOOTH_QUAD_TO, this.curCommandRelative = "t" === n3;
                          else {
                            if ("a" !== n3 && "A" !== n3)
                              throw new SyntaxError('Unexpected character "' + n3 + '" at index ' + a3 + ".");
                            this.curCommandType = _.ARC, this.curCommandRelative = "a" === n3;
                          }
                        else
                          r2.push({ type: _.CLOSE_PATH }), this.canParseCommandOrComma = true, this.curCommandType = -1;
                      }
                    else
                      this.curNumber = n3, this.curNumberHasDecimal = "." === n3;
                } else
                  this.curNumber += n3, this.curNumberHasDecimal = true;
              else
                this.curNumber += n3;
            else
              this.curNumber += n3, this.curNumberHasExp = true;
          else
            this.curNumber += n3, this.curNumberHasExpDigits = this.curNumberHasExp;
        }
        return r2;
      }, e2.prototype.transform = function(t4) {
        return Object.create(this, { parse: { value: function(r2, e3) {
          void 0 === e3 && (e3 = []);
          for (var i3 = 0, a3 = Object.getPrototypeOf(this).parse.call(this, r2); i3 < a3.length; i3++) {
            var n3 = a3[i3], o3 = t4(n3);
            Array.isArray(o3) ? e3.push.apply(e3, o3) : e3.push(o3);
          }
          return e3;
        } } });
      }, e2;
    }(l);
    _ = function(t3) {
      function i3(r2) {
        var e2 = t3.call(this) || this;
        return e2.commands = "string" == typeof r2 ? i3.parse(r2) : r2, e2;
      }
      return r(i3, t3), i3.prototype.encode = function() {
        return i3.encode(this.commands);
      }, i3.prototype.getBounds = function() {
        var t4 = u.CALCULATE_BOUNDS();
        return this.transform(t4), t4;
      }, i3.prototype.transform = function(t4) {
        for (var r2 = [], e2 = 0, i4 = this.commands; e2 < i4.length; e2++) {
          var a3 = t4(i4[e2]);
          Array.isArray(a3) ? r2.push.apply(r2, a3) : r2.push(a3);
        }
        return this.commands = r2, this;
      }, i3.encode = function(t4) {
        return e(t4);
      }, i3.parse = function(t4) {
        var r2 = new f(), e2 = [];
        return r2.parse(t4, e2), r2.finish(e2), e2;
      }, i3.CLOSE_PATH = 1, i3.MOVE_TO = 2, i3.HORIZ_LINE_TO = 4, i3.VERT_LINE_TO = 8, i3.LINE_TO = 16, i3.CURVE_TO = 32, i3.SMOOTH_CURVE_TO = 64, i3.QUAD_TO = 128, i3.SMOOTH_QUAD_TO = 256, i3.ARC = 512, i3.LINE_COMMANDS = i3.LINE_TO | i3.HORIZ_LINE_TO | i3.VERT_LINE_TO, i3.DRAWING_COMMANDS = i3.HORIZ_LINE_TO | i3.VERT_LINE_TO | i3.LINE_TO | i3.CURVE_TO | i3.SMOOTH_CURVE_TO | i3.QUAD_TO | i3.SMOOTH_QUAD_TO | i3.ARC, i3;
    }(l);
    N = ((O = {})[_.MOVE_TO] = 2, O[_.LINE_TO] = 2, O[_.HORIZ_LINE_TO] = 1, O[_.VERT_LINE_TO] = 1, O[_.CLOSE_PATH] = 0, O[_.QUAD_TO] = 4, O[_.SMOOTH_QUAD_TO] = 2, O[_.CURVE_TO] = 6, O[_.SMOOTH_CURVE_TO] = 4, O[_.ARC] = 7, O);
  }
});

// ../simple-mind-map/node_modules/core-js/internals/regexp-get-flags.js
var require_regexp_get_flags = __commonJS({
  "../simple-mind-map/node_modules/core-js/internals/regexp-get-flags.js"(exports, module) {
    var call4 = require_function_call();
    var hasOwn = require_has_own_property();
    var isPrototypeOf = require_object_is_prototype_of();
    var regExpFlags = require_regexp_flags();
    var RegExpPrototype2 = RegExp.prototype;
    module.exports = function(R2) {
      var flags = R2.flags;
      return flags === void 0 && !("flags" in RegExpPrototype2) && !hasOwn(R2, "flags") && isPrototypeOf(RegExpPrototype2, R2) ? call4(regExpFlags, R2) : flags;
    };
  }
});

// ../simple-mind-map/node_modules/core-js/modules/es.regexp.to-string.js
var PROPER_FUNCTION_NAME, defineBuiltIn, anObject4, $toString, fails3, getRegExpFlags, TO_STRING, RegExpPrototype, nativeToString, NOT_GENERIC, INCORRECT_NAME;
var init_es_regexp_to_string = __esm({
  "../simple-mind-map/node_modules/core-js/modules/es.regexp.to-string.js"() {
    "use strict";
    PROPER_FUNCTION_NAME = require_function_name().PROPER;
    defineBuiltIn = require_define_built_in();
    anObject4 = require_an_object();
    $toString = require_to_string();
    fails3 = require_fails();
    getRegExpFlags = require_regexp_get_flags();
    TO_STRING = "toString";
    RegExpPrototype = RegExp.prototype;
    nativeToString = RegExpPrototype[TO_STRING];
    NOT_GENERIC = fails3(function() {
      return nativeToString.call({ source: "a", flags: "b" }) != "/a/b";
    });
    INCORRECT_NAME = PROPER_FUNCTION_NAME && nativeToString.name != TO_STRING;
    if (NOT_GENERIC || INCORRECT_NAME) {
      defineBuiltIn(RegExp.prototype, TO_STRING, function toString8() {
        var R2 = anObject4(this);
        var pattern = $toString(R2.source);
        var flags = $toString(getRegExpFlags(R2));
        return "/" + pattern + "/" + flags;
      }, { unsafe: true });
    }
  }
});

// ../simple-mind-map/node_modules/stackblur-canvas/dist/stackblur-es.js
function _typeof2(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof2 = function(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof2 = function(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof2(obj);
}
function _classCallCheck(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function getImageDataFromCanvas(canvas, topX, topY, width2, height2) {
  if (typeof canvas === "string") {
    canvas = document.getElementById(canvas);
  }
  if (!canvas || _typeof2(canvas) !== "object" || !("getContext" in canvas)) {
    throw new TypeError("Expecting canvas with `getContext` method in processCanvasRGB(A) calls!");
  }
  var context = canvas.getContext("2d");
  try {
    return context.getImageData(topX, topY, width2, height2);
  } catch (e2) {
    throw new Error("unable to access image data: " + e2);
  }
}
function processCanvasRGBA(canvas, topX, topY, width2, height2, radius) {
  if (isNaN(radius) || radius < 1) {
    return;
  }
  radius |= 0;
  var imageData = getImageDataFromCanvas(canvas, topX, topY, width2, height2);
  imageData = processImageDataRGBA(imageData, topX, topY, width2, height2, radius);
  canvas.getContext("2d").putImageData(imageData, topX, topY);
}
function processImageDataRGBA(imageData, topX, topY, width2, height2, radius) {
  var pixels = imageData.data;
  var div = 2 * radius + 1;
  var widthMinus1 = width2 - 1;
  var heightMinus1 = height2 - 1;
  var radiusPlus1 = radius + 1;
  var sumFactor = radiusPlus1 * (radiusPlus1 + 1) / 2;
  var stackStart = new BlurStack();
  var stack = stackStart;
  var stackEnd;
  for (var i3 = 1; i3 < div; i3++) {
    stack = stack.next = new BlurStack();
    if (i3 === radiusPlus1) {
      stackEnd = stack;
    }
  }
  stack.next = stackStart;
  var stackIn = null, stackOut = null, yw = 0, yi = 0;
  var mulSum = mulTable[radius];
  var shgSum = shgTable[radius];
  for (var y4 = 0; y4 < height2; y4++) {
    stack = stackStart;
    var pr = pixels[yi], pg = pixels[yi + 1], pb = pixels[yi + 2], pa = pixels[yi + 3];
    for (var _i = 0; _i < radiusPlus1; _i++) {
      stack.r = pr;
      stack.g = pg;
      stack.b = pb;
      stack.a = pa;
      stack = stack.next;
    }
    var rInSum = 0, gInSum = 0, bInSum = 0, aInSum = 0, rOutSum = radiusPlus1 * pr, gOutSum = radiusPlus1 * pg, bOutSum = radiusPlus1 * pb, aOutSum = radiusPlus1 * pa, rSum = sumFactor * pr, gSum = sumFactor * pg, bSum = sumFactor * pb, aSum = sumFactor * pa;
    for (var _i2 = 1; _i2 < radiusPlus1; _i2++) {
      var p3 = yi + ((widthMinus1 < _i2 ? widthMinus1 : _i2) << 2);
      var r2 = pixels[p3], g2 = pixels[p3 + 1], b2 = pixels[p3 + 2], a3 = pixels[p3 + 3];
      var rbs = radiusPlus1 - _i2;
      rSum += (stack.r = r2) * rbs;
      gSum += (stack.g = g2) * rbs;
      bSum += (stack.b = b2) * rbs;
      aSum += (stack.a = a3) * rbs;
      rInSum += r2;
      gInSum += g2;
      bInSum += b2;
      aInSum += a3;
      stack = stack.next;
    }
    stackIn = stackStart;
    stackOut = stackEnd;
    for (var x3 = 0; x3 < width2; x3++) {
      var paInitial = aSum * mulSum >> shgSum;
      pixels[yi + 3] = paInitial;
      if (paInitial !== 0) {
        var _a2 = 255 / paInitial;
        pixels[yi] = (rSum * mulSum >> shgSum) * _a2;
        pixels[yi + 1] = (gSum * mulSum >> shgSum) * _a2;
        pixels[yi + 2] = (bSum * mulSum >> shgSum) * _a2;
      } else {
        pixels[yi] = pixels[yi + 1] = pixels[yi + 2] = 0;
      }
      rSum -= rOutSum;
      gSum -= gOutSum;
      bSum -= bOutSum;
      aSum -= aOutSum;
      rOutSum -= stackIn.r;
      gOutSum -= stackIn.g;
      bOutSum -= stackIn.b;
      aOutSum -= stackIn.a;
      var _p = x3 + radius + 1;
      _p = yw + (_p < widthMinus1 ? _p : widthMinus1) << 2;
      rInSum += stackIn.r = pixels[_p];
      gInSum += stackIn.g = pixels[_p + 1];
      bInSum += stackIn.b = pixels[_p + 2];
      aInSum += stackIn.a = pixels[_p + 3];
      rSum += rInSum;
      gSum += gInSum;
      bSum += bInSum;
      aSum += aInSum;
      stackIn = stackIn.next;
      var _stackOut = stackOut, _r = _stackOut.r, _g = _stackOut.g, _b2 = _stackOut.b, _a3 = _stackOut.a;
      rOutSum += _r;
      gOutSum += _g;
      bOutSum += _b2;
      aOutSum += _a3;
      rInSum -= _r;
      gInSum -= _g;
      bInSum -= _b2;
      aInSum -= _a3;
      stackOut = stackOut.next;
      yi += 4;
    }
    yw += width2;
  }
  for (var _x = 0; _x < width2; _x++) {
    yi = _x << 2;
    var _pr = pixels[yi], _pg = pixels[yi + 1], _pb = pixels[yi + 2], _pa = pixels[yi + 3], _rOutSum = radiusPlus1 * _pr, _gOutSum = radiusPlus1 * _pg, _bOutSum = radiusPlus1 * _pb, _aOutSum = radiusPlus1 * _pa, _rSum = sumFactor * _pr, _gSum = sumFactor * _pg, _bSum = sumFactor * _pb, _aSum = sumFactor * _pa;
    stack = stackStart;
    for (var _i3 = 0; _i3 < radiusPlus1; _i3++) {
      stack.r = _pr;
      stack.g = _pg;
      stack.b = _pb;
      stack.a = _pa;
      stack = stack.next;
    }
    var yp = width2;
    var _gInSum = 0, _bInSum = 0, _aInSum = 0, _rInSum = 0;
    for (var _i4 = 1; _i4 <= radius; _i4++) {
      yi = yp + _x << 2;
      var _rbs = radiusPlus1 - _i4;
      _rSum += (stack.r = _pr = pixels[yi]) * _rbs;
      _gSum += (stack.g = _pg = pixels[yi + 1]) * _rbs;
      _bSum += (stack.b = _pb = pixels[yi + 2]) * _rbs;
      _aSum += (stack.a = _pa = pixels[yi + 3]) * _rbs;
      _rInSum += _pr;
      _gInSum += _pg;
      _bInSum += _pb;
      _aInSum += _pa;
      stack = stack.next;
      if (_i4 < heightMinus1) {
        yp += width2;
      }
    }
    yi = _x;
    stackIn = stackStart;
    stackOut = stackEnd;
    for (var _y = 0; _y < height2; _y++) {
      var _p2 = yi << 2;
      pixels[_p2 + 3] = _pa = _aSum * mulSum >> shgSum;
      if (_pa > 0) {
        _pa = 255 / _pa;
        pixels[_p2] = (_rSum * mulSum >> shgSum) * _pa;
        pixels[_p2 + 1] = (_gSum * mulSum >> shgSum) * _pa;
        pixels[_p2 + 2] = (_bSum * mulSum >> shgSum) * _pa;
      } else {
        pixels[_p2] = pixels[_p2 + 1] = pixels[_p2 + 2] = 0;
      }
      _rSum -= _rOutSum;
      _gSum -= _gOutSum;
      _bSum -= _bOutSum;
      _aSum -= _aOutSum;
      _rOutSum -= stackIn.r;
      _gOutSum -= stackIn.g;
      _bOutSum -= stackIn.b;
      _aOutSum -= stackIn.a;
      _p2 = _x + ((_p2 = _y + radiusPlus1) < heightMinus1 ? _p2 : heightMinus1) * width2 << 2;
      _rSum += _rInSum += stackIn.r = pixels[_p2];
      _gSum += _gInSum += stackIn.g = pixels[_p2 + 1];
      _bSum += _bInSum += stackIn.b = pixels[_p2 + 2];
      _aSum += _aInSum += stackIn.a = pixels[_p2 + 3];
      stackIn = stackIn.next;
      _rOutSum += _pr = stackOut.r;
      _gOutSum += _pg = stackOut.g;
      _bOutSum += _pb = stackOut.b;
      _aOutSum += _pa = stackOut.a;
      _rInSum -= _pr;
      _gInSum -= _pg;
      _bInSum -= _pb;
      _aInSum -= _pa;
      stackOut = stackOut.next;
      yi += width2;
    }
  }
  return imageData;
}
var mulTable, shgTable, BlurStack;
var init_stackblur_es = __esm({
  "../simple-mind-map/node_modules/stackblur-canvas/dist/stackblur-es.js"() {
    mulTable = [512, 512, 456, 512, 328, 456, 335, 512, 405, 328, 271, 456, 388, 335, 292, 512, 454, 405, 364, 328, 298, 271, 496, 456, 420, 388, 360, 335, 312, 292, 273, 512, 482, 454, 428, 405, 383, 364, 345, 328, 312, 298, 284, 271, 259, 496, 475, 456, 437, 420, 404, 388, 374, 360, 347, 335, 323, 312, 302, 292, 282, 273, 265, 512, 497, 482, 468, 454, 441, 428, 417, 405, 394, 383, 373, 364, 354, 345, 337, 328, 320, 312, 305, 298, 291, 284, 278, 271, 265, 259, 507, 496, 485, 475, 465, 456, 446, 437, 428, 420, 412, 404, 396, 388, 381, 374, 367, 360, 354, 347, 341, 335, 329, 323, 318, 312, 307, 302, 297, 292, 287, 282, 278, 273, 269, 265, 261, 512, 505, 497, 489, 482, 475, 468, 461, 454, 447, 441, 435, 428, 422, 417, 411, 405, 399, 394, 389, 383, 378, 373, 368, 364, 359, 354, 350, 345, 341, 337, 332, 328, 324, 320, 316, 312, 309, 305, 301, 298, 294, 291, 287, 284, 281, 278, 274, 271, 268, 265, 262, 259, 257, 507, 501, 496, 491, 485, 480, 475, 470, 465, 460, 456, 451, 446, 442, 437, 433, 428, 424, 420, 416, 412, 408, 404, 400, 396, 392, 388, 385, 381, 377, 374, 370, 367, 363, 360, 357, 354, 350, 347, 344, 341, 338, 335, 332, 329, 326, 323, 320, 318, 315, 312, 310, 307, 304, 302, 299, 297, 294, 292, 289, 287, 285, 282, 280, 278, 275, 273, 271, 269, 267, 265, 263, 261, 259];
    shgTable = [9, 11, 12, 13, 13, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24];
    BlurStack = /**
     * Set properties.
     */
    function BlurStack2() {
      _classCallCheck(this, BlurStack2);
      this.r = 0;
      this.g = 0;
      this.b = 0;
      this.a = 0;
      this.next = null;
    };
  }
});

// ../simple-mind-map/node_modules/canvg/lib/index.es.js
var index_es_exports = {};
__export(index_es_exports, {
  AElement: () => AElement,
  AnimateColorElement: () => AnimateColorElement,
  AnimateElement: () => AnimateElement,
  AnimateTransformElement: () => AnimateTransformElement,
  BoundingBox: () => BoundingBox,
  CB1: () => CB1,
  CB2: () => CB2,
  CB3: () => CB3,
  CB4: () => CB4,
  Canvg: () => Canvg,
  CircleElement: () => CircleElement,
  ClipPathElement: () => ClipPathElement,
  DefsElement: () => DefsElement,
  DescElement: () => DescElement,
  Document: () => Document,
  Element: () => Element2,
  EllipseElement: () => EllipseElement,
  FeColorMatrixElement: () => FeColorMatrixElement,
  FeCompositeElement: () => FeCompositeElement,
  FeDropShadowElement: () => FeDropShadowElement,
  FeGaussianBlurElement: () => FeGaussianBlurElement,
  FeMorphologyElement: () => FeMorphologyElement,
  FilterElement: () => FilterElement,
  Font: () => Font,
  FontElement: () => FontElement,
  FontFaceElement: () => FontFaceElement,
  GElement: () => GElement,
  GlyphElement: () => GlyphElement,
  GradientElement: () => GradientElement,
  ImageElement: () => ImageElement,
  LineElement: () => LineElement,
  LinearGradientElement: () => LinearGradientElement,
  MarkerElement: () => MarkerElement,
  MaskElement: () => MaskElement,
  Matrix: () => Matrix2,
  MissingGlyphElement: () => MissingGlyphElement,
  Mouse: () => Mouse,
  PSEUDO_ZERO: () => PSEUDO_ZERO,
  Parser: () => Parser,
  PathElement: () => PathElement,
  PathParser: () => PathParser,
  PatternElement: () => PatternElement,
  Point: () => Point2,
  PolygonElement: () => PolygonElement,
  PolylineElement: () => PolylineElement,
  Property: () => Property,
  QB1: () => QB1,
  QB2: () => QB2,
  QB3: () => QB3,
  RadialGradientElement: () => RadialGradientElement,
  RectElement: () => RectElement,
  RenderedElement: () => RenderedElement,
  Rotate: () => Rotate,
  SVGElement: () => SVGElement,
  SVGFontLoader: () => SVGFontLoader,
  Scale: () => Scale,
  Screen: () => Screen,
  Skew: () => Skew,
  SkewX: () => SkewX,
  SkewY: () => SkewY,
  StopElement: () => StopElement,
  StyleElement: () => StyleElement,
  SymbolElement: () => SymbolElement,
  TRefElement: () => TRefElement,
  TSpanElement: () => TSpanElement,
  TextElement: () => TextElement,
  TextPathElement: () => TextPathElement,
  TitleElement: () => TitleElement,
  Transform: () => Transform,
  Translate: () => Translate,
  UnknownElement: () => UnknownElement,
  UseElement: () => UseElement,
  ViewPort: () => ViewPort,
  compressSpaces: () => compressSpaces,
  default: () => Canvg,
  getSelectorSpecificity: () => getSelectorSpecificity,
  normalizeAttributeName: () => normalizeAttributeName,
  normalizeColor: () => normalizeColor,
  parseExternalUrl: () => parseExternalUrl,
  presets: () => index,
  toNumbers: () => toNumbers,
  trimLeft: () => trimLeft,
  trimRight: () => trimRight,
  vectorMagnitude: () => vectorMagnitude,
  vectorsAngle: () => vectorsAngle,
  vectorsRatio: () => vectorsRatio
});
function offscreen() {
  var {
    DOMParser: DOMParserFallback
  } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
  var preset = {
    window: null,
    ignoreAnimation: true,
    ignoreMouse: true,
    DOMParser: DOMParserFallback,
    createCanvas(width2, height2) {
      return new OffscreenCanvas(width2, height2);
    },
    createImage(url) {
      return _asyncToGenerator(function* () {
        var response = yield fetch(url);
        var blob = yield response.blob();
        var img = yield createImageBitmap(blob);
        return img;
      })();
    }
  };
  if (typeof DOMParser !== "undefined" || typeof DOMParserFallback === "undefined") {
    Reflect.deleteProperty(preset, "DOMParser");
  }
  return preset;
}
function node(_ref) {
  var {
    DOMParser: DOMParser2,
    canvas,
    fetch: fetch2
  } = _ref;
  return {
    window: null,
    ignoreAnimation: true,
    ignoreMouse: true,
    DOMParser: DOMParser2,
    fetch: fetch2,
    createCanvas: canvas.createCanvas,
    createImage: canvas.loadImage
  };
}
function compressSpaces(str) {
  return str.replace(/(?!\u3000)\s+/gm, " ");
}
function trimLeft(str) {
  return str.replace(/^[\n \t]+/, "");
}
function trimRight(str) {
  return str.replace(/[\n \t]+$/, "");
}
function toNumbers(str) {
  var matches = (str || "").match(/-?(\d+(?:\.\d*(?:[eE][+-]?\d+)?)?|\.\d+)(?=\D|$)/gm) || [];
  return matches.map(parseFloat);
}
function normalizeAttributeName(name) {
  if (allUppercase.test(name)) {
    return name.toLowerCase();
  }
  return name;
}
function parseExternalUrl(url) {
  var urlMatch = /url\(('([^']+)'|"([^"]+)"|([^'")]+))\)/.exec(url) || [];
  return urlMatch[2] || urlMatch[3] || urlMatch[4];
}
function normalizeColor(color) {
  if (!color.startsWith("rgb")) {
    return color;
  }
  var rgbParts = 3;
  var normalizedColor = color.replace(/\d+(\.\d+)?/g, (num, isFloat) => rgbParts-- && isFloat ? String(Math.round(parseFloat(num))) : num);
  return normalizedColor;
}
function findSelectorMatch(selector, regex) {
  var matches = regex.exec(selector);
  if (!matches) {
    return [selector, 0];
  }
  return [selector.replace(regex, " "), matches.length];
}
function getSelectorSpecificity(selector) {
  var specificity = [0, 0, 0];
  var currentSelector = selector.replace(/:not\(([^)]*)\)/g, "     $1 ").replace(/{[\s\S]*/gm, " ");
  var delta = 0;
  [currentSelector, delta] = findSelectorMatch(currentSelector, attributeRegex);
  specificity[1] += delta;
  [currentSelector, delta] = findSelectorMatch(currentSelector, idRegex);
  specificity[0] += delta;
  [currentSelector, delta] = findSelectorMatch(currentSelector, classRegex);
  specificity[1] += delta;
  [currentSelector, delta] = findSelectorMatch(currentSelector, pseudoElementRegex);
  specificity[2] += delta;
  [currentSelector, delta] = findSelectorMatch(currentSelector, pseudoClassWithBracketsRegex);
  specificity[1] += delta;
  [currentSelector, delta] = findSelectorMatch(currentSelector, pseudoClassRegex);
  specificity[1] += delta;
  currentSelector = currentSelector.replace(/[*\s+>~]/g, " ").replace(/[#.]/g, " ");
  [currentSelector, delta] = findSelectorMatch(currentSelector, elementRegex);
  specificity[2] += delta;
  return specificity.join("");
}
function vectorMagnitude(v3) {
  return Math.sqrt(Math.pow(v3[0], 2) + Math.pow(v3[1], 2));
}
function vectorsRatio(u3, v3) {
  return (u3[0] * v3[0] + u3[1] * v3[1]) / (vectorMagnitude(u3) * vectorMagnitude(v3));
}
function vectorsAngle(u3, v3) {
  return (u3[0] * v3[1] < u3[1] * v3[0] ? -1 : 1) * Math.acos(vectorsRatio(u3, v3));
}
function CB1(t3) {
  return t3 * t3 * t3;
}
function CB2(t3) {
  return 3 * t3 * t3 * (1 - t3);
}
function CB3(t3) {
  return 3 * t3 * (1 - t3) * (1 - t3);
}
function CB4(t3) {
  return (1 - t3) * (1 - t3) * (1 - t3);
}
function QB1(t3) {
  return t3 * t3;
}
function QB2(t3) {
  return 2 * t3 * (1 - t3);
}
function QB3(t3) {
  return (1 - t3) * (1 - t3);
}
function parseTransforms(transform2) {
  return compressSpaces(transform2).trim().replace(/\)([a-zA-Z])/g, ") $1").replace(/\)(\s?,\s?)/g, ") ").split(/\s(?=[a-z])/);
}
function parseTransform(transform2) {
  var [type, value] = transform2.split("(");
  return [type.trim(), value.trim().replace(")", "")];
}
function wrapFontFamily(fontFamily) {
  var trimmed = fontFamily.trim();
  return /^('|")/.test(trimmed) ? trimmed : '"'.concat(trimmed, '"');
}
function prepareFontFamily(fontFamily) {
  return typeof process === "undefined" ? fontFamily : fontFamily.trim().split(",").map(wrapFontFamily).join(",");
}
function prepareFontStyle(fontStyle) {
  if (!fontStyle) {
    return "";
  }
  var targetFontStyle = fontStyle.trim().toLowerCase();
  switch (targetFontStyle) {
    case "normal":
    case "italic":
    case "oblique":
    case "inherit":
    case "initial":
    case "unset":
      return targetFontStyle;
    default:
      if (/^oblique\s+(-|)\d+deg$/.test(targetFontStyle)) {
        return targetFontStyle;
      }
      return "";
  }
}
function prepareFontWeight(fontWeight) {
  if (!fontWeight) {
    return "";
  }
  var targetFontWeight = fontWeight.trim().toLowerCase();
  switch (targetFontWeight) {
    case "normal":
    case "bold":
    case "lighter":
    case "bolder":
    case "inherit":
    case "initial":
    case "unset":
      return targetFontWeight;
    default:
      if (/^[\d.]+$/.test(targetFontWeight)) {
        return targetFontWeight;
      }
      return "";
  }
}
function ownKeys$2(object, enumerableOnly) {
  var keys = Object.keys(object);
  if (Object.getOwnPropertySymbols) {
    var symbols = Object.getOwnPropertySymbols(object);
    if (enumerableOnly) {
      symbols = symbols.filter(function(sym) {
        return Object.getOwnPropertyDescriptor(object, sym).enumerable;
      });
    }
    keys.push.apply(keys, symbols);
  }
  return keys;
}
function _objectSpread$2(target) {
  for (var i3 = 1; i3 < arguments.length; i3++) {
    var source = arguments[i3] != null ? arguments[i3] : {};
    if (i3 % 2) {
      ownKeys$2(Object(source), true).forEach(function(key) {
        _defineProperty(target, key, source[key]);
      });
    } else if (Object.getOwnPropertyDescriptors) {
      Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
      ownKeys$2(Object(source)).forEach(function(key) {
        Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
      });
    }
  }
  return target;
}
function imGet(img, x3, y4, width2, _height, rgba) {
  return img[y4 * width2 * 4 + x3 * 4 + rgba];
}
function imSet(img, x3, y4, width2, _height, rgba, val) {
  img[y4 * width2 * 4 + x3 * 4 + rgba] = val;
}
function m2(matrix, i3, v3) {
  var mi = matrix[i3];
  return mi * v3;
}
function c2(a3, m1, m22, m32) {
  return m1 + Math.cos(a3) * m22 + Math.sin(a3) * m32;
}
function ownKeys$1(object, enumerableOnly) {
  var keys = Object.keys(object);
  if (Object.getOwnPropertySymbols) {
    var symbols = Object.getOwnPropertySymbols(object);
    if (enumerableOnly) {
      symbols = symbols.filter(function(sym) {
        return Object.getOwnPropertyDescriptor(object, sym).enumerable;
      });
    }
    keys.push.apply(keys, symbols);
  }
  return keys;
}
function _objectSpread$1(target) {
  for (var i3 = 1; i3 < arguments.length; i3++) {
    var source = arguments[i3] != null ? arguments[i3] : {};
    if (i3 % 2) {
      ownKeys$1(Object(source), true).forEach(function(key) {
        _defineProperty(target, key, source[key]);
      });
    } else if (Object.getOwnPropertyDescriptors) {
      Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
      ownKeys$1(Object(source)).forEach(function(key) {
        Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
      });
    }
  }
  return target;
}
function createCanvas(width2, height2) {
  var canvas = document.createElement("canvas");
  canvas.width = width2;
  canvas.height = height2;
  return canvas;
}
function createImage(_x) {
  return _createImage.apply(this, arguments);
}
function _createImage() {
  _createImage = _asyncToGenerator(function* (src) {
    var anonymousCrossOrigin = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
    var image = document.createElement("img");
    if (anonymousCrossOrigin) {
      image.crossOrigin = "Anonymous";
    }
    return new Promise((resolve, reject) => {
      image.onload = () => {
        resolve(image);
      };
      image.onerror = (_event, _source, _lineno, _colno, error) => {
        reject(error);
      };
      image.src = src;
    });
  });
  return _createImage.apply(this, arguments);
}
function ownKeys(object, enumerableOnly) {
  var keys = Object.keys(object);
  if (Object.getOwnPropertySymbols) {
    var symbols = Object.getOwnPropertySymbols(object);
    if (enumerableOnly) {
      symbols = symbols.filter(function(sym) {
        return Object.getOwnPropertyDescriptor(object, sym).enumerable;
      });
    }
    keys.push.apply(keys, symbols);
  }
  return keys;
}
function _objectSpread(target) {
  for (var i3 = 1; i3 < arguments.length; i3++) {
    var source = arguments[i3] != null ? arguments[i3] : {};
    if (i3 % 2) {
      ownKeys(Object(source), true).forEach(function(key) {
        _defineProperty(target, key, source[key]);
      });
    } else if (Object.getOwnPropertyDescriptors) {
      Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
      ownKeys(Object(source)).forEach(function(key) {
        Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
      });
    }
  }
  return target;
}
var import_es_array_iterator, import_raf, import_rgbcolor, index, allUppercase, attributeRegex, idRegex, classRegex, pseudoElementRegex, pseudoClassWithBracketsRegex, pseudoClassRegex, elementRegex, PSEUDO_ZERO, Property, ViewPort, Point2, Mouse, defaultWindow, defaultFetch$1, Screen, defaultFetch, DefaultDOMParser, Parser, Translate, Rotate, Scale, Matrix2, Skew, SkewX, SkewY, Transform, Element2, UnknownElement, Font, BoundingBox, PathParser, RenderedElement, PathElement, GlyphElement, TextElement, TSpanElement, TextNode, SVGElement, RectElement, CircleElement, EllipseElement, LineElement, PolylineElement, PolygonElement, PatternElement, MarkerElement, DefsElement, GElement, GradientElement, LinearGradientElement, RadialGradientElement, StopElement, AnimateElement, AnimateColorElement, AnimateTransformElement, FontElement, FontFaceElement, MissingGlyphElement, TRefElement, AElement, TextPathElement, dataUriRegex, ImageElement, SymbolElement, SVGFontLoader, StyleElement, UseElement, FeColorMatrixElement, MaskElement, noop2, ClipPathElement, FilterElement, FeDropShadowElement, FeMorphologyElement, FeCompositeElement, FeGaussianBlurElement, TitleElement, DescElement, elements2, Document, Canvg;
var init_index_es = __esm({
  "../simple-mind-map/node_modules/canvg/lib/index.es.js"() {
    init_es_promise();
    init_asyncToGenerator();
    init_es_string_match();
    init_es_string_replace();
    init_es_string_starts_with();
    import_es_array_iterator = __toESM(require_es_array_iterator(), 1);
    init_web_dom_collections_iterator();
    init_defineProperty();
    init_es_array_reduce();
    init_es_string_ends_with();
    init_es_string_split();
    import_raf = __toESM(require_raf(), 1);
    init_es_string_trim();
    import_rgbcolor = __toESM(require_rgbcolor(), 1);
    init_es_array_index_of();
    init_es_string_includes();
    init_es_array_reverse();
    init_SVGPathData_module();
    init_es_regexp_to_string();
    init_stackblur_es();
    index = /* @__PURE__ */ Object.freeze({
      __proto__: null,
      offscreen,
      node
    });
    allUppercase = /^[A-Z-]+$/;
    attributeRegex = /(\[[^\]]+\])/g;
    idRegex = /(#[^\s+>~.[:]+)/g;
    classRegex = /(\.[^\s+>~.[:]+)/g;
    pseudoElementRegex = /(::[^\s+>~.[:]+|:first-line|:first-letter|:before|:after)/gi;
    pseudoClassWithBracketsRegex = /(:[\w-]+\([^)]*\))/gi;
    pseudoClassRegex = /(:[^\s+>~.[:]+)/g;
    elementRegex = /([^\s+>~.[:]+)/g;
    PSEUDO_ZERO = 1e-8;
    Property = class {
      constructor(document4, name, value) {
        this.document = document4;
        this.name = name;
        this.value = value;
        this.isNormalizedColor = false;
      }
      static empty(document4) {
        return new Property(document4, "EMPTY", "");
      }
      split() {
        var separator = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : " ";
        var {
          document: document4,
          name
        } = this;
        return compressSpaces(this.getString()).trim().split(separator).map((value) => new Property(document4, name, value));
      }
      hasValue(zeroIsValue) {
        var {
          value
        } = this;
        return value !== null && value !== "" && (zeroIsValue || value !== 0) && typeof value !== "undefined";
      }
      isString(regexp) {
        var {
          value
        } = this;
        var result = typeof value === "string";
        if (!result || !regexp) {
          return result;
        }
        return regexp.test(value);
      }
      isUrlDefinition() {
        return this.isString(/^url\(/);
      }
      isPixels() {
        if (!this.hasValue()) {
          return false;
        }
        var asString = this.getString();
        switch (true) {
          case asString.endsWith("px"):
          case /^[0-9]+$/.test(asString):
            return true;
          default:
            return false;
        }
      }
      setValue(value) {
        this.value = value;
        return this;
      }
      getValue(def) {
        if (typeof def === "undefined" || this.hasValue()) {
          return this.value;
        }
        return def;
      }
      getNumber(def) {
        if (!this.hasValue()) {
          if (typeof def === "undefined") {
            return 0;
          }
          return parseFloat(def);
        }
        var {
          value
        } = this;
        var n3 = parseFloat(value);
        if (this.isString(/%$/)) {
          n3 /= 100;
        }
        return n3;
      }
      getString(def) {
        if (typeof def === "undefined" || this.hasValue()) {
          return typeof this.value === "undefined" ? "" : String(this.value);
        }
        return String(def);
      }
      getColor(def) {
        var color = this.getString(def);
        if (this.isNormalizedColor) {
          return color;
        }
        this.isNormalizedColor = true;
        color = normalizeColor(color);
        this.value = color;
        return color;
      }
      getDpi() {
        return 96;
      }
      getRem() {
        return this.document.rootEmSize;
      }
      getEm() {
        return this.document.emSize;
      }
      getUnits() {
        return this.getString().replace(/[0-9.-]/g, "");
      }
      getPixels(axisOrIsFontSize) {
        var processPercent = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
        if (!this.hasValue()) {
          return 0;
        }
        var [axis, isFontSize] = typeof axisOrIsFontSize === "boolean" ? [void 0, axisOrIsFontSize] : [axisOrIsFontSize];
        var {
          viewPort
        } = this.document.screen;
        switch (true) {
          case this.isString(/vmin$/):
            return this.getNumber() / 100 * Math.min(viewPort.computeSize("x"), viewPort.computeSize("y"));
          case this.isString(/vmax$/):
            return this.getNumber() / 100 * Math.max(viewPort.computeSize("x"), viewPort.computeSize("y"));
          case this.isString(/vw$/):
            return this.getNumber() / 100 * viewPort.computeSize("x");
          case this.isString(/vh$/):
            return this.getNumber() / 100 * viewPort.computeSize("y");
          case this.isString(/rem$/):
            return this.getNumber() * this.getRem();
          case this.isString(/em$/):
            return this.getNumber() * this.getEm();
          case this.isString(/ex$/):
            return this.getNumber() * this.getEm() / 2;
          case this.isString(/px$/):
            return this.getNumber();
          case this.isString(/pt$/):
            return this.getNumber() * this.getDpi() * (1 / 72);
          case this.isString(/pc$/):
            return this.getNumber() * 15;
          case this.isString(/cm$/):
            return this.getNumber() * this.getDpi() / 2.54;
          case this.isString(/mm$/):
            return this.getNumber() * this.getDpi() / 25.4;
          case this.isString(/in$/):
            return this.getNumber() * this.getDpi();
          case (this.isString(/%$/) && isFontSize):
            return this.getNumber() * this.getEm();
          case this.isString(/%$/):
            return this.getNumber() * viewPort.computeSize(axis);
          default: {
            var n3 = this.getNumber();
            if (processPercent && n3 < 1) {
              return n3 * viewPort.computeSize(axis);
            }
            return n3;
          }
        }
      }
      getMilliseconds() {
        if (!this.hasValue()) {
          return 0;
        }
        if (this.isString(/ms$/)) {
          return this.getNumber();
        }
        return this.getNumber() * 1e3;
      }
      getRadians() {
        if (!this.hasValue()) {
          return 0;
        }
        switch (true) {
          case this.isString(/deg$/):
            return this.getNumber() * (Math.PI / 180);
          case this.isString(/grad$/):
            return this.getNumber() * (Math.PI / 200);
          case this.isString(/rad$/):
            return this.getNumber();
          default:
            return this.getNumber() * (Math.PI / 180);
        }
      }
      getDefinition() {
        var asString = this.getString();
        var name = /#([^)'"]+)/.exec(asString);
        if (name) {
          name = name[1];
        }
        if (!name) {
          name = asString;
        }
        return this.document.definitions[name];
      }
      getFillStyleDefinition(element2, opacity) {
        var def = this.getDefinition();
        if (!def) {
          return null;
        }
        if (typeof def.createGradient === "function") {
          return def.createGradient(this.document.ctx, element2, opacity);
        }
        if (typeof def.createPattern === "function") {
          if (def.getHrefAttribute().hasValue()) {
            var patternTransform = def.getAttribute("patternTransform");
            def = def.getHrefAttribute().getDefinition();
            if (patternTransform.hasValue()) {
              def.getAttribute("patternTransform", true).setValue(patternTransform.value);
            }
          }
          return def.createPattern(this.document.ctx, element2, opacity);
        }
        return null;
      }
      getTextBaseline() {
        if (!this.hasValue()) {
          return null;
        }
        return Property.textBaselineMapping[this.getString()];
      }
      addOpacity(opacity) {
        var value = this.getColor();
        var len = value.length;
        var commas = 0;
        for (var i3 = 0; i3 < len; i3++) {
          if (value[i3] === ",") {
            commas++;
          }
          if (commas === 3) {
            break;
          }
        }
        if (opacity.hasValue() && this.isString() && commas !== 3) {
          var color = new import_rgbcolor.default(value);
          if (color.ok) {
            color.alpha = opacity.getNumber();
            value = color.toRGBA();
          }
        }
        return new Property(this.document, this.name, value);
      }
    };
    Property.textBaselineMapping = {
      "baseline": "alphabetic",
      "before-edge": "top",
      "text-before-edge": "top",
      "middle": "middle",
      "central": "middle",
      "after-edge": "bottom",
      "text-after-edge": "bottom",
      "ideographic": "ideographic",
      "alphabetic": "alphabetic",
      "hanging": "hanging",
      "mathematical": "alphabetic"
    };
    ViewPort = class {
      constructor() {
        this.viewPorts = [];
      }
      clear() {
        this.viewPorts = [];
      }
      setCurrent(width2, height2) {
        this.viewPorts.push({
          width: width2,
          height: height2
        });
      }
      removeCurrent() {
        this.viewPorts.pop();
      }
      getCurrent() {
        var {
          viewPorts
        } = this;
        return viewPorts[viewPorts.length - 1];
      }
      get width() {
        return this.getCurrent().width;
      }
      get height() {
        return this.getCurrent().height;
      }
      computeSize(d2) {
        if (typeof d2 === "number") {
          return d2;
        }
        if (d2 === "x") {
          return this.width;
        }
        if (d2 === "y") {
          return this.height;
        }
        return Math.sqrt(Math.pow(this.width, 2) + Math.pow(this.height, 2)) / Math.sqrt(2);
      }
    };
    Point2 = class {
      constructor(x3, y4) {
        this.x = x3;
        this.y = y4;
      }
      static parse(point4) {
        var defaultValue = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
        var [x3 = defaultValue, y4 = defaultValue] = toNumbers(point4);
        return new Point2(x3, y4);
      }
      static parseScale(scale) {
        var defaultValue = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1;
        var [x3 = defaultValue, y4 = x3] = toNumbers(scale);
        return new Point2(x3, y4);
      }
      static parsePath(path) {
        var points = toNumbers(path);
        var len = points.length;
        var pathPoints = [];
        for (var i3 = 0; i3 < len; i3 += 2) {
          pathPoints.push(new Point2(points[i3], points[i3 + 1]));
        }
        return pathPoints;
      }
      angleTo(point4) {
        return Math.atan2(point4.y - this.y, point4.x - this.x);
      }
      applyTransform(transform2) {
        var {
          x: x3,
          y: y4
        } = this;
        var xp = x3 * transform2[0] + y4 * transform2[2] + transform2[4];
        var yp = x3 * transform2[1] + y4 * transform2[3] + transform2[5];
        this.x = xp;
        this.y = yp;
      }
    };
    Mouse = class {
      constructor(screen) {
        this.screen = screen;
        this.working = false;
        this.events = [];
        this.eventElements = [];
        this.onClick = this.onClick.bind(this);
        this.onMouseMove = this.onMouseMove.bind(this);
      }
      isWorking() {
        return this.working;
      }
      start() {
        if (this.working) {
          return;
        }
        var {
          screen,
          onClick,
          onMouseMove
        } = this;
        var canvas = screen.ctx.canvas;
        canvas.onclick = onClick;
        canvas.onmousemove = onMouseMove;
        this.working = true;
      }
      stop() {
        if (!this.working) {
          return;
        }
        var canvas = this.screen.ctx.canvas;
        this.working = false;
        canvas.onclick = null;
        canvas.onmousemove = null;
      }
      hasEvents() {
        return this.working && this.events.length > 0;
      }
      runEvents() {
        if (!this.working) {
          return;
        }
        var {
          screen: document4,
          events,
          eventElements
        } = this;
        var {
          style
        } = document4.ctx.canvas;
        if (style) {
          style.cursor = "";
        }
        events.forEach((_ref, i3) => {
          var {
            run
          } = _ref;
          var element2 = eventElements[i3];
          while (element2) {
            run(element2);
            element2 = element2.parent;
          }
        });
        this.events = [];
        this.eventElements = [];
      }
      checkPath(element2, ctx) {
        if (!this.working || !ctx) {
          return;
        }
        var {
          events,
          eventElements
        } = this;
        events.forEach((_ref2, i3) => {
          var {
            x: x3,
            y: y4
          } = _ref2;
          if (!eventElements[i3] && ctx.isPointInPath && ctx.isPointInPath(x3, y4)) {
            eventElements[i3] = element2;
          }
        });
      }
      checkBoundingBox(element2, boundingBox) {
        if (!this.working || !boundingBox) {
          return;
        }
        var {
          events,
          eventElements
        } = this;
        events.forEach((_ref3, i3) => {
          var {
            x: x3,
            y: y4
          } = _ref3;
          if (!eventElements[i3] && boundingBox.isPointInBox(x3, y4)) {
            eventElements[i3] = element2;
          }
        });
      }
      mapXY(x3, y4) {
        var {
          window: window2,
          ctx
        } = this.screen;
        var point4 = new Point2(x3, y4);
        var element2 = ctx.canvas;
        while (element2) {
          point4.x -= element2.offsetLeft;
          point4.y -= element2.offsetTop;
          element2 = element2.offsetParent;
        }
        if (window2.scrollX) {
          point4.x += window2.scrollX;
        }
        if (window2.scrollY) {
          point4.y += window2.scrollY;
        }
        return point4;
      }
      onClick(event) {
        var {
          x: x3,
          y: y4
        } = this.mapXY(event.clientX, event.clientY);
        this.events.push({
          type: "onclick",
          x: x3,
          y: y4,
          run(eventTarget) {
            if (eventTarget.onClick) {
              eventTarget.onClick();
            }
          }
        });
      }
      onMouseMove(event) {
        var {
          x: x3,
          y: y4
        } = this.mapXY(event.clientX, event.clientY);
        this.events.push({
          type: "onmousemove",
          x: x3,
          y: y4,
          run(eventTarget) {
            if (eventTarget.onMouseMove) {
              eventTarget.onMouseMove();
            }
          }
        });
      }
    };
    defaultWindow = typeof window !== "undefined" ? window : null;
    defaultFetch$1 = typeof fetch !== "undefined" ? fetch.bind(void 0) : null;
    Screen = class {
      constructor(ctx) {
        var {
          fetch: fetch2 = defaultFetch$1,
          window: window2 = defaultWindow
        } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
        this.ctx = ctx;
        this.FRAMERATE = 30;
        this.MAX_VIRTUAL_PIXELS = 3e4;
        this.CLIENT_WIDTH = 800;
        this.CLIENT_HEIGHT = 600;
        this.viewPort = new ViewPort();
        this.mouse = new Mouse(this);
        this.animations = [];
        this.waits = [];
        this.frameDuration = 0;
        this.isReadyLock = false;
        this.isFirstRender = true;
        this.intervalId = null;
        this.window = window2;
        this.fetch = fetch2;
      }
      wait(checker) {
        this.waits.push(checker);
      }
      ready() {
        if (!this.readyPromise) {
          return Promise.resolve();
        }
        return this.readyPromise;
      }
      isReady() {
        if (this.isReadyLock) {
          return true;
        }
        var isReadyLock = this.waits.every((_3) => _3());
        if (isReadyLock) {
          this.waits = [];
          if (this.resolveReady) {
            this.resolveReady();
          }
        }
        this.isReadyLock = isReadyLock;
        return isReadyLock;
      }
      setDefaults(ctx) {
        ctx.strokeStyle = "rgba(0,0,0,0)";
        ctx.lineCap = "butt";
        ctx.lineJoin = "miter";
        ctx.miterLimit = 4;
      }
      setViewBox(_ref) {
        var {
          document: document4,
          ctx,
          aspectRatio,
          width: width2,
          desiredWidth,
          height: height2,
          desiredHeight,
          minX = 0,
          minY = 0,
          refX,
          refY,
          clip = false,
          clipX = 0,
          clipY = 0
        } = _ref;
        var cleanAspectRatio = compressSpaces(aspectRatio).replace(/^defer\s/, "");
        var [aspectRatioAlign, aspectRatioMeetOrSlice] = cleanAspectRatio.split(" ");
        var align = aspectRatioAlign || "xMidYMid";
        var meetOrSlice = aspectRatioMeetOrSlice || "meet";
        var scaleX = width2 / desiredWidth;
        var scaleY = height2 / desiredHeight;
        var scaleMin = Math.min(scaleX, scaleY);
        var scaleMax = Math.max(scaleX, scaleY);
        var finalDesiredWidth = desiredWidth;
        var finalDesiredHeight = desiredHeight;
        if (meetOrSlice === "meet") {
          finalDesiredWidth *= scaleMin;
          finalDesiredHeight *= scaleMin;
        }
        if (meetOrSlice === "slice") {
          finalDesiredWidth *= scaleMax;
          finalDesiredHeight *= scaleMax;
        }
        var refXProp = new Property(document4, "refX", refX);
        var refYProp = new Property(document4, "refY", refY);
        var hasRefs = refXProp.hasValue() && refYProp.hasValue();
        if (hasRefs) {
          ctx.translate(-scaleMin * refXProp.getPixels("x"), -scaleMin * refYProp.getPixels("y"));
        }
        if (clip) {
          var scaledClipX = scaleMin * clipX;
          var scaledClipY = scaleMin * clipY;
          ctx.beginPath();
          ctx.moveTo(scaledClipX, scaledClipY);
          ctx.lineTo(width2, scaledClipY);
          ctx.lineTo(width2, height2);
          ctx.lineTo(scaledClipX, height2);
          ctx.closePath();
          ctx.clip();
        }
        if (!hasRefs) {
          var isMeetMinY = meetOrSlice === "meet" && scaleMin === scaleY;
          var isSliceMaxY = meetOrSlice === "slice" && scaleMax === scaleY;
          var isMeetMinX = meetOrSlice === "meet" && scaleMin === scaleX;
          var isSliceMaxX = meetOrSlice === "slice" && scaleMax === scaleX;
          if (align.startsWith("xMid") && (isMeetMinY || isSliceMaxY)) {
            ctx.translate(width2 / 2 - finalDesiredWidth / 2, 0);
          }
          if (align.endsWith("YMid") && (isMeetMinX || isSliceMaxX)) {
            ctx.translate(0, height2 / 2 - finalDesiredHeight / 2);
          }
          if (align.startsWith("xMax") && (isMeetMinY || isSliceMaxY)) {
            ctx.translate(width2 - finalDesiredWidth, 0);
          }
          if (align.endsWith("YMax") && (isMeetMinX || isSliceMaxX)) {
            ctx.translate(0, height2 - finalDesiredHeight);
          }
        }
        switch (true) {
          case align === "none":
            ctx.scale(scaleX, scaleY);
            break;
          case meetOrSlice === "meet":
            ctx.scale(scaleMin, scaleMin);
            break;
          case meetOrSlice === "slice":
            ctx.scale(scaleMax, scaleMax);
            break;
        }
        ctx.translate(-minX, -minY);
      }
      start(element2) {
        var {
          enableRedraw = false,
          ignoreMouse = false,
          ignoreAnimation = false,
          ignoreDimensions = false,
          ignoreClear = false,
          forceRedraw,
          scaleWidth,
          scaleHeight,
          offsetX,
          offsetY
        } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
        var {
          FRAMERATE,
          mouse
        } = this;
        var frameDuration = 1e3 / FRAMERATE;
        this.frameDuration = frameDuration;
        this.readyPromise = new Promise((resolve) => {
          this.resolveReady = resolve;
        });
        if (this.isReady()) {
          this.render(element2, ignoreDimensions, ignoreClear, scaleWidth, scaleHeight, offsetX, offsetY);
        }
        if (!enableRedraw) {
          return;
        }
        var now = Date.now();
        var then = now;
        var delta = 0;
        var tick = () => {
          now = Date.now();
          delta = now - then;
          if (delta >= frameDuration) {
            then = now - delta % frameDuration;
            if (this.shouldUpdate(ignoreAnimation, forceRedraw)) {
              this.render(element2, ignoreDimensions, ignoreClear, scaleWidth, scaleHeight, offsetX, offsetY);
              mouse.runEvents();
            }
          }
          this.intervalId = (0, import_raf.default)(tick);
        };
        if (!ignoreMouse) {
          mouse.start();
        }
        this.intervalId = (0, import_raf.default)(tick);
      }
      stop() {
        if (this.intervalId) {
          import_raf.default.cancel(this.intervalId);
          this.intervalId = null;
        }
        this.mouse.stop();
      }
      shouldUpdate(ignoreAnimation, forceRedraw) {
        if (!ignoreAnimation) {
          var {
            frameDuration
          } = this;
          var shouldUpdate = this.animations.reduce((shouldUpdate2, animation) => animation.update(frameDuration) || shouldUpdate2, false);
          if (shouldUpdate) {
            return true;
          }
        }
        if (typeof forceRedraw === "function" && forceRedraw()) {
          return true;
        }
        if (!this.isReadyLock && this.isReady()) {
          return true;
        }
        if (this.mouse.hasEvents()) {
          return true;
        }
        return false;
      }
      render(element2, ignoreDimensions, ignoreClear, scaleWidth, scaleHeight, offsetX, offsetY) {
        var {
          CLIENT_WIDTH,
          CLIENT_HEIGHT,
          viewPort,
          ctx,
          isFirstRender
        } = this;
        var canvas = ctx.canvas;
        viewPort.clear();
        if (canvas.width && canvas.height) {
          viewPort.setCurrent(canvas.width, canvas.height);
        } else {
          viewPort.setCurrent(CLIENT_WIDTH, CLIENT_HEIGHT);
        }
        var widthStyle = element2.getStyle("width");
        var heightStyle = element2.getStyle("height");
        if (!ignoreDimensions && (isFirstRender || typeof scaleWidth !== "number" && typeof scaleHeight !== "number")) {
          if (widthStyle.hasValue()) {
            canvas.width = widthStyle.getPixels("x");
            if (canvas.style) {
              canvas.style.width = "".concat(canvas.width, "px");
            }
          }
          if (heightStyle.hasValue()) {
            canvas.height = heightStyle.getPixels("y");
            if (canvas.style) {
              canvas.style.height = "".concat(canvas.height, "px");
            }
          }
        }
        var cWidth = canvas.clientWidth || canvas.width;
        var cHeight = canvas.clientHeight || canvas.height;
        if (ignoreDimensions && widthStyle.hasValue() && heightStyle.hasValue()) {
          cWidth = widthStyle.getPixels("x");
          cHeight = heightStyle.getPixels("y");
        }
        viewPort.setCurrent(cWidth, cHeight);
        if (typeof offsetX === "number") {
          element2.getAttribute("x", true).setValue(offsetX);
        }
        if (typeof offsetY === "number") {
          element2.getAttribute("y", true).setValue(offsetY);
        }
        if (typeof scaleWidth === "number" || typeof scaleHeight === "number") {
          var viewBox = toNumbers(element2.getAttribute("viewBox").getString());
          var xRatio = 0;
          var yRatio = 0;
          if (typeof scaleWidth === "number") {
            var _widthStyle = element2.getStyle("width");
            if (_widthStyle.hasValue()) {
              xRatio = _widthStyle.getPixels("x") / scaleWidth;
            } else if (!isNaN(viewBox[2])) {
              xRatio = viewBox[2] / scaleWidth;
            }
          }
          if (typeof scaleHeight === "number") {
            var _heightStyle = element2.getStyle("height");
            if (_heightStyle.hasValue()) {
              yRatio = _heightStyle.getPixels("y") / scaleHeight;
            } else if (!isNaN(viewBox[3])) {
              yRatio = viewBox[3] / scaleHeight;
            }
          }
          if (!xRatio) {
            xRatio = yRatio;
          }
          if (!yRatio) {
            yRatio = xRatio;
          }
          element2.getAttribute("width", true).setValue(scaleWidth);
          element2.getAttribute("height", true).setValue(scaleHeight);
          var transformStyle = element2.getStyle("transform", true, true);
          transformStyle.setValue("".concat(transformStyle.getString(), " scale(").concat(1 / xRatio, ", ").concat(1 / yRatio, ")"));
        }
        if (!ignoreClear) {
          ctx.clearRect(0, 0, cWidth, cHeight);
        }
        element2.render(ctx);
        if (isFirstRender) {
          this.isFirstRender = false;
        }
      }
    };
    Screen.defaultWindow = defaultWindow;
    Screen.defaultFetch = defaultFetch$1;
    ({
      defaultFetch
    } = Screen);
    DefaultDOMParser = typeof DOMParser !== "undefined" ? DOMParser : null;
    Parser = class {
      constructor() {
        var {
          fetch: fetch2 = defaultFetch,
          DOMParser: DOMParser2 = DefaultDOMParser
        } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
        this.fetch = fetch2;
        this.DOMParser = DOMParser2;
      }
      parse(resource) {
        var _this = this;
        return _asyncToGenerator(function* () {
          if (resource.startsWith("<")) {
            return _this.parseFromString(resource);
          }
          return _this.load(resource);
        })();
      }
      parseFromString(xml) {
        var parser2 = new this.DOMParser();
        try {
          return this.checkDocument(parser2.parseFromString(xml, "image/svg+xml"));
        } catch (err) {
          return this.checkDocument(parser2.parseFromString(xml, "text/xml"));
        }
      }
      checkDocument(document4) {
        var parserError = document4.getElementsByTagName("parsererror")[0];
        if (parserError) {
          throw new Error(parserError.textContent);
        }
        return document4;
      }
      load(url) {
        var _this2 = this;
        return _asyncToGenerator(function* () {
          var response = yield _this2.fetch(url);
          var xml = yield response.text();
          return _this2.parseFromString(xml);
        })();
      }
    };
    Translate = class {
      constructor(_3, point4) {
        this.type = "translate";
        this.point = null;
        this.point = Point2.parse(point4);
      }
      apply(ctx) {
        var {
          x: x3,
          y: y4
        } = this.point;
        ctx.translate(x3 || 0, y4 || 0);
      }
      unapply(ctx) {
        var {
          x: x3,
          y: y4
        } = this.point;
        ctx.translate(-1 * x3 || 0, -1 * y4 || 0);
      }
      applyToPoint(point4) {
        var {
          x: x3,
          y: y4
        } = this.point;
        point4.applyTransform([1, 0, 0, 1, x3 || 0, y4 || 0]);
      }
    };
    Rotate = class {
      constructor(document4, rotate, transformOrigin) {
        this.type = "rotate";
        this.angle = null;
        this.originX = null;
        this.originY = null;
        this.cx = 0;
        this.cy = 0;
        var numbers = toNumbers(rotate);
        this.angle = new Property(document4, "angle", numbers[0]);
        this.originX = transformOrigin[0];
        this.originY = transformOrigin[1];
        this.cx = numbers[1] || 0;
        this.cy = numbers[2] || 0;
      }
      apply(ctx) {
        var {
          cx: cx2,
          cy: cy2,
          originX,
          originY,
          angle
        } = this;
        var tx = cx2 + originX.getPixels("x");
        var ty = cy2 + originY.getPixels("y");
        ctx.translate(tx, ty);
        ctx.rotate(angle.getRadians());
        ctx.translate(-tx, -ty);
      }
      unapply(ctx) {
        var {
          cx: cx2,
          cy: cy2,
          originX,
          originY,
          angle
        } = this;
        var tx = cx2 + originX.getPixels("x");
        var ty = cy2 + originY.getPixels("y");
        ctx.translate(tx, ty);
        ctx.rotate(-1 * angle.getRadians());
        ctx.translate(-tx, -ty);
      }
      applyToPoint(point4) {
        var {
          cx: cx2,
          cy: cy2,
          angle
        } = this;
        var rad = angle.getRadians();
        point4.applyTransform([
          1,
          0,
          0,
          1,
          cx2 || 0,
          cy2 || 0
          // this.p.y
        ]);
        point4.applyTransform([Math.cos(rad), Math.sin(rad), -Math.sin(rad), Math.cos(rad), 0, 0]);
        point4.applyTransform([
          1,
          0,
          0,
          1,
          -cx2 || 0,
          -cy2 || 0
          // -this.p.y
        ]);
      }
    };
    Scale = class {
      constructor(_3, scale, transformOrigin) {
        this.type = "scale";
        this.scale = null;
        this.originX = null;
        this.originY = null;
        var scaleSize = Point2.parseScale(scale);
        if (scaleSize.x === 0 || scaleSize.y === 0) {
          scaleSize.x = PSEUDO_ZERO;
          scaleSize.y = PSEUDO_ZERO;
        }
        this.scale = scaleSize;
        this.originX = transformOrigin[0];
        this.originY = transformOrigin[1];
      }
      apply(ctx) {
        var {
          scale: {
            x: x3,
            y: y4
          },
          originX,
          originY
        } = this;
        var tx = originX.getPixels("x");
        var ty = originY.getPixels("y");
        ctx.translate(tx, ty);
        ctx.scale(x3, y4 || x3);
        ctx.translate(-tx, -ty);
      }
      unapply(ctx) {
        var {
          scale: {
            x: x3,
            y: y4
          },
          originX,
          originY
        } = this;
        var tx = originX.getPixels("x");
        var ty = originY.getPixels("y");
        ctx.translate(tx, ty);
        ctx.scale(1 / x3, 1 / y4 || x3);
        ctx.translate(-tx, -ty);
      }
      applyToPoint(point4) {
        var {
          x: x3,
          y: y4
        } = this.scale;
        point4.applyTransform([x3 || 0, 0, 0, y4 || 0, 0, 0]);
      }
    };
    Matrix2 = class {
      constructor(_3, matrix, transformOrigin) {
        this.type = "matrix";
        this.matrix = [];
        this.originX = null;
        this.originY = null;
        this.matrix = toNumbers(matrix);
        this.originX = transformOrigin[0];
        this.originY = transformOrigin[1];
      }
      apply(ctx) {
        var {
          originX,
          originY,
          matrix
        } = this;
        var tx = originX.getPixels("x");
        var ty = originY.getPixels("y");
        ctx.translate(tx, ty);
        ctx.transform(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]);
        ctx.translate(-tx, -ty);
      }
      unapply(ctx) {
        var {
          originX,
          originY,
          matrix
        } = this;
        var a3 = matrix[0];
        var b2 = matrix[2];
        var c4 = matrix[4];
        var d2 = matrix[1];
        var e2 = matrix[3];
        var f3 = matrix[5];
        var g2 = 0;
        var h3 = 0;
        var i3 = 1;
        var det = 1 / (a3 * (e2 * i3 - f3 * h3) - b2 * (d2 * i3 - f3 * g2) + c4 * (d2 * h3 - e2 * g2));
        var tx = originX.getPixels("x");
        var ty = originY.getPixels("y");
        ctx.translate(tx, ty);
        ctx.transform(det * (e2 * i3 - f3 * h3), det * (f3 * g2 - d2 * i3), det * (c4 * h3 - b2 * i3), det * (a3 * i3 - c4 * g2), det * (b2 * f3 - c4 * e2), det * (c4 * d2 - a3 * f3));
        ctx.translate(-tx, -ty);
      }
      applyToPoint(point4) {
        point4.applyTransform(this.matrix);
      }
    };
    Skew = class extends Matrix2 {
      constructor(document4, skew, transformOrigin) {
        super(document4, skew, transformOrigin);
        this.type = "skew";
        this.angle = null;
        this.angle = new Property(document4, "angle", skew);
      }
    };
    SkewX = class extends Skew {
      constructor(document4, skew, transformOrigin) {
        super(document4, skew, transformOrigin);
        this.type = "skewX";
        this.matrix = [1, 0, Math.tan(this.angle.getRadians()), 1, 0, 0];
      }
    };
    SkewY = class extends Skew {
      constructor(document4, skew, transformOrigin) {
        super(document4, skew, transformOrigin);
        this.type = "skewY";
        this.matrix = [1, Math.tan(this.angle.getRadians()), 0, 1, 0, 0];
      }
    };
    Transform = class {
      constructor(document4, transform2, transformOrigin) {
        this.document = document4;
        this.transforms = [];
        var data2 = parseTransforms(transform2);
        data2.forEach((transform3) => {
          if (transform3 === "none") {
            return;
          }
          var [type, value] = parseTransform(transform3);
          var TransformType = Transform.transformTypes[type];
          if (typeof TransformType !== "undefined") {
            this.transforms.push(new TransformType(this.document, value, transformOrigin));
          }
        });
      }
      static fromElement(document4, element2) {
        var transformStyle = element2.getStyle("transform", false, true);
        var [transformOriginXProperty, transformOriginYProperty = transformOriginXProperty] = element2.getStyle("transform-origin", false, true).split();
        var transformOrigin = [transformOriginXProperty, transformOriginYProperty];
        if (transformStyle.hasValue()) {
          return new Transform(document4, transformStyle.getString(), transformOrigin);
        }
        return null;
      }
      apply(ctx) {
        var {
          transforms: transforms2
        } = this;
        var len = transforms2.length;
        for (var i3 = 0; i3 < len; i3++) {
          transforms2[i3].apply(ctx);
        }
      }
      unapply(ctx) {
        var {
          transforms: transforms2
        } = this;
        var len = transforms2.length;
        for (var i3 = len - 1; i3 >= 0; i3--) {
          transforms2[i3].unapply(ctx);
        }
      }
      // TODO: applyToPoint unused ... remove?
      applyToPoint(point4) {
        var {
          transforms: transforms2
        } = this;
        var len = transforms2.length;
        for (var i3 = 0; i3 < len; i3++) {
          transforms2[i3].applyToPoint(point4);
        }
      }
    };
    Transform.transformTypes = {
      translate: Translate,
      rotate: Rotate,
      scale: Scale,
      matrix: Matrix2,
      skewX: SkewX,
      skewY: SkewY
    };
    Element2 = class {
      constructor(document4, node3) {
        var captureTextNodes = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
        this.document = document4;
        this.node = node3;
        this.captureTextNodes = captureTextNodes;
        this.attributes = {};
        this.styles = {};
        this.stylesSpecificity = {};
        this.animationFrozen = false;
        this.animationFrozenValue = "";
        this.parent = null;
        this.children = [];
        if (!node3 || node3.nodeType !== 1) {
          return;
        }
        Array.from(node3.attributes).forEach((attribute) => {
          var nodeName = normalizeAttributeName(attribute.nodeName);
          this.attributes[nodeName] = new Property(document4, nodeName, attribute.value);
        });
        this.addStylesFromStyleDefinition();
        if (this.getAttribute("style").hasValue()) {
          var styles = this.getAttribute("style").getString().split(";").map((_3) => _3.trim());
          styles.forEach((style) => {
            if (!style) {
              return;
            }
            var [name, value] = style.split(":").map((_3) => _3.trim());
            this.styles[name] = new Property(document4, name, value);
          });
        }
        var {
          definitions
        } = document4;
        var id = this.getAttribute("id");
        if (id.hasValue()) {
          if (!definitions[id.getString()]) {
            definitions[id.getString()] = this;
          }
        }
        Array.from(node3.childNodes).forEach((childNode) => {
          if (childNode.nodeType === 1) {
            this.addChild(childNode);
          } else if (captureTextNodes && (childNode.nodeType === 3 || childNode.nodeType === 4)) {
            var textNode = document4.createTextNode(childNode);
            if (textNode.getText().length > 0) {
              this.addChild(textNode);
            }
          }
        });
      }
      getAttribute(name) {
        var createIfNotExists = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
        var attr2 = this.attributes[name];
        if (!attr2 && createIfNotExists) {
          var _attr = new Property(this.document, name, "");
          this.attributes[name] = _attr;
          return _attr;
        }
        return attr2 || Property.empty(this.document);
      }
      getHrefAttribute() {
        for (var key in this.attributes) {
          if (key === "href" || key.endsWith(":href")) {
            return this.attributes[key];
          }
        }
        return Property.empty(this.document);
      }
      getStyle(name) {
        var createIfNotExists = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
        var skipAncestors = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
        var style = this.styles[name];
        if (style) {
          return style;
        }
        var attr2 = this.getAttribute(name);
        if (attr2 !== null && attr2 !== void 0 && attr2.hasValue()) {
          this.styles[name] = attr2;
          return attr2;
        }
        if (!skipAncestors) {
          var {
            parent
          } = this;
          if (parent) {
            var parentStyle = parent.getStyle(name);
            if (parentStyle !== null && parentStyle !== void 0 && parentStyle.hasValue()) {
              return parentStyle;
            }
          }
        }
        if (createIfNotExists) {
          var _style = new Property(this.document, name, "");
          this.styles[name] = _style;
          return _style;
        }
        return style || Property.empty(this.document);
      }
      render(ctx) {
        if (this.getStyle("display").getString() === "none" || this.getStyle("visibility").getString() === "hidden") {
          return;
        }
        ctx.save();
        if (this.getStyle("mask").hasValue()) {
          var mask = this.getStyle("mask").getDefinition();
          if (mask) {
            this.applyEffects(ctx);
            mask.apply(ctx, this);
          }
        } else if (this.getStyle("filter").getValue("none") !== "none") {
          var filter2 = this.getStyle("filter").getDefinition();
          if (filter2) {
            this.applyEffects(ctx);
            filter2.apply(ctx, this);
          }
        } else {
          this.setContext(ctx);
          this.renderChildren(ctx);
          this.clearContext(ctx);
        }
        ctx.restore();
      }
      setContext(_3) {
      }
      applyEffects(ctx) {
        var transform2 = Transform.fromElement(this.document, this);
        if (transform2) {
          transform2.apply(ctx);
        }
        var clipPathStyleProp = this.getStyle("clip-path", false, true);
        if (clipPathStyleProp.hasValue()) {
          var clip = clipPathStyleProp.getDefinition();
          if (clip) {
            clip.apply(ctx);
          }
        }
      }
      clearContext(_3) {
      }
      renderChildren(ctx) {
        this.children.forEach((child) => {
          child.render(ctx);
        });
      }
      addChild(childNode) {
        var child = childNode instanceof Element2 ? childNode : this.document.createElement(childNode);
        child.parent = this;
        if (!Element2.ignoreChildTypes.includes(child.type)) {
          this.children.push(child);
        }
      }
      matchesSelector(selector) {
        var _node$getAttribute;
        var {
          node: node3
        } = this;
        if (typeof node3.matches === "function") {
          return node3.matches(selector);
        }
        var styleClasses = (_node$getAttribute = node3.getAttribute) === null || _node$getAttribute === void 0 ? void 0 : _node$getAttribute.call(node3, "class");
        if (!styleClasses || styleClasses === "") {
          return false;
        }
        return styleClasses.split(" ").some((styleClass) => ".".concat(styleClass) === selector);
      }
      addStylesFromStyleDefinition() {
        var {
          styles,
          stylesSpecificity
        } = this.document;
        for (var selector in styles) {
          if (!selector.startsWith("@") && this.matchesSelector(selector)) {
            var style = styles[selector];
            var specificity = stylesSpecificity[selector];
            if (style) {
              for (var name in style) {
                var existingSpecificity = this.stylesSpecificity[name];
                if (typeof existingSpecificity === "undefined") {
                  existingSpecificity = "000";
                }
                if (specificity >= existingSpecificity) {
                  this.styles[name] = style[name];
                  this.stylesSpecificity[name] = specificity;
                }
              }
            }
          }
        }
      }
      removeStyles(element2, ignoreStyles) {
        var toRestore = ignoreStyles.reduce((toRestore2, name) => {
          var styleProp = element2.getStyle(name);
          if (!styleProp.hasValue()) {
            return toRestore2;
          }
          var value = styleProp.getString();
          styleProp.setValue("");
          return [...toRestore2, [name, value]];
        }, []);
        return toRestore;
      }
      restoreStyles(element2, styles) {
        styles.forEach((_ref) => {
          var [name, value] = _ref;
          element2.getStyle(name, true).setValue(value);
        });
      }
      isFirstChild() {
        var _this$parent;
        return ((_this$parent = this.parent) === null || _this$parent === void 0 ? void 0 : _this$parent.children.indexOf(this)) === 0;
      }
    };
    Element2.ignoreChildTypes = ["title"];
    UnknownElement = class extends Element2 {
      constructor(document4, node3, captureTextNodes) {
        super(document4, node3, captureTextNodes);
      }
    };
    Font = class {
      constructor(fontStyle, fontVariant, fontWeight, fontSize, fontFamily, inherit) {
        var inheritFont = inherit ? typeof inherit === "string" ? Font.parse(inherit) : inherit : {};
        this.fontFamily = fontFamily || inheritFont.fontFamily;
        this.fontSize = fontSize || inheritFont.fontSize;
        this.fontStyle = fontStyle || inheritFont.fontStyle;
        this.fontWeight = fontWeight || inheritFont.fontWeight;
        this.fontVariant = fontVariant || inheritFont.fontVariant;
      }
      static parse() {
        var font = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
        var inherit = arguments.length > 1 ? arguments[1] : void 0;
        var fontStyle = "";
        var fontVariant = "";
        var fontWeight = "";
        var fontSize = "";
        var fontFamily = "";
        var parts = compressSpaces(font).trim().split(" ");
        var set = {
          fontSize: false,
          fontStyle: false,
          fontWeight: false,
          fontVariant: false
        };
        parts.forEach((part) => {
          switch (true) {
            case (!set.fontStyle && Font.styles.includes(part)):
              if (part !== "inherit") {
                fontStyle = part;
              }
              set.fontStyle = true;
              break;
            case (!set.fontVariant && Font.variants.includes(part)):
              if (part !== "inherit") {
                fontVariant = part;
              }
              set.fontStyle = true;
              set.fontVariant = true;
              break;
            case (!set.fontWeight && Font.weights.includes(part)):
              if (part !== "inherit") {
                fontWeight = part;
              }
              set.fontStyle = true;
              set.fontVariant = true;
              set.fontWeight = true;
              break;
            case !set.fontSize:
              if (part !== "inherit") {
                [fontSize] = part.split("/");
              }
              set.fontStyle = true;
              set.fontVariant = true;
              set.fontWeight = true;
              set.fontSize = true;
              break;
            default:
              if (part !== "inherit") {
                fontFamily += part;
              }
          }
        });
        return new Font(fontStyle, fontVariant, fontWeight, fontSize, fontFamily, inherit);
      }
      toString() {
        return [
          prepareFontStyle(this.fontStyle),
          this.fontVariant,
          prepareFontWeight(this.fontWeight),
          this.fontSize,
          // Wrap fontFamily only on nodejs and only for canvas.ctx
          prepareFontFamily(this.fontFamily)
        ].join(" ").trim();
      }
    };
    Font.styles = "normal|italic|oblique|inherit";
    Font.variants = "normal|small-caps|inherit";
    Font.weights = "normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit";
    BoundingBox = class {
      constructor() {
        var x1 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Number.NaN;
        var y1 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Number.NaN;
        var x22 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Number.NaN;
        var y22 = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : Number.NaN;
        this.x1 = x1;
        this.y1 = y1;
        this.x2 = x22;
        this.y2 = y22;
        this.addPoint(x1, y1);
        this.addPoint(x22, y22);
      }
      get x() {
        return this.x1;
      }
      get y() {
        return this.y1;
      }
      get width() {
        return this.x2 - this.x1;
      }
      get height() {
        return this.y2 - this.y1;
      }
      addPoint(x3, y4) {
        if (typeof x3 !== "undefined") {
          if (isNaN(this.x1) || isNaN(this.x2)) {
            this.x1 = x3;
            this.x2 = x3;
          }
          if (x3 < this.x1) {
            this.x1 = x3;
          }
          if (x3 > this.x2) {
            this.x2 = x3;
          }
        }
        if (typeof y4 !== "undefined") {
          if (isNaN(this.y1) || isNaN(this.y2)) {
            this.y1 = y4;
            this.y2 = y4;
          }
          if (y4 < this.y1) {
            this.y1 = y4;
          }
          if (y4 > this.y2) {
            this.y2 = y4;
          }
        }
      }
      addX(x3) {
        this.addPoint(x3, null);
      }
      addY(y4) {
        this.addPoint(null, y4);
      }
      addBoundingBox(boundingBox) {
        if (!boundingBox) {
          return;
        }
        var {
          x1,
          y1,
          x2: x22,
          y2: y22
        } = boundingBox;
        this.addPoint(x1, y1);
        this.addPoint(x22, y22);
      }
      sumCubic(t3, p0, p1, p22, p3) {
        return Math.pow(1 - t3, 3) * p0 + 3 * Math.pow(1 - t3, 2) * t3 * p1 + 3 * (1 - t3) * Math.pow(t3, 2) * p22 + Math.pow(t3, 3) * p3;
      }
      bezierCurveAdd(forX, p0, p1, p22, p3) {
        var b2 = 6 * p0 - 12 * p1 + 6 * p22;
        var a3 = -3 * p0 + 9 * p1 - 9 * p22 + 3 * p3;
        var c4 = 3 * p1 - 3 * p0;
        if (a3 === 0) {
          if (b2 === 0) {
            return;
          }
          var t3 = -c4 / b2;
          if (0 < t3 && t3 < 1) {
            if (forX) {
              this.addX(this.sumCubic(t3, p0, p1, p22, p3));
            } else {
              this.addY(this.sumCubic(t3, p0, p1, p22, p3));
            }
          }
          return;
        }
        var b2ac = Math.pow(b2, 2) - 4 * c4 * a3;
        if (b2ac < 0) {
          return;
        }
        var t1 = (-b2 + Math.sqrt(b2ac)) / (2 * a3);
        if (0 < t1 && t1 < 1) {
          if (forX) {
            this.addX(this.sumCubic(t1, p0, p1, p22, p3));
          } else {
            this.addY(this.sumCubic(t1, p0, p1, p22, p3));
          }
        }
        var t22 = (-b2 - Math.sqrt(b2ac)) / (2 * a3);
        if (0 < t22 && t22 < 1) {
          if (forX) {
            this.addX(this.sumCubic(t22, p0, p1, p22, p3));
          } else {
            this.addY(this.sumCubic(t22, p0, p1, p22, p3));
          }
        }
      }
      // from http://blog.hackers-cafe.net/2009/06/how-to-calculate-bezier-curves-bounding.html
      addBezierCurve(p0x, p0y, p1x, p1y, p2x, p2y, p3x, p3y) {
        this.addPoint(p0x, p0y);
        this.addPoint(p3x, p3y);
        this.bezierCurveAdd(true, p0x, p1x, p2x, p3x);
        this.bezierCurveAdd(false, p0y, p1y, p2y, p3y);
      }
      addQuadraticCurve(p0x, p0y, p1x, p1y, p2x, p2y) {
        var cp1x = p0x + 2 / 3 * (p1x - p0x);
        var cp1y = p0y + 2 / 3 * (p1y - p0y);
        var cp2x = cp1x + 1 / 3 * (p2x - p0x);
        var cp2y = cp1y + 1 / 3 * (p2y - p0y);
        this.addBezierCurve(p0x, p0y, cp1x, cp2x, cp1y, cp2y, p2x, p2y);
      }
      isPointInBox(x3, y4) {
        var {
          x1,
          y1,
          x2: x22,
          y2: y22
        } = this;
        return x1 <= x3 && x3 <= x22 && y1 <= y4 && y4 <= y22;
      }
    };
    PathParser = class extends _ {
      constructor(path) {
        super(path.replace(/([+\-.])\s+/gm, "$1").replace(/[^MmZzLlHhVvCcSsQqTtAae\d\s.,+-].*/g, ""));
        this.control = null;
        this.start = null;
        this.current = null;
        this.command = null;
        this.commands = this.commands;
        this.i = -1;
        this.previousCommand = null;
        this.points = [];
        this.angles = [];
      }
      reset() {
        this.i = -1;
        this.command = null;
        this.previousCommand = null;
        this.start = new Point2(0, 0);
        this.control = new Point2(0, 0);
        this.current = new Point2(0, 0);
        this.points = [];
        this.angles = [];
      }
      isEnd() {
        var {
          i: i3,
          commands
        } = this;
        return i3 >= commands.length - 1;
      }
      next() {
        var command = this.commands[++this.i];
        this.previousCommand = this.command;
        this.command = command;
        return command;
      }
      getPoint() {
        var xProp = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "x";
        var yProp = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "y";
        var point4 = new Point2(this.command[xProp], this.command[yProp]);
        return this.makeAbsolute(point4);
      }
      getAsControlPoint(xProp, yProp) {
        var point4 = this.getPoint(xProp, yProp);
        this.control = point4;
        return point4;
      }
      getAsCurrentPoint(xProp, yProp) {
        var point4 = this.getPoint(xProp, yProp);
        this.current = point4;
        return point4;
      }
      getReflectedControlPoint() {
        var previousCommand = this.previousCommand.type;
        if (previousCommand !== _.CURVE_TO && previousCommand !== _.SMOOTH_CURVE_TO && previousCommand !== _.QUAD_TO && previousCommand !== _.SMOOTH_QUAD_TO) {
          return this.current;
        }
        var {
          current: {
            x: cx2,
            y: cy2
          },
          control: {
            x: ox,
            y: oy
          }
        } = this;
        var point4 = new Point2(2 * cx2 - ox, 2 * cy2 - oy);
        return point4;
      }
      makeAbsolute(point4) {
        if (this.command.relative) {
          var {
            x: x3,
            y: y4
          } = this.current;
          point4.x += x3;
          point4.y += y4;
        }
        return point4;
      }
      addMarker(point4, from2, priorTo) {
        var {
          points,
          angles
        } = this;
        if (priorTo && angles.length > 0 && !angles[angles.length - 1]) {
          angles[angles.length - 1] = points[points.length - 1].angleTo(priorTo);
        }
        this.addMarkerAngle(point4, from2 ? from2.angleTo(point4) : null);
      }
      addMarkerAngle(point4, angle) {
        this.points.push(point4);
        this.angles.push(angle);
      }
      getMarkerPoints() {
        return this.points;
      }
      getMarkerAngles() {
        var {
          angles
        } = this;
        var len = angles.length;
        for (var i3 = 0; i3 < len; i3++) {
          if (!angles[i3]) {
            for (var j2 = i3 + 1; j2 < len; j2++) {
              if (angles[j2]) {
                angles[i3] = angles[j2];
                break;
              }
            }
          }
        }
        return angles;
      }
    };
    RenderedElement = class extends Element2 {
      constructor() {
        super(...arguments);
        this.modifiedEmSizeStack = false;
      }
      calculateOpacity() {
        var opacity = 1;
        var element2 = this;
        while (element2) {
          var opacityStyle = element2.getStyle("opacity", false, true);
          if (opacityStyle.hasValue(true)) {
            opacity *= opacityStyle.getNumber();
          }
          element2 = element2.parent;
        }
        return opacity;
      }
      setContext(ctx) {
        var fromMeasure = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
        if (!fromMeasure) {
          var fillStyleProp = this.getStyle("fill");
          var fillOpacityStyleProp = this.getStyle("fill-opacity");
          var strokeStyleProp = this.getStyle("stroke");
          var strokeOpacityProp = this.getStyle("stroke-opacity");
          if (fillStyleProp.isUrlDefinition()) {
            var fillStyle = fillStyleProp.getFillStyleDefinition(this, fillOpacityStyleProp);
            if (fillStyle) {
              ctx.fillStyle = fillStyle;
            }
          } else if (fillStyleProp.hasValue()) {
            if (fillStyleProp.getString() === "currentColor") {
              fillStyleProp.setValue(this.getStyle("color").getColor());
            }
            var _fillStyle = fillStyleProp.getColor();
            if (_fillStyle !== "inherit") {
              ctx.fillStyle = _fillStyle === "none" ? "rgba(0,0,0,0)" : _fillStyle;
            }
          }
          if (fillOpacityStyleProp.hasValue()) {
            var _fillStyle2 = new Property(this.document, "fill", ctx.fillStyle).addOpacity(fillOpacityStyleProp).getColor();
            ctx.fillStyle = _fillStyle2;
          }
          if (strokeStyleProp.isUrlDefinition()) {
            var strokeStyle = strokeStyleProp.getFillStyleDefinition(this, strokeOpacityProp);
            if (strokeStyle) {
              ctx.strokeStyle = strokeStyle;
            }
          } else if (strokeStyleProp.hasValue()) {
            if (strokeStyleProp.getString() === "currentColor") {
              strokeStyleProp.setValue(this.getStyle("color").getColor());
            }
            var _strokeStyle = strokeStyleProp.getString();
            if (_strokeStyle !== "inherit") {
              ctx.strokeStyle = _strokeStyle === "none" ? "rgba(0,0,0,0)" : _strokeStyle;
            }
          }
          if (strokeOpacityProp.hasValue()) {
            var _strokeStyle2 = new Property(this.document, "stroke", ctx.strokeStyle).addOpacity(strokeOpacityProp).getString();
            ctx.strokeStyle = _strokeStyle2;
          }
          var strokeWidthStyleProp = this.getStyle("stroke-width");
          if (strokeWidthStyleProp.hasValue()) {
            var newLineWidth = strokeWidthStyleProp.getPixels();
            ctx.lineWidth = !newLineWidth ? PSEUDO_ZERO : newLineWidth;
          }
          var strokeLinecapStyleProp = this.getStyle("stroke-linecap");
          var strokeLinejoinStyleProp = this.getStyle("stroke-linejoin");
          var strokeMiterlimitProp = this.getStyle("stroke-miterlimit");
          var strokeDasharrayStyleProp = this.getStyle("stroke-dasharray");
          var strokeDashoffsetProp = this.getStyle("stroke-dashoffset");
          if (strokeLinecapStyleProp.hasValue()) {
            ctx.lineCap = strokeLinecapStyleProp.getString();
          }
          if (strokeLinejoinStyleProp.hasValue()) {
            ctx.lineJoin = strokeLinejoinStyleProp.getString();
          }
          if (strokeMiterlimitProp.hasValue()) {
            ctx.miterLimit = strokeMiterlimitProp.getNumber();
          }
          if (strokeDasharrayStyleProp.hasValue() && strokeDasharrayStyleProp.getString() !== "none") {
            var gaps = toNumbers(strokeDasharrayStyleProp.getString());
            if (typeof ctx.setLineDash !== "undefined") {
              ctx.setLineDash(gaps);
            } else if (typeof ctx.webkitLineDash !== "undefined") {
              ctx.webkitLineDash = gaps;
            } else if (typeof ctx.mozDash !== "undefined" && !(gaps.length === 1 && gaps[0] === 0)) {
              ctx.mozDash = gaps;
            }
            var offset = strokeDashoffsetProp.getPixels();
            if (typeof ctx.lineDashOffset !== "undefined") {
              ctx.lineDashOffset = offset;
            } else if (typeof ctx.webkitLineDashOffset !== "undefined") {
              ctx.webkitLineDashOffset = offset;
            } else if (typeof ctx.mozDashOffset !== "undefined") {
              ctx.mozDashOffset = offset;
            }
          }
        }
        this.modifiedEmSizeStack = false;
        if (typeof ctx.font !== "undefined") {
          var fontStyleProp = this.getStyle("font");
          var fontStyleStyleProp = this.getStyle("font-style");
          var fontVariantStyleProp = this.getStyle("font-variant");
          var fontWeightStyleProp = this.getStyle("font-weight");
          var fontSizeStyleProp = this.getStyle("font-size");
          var fontFamilyStyleProp = this.getStyle("font-family");
          var font = new Font(fontStyleStyleProp.getString(), fontVariantStyleProp.getString(), fontWeightStyleProp.getString(), fontSizeStyleProp.hasValue() ? "".concat(fontSizeStyleProp.getPixels(true), "px") : "", fontFamilyStyleProp.getString(), Font.parse(fontStyleProp.getString(), ctx.font));
          fontStyleStyleProp.setValue(font.fontStyle);
          fontVariantStyleProp.setValue(font.fontVariant);
          fontWeightStyleProp.setValue(font.fontWeight);
          fontSizeStyleProp.setValue(font.fontSize);
          fontFamilyStyleProp.setValue(font.fontFamily);
          ctx.font = font.toString();
          if (fontSizeStyleProp.isPixels()) {
            this.document.emSize = fontSizeStyleProp.getPixels();
            this.modifiedEmSizeStack = true;
          }
        }
        if (!fromMeasure) {
          this.applyEffects(ctx);
          ctx.globalAlpha = this.calculateOpacity();
        }
      }
      clearContext(ctx) {
        super.clearContext(ctx);
        if (this.modifiedEmSizeStack) {
          this.document.popEmSize();
        }
      }
    };
    PathElement = class extends RenderedElement {
      constructor(document4, node3, captureTextNodes) {
        super(document4, node3, captureTextNodes);
        this.type = "path";
        this.pathParser = null;
        this.pathParser = new PathParser(this.getAttribute("d").getString());
      }
      path(ctx) {
        var {
          pathParser: pathParser2
        } = this;
        var boundingBox = new BoundingBox();
        pathParser2.reset();
        if (ctx) {
          ctx.beginPath();
        }
        while (!pathParser2.isEnd()) {
          switch (pathParser2.next().type) {
            case PathParser.MOVE_TO:
              this.pathM(ctx, boundingBox);
              break;
            case PathParser.LINE_TO:
              this.pathL(ctx, boundingBox);
              break;
            case PathParser.HORIZ_LINE_TO:
              this.pathH(ctx, boundingBox);
              break;
            case PathParser.VERT_LINE_TO:
              this.pathV(ctx, boundingBox);
              break;
            case PathParser.CURVE_TO:
              this.pathC(ctx, boundingBox);
              break;
            case PathParser.SMOOTH_CURVE_TO:
              this.pathS(ctx, boundingBox);
              break;
            case PathParser.QUAD_TO:
              this.pathQ(ctx, boundingBox);
              break;
            case PathParser.SMOOTH_QUAD_TO:
              this.pathT(ctx, boundingBox);
              break;
            case PathParser.ARC:
              this.pathA(ctx, boundingBox);
              break;
            case PathParser.CLOSE_PATH:
              this.pathZ(ctx, boundingBox);
              break;
          }
        }
        return boundingBox;
      }
      getBoundingBox(_3) {
        return this.path();
      }
      getMarkers() {
        var {
          pathParser: pathParser2
        } = this;
        var points = pathParser2.getMarkerPoints();
        var angles = pathParser2.getMarkerAngles();
        var markers = points.map((point4, i3) => [point4, angles[i3]]);
        return markers;
      }
      renderChildren(ctx) {
        this.path(ctx);
        this.document.screen.mouse.checkPath(this, ctx);
        var fillRuleStyleProp = this.getStyle("fill-rule");
        if (ctx.fillStyle !== "") {
          if (fillRuleStyleProp.getString("inherit") !== "inherit") {
            ctx.fill(fillRuleStyleProp.getString());
          } else {
            ctx.fill();
          }
        }
        if (ctx.strokeStyle !== "") {
          if (this.getAttribute("vector-effect").getString() === "non-scaling-stroke") {
            ctx.save();
            ctx.setTransform(1, 0, 0, 1, 0, 0);
            ctx.stroke();
            ctx.restore();
          } else {
            ctx.stroke();
          }
        }
        var markers = this.getMarkers();
        if (markers) {
          var markersLastIndex = markers.length - 1;
          var markerStartStyleProp = this.getStyle("marker-start");
          var markerMidStyleProp = this.getStyle("marker-mid");
          var markerEndStyleProp = this.getStyle("marker-end");
          if (markerStartStyleProp.isUrlDefinition()) {
            var marker = markerStartStyleProp.getDefinition();
            var [point4, angle] = markers[0];
            marker.render(ctx, point4, angle);
          }
          if (markerMidStyleProp.isUrlDefinition()) {
            var _marker = markerMidStyleProp.getDefinition();
            for (var i3 = 1; i3 < markersLastIndex; i3++) {
              var [_point, _angle] = markers[i3];
              _marker.render(ctx, _point, _angle);
            }
          }
          if (markerEndStyleProp.isUrlDefinition()) {
            var _marker2 = markerEndStyleProp.getDefinition();
            var [_point2, _angle2] = markers[markersLastIndex];
            _marker2.render(ctx, _point2, _angle2);
          }
        }
      }
      static pathM(pathParser2) {
        var point4 = pathParser2.getAsCurrentPoint();
        pathParser2.start = pathParser2.current;
        return {
          point: point4
        };
      }
      pathM(ctx, boundingBox) {
        var {
          pathParser: pathParser2
        } = this;
        var {
          point: point4
        } = PathElement.pathM(pathParser2);
        var {
          x: x3,
          y: y4
        } = point4;
        pathParser2.addMarker(point4);
        boundingBox.addPoint(x3, y4);
        if (ctx) {
          ctx.moveTo(x3, y4);
        }
      }
      static pathL(pathParser2) {
        var {
          current
        } = pathParser2;
        var point4 = pathParser2.getAsCurrentPoint();
        return {
          current,
          point: point4
        };
      }
      pathL(ctx, boundingBox) {
        var {
          pathParser: pathParser2
        } = this;
        var {
          current,
          point: point4
        } = PathElement.pathL(pathParser2);
        var {
          x: x3,
          y: y4
        } = point4;
        pathParser2.addMarker(point4, current);
        boundingBox.addPoint(x3, y4);
        if (ctx) {
          ctx.lineTo(x3, y4);
        }
      }
      static pathH(pathParser2) {
        var {
          current,
          command
        } = pathParser2;
        var point4 = new Point2((command.relative ? current.x : 0) + command.x, current.y);
        pathParser2.current = point4;
        return {
          current,
          point: point4
        };
      }
      pathH(ctx, boundingBox) {
        var {
          pathParser: pathParser2
        } = this;
        var {
          current,
          point: point4
        } = PathElement.pathH(pathParser2);
        var {
          x: x3,
          y: y4
        } = point4;
        pathParser2.addMarker(point4, current);
        boundingBox.addPoint(x3, y4);
        if (ctx) {
          ctx.lineTo(x3, y4);
        }
      }
      static pathV(pathParser2) {
        var {
          current,
          command
        } = pathParser2;
        var point4 = new Point2(current.x, (command.relative ? current.y : 0) + command.y);
        pathParser2.current = point4;
        return {
          current,
          point: point4
        };
      }
      pathV(ctx, boundingBox) {
        var {
          pathParser: pathParser2
        } = this;
        var {
          current,
          point: point4
        } = PathElement.pathV(pathParser2);
        var {
          x: x3,
          y: y4
        } = point4;
        pathParser2.addMarker(point4, current);
        boundingBox.addPoint(x3, y4);
        if (ctx) {
          ctx.lineTo(x3, y4);
        }
      }
      static pathC(pathParser2) {
        var {
          current
        } = pathParser2;
        var point4 = pathParser2.getPoint("x1", "y1");
        var controlPoint = pathParser2.getAsControlPoint("x2", "y2");
        var currentPoint = pathParser2.getAsCurrentPoint();
        return {
          current,
          point: point4,
          controlPoint,
          currentPoint
        };
      }
      pathC(ctx, boundingBox) {
        var {
          pathParser: pathParser2
        } = this;
        var {
          current,
          point: point4,
          controlPoint,
          currentPoint
        } = PathElement.pathC(pathParser2);
        pathParser2.addMarker(currentPoint, controlPoint, point4);
        boundingBox.addBezierCurve(current.x, current.y, point4.x, point4.y, controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
        if (ctx) {
          ctx.bezierCurveTo(point4.x, point4.y, controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
        }
      }
      static pathS(pathParser2) {
        var {
          current
        } = pathParser2;
        var point4 = pathParser2.getReflectedControlPoint();
        var controlPoint = pathParser2.getAsControlPoint("x2", "y2");
        var currentPoint = pathParser2.getAsCurrentPoint();
        return {
          current,
          point: point4,
          controlPoint,
          currentPoint
        };
      }
      pathS(ctx, boundingBox) {
        var {
          pathParser: pathParser2
        } = this;
        var {
          current,
          point: point4,
          controlPoint,
          currentPoint
        } = PathElement.pathS(pathParser2);
        pathParser2.addMarker(currentPoint, controlPoint, point4);
        boundingBox.addBezierCurve(current.x, current.y, point4.x, point4.y, controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
        if (ctx) {
          ctx.bezierCurveTo(point4.x, point4.y, controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
        }
      }
      static pathQ(pathParser2) {
        var {
          current
        } = pathParser2;
        var controlPoint = pathParser2.getAsControlPoint("x1", "y1");
        var currentPoint = pathParser2.getAsCurrentPoint();
        return {
          current,
          controlPoint,
          currentPoint
        };
      }
      pathQ(ctx, boundingBox) {
        var {
          pathParser: pathParser2
        } = this;
        var {
          current,
          controlPoint,
          currentPoint
        } = PathElement.pathQ(pathParser2);
        pathParser2.addMarker(currentPoint, controlPoint, controlPoint);
        boundingBox.addQuadraticCurve(current.x, current.y, controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
        if (ctx) {
          ctx.quadraticCurveTo(controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
        }
      }
      static pathT(pathParser2) {
        var {
          current
        } = pathParser2;
        var controlPoint = pathParser2.getReflectedControlPoint();
        pathParser2.control = controlPoint;
        var currentPoint = pathParser2.getAsCurrentPoint();
        return {
          current,
          controlPoint,
          currentPoint
        };
      }
      pathT(ctx, boundingBox) {
        var {
          pathParser: pathParser2
        } = this;
        var {
          current,
          controlPoint,
          currentPoint
        } = PathElement.pathT(pathParser2);
        pathParser2.addMarker(currentPoint, controlPoint, controlPoint);
        boundingBox.addQuadraticCurve(current.x, current.y, controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
        if (ctx) {
          ctx.quadraticCurveTo(controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
        }
      }
      static pathA(pathParser2) {
        var {
          current,
          command
        } = pathParser2;
        var {
          rX,
          rY,
          xRot,
          lArcFlag,
          sweepFlag
        } = command;
        var xAxisRotation = xRot * (Math.PI / 180);
        var currentPoint = pathParser2.getAsCurrentPoint();
        var currp = new Point2(Math.cos(xAxisRotation) * (current.x - currentPoint.x) / 2 + Math.sin(xAxisRotation) * (current.y - currentPoint.y) / 2, -Math.sin(xAxisRotation) * (current.x - currentPoint.x) / 2 + Math.cos(xAxisRotation) * (current.y - currentPoint.y) / 2);
        var l3 = Math.pow(currp.x, 2) / Math.pow(rX, 2) + Math.pow(currp.y, 2) / Math.pow(rY, 2);
        if (l3 > 1) {
          rX *= Math.sqrt(l3);
          rY *= Math.sqrt(l3);
        }
        var s3 = (lArcFlag === sweepFlag ? -1 : 1) * Math.sqrt((Math.pow(rX, 2) * Math.pow(rY, 2) - Math.pow(rX, 2) * Math.pow(currp.y, 2) - Math.pow(rY, 2) * Math.pow(currp.x, 2)) / (Math.pow(rX, 2) * Math.pow(currp.y, 2) + Math.pow(rY, 2) * Math.pow(currp.x, 2)));
        if (isNaN(s3)) {
          s3 = 0;
        }
        var cpp = new Point2(s3 * rX * currp.y / rY, s3 * -rY * currp.x / rX);
        var centp = new Point2((current.x + currentPoint.x) / 2 + Math.cos(xAxisRotation) * cpp.x - Math.sin(xAxisRotation) * cpp.y, (current.y + currentPoint.y) / 2 + Math.sin(xAxisRotation) * cpp.x + Math.cos(xAxisRotation) * cpp.y);
        var a1 = vectorsAngle([1, 0], [(currp.x - cpp.x) / rX, (currp.y - cpp.y) / rY]);
        var u3 = [(currp.x - cpp.x) / rX, (currp.y - cpp.y) / rY];
        var v3 = [(-currp.x - cpp.x) / rX, (-currp.y - cpp.y) / rY];
        var ad = vectorsAngle(u3, v3);
        if (vectorsRatio(u3, v3) <= -1) {
          ad = Math.PI;
        }
        if (vectorsRatio(u3, v3) >= 1) {
          ad = 0;
        }
        return {
          currentPoint,
          rX,
          rY,
          sweepFlag,
          xAxisRotation,
          centp,
          a1,
          ad
        };
      }
      pathA(ctx, boundingBox) {
        var {
          pathParser: pathParser2
        } = this;
        var {
          currentPoint,
          rX,
          rY,
          sweepFlag,
          xAxisRotation,
          centp,
          a1,
          ad
        } = PathElement.pathA(pathParser2);
        var dir = 1 - sweepFlag ? 1 : -1;
        var ah = a1 + dir * (ad / 2);
        var halfWay = new Point2(centp.x + rX * Math.cos(ah), centp.y + rY * Math.sin(ah));
        pathParser2.addMarkerAngle(halfWay, ah - dir * Math.PI / 2);
        pathParser2.addMarkerAngle(currentPoint, ah - dir * Math.PI);
        boundingBox.addPoint(currentPoint.x, currentPoint.y);
        if (ctx && !isNaN(a1) && !isNaN(ad)) {
          var r2 = rX > rY ? rX : rY;
          var sx = rX > rY ? 1 : rX / rY;
          var sy = rX > rY ? rY / rX : 1;
          ctx.translate(centp.x, centp.y);
          ctx.rotate(xAxisRotation);
          ctx.scale(sx, sy);
          ctx.arc(0, 0, r2, a1, a1 + ad, Boolean(1 - sweepFlag));
          ctx.scale(1 / sx, 1 / sy);
          ctx.rotate(-xAxisRotation);
          ctx.translate(-centp.x, -centp.y);
        }
      }
      static pathZ(pathParser2) {
        pathParser2.current = pathParser2.start;
      }
      pathZ(ctx, boundingBox) {
        PathElement.pathZ(this.pathParser);
        if (ctx) {
          if (boundingBox.x1 !== boundingBox.x2 && boundingBox.y1 !== boundingBox.y2) {
            ctx.closePath();
          }
        }
      }
    };
    GlyphElement = class extends PathElement {
      constructor(document4, node3, captureTextNodes) {
        super(document4, node3, captureTextNodes);
        this.type = "glyph";
        this.horizAdvX = this.getAttribute("horiz-adv-x").getNumber();
        this.unicode = this.getAttribute("unicode").getString();
        this.arabicForm = this.getAttribute("arabic-form").getString();
      }
    };
    TextElement = class extends RenderedElement {
      constructor(document4, node3, captureTextNodes) {
        super(document4, node3, new.target === TextElement ? true : captureTextNodes);
        this.type = "text";
        this.x = 0;
        this.y = 0;
        this.measureCache = -1;
      }
      setContext(ctx) {
        var fromMeasure = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
        super.setContext(ctx, fromMeasure);
        var textBaseline = this.getStyle("dominant-baseline").getTextBaseline() || this.getStyle("alignment-baseline").getTextBaseline();
        if (textBaseline) {
          ctx.textBaseline = textBaseline;
        }
      }
      initializeCoordinates() {
        this.x = 0;
        this.y = 0;
        this.leafTexts = [];
        this.textChunkStart = 0;
        this.minX = Number.POSITIVE_INFINITY;
        this.maxX = Number.NEGATIVE_INFINITY;
      }
      getBoundingBox(ctx) {
        if (this.type !== "text") {
          return this.getTElementBoundingBox(ctx);
        }
        this.initializeCoordinates();
        this.adjustChildCoordinatesRecursive(ctx);
        var boundingBox = null;
        this.children.forEach((_3, i3) => {
          var childBoundingBox = this.getChildBoundingBox(ctx, this, this, i3);
          if (!boundingBox) {
            boundingBox = childBoundingBox;
          } else {
            boundingBox.addBoundingBox(childBoundingBox);
          }
        });
        return boundingBox;
      }
      getFontSize() {
        var {
          document: document4,
          parent
        } = this;
        var inheritFontSize = Font.parse(document4.ctx.font).fontSize;
        var fontSize = parent.getStyle("font-size").getNumber(inheritFontSize);
        return fontSize;
      }
      getTElementBoundingBox(ctx) {
        var fontSize = this.getFontSize();
        return new BoundingBox(this.x, this.y - fontSize, this.x + this.measureText(ctx), this.y);
      }
      getGlyph(font, text3, i3) {
        var char = text3[i3];
        var glyph = null;
        if (font.isArabic) {
          var len = text3.length;
          var prevChar = text3[i3 - 1];
          var nextChar = text3[i3 + 1];
          var arabicForm = "isolated";
          if ((i3 === 0 || prevChar === " ") && i3 < len - 1 && nextChar !== " ") {
            arabicForm = "terminal";
          }
          if (i3 > 0 && prevChar !== " " && i3 < len - 1 && nextChar !== " ") {
            arabicForm = "medial";
          }
          if (i3 > 0 && prevChar !== " " && (i3 === len - 1 || nextChar === " ")) {
            arabicForm = "initial";
          }
          if (typeof font.glyphs[char] !== "undefined") {
            var maybeGlyph = font.glyphs[char];
            glyph = maybeGlyph instanceof GlyphElement ? maybeGlyph : maybeGlyph[arabicForm];
          }
        } else {
          glyph = font.glyphs[char];
        }
        if (!glyph) {
          glyph = font.missingGlyph;
        }
        return glyph;
      }
      getText() {
        return "";
      }
      getTextFromNode(node3) {
        var textNode = node3 || this.node;
        var childNodes = Array.from(textNode.parentNode.childNodes);
        var index3 = childNodes.indexOf(textNode);
        var lastIndex = childNodes.length - 1;
        var text3 = compressSpaces(
          // textNode.value
          // || textNode.text
          textNode.textContent || ""
        );
        if (index3 === 0) {
          text3 = trimLeft(text3);
        }
        if (index3 === lastIndex) {
          text3 = trimRight(text3);
        }
        return text3;
      }
      renderChildren(ctx) {
        if (this.type !== "text") {
          this.renderTElementChildren(ctx);
          return;
        }
        this.initializeCoordinates();
        this.adjustChildCoordinatesRecursive(ctx);
        this.children.forEach((_3, i3) => {
          this.renderChild(ctx, this, this, i3);
        });
        var {
          mouse
        } = this.document.screen;
        if (mouse.isWorking()) {
          mouse.checkBoundingBox(this, this.getBoundingBox(ctx));
        }
      }
      renderTElementChildren(ctx) {
        var {
          document: document4,
          parent
        } = this;
        var renderText2 = this.getText();
        var customFont = parent.getStyle("font-family").getDefinition();
        if (customFont) {
          var {
            unitsPerEm
          } = customFont.fontFace;
          var ctxFont = Font.parse(document4.ctx.font);
          var fontSize = parent.getStyle("font-size").getNumber(ctxFont.fontSize);
          var fontStyle = parent.getStyle("font-style").getString(ctxFont.fontStyle);
          var scale = fontSize / unitsPerEm;
          var text3 = customFont.isRTL ? renderText2.split("").reverse().join("") : renderText2;
          var dx2 = toNumbers(parent.getAttribute("dx").getString());
          var len = text3.length;
          for (var i3 = 0; i3 < len; i3++) {
            var glyph = this.getGlyph(customFont, text3, i3);
            ctx.translate(this.x, this.y);
            ctx.scale(scale, -scale);
            var lw = ctx.lineWidth;
            ctx.lineWidth = ctx.lineWidth * unitsPerEm / fontSize;
            if (fontStyle === "italic") {
              ctx.transform(1, 0, 0.4, 1, 0, 0);
            }
            glyph.render(ctx);
            if (fontStyle === "italic") {
              ctx.transform(1, 0, -0.4, 1, 0, 0);
            }
            ctx.lineWidth = lw;
            ctx.scale(1 / scale, -1 / scale);
            ctx.translate(-this.x, -this.y);
            this.x += fontSize * (glyph.horizAdvX || customFont.horizAdvX) / unitsPerEm;
            if (typeof dx2[i3] !== "undefined" && !isNaN(dx2[i3])) {
              this.x += dx2[i3];
            }
          }
          return;
        }
        var {
          x: x3,
          y: y4
        } = this;
        if (ctx.fillStyle) {
          ctx.fillText(renderText2, x3, y4);
        }
        if (ctx.strokeStyle) {
          ctx.strokeText(renderText2, x3, y4);
        }
      }
      applyAnchoring() {
        if (this.textChunkStart >= this.leafTexts.length) {
          return;
        }
        var firstElement = this.leafTexts[this.textChunkStart];
        var textAnchor = firstElement.getStyle("text-anchor").getString("start");
        var isRTL = false;
        var shift = 0;
        if (textAnchor === "start" && !isRTL || textAnchor === "end" && isRTL) {
          shift = firstElement.x - this.minX;
        } else if (textAnchor === "end" && !isRTL || textAnchor === "start" && isRTL) {
          shift = firstElement.x - this.maxX;
        } else {
          shift = firstElement.x - (this.minX + this.maxX) / 2;
        }
        for (var i3 = this.textChunkStart; i3 < this.leafTexts.length; i3++) {
          this.leafTexts[i3].x += shift;
        }
        this.minX = Number.POSITIVE_INFINITY;
        this.maxX = Number.NEGATIVE_INFINITY;
        this.textChunkStart = this.leafTexts.length;
      }
      adjustChildCoordinatesRecursive(ctx) {
        this.children.forEach((_3, i3) => {
          this.adjustChildCoordinatesRecursiveCore(ctx, this, this, i3);
        });
        this.applyAnchoring();
      }
      adjustChildCoordinatesRecursiveCore(ctx, textParent, parent, i3) {
        var child = parent.children[i3];
        if (child.children.length > 0) {
          child.children.forEach((_3, i4) => {
            textParent.adjustChildCoordinatesRecursiveCore(ctx, textParent, child, i4);
          });
        } else {
          this.adjustChildCoordinates(ctx, textParent, parent, i3);
        }
      }
      adjustChildCoordinates(ctx, textParent, parent, i3) {
        var child = parent.children[i3];
        if (typeof child.measureText !== "function") {
          return child;
        }
        ctx.save();
        child.setContext(ctx, true);
        var xAttr = child.getAttribute("x");
        var yAttr = child.getAttribute("y");
        var dxAttr = child.getAttribute("dx");
        var dyAttr = child.getAttribute("dy");
        var customFont = child.getStyle("font-family").getDefinition();
        var isRTL = Boolean(customFont) && customFont.isRTL;
        if (i3 === 0) {
          if (!xAttr.hasValue()) {
            xAttr.setValue(child.getInheritedAttribute("x"));
          }
          if (!yAttr.hasValue()) {
            yAttr.setValue(child.getInheritedAttribute("y"));
          }
          if (!dxAttr.hasValue()) {
            dxAttr.setValue(child.getInheritedAttribute("dx"));
          }
          if (!dyAttr.hasValue()) {
            dyAttr.setValue(child.getInheritedAttribute("dy"));
          }
        }
        var width2 = child.measureText(ctx);
        if (isRTL) {
          textParent.x -= width2;
        }
        if (xAttr.hasValue()) {
          textParent.applyAnchoring();
          child.x = xAttr.getPixels("x");
          if (dxAttr.hasValue()) {
            child.x += dxAttr.getPixels("x");
          }
        } else {
          if (dxAttr.hasValue()) {
            textParent.x += dxAttr.getPixels("x");
          }
          child.x = textParent.x;
        }
        textParent.x = child.x;
        if (!isRTL) {
          textParent.x += width2;
        }
        if (yAttr.hasValue()) {
          child.y = yAttr.getPixels("y");
          if (dyAttr.hasValue()) {
            child.y += dyAttr.getPixels("y");
          }
        } else {
          if (dyAttr.hasValue()) {
            textParent.y += dyAttr.getPixels("y");
          }
          child.y = textParent.y;
        }
        textParent.y = child.y;
        textParent.leafTexts.push(child);
        textParent.minX = Math.min(textParent.minX, child.x, child.x + width2);
        textParent.maxX = Math.max(textParent.maxX, child.x, child.x + width2);
        child.clearContext(ctx);
        ctx.restore();
        return child;
      }
      getChildBoundingBox(ctx, textParent, parent, i3) {
        var child = parent.children[i3];
        if (typeof child.getBoundingBox !== "function") {
          return null;
        }
        var boundingBox = child.getBoundingBox(ctx);
        if (!boundingBox) {
          return null;
        }
        child.children.forEach((_3, i4) => {
          var childBoundingBox = textParent.getChildBoundingBox(ctx, textParent, child, i4);
          boundingBox.addBoundingBox(childBoundingBox);
        });
        return boundingBox;
      }
      renderChild(ctx, textParent, parent, i3) {
        var child = parent.children[i3];
        child.render(ctx);
        child.children.forEach((_3, i4) => {
          textParent.renderChild(ctx, textParent, child, i4);
        });
      }
      measureText(ctx) {
        var {
          measureCache
        } = this;
        if (~measureCache) {
          return measureCache;
        }
        var renderText2 = this.getText();
        var measure = this.measureTargetText(ctx, renderText2);
        this.measureCache = measure;
        return measure;
      }
      measureTargetText(ctx, targetText) {
        if (!targetText.length) {
          return 0;
        }
        var {
          parent
        } = this;
        var customFont = parent.getStyle("font-family").getDefinition();
        if (customFont) {
          var fontSize = this.getFontSize();
          var text3 = customFont.isRTL ? targetText.split("").reverse().join("") : targetText;
          var dx2 = toNumbers(parent.getAttribute("dx").getString());
          var len = text3.length;
          var _measure = 0;
          for (var i3 = 0; i3 < len; i3++) {
            var glyph = this.getGlyph(customFont, text3, i3);
            _measure += (glyph.horizAdvX || customFont.horizAdvX) * fontSize / customFont.fontFace.unitsPerEm;
            if (typeof dx2[i3] !== "undefined" && !isNaN(dx2[i3])) {
              _measure += dx2[i3];
            }
          }
          return _measure;
        }
        if (!ctx.measureText) {
          return targetText.length * 10;
        }
        ctx.save();
        this.setContext(ctx, true);
        var {
          width: measure
        } = ctx.measureText(targetText);
        this.clearContext(ctx);
        ctx.restore();
        return measure;
      }
      /**
       * Inherits positional attributes from {@link TextElement} parent(s). Attributes
       * are only inherited from a parent to its first child.
       * @param name - The attribute name.
       * @returns The attribute value or null.
       */
      getInheritedAttribute(name) {
        var current = this;
        while (current instanceof TextElement && current.isFirstChild()) {
          var parentAttr = current.parent.getAttribute(name);
          if (parentAttr.hasValue(true)) {
            return parentAttr.getValue("0");
          }
          current = current.parent;
        }
        return null;
      }
    };
    TSpanElement = class extends TextElement {
      constructor(document4, node3, captureTextNodes) {
        super(document4, node3, new.target === TSpanElement ? true : captureTextNodes);
        this.type = "tspan";
        this.text = this.children.length > 0 ? "" : this.getTextFromNode();
      }
      getText() {
        return this.text;
      }
    };
    TextNode = class extends TSpanElement {
      constructor() {
        super(...arguments);
        this.type = "textNode";
      }
    };
    SVGElement = class extends RenderedElement {
      constructor() {
        super(...arguments);
        this.type = "svg";
        this.root = false;
      }
      setContext(ctx) {
        var _this$node$parentNode;
        var {
          document: document4
        } = this;
        var {
          screen,
          window: window2
        } = document4;
        var canvas = ctx.canvas;
        screen.setDefaults(ctx);
        if (canvas.style && typeof ctx.font !== "undefined" && window2 && typeof window2.getComputedStyle !== "undefined") {
          ctx.font = window2.getComputedStyle(canvas).getPropertyValue("font");
          var fontSizeProp = new Property(document4, "fontSize", Font.parse(ctx.font).fontSize);
          if (fontSizeProp.hasValue()) {
            document4.rootEmSize = fontSizeProp.getPixels("y");
            document4.emSize = document4.rootEmSize;
          }
        }
        if (!this.getAttribute("x").hasValue()) {
          this.getAttribute("x", true).setValue(0);
        }
        if (!this.getAttribute("y").hasValue()) {
          this.getAttribute("y", true).setValue(0);
        }
        var {
          width: width2,
          height: height2
        } = screen.viewPort;
        if (!this.getStyle("width").hasValue()) {
          this.getStyle("width", true).setValue("100%");
        }
        if (!this.getStyle("height").hasValue()) {
          this.getStyle("height", true).setValue("100%");
        }
        if (!this.getStyle("color").hasValue()) {
          this.getStyle("color", true).setValue("black");
        }
        var refXAttr = this.getAttribute("refX");
        var refYAttr = this.getAttribute("refY");
        var viewBoxAttr = this.getAttribute("viewBox");
        var viewBox = viewBoxAttr.hasValue() ? toNumbers(viewBoxAttr.getString()) : null;
        var clip = !this.root && this.getStyle("overflow").getValue("hidden") !== "visible";
        var minX = 0;
        var minY = 0;
        var clipX = 0;
        var clipY = 0;
        if (viewBox) {
          minX = viewBox[0];
          minY = viewBox[1];
        }
        if (!this.root) {
          width2 = this.getStyle("width").getPixels("x");
          height2 = this.getStyle("height").getPixels("y");
          if (this.type === "marker") {
            clipX = minX;
            clipY = minY;
            minX = 0;
            minY = 0;
          }
        }
        screen.viewPort.setCurrent(width2, height2);
        if (this.node && (!this.parent || ((_this$node$parentNode = this.node.parentNode) === null || _this$node$parentNode === void 0 ? void 0 : _this$node$parentNode.nodeName) === "foreignObject") && this.getStyle("transform", false, true).hasValue() && !this.getStyle("transform-origin", false, true).hasValue()) {
          this.getStyle("transform-origin", true, true).setValue("50% 50%");
        }
        super.setContext(ctx);
        ctx.translate(this.getAttribute("x").getPixels("x"), this.getAttribute("y").getPixels("y"));
        if (viewBox) {
          width2 = viewBox[2];
          height2 = viewBox[3];
        }
        document4.setViewBox({
          ctx,
          aspectRatio: this.getAttribute("preserveAspectRatio").getString(),
          width: screen.viewPort.width,
          desiredWidth: width2,
          height: screen.viewPort.height,
          desiredHeight: height2,
          minX,
          minY,
          refX: refXAttr.getValue(),
          refY: refYAttr.getValue(),
          clip,
          clipX,
          clipY
        });
        if (viewBox) {
          screen.viewPort.removeCurrent();
          screen.viewPort.setCurrent(width2, height2);
        }
      }
      clearContext(ctx) {
        super.clearContext(ctx);
        this.document.screen.viewPort.removeCurrent();
      }
      /**
       * Resize SVG to fit in given size.
       * @param width
       * @param height
       * @param preserveAspectRatio
       */
      resize(width2) {
        var height2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : width2;
        var preserveAspectRatio = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
        var widthAttr = this.getAttribute("width", true);
        var heightAttr = this.getAttribute("height", true);
        var viewBoxAttr = this.getAttribute("viewBox");
        var styleAttr = this.getAttribute("style");
        var originWidth = widthAttr.getNumber(0);
        var originHeight = heightAttr.getNumber(0);
        if (preserveAspectRatio) {
          if (typeof preserveAspectRatio === "string") {
            this.getAttribute("preserveAspectRatio", true).setValue(preserveAspectRatio);
          } else {
            var preserveAspectRatioAttr = this.getAttribute("preserveAspectRatio");
            if (preserveAspectRatioAttr.hasValue()) {
              preserveAspectRatioAttr.setValue(preserveAspectRatioAttr.getString().replace(/^\s*(\S.*\S)\s*$/, "$1"));
            }
          }
        }
        widthAttr.setValue(width2);
        heightAttr.setValue(height2);
        if (!viewBoxAttr.hasValue()) {
          viewBoxAttr.setValue("0 0 ".concat(originWidth || width2, " ").concat(originHeight || height2));
        }
        if (styleAttr.hasValue()) {
          var widthStyle = this.getStyle("width");
          var heightStyle = this.getStyle("height");
          if (widthStyle.hasValue()) {
            widthStyle.setValue("".concat(width2, "px"));
          }
          if (heightStyle.hasValue()) {
            heightStyle.setValue("".concat(height2, "px"));
          }
        }
      }
    };
    RectElement = class extends PathElement {
      constructor() {
        super(...arguments);
        this.type = "rect";
      }
      path(ctx) {
        var x3 = this.getAttribute("x").getPixels("x");
        var y4 = this.getAttribute("y").getPixels("y");
        var width2 = this.getStyle("width", false, true).getPixels("x");
        var height2 = this.getStyle("height", false, true).getPixels("y");
        var rxAttr = this.getAttribute("rx");
        var ryAttr = this.getAttribute("ry");
        var rx2 = rxAttr.getPixels("x");
        var ry2 = ryAttr.getPixels("y");
        if (rxAttr.hasValue() && !ryAttr.hasValue()) {
          ry2 = rx2;
        }
        if (ryAttr.hasValue() && !rxAttr.hasValue()) {
          rx2 = ry2;
        }
        rx2 = Math.min(rx2, width2 / 2);
        ry2 = Math.min(ry2, height2 / 2);
        if (ctx) {
          var KAPPA = 4 * ((Math.sqrt(2) - 1) / 3);
          ctx.beginPath();
          if (height2 > 0 && width2 > 0) {
            ctx.moveTo(x3 + rx2, y4);
            ctx.lineTo(x3 + width2 - rx2, y4);
            ctx.bezierCurveTo(x3 + width2 - rx2 + KAPPA * rx2, y4, x3 + width2, y4 + ry2 - KAPPA * ry2, x3 + width2, y4 + ry2);
            ctx.lineTo(x3 + width2, y4 + height2 - ry2);
            ctx.bezierCurveTo(x3 + width2, y4 + height2 - ry2 + KAPPA * ry2, x3 + width2 - rx2 + KAPPA * rx2, y4 + height2, x3 + width2 - rx2, y4 + height2);
            ctx.lineTo(x3 + rx2, y4 + height2);
            ctx.bezierCurveTo(x3 + rx2 - KAPPA * rx2, y4 + height2, x3, y4 + height2 - ry2 + KAPPA * ry2, x3, y4 + height2 - ry2);
            ctx.lineTo(x3, y4 + ry2);
            ctx.bezierCurveTo(x3, y4 + ry2 - KAPPA * ry2, x3 + rx2 - KAPPA * rx2, y4, x3 + rx2, y4);
            ctx.closePath();
          }
        }
        return new BoundingBox(x3, y4, x3 + width2, y4 + height2);
      }
      getMarkers() {
        return null;
      }
    };
    CircleElement = class extends PathElement {
      constructor() {
        super(...arguments);
        this.type = "circle";
      }
      path(ctx) {
        var cx2 = this.getAttribute("cx").getPixels("x");
        var cy2 = this.getAttribute("cy").getPixels("y");
        var r2 = this.getAttribute("r").getPixels();
        if (ctx && r2 > 0) {
          ctx.beginPath();
          ctx.arc(cx2, cy2, r2, 0, Math.PI * 2, false);
          ctx.closePath();
        }
        return new BoundingBox(cx2 - r2, cy2 - r2, cx2 + r2, cy2 + r2);
      }
      getMarkers() {
        return null;
      }
    };
    EllipseElement = class extends PathElement {
      constructor() {
        super(...arguments);
        this.type = "ellipse";
      }
      path(ctx) {
        var KAPPA = 4 * ((Math.sqrt(2) - 1) / 3);
        var rx2 = this.getAttribute("rx").getPixels("x");
        var ry2 = this.getAttribute("ry").getPixels("y");
        var cx2 = this.getAttribute("cx").getPixels("x");
        var cy2 = this.getAttribute("cy").getPixels("y");
        if (ctx && rx2 > 0 && ry2 > 0) {
          ctx.beginPath();
          ctx.moveTo(cx2 + rx2, cy2);
          ctx.bezierCurveTo(cx2 + rx2, cy2 + KAPPA * ry2, cx2 + KAPPA * rx2, cy2 + ry2, cx2, cy2 + ry2);
          ctx.bezierCurveTo(cx2 - KAPPA * rx2, cy2 + ry2, cx2 - rx2, cy2 + KAPPA * ry2, cx2 - rx2, cy2);
          ctx.bezierCurveTo(cx2 - rx2, cy2 - KAPPA * ry2, cx2 - KAPPA * rx2, cy2 - ry2, cx2, cy2 - ry2);
          ctx.bezierCurveTo(cx2 + KAPPA * rx2, cy2 - ry2, cx2 + rx2, cy2 - KAPPA * ry2, cx2 + rx2, cy2);
          ctx.closePath();
        }
        return new BoundingBox(cx2 - rx2, cy2 - ry2, cx2 + rx2, cy2 + ry2);
      }
      getMarkers() {
        return null;
      }
    };
    LineElement = class extends PathElement {
      constructor() {
        super(...arguments);
        this.type = "line";
      }
      getPoints() {
        return [new Point2(this.getAttribute("x1").getPixels("x"), this.getAttribute("y1").getPixels("y")), new Point2(this.getAttribute("x2").getPixels("x"), this.getAttribute("y2").getPixels("y"))];
      }
      path(ctx) {
        var [{
          x: x0,
          y: y0
        }, {
          x: x1,
          y: y1
        }] = this.getPoints();
        if (ctx) {
          ctx.beginPath();
          ctx.moveTo(x0, y0);
          ctx.lineTo(x1, y1);
        }
        return new BoundingBox(x0, y0, x1, y1);
      }
      getMarkers() {
        var [p0, p1] = this.getPoints();
        var a3 = p0.angleTo(p1);
        return [[p0, a3], [p1, a3]];
      }
    };
    PolylineElement = class extends PathElement {
      constructor(document4, node3, captureTextNodes) {
        super(document4, node3, captureTextNodes);
        this.type = "polyline";
        this.points = [];
        this.points = Point2.parsePath(this.getAttribute("points").getString());
      }
      path(ctx) {
        var {
          points
        } = this;
        var [{
          x: x0,
          y: y0
        }] = points;
        var boundingBox = new BoundingBox(x0, y0);
        if (ctx) {
          ctx.beginPath();
          ctx.moveTo(x0, y0);
        }
        points.forEach((_ref) => {
          var {
            x: x3,
            y: y4
          } = _ref;
          boundingBox.addPoint(x3, y4);
          if (ctx) {
            ctx.lineTo(x3, y4);
          }
        });
        return boundingBox;
      }
      getMarkers() {
        var {
          points
        } = this;
        var lastIndex = points.length - 1;
        var markers = [];
        points.forEach((point4, i3) => {
          if (i3 === lastIndex) {
            return;
          }
          markers.push([point4, point4.angleTo(points[i3 + 1])]);
        });
        if (markers.length > 0) {
          markers.push([points[points.length - 1], markers[markers.length - 1][1]]);
        }
        return markers;
      }
    };
    PolygonElement = class extends PolylineElement {
      constructor() {
        super(...arguments);
        this.type = "polygon";
      }
      path(ctx) {
        var boundingBox = super.path(ctx);
        var [{
          x: x3,
          y: y4
        }] = this.points;
        if (ctx) {
          ctx.lineTo(x3, y4);
          ctx.closePath();
        }
        return boundingBox;
      }
    };
    PatternElement = class extends Element2 {
      constructor() {
        super(...arguments);
        this.type = "pattern";
      }
      createPattern(ctx, _3, parentOpacityProp) {
        var width2 = this.getStyle("width").getPixels("x", true);
        var height2 = this.getStyle("height").getPixels("y", true);
        var patternSvg = new SVGElement(this.document, null);
        patternSvg.attributes.viewBox = new Property(this.document, "viewBox", this.getAttribute("viewBox").getValue());
        patternSvg.attributes.width = new Property(this.document, "width", "".concat(width2, "px"));
        patternSvg.attributes.height = new Property(this.document, "height", "".concat(height2, "px"));
        patternSvg.attributes.transform = new Property(this.document, "transform", this.getAttribute("patternTransform").getValue());
        patternSvg.children = this.children;
        var patternCanvas = this.document.createCanvas(width2, height2);
        var patternCtx = patternCanvas.getContext("2d");
        var xAttr = this.getAttribute("x");
        var yAttr = this.getAttribute("y");
        if (xAttr.hasValue() && yAttr.hasValue()) {
          patternCtx.translate(xAttr.getPixels("x", true), yAttr.getPixels("y", true));
        }
        if (parentOpacityProp.hasValue()) {
          this.styles["fill-opacity"] = parentOpacityProp;
        } else {
          Reflect.deleteProperty(this.styles, "fill-opacity");
        }
        for (var x3 = -1; x3 <= 1; x3++) {
          for (var y4 = -1; y4 <= 1; y4++) {
            patternCtx.save();
            patternSvg.attributes.x = new Property(this.document, "x", x3 * patternCanvas.width);
            patternSvg.attributes.y = new Property(this.document, "y", y4 * patternCanvas.height);
            patternSvg.render(patternCtx);
            patternCtx.restore();
          }
        }
        var pattern = ctx.createPattern(patternCanvas, "repeat");
        return pattern;
      }
    };
    MarkerElement = class extends Element2 {
      constructor() {
        super(...arguments);
        this.type = "marker";
      }
      render(ctx, point4, angle) {
        if (!point4) {
          return;
        }
        var {
          x: x3,
          y: y4
        } = point4;
        var orient = this.getAttribute("orient").getString("auto");
        var markerUnits = this.getAttribute("markerUnits").getString("strokeWidth");
        ctx.translate(x3, y4);
        if (orient === "auto") {
          ctx.rotate(angle);
        }
        if (markerUnits === "strokeWidth") {
          ctx.scale(ctx.lineWidth, ctx.lineWidth);
        }
        ctx.save();
        var markerSvg = new SVGElement(this.document, null);
        markerSvg.type = this.type;
        markerSvg.attributes.viewBox = new Property(this.document, "viewBox", this.getAttribute("viewBox").getValue());
        markerSvg.attributes.refX = new Property(this.document, "refX", this.getAttribute("refX").getValue());
        markerSvg.attributes.refY = new Property(this.document, "refY", this.getAttribute("refY").getValue());
        markerSvg.attributes.width = new Property(this.document, "width", this.getAttribute("markerWidth").getValue());
        markerSvg.attributes.height = new Property(this.document, "height", this.getAttribute("markerHeight").getValue());
        markerSvg.attributes.overflow = new Property(this.document, "overflow", this.getAttribute("overflow").getValue());
        markerSvg.attributes.fill = new Property(this.document, "fill", this.getAttribute("fill").getColor("black"));
        markerSvg.attributes.stroke = new Property(this.document, "stroke", this.getAttribute("stroke").getValue("none"));
        markerSvg.children = this.children;
        markerSvg.render(ctx);
        ctx.restore();
        if (markerUnits === "strokeWidth") {
          ctx.scale(1 / ctx.lineWidth, 1 / ctx.lineWidth);
        }
        if (orient === "auto") {
          ctx.rotate(-angle);
        }
        ctx.translate(-x3, -y4);
      }
    };
    DefsElement = class extends Element2 {
      constructor() {
        super(...arguments);
        this.type = "defs";
      }
      render() {
      }
    };
    GElement = class extends RenderedElement {
      constructor() {
        super(...arguments);
        this.type = "g";
      }
      getBoundingBox(ctx) {
        var boundingBox = new BoundingBox();
        this.children.forEach((child) => {
          boundingBox.addBoundingBox(child.getBoundingBox(ctx));
        });
        return boundingBox;
      }
    };
    GradientElement = class extends Element2 {
      constructor(document4, node3, captureTextNodes) {
        super(document4, node3, captureTextNodes);
        this.attributesToInherit = ["gradientUnits"];
        this.stops = [];
        var {
          stops,
          children
        } = this;
        children.forEach((child) => {
          if (child.type === "stop") {
            stops.push(child);
          }
        });
      }
      getGradientUnits() {
        return this.getAttribute("gradientUnits").getString("objectBoundingBox");
      }
      createGradient(ctx, element2, parentOpacityProp) {
        var stopsContainer = this;
        if (this.getHrefAttribute().hasValue()) {
          stopsContainer = this.getHrefAttribute().getDefinition();
          this.inheritStopContainer(stopsContainer);
        }
        var {
          stops
        } = stopsContainer;
        var gradient = this.getGradient(ctx, element2);
        if (!gradient) {
          return this.addParentOpacity(parentOpacityProp, stops[stops.length - 1].color);
        }
        stops.forEach((stop) => {
          gradient.addColorStop(stop.offset, this.addParentOpacity(parentOpacityProp, stop.color));
        });
        if (this.getAttribute("gradientTransform").hasValue()) {
          var {
            document: document4
          } = this;
          var {
            MAX_VIRTUAL_PIXELS,
            viewPort
          } = document4.screen;
          var [rootView] = viewPort.viewPorts;
          var rect = new RectElement(document4, null);
          rect.attributes.x = new Property(document4, "x", -MAX_VIRTUAL_PIXELS / 3);
          rect.attributes.y = new Property(document4, "y", -MAX_VIRTUAL_PIXELS / 3);
          rect.attributes.width = new Property(document4, "width", MAX_VIRTUAL_PIXELS);
          rect.attributes.height = new Property(document4, "height", MAX_VIRTUAL_PIXELS);
          var group = new GElement(document4, null);
          group.attributes.transform = new Property(document4, "transform", this.getAttribute("gradientTransform").getValue());
          group.children = [rect];
          var patternSvg = new SVGElement(document4, null);
          patternSvg.attributes.x = new Property(document4, "x", 0);
          patternSvg.attributes.y = new Property(document4, "y", 0);
          patternSvg.attributes.width = new Property(document4, "width", rootView.width);
          patternSvg.attributes.height = new Property(document4, "height", rootView.height);
          patternSvg.children = [group];
          var patternCanvas = document4.createCanvas(rootView.width, rootView.height);
          var patternCtx = patternCanvas.getContext("2d");
          patternCtx.fillStyle = gradient;
          patternSvg.render(patternCtx);
          return patternCtx.createPattern(patternCanvas, "no-repeat");
        }
        return gradient;
      }
      inheritStopContainer(stopsContainer) {
        this.attributesToInherit.forEach((attributeToInherit) => {
          if (!this.getAttribute(attributeToInherit).hasValue() && stopsContainer.getAttribute(attributeToInherit).hasValue()) {
            this.getAttribute(attributeToInherit, true).setValue(stopsContainer.getAttribute(attributeToInherit).getValue());
          }
        });
      }
      addParentOpacity(parentOpacityProp, color) {
        if (parentOpacityProp.hasValue()) {
          var colorProp = new Property(this.document, "color", color);
          return colorProp.addOpacity(parentOpacityProp).getColor();
        }
        return color;
      }
    };
    LinearGradientElement = class extends GradientElement {
      constructor(document4, node3, captureTextNodes) {
        super(document4, node3, captureTextNodes);
        this.type = "linearGradient";
        this.attributesToInherit.push("x1", "y1", "x2", "y2");
      }
      getGradient(ctx, element2) {
        var isBoundingBoxUnits = this.getGradientUnits() === "objectBoundingBox";
        var boundingBox = isBoundingBoxUnits ? element2.getBoundingBox(ctx) : null;
        if (isBoundingBoxUnits && !boundingBox) {
          return null;
        }
        if (!this.getAttribute("x1").hasValue() && !this.getAttribute("y1").hasValue() && !this.getAttribute("x2").hasValue() && !this.getAttribute("y2").hasValue()) {
          this.getAttribute("x1", true).setValue(0);
          this.getAttribute("y1", true).setValue(0);
          this.getAttribute("x2", true).setValue(1);
          this.getAttribute("y2", true).setValue(0);
        }
        var x1 = isBoundingBoxUnits ? boundingBox.x + boundingBox.width * this.getAttribute("x1").getNumber() : this.getAttribute("x1").getPixels("x");
        var y1 = isBoundingBoxUnits ? boundingBox.y + boundingBox.height * this.getAttribute("y1").getNumber() : this.getAttribute("y1").getPixels("y");
        var x22 = isBoundingBoxUnits ? boundingBox.x + boundingBox.width * this.getAttribute("x2").getNumber() : this.getAttribute("x2").getPixels("x");
        var y22 = isBoundingBoxUnits ? boundingBox.y + boundingBox.height * this.getAttribute("y2").getNumber() : this.getAttribute("y2").getPixels("y");
        if (x1 === x22 && y1 === y22) {
          return null;
        }
        return ctx.createLinearGradient(x1, y1, x22, y22);
      }
    };
    RadialGradientElement = class extends GradientElement {
      constructor(document4, node3, captureTextNodes) {
        super(document4, node3, captureTextNodes);
        this.type = "radialGradient";
        this.attributesToInherit.push("cx", "cy", "r", "fx", "fy", "fr");
      }
      getGradient(ctx, element2) {
        var isBoundingBoxUnits = this.getGradientUnits() === "objectBoundingBox";
        var boundingBox = element2.getBoundingBox(ctx);
        if (isBoundingBoxUnits && !boundingBox) {
          return null;
        }
        if (!this.getAttribute("cx").hasValue()) {
          this.getAttribute("cx", true).setValue("50%");
        }
        if (!this.getAttribute("cy").hasValue()) {
          this.getAttribute("cy", true).setValue("50%");
        }
        if (!this.getAttribute("r").hasValue()) {
          this.getAttribute("r", true).setValue("50%");
        }
        var cx2 = isBoundingBoxUnits ? boundingBox.x + boundingBox.width * this.getAttribute("cx").getNumber() : this.getAttribute("cx").getPixels("x");
        var cy2 = isBoundingBoxUnits ? boundingBox.y + boundingBox.height * this.getAttribute("cy").getNumber() : this.getAttribute("cy").getPixels("y");
        var fx = cx2;
        var fy = cy2;
        if (this.getAttribute("fx").hasValue()) {
          fx = isBoundingBoxUnits ? boundingBox.x + boundingBox.width * this.getAttribute("fx").getNumber() : this.getAttribute("fx").getPixels("x");
        }
        if (this.getAttribute("fy").hasValue()) {
          fy = isBoundingBoxUnits ? boundingBox.y + boundingBox.height * this.getAttribute("fy").getNumber() : this.getAttribute("fy").getPixels("y");
        }
        var r2 = isBoundingBoxUnits ? (boundingBox.width + boundingBox.height) / 2 * this.getAttribute("r").getNumber() : this.getAttribute("r").getPixels();
        var fr = this.getAttribute("fr").getPixels();
        return ctx.createRadialGradient(fx, fy, fr, cx2, cy2, r2);
      }
    };
    StopElement = class extends Element2 {
      constructor(document4, node3, captureTextNodes) {
        super(document4, node3, captureTextNodes);
        this.type = "stop";
        var offset = Math.max(0, Math.min(1, this.getAttribute("offset").getNumber()));
        var stopOpacity = this.getStyle("stop-opacity");
        var stopColor = this.getStyle("stop-color", true);
        if (stopColor.getString() === "") {
          stopColor.setValue("#000");
        }
        if (stopOpacity.hasValue()) {
          stopColor = stopColor.addOpacity(stopOpacity);
        }
        this.offset = offset;
        this.color = stopColor.getColor();
      }
    };
    AnimateElement = class extends Element2 {
      constructor(document4, node3, captureTextNodes) {
        super(document4, node3, captureTextNodes);
        this.type = "animate";
        this.duration = 0;
        this.initialValue = null;
        this.initialUnits = "";
        this.removed = false;
        this.frozen = false;
        document4.screen.animations.push(this);
        this.begin = this.getAttribute("begin").getMilliseconds();
        this.maxDuration = this.begin + this.getAttribute("dur").getMilliseconds();
        this.from = this.getAttribute("from");
        this.to = this.getAttribute("to");
        this.values = new Property(document4, "values", null);
        var valuesAttr = this.getAttribute("values");
        if (valuesAttr.hasValue()) {
          this.values.setValue(valuesAttr.getString().split(";"));
        }
      }
      getProperty() {
        var attributeType = this.getAttribute("attributeType").getString();
        var attributeName = this.getAttribute("attributeName").getString();
        if (attributeType === "CSS") {
          return this.parent.getStyle(attributeName, true);
        }
        return this.parent.getAttribute(attributeName, true);
      }
      calcValue() {
        var {
          initialUnits
        } = this;
        var {
          progress,
          from: from2,
          to: to2
        } = this.getProgress();
        var newValue = from2.getNumber() + (to2.getNumber() - from2.getNumber()) * progress;
        if (initialUnits === "%") {
          newValue *= 100;
        }
        return "".concat(newValue).concat(initialUnits);
      }
      update(delta) {
        var {
          parent
        } = this;
        var prop = this.getProperty();
        if (!this.initialValue) {
          this.initialValue = prop.getString();
          this.initialUnits = prop.getUnits();
        }
        if (this.duration > this.maxDuration) {
          var fill = this.getAttribute("fill").getString("remove");
          if (this.getAttribute("repeatCount").getString() === "indefinite" || this.getAttribute("repeatDur").getString() === "indefinite") {
            this.duration = 0;
          } else if (fill === "freeze" && !this.frozen) {
            this.frozen = true;
            parent.animationFrozen = true;
            parent.animationFrozenValue = prop.getString();
          } else if (fill === "remove" && !this.removed) {
            this.removed = true;
            prop.setValue(parent.animationFrozen ? parent.animationFrozenValue : this.initialValue);
            return true;
          }
          return false;
        }
        this.duration += delta;
        var updated = false;
        if (this.begin < this.duration) {
          var newValue = this.calcValue();
          var typeAttr = this.getAttribute("type");
          if (typeAttr.hasValue()) {
            var type = typeAttr.getString();
            newValue = "".concat(type, "(").concat(newValue, ")");
          }
          prop.setValue(newValue);
          updated = true;
        }
        return updated;
      }
      getProgress() {
        var {
          document: document4,
          values
        } = this;
        var result = {
          progress: (this.duration - this.begin) / (this.maxDuration - this.begin)
        };
        if (values.hasValue()) {
          var p3 = result.progress * (values.getValue().length - 1);
          var lb = Math.floor(p3);
          var ub = Math.ceil(p3);
          result.from = new Property(document4, "from", parseFloat(values.getValue()[lb]));
          result.to = new Property(document4, "to", parseFloat(values.getValue()[ub]));
          result.progress = (p3 - lb) / (ub - lb);
        } else {
          result.from = this.from;
          result.to = this.to;
        }
        return result;
      }
    };
    AnimateColorElement = class extends AnimateElement {
      constructor() {
        super(...arguments);
        this.type = "animateColor";
      }
      calcValue() {
        var {
          progress,
          from: from2,
          to: to2
        } = this.getProgress();
        var colorFrom = new import_rgbcolor.default(from2.getColor());
        var colorTo = new import_rgbcolor.default(to2.getColor());
        if (colorFrom.ok && colorTo.ok) {
          var r2 = colorFrom.r + (colorTo.r - colorFrom.r) * progress;
          var g2 = colorFrom.g + (colorTo.g - colorFrom.g) * progress;
          var b2 = colorFrom.b + (colorTo.b - colorFrom.b) * progress;
          return "rgb(".concat(Math.floor(r2), ", ").concat(Math.floor(g2), ", ").concat(Math.floor(b2), ")");
        }
        return this.getAttribute("from").getColor();
      }
    };
    AnimateTransformElement = class extends AnimateElement {
      constructor() {
        super(...arguments);
        this.type = "animateTransform";
      }
      calcValue() {
        var {
          progress,
          from: from2,
          to: to2
        } = this.getProgress();
        var transformFrom = toNumbers(from2.getString());
        var transformTo = toNumbers(to2.getString());
        var newValue = transformFrom.map((from3, i3) => {
          var to3 = transformTo[i3];
          return from3 + (to3 - from3) * progress;
        }).join(" ");
        return newValue;
      }
    };
    FontElement = class extends Element2 {
      constructor(document4, node3, captureTextNodes) {
        super(document4, node3, captureTextNodes);
        this.type = "font";
        this.glyphs = {};
        this.horizAdvX = this.getAttribute("horiz-adv-x").getNumber();
        var {
          definitions
        } = document4;
        var {
          children
        } = this;
        for (var child of children) {
          switch (child.type) {
            case "font-face": {
              this.fontFace = child;
              var fontFamilyStyle = child.getStyle("font-family");
              if (fontFamilyStyle.hasValue()) {
                definitions[fontFamilyStyle.getString()] = this;
              }
              break;
            }
            case "missing-glyph":
              this.missingGlyph = child;
              break;
            case "glyph": {
              var glyph = child;
              if (glyph.arabicForm) {
                this.isRTL = true;
                this.isArabic = true;
                if (typeof this.glyphs[glyph.unicode] === "undefined") {
                  this.glyphs[glyph.unicode] = {};
                }
                this.glyphs[glyph.unicode][glyph.arabicForm] = glyph;
              } else {
                this.glyphs[glyph.unicode] = glyph;
              }
              break;
            }
          }
        }
      }
      render() {
      }
    };
    FontFaceElement = class extends Element2 {
      constructor(document4, node3, captureTextNodes) {
        super(document4, node3, captureTextNodes);
        this.type = "font-face";
        this.ascent = this.getAttribute("ascent").getNumber();
        this.descent = this.getAttribute("descent").getNumber();
        this.unitsPerEm = this.getAttribute("units-per-em").getNumber();
      }
    };
    MissingGlyphElement = class extends PathElement {
      constructor() {
        super(...arguments);
        this.type = "missing-glyph";
        this.horizAdvX = 0;
      }
    };
    TRefElement = class extends TextElement {
      constructor() {
        super(...arguments);
        this.type = "tref";
      }
      getText() {
        var element2 = this.getHrefAttribute().getDefinition();
        if (element2) {
          var firstChild = element2.children[0];
          if (firstChild) {
            return firstChild.getText();
          }
        }
        return "";
      }
    };
    AElement = class extends TextElement {
      constructor(document4, node3, captureTextNodes) {
        super(document4, node3, captureTextNodes);
        this.type = "a";
        var {
          childNodes
        } = node3;
        var firstChild = childNodes[0];
        var hasText = childNodes.length > 0 && Array.from(childNodes).every((node4) => node4.nodeType === 3);
        this.hasText = hasText;
        this.text = hasText ? this.getTextFromNode(firstChild) : "";
      }
      getText() {
        return this.text;
      }
      renderChildren(ctx) {
        if (this.hasText) {
          super.renderChildren(ctx);
          var {
            document: document4,
            x: x3,
            y: y4
          } = this;
          var {
            mouse
          } = document4.screen;
          var fontSize = new Property(document4, "fontSize", Font.parse(document4.ctx.font).fontSize);
          if (mouse.isWorking()) {
            mouse.checkBoundingBox(this, new BoundingBox(x3, y4 - fontSize.getPixels("y"), x3 + this.measureText(ctx), y4));
          }
        } else if (this.children.length > 0) {
          var g2 = new GElement(this.document, null);
          g2.children = this.children;
          g2.parent = this;
          g2.render(ctx);
        }
      }
      onClick() {
        var {
          window: window2
        } = this.document;
        if (window2) {
          window2.open(this.getHrefAttribute().getString());
        }
      }
      onMouseMove() {
        var ctx = this.document.ctx;
        ctx.canvas.style.cursor = "pointer";
      }
    };
    TextPathElement = class extends TextElement {
      constructor(document4, node3, captureTextNodes) {
        super(document4, node3, captureTextNodes);
        this.type = "textPath";
        this.textWidth = 0;
        this.textHeight = 0;
        this.pathLength = -1;
        this.glyphInfo = null;
        this.letterSpacingCache = [];
        this.measuresCache = /* @__PURE__ */ new Map([["", 0]]);
        var pathElement = this.getHrefAttribute().getDefinition();
        this.text = this.getTextFromNode();
        this.dataArray = this.parsePathData(pathElement);
      }
      getText() {
        return this.text;
      }
      path(ctx) {
        var {
          dataArray
        } = this;
        if (ctx) {
          ctx.beginPath();
        }
        dataArray.forEach((_ref) => {
          var {
            type,
            points
          } = _ref;
          switch (type) {
            case PathParser.LINE_TO:
              if (ctx) {
                ctx.lineTo(points[0], points[1]);
              }
              break;
            case PathParser.MOVE_TO:
              if (ctx) {
                ctx.moveTo(points[0], points[1]);
              }
              break;
            case PathParser.CURVE_TO:
              if (ctx) {
                ctx.bezierCurveTo(points[0], points[1], points[2], points[3], points[4], points[5]);
              }
              break;
            case PathParser.QUAD_TO:
              if (ctx) {
                ctx.quadraticCurveTo(points[0], points[1], points[2], points[3]);
              }
              break;
            case PathParser.ARC: {
              var [cx2, cy2, rx2, ry2, theta, dTheta, psi, fs] = points;
              var r2 = rx2 > ry2 ? rx2 : ry2;
              var scaleX = rx2 > ry2 ? 1 : rx2 / ry2;
              var scaleY = rx2 > ry2 ? ry2 / rx2 : 1;
              if (ctx) {
                ctx.translate(cx2, cy2);
                ctx.rotate(psi);
                ctx.scale(scaleX, scaleY);
                ctx.arc(0, 0, r2, theta, theta + dTheta, Boolean(1 - fs));
                ctx.scale(1 / scaleX, 1 / scaleY);
                ctx.rotate(-psi);
                ctx.translate(-cx2, -cy2);
              }
              break;
            }
            case PathParser.CLOSE_PATH:
              if (ctx) {
                ctx.closePath();
              }
              break;
          }
        });
      }
      renderChildren(ctx) {
        this.setTextData(ctx);
        ctx.save();
        var textDecoration = this.parent.getStyle("text-decoration").getString();
        var fontSize = this.getFontSize();
        var {
          glyphInfo
        } = this;
        var fill = ctx.fillStyle;
        if (textDecoration === "underline") {
          ctx.beginPath();
        }
        glyphInfo.forEach((glyph, i3) => {
          var {
            p0,
            p1,
            rotation,
            text: partialText
          } = glyph;
          ctx.save();
          ctx.translate(p0.x, p0.y);
          ctx.rotate(rotation);
          if (ctx.fillStyle) {
            ctx.fillText(partialText, 0, 0);
          }
          if (ctx.strokeStyle) {
            ctx.strokeText(partialText, 0, 0);
          }
          ctx.restore();
          if (textDecoration === "underline") {
            if (i3 === 0) {
              ctx.moveTo(p0.x, p0.y + fontSize / 8);
            }
            ctx.lineTo(p1.x, p1.y + fontSize / 5);
          }
        });
        if (textDecoration === "underline") {
          ctx.lineWidth = fontSize / 20;
          ctx.strokeStyle = fill;
          ctx.stroke();
          ctx.closePath();
        }
        ctx.restore();
      }
      getLetterSpacingAt() {
        var idx = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
        return this.letterSpacingCache[idx] || 0;
      }
      findSegmentToFitChar(ctx, anchor, textFullWidth, fullPathWidth, spacesNumber, inputOffset, dy2, c4, charI) {
        var offset = inputOffset;
        var glyphWidth = this.measureText(ctx, c4);
        if (c4 === " " && anchor === "justify" && textFullWidth < fullPathWidth) {
          glyphWidth += (fullPathWidth - textFullWidth) / spacesNumber;
        }
        if (charI > -1) {
          offset += this.getLetterSpacingAt(charI);
        }
        var splineStep = this.textHeight / 20;
        var p0 = this.getEquidistantPointOnPath(offset, splineStep, 0);
        var p1 = this.getEquidistantPointOnPath(offset + glyphWidth, splineStep, 0);
        var segment = {
          p0,
          p1
        };
        var rotation = p0 && p1 ? Math.atan2(p1.y - p0.y, p1.x - p0.x) : 0;
        if (dy2) {
          var dyX = Math.cos(Math.PI / 2 + rotation) * dy2;
          var dyY = Math.cos(-rotation) * dy2;
          segment.p0 = _objectSpread$2(_objectSpread$2({}, p0), {}, {
            x: p0.x + dyX,
            y: p0.y + dyY
          });
          segment.p1 = _objectSpread$2(_objectSpread$2({}, p1), {}, {
            x: p1.x + dyX,
            y: p1.y + dyY
          });
        }
        offset += glyphWidth;
        return {
          offset,
          segment,
          rotation
        };
      }
      measureText(ctx, text3) {
        var {
          measuresCache
        } = this;
        var targetText = text3 || this.getText();
        if (measuresCache.has(targetText)) {
          return measuresCache.get(targetText);
        }
        var measure = this.measureTargetText(ctx, targetText);
        measuresCache.set(targetText, measure);
        return measure;
      }
      // This method supposes what all custom fonts already loaded.
      // If some font will be loaded after this method call, <textPath> will not be rendered correctly.
      // You need to call this method manually to update glyphs cache.
      setTextData(ctx) {
        if (this.glyphInfo) {
          return;
        }
        var renderText2 = this.getText();
        var chars = renderText2.split("");
        var spacesNumber = renderText2.split(" ").length - 1;
        var dx2 = this.parent.getAttribute("dx").split().map((_3) => _3.getPixels("x"));
        var dy2 = this.parent.getAttribute("dy").getPixels("y");
        var anchor = this.parent.getStyle("text-anchor").getString("start");
        var thisSpacing = this.getStyle("letter-spacing");
        var parentSpacing = this.parent.getStyle("letter-spacing");
        var letterSpacing = 0;
        if (!thisSpacing.hasValue() || thisSpacing.getValue() === "inherit") {
          letterSpacing = parentSpacing.getPixels();
        } else if (thisSpacing.hasValue()) {
          if (thisSpacing.getValue() !== "initial" && thisSpacing.getValue() !== "unset") {
            letterSpacing = thisSpacing.getPixels();
          }
        }
        var letterSpacingCache = [];
        var textLen = renderText2.length;
        this.letterSpacingCache = letterSpacingCache;
        for (var i3 = 0; i3 < textLen; i3++) {
          letterSpacingCache.push(typeof dx2[i3] !== "undefined" ? dx2[i3] : letterSpacing);
        }
        var dxSum = letterSpacingCache.reduce((acc, cur, i4) => i4 === 0 ? 0 : acc + cur || 0, 0);
        var textWidth = this.measureText(ctx);
        var textFullWidth = Math.max(textWidth + dxSum, 0);
        this.textWidth = textWidth;
        this.textHeight = this.getFontSize();
        this.glyphInfo = [];
        var fullPathWidth = this.getPathLength();
        var startOffset = this.getStyle("startOffset").getNumber(0) * fullPathWidth;
        var offset = 0;
        if (anchor === "middle" || anchor === "center") {
          offset = -textFullWidth / 2;
        }
        if (anchor === "end" || anchor === "right") {
          offset = -textFullWidth;
        }
        offset += startOffset;
        chars.forEach((char, i4) => {
          var {
            offset: nextOffset,
            segment,
            rotation
          } = this.findSegmentToFitChar(ctx, anchor, textFullWidth, fullPathWidth, spacesNumber, offset, dy2, char, i4);
          offset = nextOffset;
          if (!segment.p0 || !segment.p1) {
            return;
          }
          this.glyphInfo.push({
            // transposeX: midpoint.x,
            // transposeY: midpoint.y,
            text: chars[i4],
            p0: segment.p0,
            p1: segment.p1,
            rotation
          });
        });
      }
      parsePathData(path) {
        this.pathLength = -1;
        if (!path) {
          return [];
        }
        var pathCommands = [];
        var {
          pathParser: pathParser2
        } = path;
        pathParser2.reset();
        while (!pathParser2.isEnd()) {
          var {
            current
          } = pathParser2;
          var startX = current ? current.x : 0;
          var startY = current ? current.y : 0;
          var command = pathParser2.next();
          var nextCommandType = command.type;
          var points = [];
          switch (command.type) {
            case PathParser.MOVE_TO:
              this.pathM(pathParser2, points);
              break;
            case PathParser.LINE_TO:
              nextCommandType = this.pathL(pathParser2, points);
              break;
            case PathParser.HORIZ_LINE_TO:
              nextCommandType = this.pathH(pathParser2, points);
              break;
            case PathParser.VERT_LINE_TO:
              nextCommandType = this.pathV(pathParser2, points);
              break;
            case PathParser.CURVE_TO:
              this.pathC(pathParser2, points);
              break;
            case PathParser.SMOOTH_CURVE_TO:
              nextCommandType = this.pathS(pathParser2, points);
              break;
            case PathParser.QUAD_TO:
              this.pathQ(pathParser2, points);
              break;
            case PathParser.SMOOTH_QUAD_TO:
              nextCommandType = this.pathT(pathParser2, points);
              break;
            case PathParser.ARC:
              points = this.pathA(pathParser2);
              break;
            case PathParser.CLOSE_PATH:
              PathElement.pathZ(pathParser2);
              break;
          }
          if (command.type !== PathParser.CLOSE_PATH) {
            pathCommands.push({
              type: nextCommandType,
              points,
              start: {
                x: startX,
                y: startY
              },
              pathLength: this.calcLength(startX, startY, nextCommandType, points)
            });
          } else {
            pathCommands.push({
              type: PathParser.CLOSE_PATH,
              points: [],
              pathLength: 0
            });
          }
        }
        return pathCommands;
      }
      pathM(pathParser2, points) {
        var {
          x: x3,
          y: y4
        } = PathElement.pathM(pathParser2).point;
        points.push(x3, y4);
      }
      pathL(pathParser2, points) {
        var {
          x: x3,
          y: y4
        } = PathElement.pathL(pathParser2).point;
        points.push(x3, y4);
        return PathParser.LINE_TO;
      }
      pathH(pathParser2, points) {
        var {
          x: x3,
          y: y4
        } = PathElement.pathH(pathParser2).point;
        points.push(x3, y4);
        return PathParser.LINE_TO;
      }
      pathV(pathParser2, points) {
        var {
          x: x3,
          y: y4
        } = PathElement.pathV(pathParser2).point;
        points.push(x3, y4);
        return PathParser.LINE_TO;
      }
      pathC(pathParser2, points) {
        var {
          point: point4,
          controlPoint,
          currentPoint
        } = PathElement.pathC(pathParser2);
        points.push(point4.x, point4.y, controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
      }
      pathS(pathParser2, points) {
        var {
          point: point4,
          controlPoint,
          currentPoint
        } = PathElement.pathS(pathParser2);
        points.push(point4.x, point4.y, controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
        return PathParser.CURVE_TO;
      }
      pathQ(pathParser2, points) {
        var {
          controlPoint,
          currentPoint
        } = PathElement.pathQ(pathParser2);
        points.push(controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
      }
      pathT(pathParser2, points) {
        var {
          controlPoint,
          currentPoint
        } = PathElement.pathT(pathParser2);
        points.push(controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
        return PathParser.QUAD_TO;
      }
      pathA(pathParser2) {
        var {
          rX,
          rY,
          sweepFlag,
          xAxisRotation,
          centp,
          a1,
          ad
        } = PathElement.pathA(pathParser2);
        if (sweepFlag === 0 && ad > 0) {
          ad -= 2 * Math.PI;
        }
        if (sweepFlag === 1 && ad < 0) {
          ad += 2 * Math.PI;
        }
        return [centp.x, centp.y, rX, rY, a1, ad, xAxisRotation, sweepFlag];
      }
      calcLength(x3, y4, commandType, points) {
        var len = 0;
        var p1 = null;
        var p22 = null;
        var t3 = 0;
        switch (commandType) {
          case PathParser.LINE_TO:
            return this.getLineLength(x3, y4, points[0], points[1]);
          case PathParser.CURVE_TO:
            len = 0;
            p1 = this.getPointOnCubicBezier(0, x3, y4, points[0], points[1], points[2], points[3], points[4], points[5]);
            for (t3 = 0.01; t3 <= 1; t3 += 0.01) {
              p22 = this.getPointOnCubicBezier(t3, x3, y4, points[0], points[1], points[2], points[3], points[4], points[5]);
              len += this.getLineLength(p1.x, p1.y, p22.x, p22.y);
              p1 = p22;
            }
            return len;
          case PathParser.QUAD_TO:
            len = 0;
            p1 = this.getPointOnQuadraticBezier(0, x3, y4, points[0], points[1], points[2], points[3]);
            for (t3 = 0.01; t3 <= 1; t3 += 0.01) {
              p22 = this.getPointOnQuadraticBezier(t3, x3, y4, points[0], points[1], points[2], points[3]);
              len += this.getLineLength(p1.x, p1.y, p22.x, p22.y);
              p1 = p22;
            }
            return len;
          case PathParser.ARC: {
            len = 0;
            var start = points[4];
            var dTheta = points[5];
            var end = points[4] + dTheta;
            var inc = Math.PI / 180;
            if (Math.abs(start - end) < inc) {
              inc = Math.abs(start - end);
            }
            p1 = this.getPointOnEllipticalArc(points[0], points[1], points[2], points[3], start, 0);
            if (dTheta < 0) {
              for (t3 = start - inc; t3 > end; t3 -= inc) {
                p22 = this.getPointOnEllipticalArc(points[0], points[1], points[2], points[3], t3, 0);
                len += this.getLineLength(p1.x, p1.y, p22.x, p22.y);
                p1 = p22;
              }
            } else {
              for (t3 = start + inc; t3 < end; t3 += inc) {
                p22 = this.getPointOnEllipticalArc(points[0], points[1], points[2], points[3], t3, 0);
                len += this.getLineLength(p1.x, p1.y, p22.x, p22.y);
                p1 = p22;
              }
            }
            p22 = this.getPointOnEllipticalArc(points[0], points[1], points[2], points[3], end, 0);
            len += this.getLineLength(p1.x, p1.y, p22.x, p22.y);
            return len;
          }
        }
        return 0;
      }
      getPointOnLine(dist, p1x, p1y, p2x, p2y) {
        var fromX = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : p1x;
        var fromY = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : p1y;
        var m4 = (p2y - p1y) / (p2x - p1x + PSEUDO_ZERO);
        var run = Math.sqrt(dist * dist / (1 + m4 * m4));
        if (p2x < p1x) {
          run *= -1;
        }
        var rise = m4 * run;
        var pt2 = null;
        if (p2x === p1x) {
          pt2 = {
            x: fromX,
            y: fromY + rise
          };
        } else if ((fromY - p1y) / (fromX - p1x + PSEUDO_ZERO) === m4) {
          pt2 = {
            x: fromX + run,
            y: fromY + rise
          };
        } else {
          var ix = 0;
          var iy = 0;
          var len = this.getLineLength(p1x, p1y, p2x, p2y);
          if (len < PSEUDO_ZERO) {
            return null;
          }
          var u3 = (fromX - p1x) * (p2x - p1x) + (fromY - p1y) * (p2y - p1y);
          u3 /= len * len;
          ix = p1x + u3 * (p2x - p1x);
          iy = p1y + u3 * (p2y - p1y);
          var pRise = this.getLineLength(fromX, fromY, ix, iy);
          var pRun = Math.sqrt(dist * dist - pRise * pRise);
          run = Math.sqrt(pRun * pRun / (1 + m4 * m4));
          if (p2x < p1x) {
            run *= -1;
          }
          rise = m4 * run;
          pt2 = {
            x: ix + run,
            y: iy + rise
          };
        }
        return pt2;
      }
      getPointOnPath(distance) {
        var fullLen = this.getPathLength();
        var cumulativePathLength = 0;
        var p3 = null;
        if (distance < -5e-5 || distance - 5e-5 > fullLen) {
          return null;
        }
        var {
          dataArray
        } = this;
        for (var command of dataArray) {
          if (command && (command.pathLength < 5e-5 || cumulativePathLength + command.pathLength + 5e-5 < distance)) {
            cumulativePathLength += command.pathLength;
            continue;
          }
          var delta = distance - cumulativePathLength;
          var currentT = 0;
          switch (command.type) {
            case PathParser.LINE_TO:
              p3 = this.getPointOnLine(delta, command.start.x, command.start.y, command.points[0], command.points[1], command.start.x, command.start.y);
              break;
            case PathParser.ARC: {
              var start = command.points[4];
              var dTheta = command.points[5];
              var end = command.points[4] + dTheta;
              currentT = start + delta / command.pathLength * dTheta;
              if (dTheta < 0 && currentT < end || dTheta >= 0 && currentT > end) {
                break;
              }
              p3 = this.getPointOnEllipticalArc(command.points[0], command.points[1], command.points[2], command.points[3], currentT, command.points[6]);
              break;
            }
            case PathParser.CURVE_TO:
              currentT = delta / command.pathLength;
              if (currentT > 1) {
                currentT = 1;
              }
              p3 = this.getPointOnCubicBezier(currentT, command.start.x, command.start.y, command.points[0], command.points[1], command.points[2], command.points[3], command.points[4], command.points[5]);
              break;
            case PathParser.QUAD_TO:
              currentT = delta / command.pathLength;
              if (currentT > 1) {
                currentT = 1;
              }
              p3 = this.getPointOnQuadraticBezier(currentT, command.start.x, command.start.y, command.points[0], command.points[1], command.points[2], command.points[3]);
              break;
          }
          if (p3) {
            return p3;
          }
          break;
        }
        return null;
      }
      getLineLength(x1, y1, x22, y22) {
        return Math.sqrt((x22 - x1) * (x22 - x1) + (y22 - y1) * (y22 - y1));
      }
      getPathLength() {
        if (this.pathLength === -1) {
          this.pathLength = this.dataArray.reduce((length2, command) => command.pathLength > 0 ? length2 + command.pathLength : length2, 0);
        }
        return this.pathLength;
      }
      getPointOnCubicBezier(pct, p1x, p1y, p2x, p2y, p3x, p3y, p4x, p4y) {
        var x3 = p4x * CB1(pct) + p3x * CB2(pct) + p2x * CB3(pct) + p1x * CB4(pct);
        var y4 = p4y * CB1(pct) + p3y * CB2(pct) + p2y * CB3(pct) + p1y * CB4(pct);
        return {
          x: x3,
          y: y4
        };
      }
      getPointOnQuadraticBezier(pct, p1x, p1y, p2x, p2y, p3x, p3y) {
        var x3 = p3x * QB1(pct) + p2x * QB2(pct) + p1x * QB3(pct);
        var y4 = p3y * QB1(pct) + p2y * QB2(pct) + p1y * QB3(pct);
        return {
          x: x3,
          y: y4
        };
      }
      getPointOnEllipticalArc(cx2, cy2, rx2, ry2, theta, psi) {
        var cosPsi = Math.cos(psi);
        var sinPsi = Math.sin(psi);
        var pt2 = {
          x: rx2 * Math.cos(theta),
          y: ry2 * Math.sin(theta)
        };
        return {
          x: cx2 + (pt2.x * cosPsi - pt2.y * sinPsi),
          y: cy2 + (pt2.x * sinPsi + pt2.y * cosPsi)
        };
      }
      // TODO need some optimisations. possibly build cache only for curved segments?
      buildEquidistantCache(inputStep, inputPrecision) {
        var fullLen = this.getPathLength();
        var precision = inputPrecision || 0.25;
        var step = inputStep || fullLen / 100;
        if (!this.equidistantCache || this.equidistantCache.step !== step || this.equidistantCache.precision !== precision) {
          this.equidistantCache = {
            step,
            precision,
            points: []
          };
          var s3 = 0;
          for (var l3 = 0; l3 <= fullLen; l3 += precision) {
            var p0 = this.getPointOnPath(l3);
            var p1 = this.getPointOnPath(l3 + precision);
            if (!p0 || !p1) {
              continue;
            }
            s3 += this.getLineLength(p0.x, p0.y, p1.x, p1.y);
            if (s3 >= step) {
              this.equidistantCache.points.push({
                x: p0.x,
                y: p0.y,
                distance: l3
              });
              s3 -= step;
            }
          }
        }
      }
      getEquidistantPointOnPath(targetDistance, step, precision) {
        this.buildEquidistantCache(step, precision);
        if (targetDistance < 0 || targetDistance - this.getPathLength() > 5e-5) {
          return null;
        }
        var idx = Math.round(targetDistance / this.getPathLength() * (this.equidistantCache.points.length - 1));
        return this.equidistantCache.points[idx] || null;
      }
    };
    dataUriRegex = /^\s*data:(([^/,;]+\/[^/,;]+)(?:;([^,;=]+=[^,;=]+))?)?(?:;(base64))?,(.*)$/i;
    ImageElement = class extends RenderedElement {
      constructor(document4, node3, captureTextNodes) {
        super(document4, node3, captureTextNodes);
        this.type = "image";
        this.loaded = false;
        var href = this.getHrefAttribute().getString();
        if (!href) {
          return;
        }
        var isSvg = href.endsWith(".svg") || /^\s*data:image\/svg\+xml/i.test(href);
        document4.images.push(this);
        if (!isSvg) {
          void this.loadImage(href);
        } else {
          void this.loadSvg(href);
        }
        this.isSvg = isSvg;
      }
      loadImage(href) {
        var _this = this;
        return _asyncToGenerator(function* () {
          try {
            var image = yield _this.document.createImage(href);
            _this.image = image;
          } catch (err) {
            console.error('Error while loading image "'.concat(href, '":'), err);
          }
          _this.loaded = true;
        })();
      }
      loadSvg(href) {
        var _this2 = this;
        return _asyncToGenerator(function* () {
          var match = dataUriRegex.exec(href);
          if (match) {
            var data2 = match[5];
            if (match[4] === "base64") {
              _this2.image = atob(data2);
            } else {
              _this2.image = decodeURIComponent(data2);
            }
          } else {
            try {
              var response = yield _this2.document.fetch(href);
              var svg2 = yield response.text();
              _this2.image = svg2;
            } catch (err) {
              console.error('Error while loading image "'.concat(href, '":'), err);
            }
          }
          _this2.loaded = true;
        })();
      }
      renderChildren(ctx) {
        var {
          document: document4,
          image,
          loaded
        } = this;
        var x3 = this.getAttribute("x").getPixels("x");
        var y4 = this.getAttribute("y").getPixels("y");
        var width2 = this.getStyle("width").getPixels("x");
        var height2 = this.getStyle("height").getPixels("y");
        if (!loaded || !image || !width2 || !height2) {
          return;
        }
        ctx.save();
        ctx.translate(x3, y4);
        if (this.isSvg) {
          var subDocument = document4.canvg.forkString(ctx, this.image, {
            ignoreMouse: true,
            ignoreAnimation: true,
            ignoreDimensions: true,
            ignoreClear: true,
            offsetX: 0,
            offsetY: 0,
            scaleWidth: width2,
            scaleHeight: height2
          });
          subDocument.document.documentElement.parent = this;
          void subDocument.render();
        } else {
          var _image = this.image;
          document4.setViewBox({
            ctx,
            aspectRatio: this.getAttribute("preserveAspectRatio").getString(),
            width: width2,
            desiredWidth: _image.width,
            height: height2,
            desiredHeight: _image.height
          });
          if (this.loaded) {
            if (typeof _image.complete === "undefined" || _image.complete) {
              ctx.drawImage(_image, 0, 0);
            }
          }
        }
        ctx.restore();
      }
      getBoundingBox() {
        var x3 = this.getAttribute("x").getPixels("x");
        var y4 = this.getAttribute("y").getPixels("y");
        var width2 = this.getStyle("width").getPixels("x");
        var height2 = this.getStyle("height").getPixels("y");
        return new BoundingBox(x3, y4, x3 + width2, y4 + height2);
      }
    };
    SymbolElement = class extends RenderedElement {
      constructor() {
        super(...arguments);
        this.type = "symbol";
      }
      render(_3) {
      }
    };
    SVGFontLoader = class {
      constructor(document4) {
        this.document = document4;
        this.loaded = false;
        document4.fonts.push(this);
      }
      load(fontFamily, url) {
        var _this = this;
        return _asyncToGenerator(function* () {
          try {
            var {
              document: document4
            } = _this;
            var svgDocument = yield document4.canvg.parser.load(url);
            var fonts = svgDocument.getElementsByTagName("font");
            Array.from(fonts).forEach((fontNode) => {
              var font = document4.createElement(fontNode);
              document4.definitions[fontFamily] = font;
            });
          } catch (err) {
            console.error('Error while loading font "'.concat(url, '":'), err);
          }
          _this.loaded = true;
        })();
      }
    };
    StyleElement = class extends Element2 {
      constructor(document4, node3, captureTextNodes) {
        super(document4, node3, captureTextNodes);
        this.type = "style";
        var css2 = compressSpaces(
          Array.from(node3.childNodes).map((_3) => _3.textContent).join("").replace(/(\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm, "").replace(/@import.*;/g, "")
          // remove imports
        );
        var cssDefs = css2.split("}");
        cssDefs.forEach((_3) => {
          var def = _3.trim();
          if (!def) {
            return;
          }
          var cssParts = def.split("{");
          var cssClasses = cssParts[0].split(",");
          var cssProps = cssParts[1].split(";");
          cssClasses.forEach((_4) => {
            var cssClass = _4.trim();
            if (!cssClass) {
              return;
            }
            var props = document4.styles[cssClass] || {};
            cssProps.forEach((cssProp) => {
              var prop = cssProp.indexOf(":");
              var name = cssProp.substr(0, prop).trim();
              var value = cssProp.substr(prop + 1, cssProp.length - prop).trim();
              if (name && value) {
                props[name] = new Property(document4, name, value);
              }
            });
            document4.styles[cssClass] = props;
            document4.stylesSpecificity[cssClass] = getSelectorSpecificity(cssClass);
            if (cssClass === "@font-face") {
              var fontFamily = props["font-family"].getString().replace(/"|'/g, "");
              var srcs = props.src.getString().split(",");
              srcs.forEach((src) => {
                if (src.indexOf('format("svg")') > 0) {
                  var url = parseExternalUrl(src);
                  if (url) {
                    void new SVGFontLoader(document4).load(fontFamily, url);
                  }
                }
              });
            }
          });
        });
      }
    };
    StyleElement.parseExternalUrl = parseExternalUrl;
    UseElement = class extends RenderedElement {
      constructor() {
        super(...arguments);
        this.type = "use";
      }
      setContext(ctx) {
        super.setContext(ctx);
        var xAttr = this.getAttribute("x");
        var yAttr = this.getAttribute("y");
        if (xAttr.hasValue()) {
          ctx.translate(xAttr.getPixels("x"), 0);
        }
        if (yAttr.hasValue()) {
          ctx.translate(0, yAttr.getPixels("y"));
        }
      }
      path(ctx) {
        var {
          element: element2
        } = this;
        if (element2) {
          element2.path(ctx);
        }
      }
      renderChildren(ctx) {
        var {
          document: document4,
          element: element2
        } = this;
        if (element2) {
          var tempSvg = element2;
          if (element2.type === "symbol") {
            tempSvg = new SVGElement(document4, null);
            tempSvg.attributes.viewBox = new Property(document4, "viewBox", element2.getAttribute("viewBox").getString());
            tempSvg.attributes.preserveAspectRatio = new Property(document4, "preserveAspectRatio", element2.getAttribute("preserveAspectRatio").getString());
            tempSvg.attributes.overflow = new Property(document4, "overflow", element2.getAttribute("overflow").getString());
            tempSvg.children = element2.children;
            element2.styles.opacity = new Property(document4, "opacity", this.calculateOpacity());
          }
          if (tempSvg.type === "svg") {
            var widthStyle = this.getStyle("width", false, true);
            var heightStyle = this.getStyle("height", false, true);
            if (widthStyle.hasValue()) {
              tempSvg.attributes.width = new Property(document4, "width", widthStyle.getString());
            }
            if (heightStyle.hasValue()) {
              tempSvg.attributes.height = new Property(document4, "height", heightStyle.getString());
            }
          }
          var oldParent = tempSvg.parent;
          tempSvg.parent = this;
          tempSvg.render(ctx);
          tempSvg.parent = oldParent;
        }
      }
      getBoundingBox(ctx) {
        var {
          element: element2
        } = this;
        if (element2) {
          return element2.getBoundingBox(ctx);
        }
        return null;
      }
      elementTransform() {
        var {
          document: document4,
          element: element2
        } = this;
        return Transform.fromElement(document4, element2);
      }
      get element() {
        if (!this.cachedElement) {
          this.cachedElement = this.getHrefAttribute().getDefinition();
        }
        return this.cachedElement;
      }
    };
    FeColorMatrixElement = class extends Element2 {
      constructor(document4, node3, captureTextNodes) {
        super(document4, node3, captureTextNodes);
        this.type = "feColorMatrix";
        var matrix = toNumbers(this.getAttribute("values").getString());
        switch (this.getAttribute("type").getString("matrix")) {
          case "saturate": {
            var s3 = matrix[0];
            matrix = [0.213 + 0.787 * s3, 0.715 - 0.715 * s3, 0.072 - 0.072 * s3, 0, 0, 0.213 - 0.213 * s3, 0.715 + 0.285 * s3, 0.072 - 0.072 * s3, 0, 0, 0.213 - 0.213 * s3, 0.715 - 0.715 * s3, 0.072 + 0.928 * s3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1];
            break;
          }
          case "hueRotate": {
            var a3 = matrix[0] * Math.PI / 180;
            matrix = [c2(a3, 0.213, 0.787, -0.213), c2(a3, 0.715, -0.715, -0.715), c2(a3, 0.072, -0.072, 0.928), 0, 0, c2(a3, 0.213, -0.213, 0.143), c2(a3, 0.715, 0.285, 0.14), c2(a3, 0.072, -0.072, -0.283), 0, 0, c2(a3, 0.213, -0.213, -0.787), c2(a3, 0.715, -0.715, 0.715), c2(a3, 0.072, 0.928, 0.072), 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1];
            break;
          }
          case "luminanceToAlpha":
            matrix = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2125, 0.7154, 0.0721, 0, 0, 0, 0, 0, 0, 1];
            break;
        }
        this.matrix = matrix;
        this.includeOpacity = this.getAttribute("includeOpacity").hasValue();
      }
      apply(ctx, _x, _y, width2, height2) {
        var {
          includeOpacity,
          matrix
        } = this;
        var srcData = ctx.getImageData(0, 0, width2, height2);
        for (var y4 = 0; y4 < height2; y4++) {
          for (var x3 = 0; x3 < width2; x3++) {
            var r2 = imGet(srcData.data, x3, y4, width2, height2, 0);
            var g2 = imGet(srcData.data, x3, y4, width2, height2, 1);
            var b2 = imGet(srcData.data, x3, y4, width2, height2, 2);
            var a3 = imGet(srcData.data, x3, y4, width2, height2, 3);
            var nr = m2(matrix, 0, r2) + m2(matrix, 1, g2) + m2(matrix, 2, b2) + m2(matrix, 3, a3) + m2(matrix, 4, 1);
            var ng = m2(matrix, 5, r2) + m2(matrix, 6, g2) + m2(matrix, 7, b2) + m2(matrix, 8, a3) + m2(matrix, 9, 1);
            var nb = m2(matrix, 10, r2) + m2(matrix, 11, g2) + m2(matrix, 12, b2) + m2(matrix, 13, a3) + m2(matrix, 14, 1);
            var na = m2(matrix, 15, r2) + m2(matrix, 16, g2) + m2(matrix, 17, b2) + m2(matrix, 18, a3) + m2(matrix, 19, 1);
            if (includeOpacity) {
              nr = 0;
              ng = 0;
              nb = 0;
              na *= a3 / 255;
            }
            imSet(srcData.data, x3, y4, width2, height2, 0, nr);
            imSet(srcData.data, x3, y4, width2, height2, 1, ng);
            imSet(srcData.data, x3, y4, width2, height2, 2, nb);
            imSet(srcData.data, x3, y4, width2, height2, 3, na);
          }
        }
        ctx.clearRect(0, 0, width2, height2);
        ctx.putImageData(srcData, 0, 0);
      }
    };
    MaskElement = class extends Element2 {
      constructor() {
        super(...arguments);
        this.type = "mask";
      }
      apply(ctx, element2) {
        var {
          document: document4
        } = this;
        var x3 = this.getAttribute("x").getPixels("x");
        var y4 = this.getAttribute("y").getPixels("y");
        var width2 = this.getStyle("width").getPixels("x");
        var height2 = this.getStyle("height").getPixels("y");
        if (!width2 && !height2) {
          var boundingBox = new BoundingBox();
          this.children.forEach((child) => {
            boundingBox.addBoundingBox(child.getBoundingBox(ctx));
          });
          x3 = Math.floor(boundingBox.x1);
          y4 = Math.floor(boundingBox.y1);
          width2 = Math.floor(boundingBox.width);
          height2 = Math.floor(boundingBox.height);
        }
        var ignoredStyles = this.removeStyles(element2, MaskElement.ignoreStyles);
        var maskCanvas = document4.createCanvas(x3 + width2, y4 + height2);
        var maskCtx = maskCanvas.getContext("2d");
        document4.screen.setDefaults(maskCtx);
        this.renderChildren(maskCtx);
        new FeColorMatrixElement(document4, {
          nodeType: 1,
          childNodes: [],
          attributes: [{
            nodeName: "type",
            value: "luminanceToAlpha"
          }, {
            nodeName: "includeOpacity",
            value: "true"
          }]
        }).apply(maskCtx, 0, 0, x3 + width2, y4 + height2);
        var tmpCanvas = document4.createCanvas(x3 + width2, y4 + height2);
        var tmpCtx = tmpCanvas.getContext("2d");
        document4.screen.setDefaults(tmpCtx);
        element2.render(tmpCtx);
        tmpCtx.globalCompositeOperation = "destination-in";
        tmpCtx.fillStyle = maskCtx.createPattern(maskCanvas, "no-repeat");
        tmpCtx.fillRect(0, 0, x3 + width2, y4 + height2);
        ctx.fillStyle = tmpCtx.createPattern(tmpCanvas, "no-repeat");
        ctx.fillRect(0, 0, x3 + width2, y4 + height2);
        this.restoreStyles(element2, ignoredStyles);
      }
      render(_3) {
      }
    };
    MaskElement.ignoreStyles = ["mask", "transform", "clip-path"];
    noop2 = () => {
    };
    ClipPathElement = class extends Element2 {
      constructor() {
        super(...arguments);
        this.type = "clipPath";
      }
      apply(ctx) {
        var {
          document: document4
        } = this;
        var contextProto = Reflect.getPrototypeOf(ctx);
        var {
          beginPath,
          closePath
        } = ctx;
        if (contextProto) {
          contextProto.beginPath = noop2;
          contextProto.closePath = noop2;
        }
        Reflect.apply(beginPath, ctx, []);
        this.children.forEach((child) => {
          if (typeof child.path === "undefined") {
            return;
          }
          var transform2 = typeof child.elementTransform !== "undefined" ? child.elementTransform() : null;
          if (!transform2) {
            transform2 = Transform.fromElement(document4, child);
          }
          if (transform2) {
            transform2.apply(ctx);
          }
          child.path(ctx);
          if (contextProto) {
            contextProto.closePath = closePath;
          }
          if (transform2) {
            transform2.unapply(ctx);
          }
        });
        Reflect.apply(closePath, ctx, []);
        ctx.clip();
        if (contextProto) {
          contextProto.beginPath = beginPath;
          contextProto.closePath = closePath;
        }
      }
      render(_3) {
      }
    };
    FilterElement = class extends Element2 {
      constructor() {
        super(...arguments);
        this.type = "filter";
      }
      apply(ctx, element2) {
        var {
          document: document4,
          children
        } = this;
        var boundingBox = element2.getBoundingBox(ctx);
        if (!boundingBox) {
          return;
        }
        var px = 0;
        var py = 0;
        children.forEach((child) => {
          var efd = child.extraFilterDistance || 0;
          px = Math.max(px, efd);
          py = Math.max(py, efd);
        });
        var width2 = Math.floor(boundingBox.width);
        var height2 = Math.floor(boundingBox.height);
        var tmpCanvasWidth = width2 + 2 * px;
        var tmpCanvasHeight = height2 + 2 * py;
        if (tmpCanvasWidth < 1 || tmpCanvasHeight < 1) {
          return;
        }
        var x3 = Math.floor(boundingBox.x);
        var y4 = Math.floor(boundingBox.y);
        var ignoredStyles = this.removeStyles(element2, FilterElement.ignoreStyles);
        var tmpCanvas = document4.createCanvas(tmpCanvasWidth, tmpCanvasHeight);
        var tmpCtx = tmpCanvas.getContext("2d");
        document4.screen.setDefaults(tmpCtx);
        tmpCtx.translate(-x3 + px, -y4 + py);
        element2.render(tmpCtx);
        children.forEach((child) => {
          if (typeof child.apply === "function") {
            child.apply(tmpCtx, 0, 0, tmpCanvasWidth, tmpCanvasHeight);
          }
        });
        ctx.drawImage(tmpCanvas, 0, 0, tmpCanvasWidth, tmpCanvasHeight, x3 - px, y4 - py, tmpCanvasWidth, tmpCanvasHeight);
        this.restoreStyles(element2, ignoredStyles);
      }
      render(_3) {
      }
    };
    FilterElement.ignoreStyles = ["filter", "transform", "clip-path"];
    FeDropShadowElement = class extends Element2 {
      constructor(document4, node3, captureTextNodes) {
        super(document4, node3, captureTextNodes);
        this.type = "feDropShadow";
        this.addStylesFromStyleDefinition();
      }
      apply(_3, _x, _y, _width, _height) {
      }
    };
    FeMorphologyElement = class extends Element2 {
      constructor() {
        super(...arguments);
        this.type = "feMorphology";
      }
      apply(_3, _x, _y, _width, _height) {
      }
    };
    FeCompositeElement = class extends Element2 {
      constructor() {
        super(...arguments);
        this.type = "feComposite";
      }
      apply(_3, _x, _y, _width, _height) {
      }
    };
    FeGaussianBlurElement = class extends Element2 {
      constructor(document4, node3, captureTextNodes) {
        super(document4, node3, captureTextNodes);
        this.type = "feGaussianBlur";
        this.blurRadius = Math.floor(this.getAttribute("stdDeviation").getNumber());
        this.extraFilterDistance = this.blurRadius;
      }
      apply(ctx, x3, y4, width2, height2) {
        var {
          document: document4,
          blurRadius
        } = this;
        var body = document4.window ? document4.window.document.body : null;
        var canvas = ctx.canvas;
        canvas.id = document4.getUniqueId();
        if (body) {
          canvas.style.display = "none";
          body.appendChild(canvas);
        }
        processCanvasRGBA(canvas, x3, y4, width2, height2, blurRadius);
        if (body) {
          body.removeChild(canvas);
        }
      }
    };
    TitleElement = class extends Element2 {
      constructor() {
        super(...arguments);
        this.type = "title";
      }
    };
    DescElement = class extends Element2 {
      constructor() {
        super(...arguments);
        this.type = "desc";
      }
    };
    elements2 = {
      "svg": SVGElement,
      "rect": RectElement,
      "circle": CircleElement,
      "ellipse": EllipseElement,
      "line": LineElement,
      "polyline": PolylineElement,
      "polygon": PolygonElement,
      "path": PathElement,
      "pattern": PatternElement,
      "marker": MarkerElement,
      "defs": DefsElement,
      "linearGradient": LinearGradientElement,
      "radialGradient": RadialGradientElement,
      "stop": StopElement,
      "animate": AnimateElement,
      "animateColor": AnimateColorElement,
      "animateTransform": AnimateTransformElement,
      "font": FontElement,
      "font-face": FontFaceElement,
      "missing-glyph": MissingGlyphElement,
      "glyph": GlyphElement,
      "text": TextElement,
      "tspan": TSpanElement,
      "tref": TRefElement,
      "a": AElement,
      "textPath": TextPathElement,
      "image": ImageElement,
      "g": GElement,
      "symbol": SymbolElement,
      "style": StyleElement,
      "use": UseElement,
      "mask": MaskElement,
      "clipPath": ClipPathElement,
      "filter": FilterElement,
      "feDropShadow": FeDropShadowElement,
      "feMorphology": FeMorphologyElement,
      "feComposite": FeCompositeElement,
      "feColorMatrix": FeColorMatrixElement,
      "feGaussianBlur": FeGaussianBlurElement,
      "title": TitleElement,
      "desc": DescElement
    };
    Document = class {
      constructor(canvg) {
        var {
          rootEmSize = 12,
          emSize = 12,
          createCanvas: createCanvas2 = Document.createCanvas,
          createImage: createImage2 = Document.createImage,
          anonymousCrossOrigin
        } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
        this.canvg = canvg;
        this.definitions = {};
        this.styles = {};
        this.stylesSpecificity = {};
        this.images = [];
        this.fonts = [];
        this.emSizeStack = [];
        this.uniqueId = 0;
        this.screen = canvg.screen;
        this.rootEmSize = rootEmSize;
        this.emSize = emSize;
        this.createCanvas = createCanvas2;
        this.createImage = this.bindCreateImage(createImage2, anonymousCrossOrigin);
        this.screen.wait(this.isImagesLoaded.bind(this));
        this.screen.wait(this.isFontsLoaded.bind(this));
      }
      bindCreateImage(createImage2, anonymousCrossOrigin) {
        if (typeof anonymousCrossOrigin === "boolean") {
          return (source, forceAnonymousCrossOrigin) => createImage2(source, typeof forceAnonymousCrossOrigin === "boolean" ? forceAnonymousCrossOrigin : anonymousCrossOrigin);
        }
        return createImage2;
      }
      get window() {
        return this.screen.window;
      }
      get fetch() {
        return this.screen.fetch;
      }
      get ctx() {
        return this.screen.ctx;
      }
      get emSize() {
        var {
          emSizeStack
        } = this;
        return emSizeStack[emSizeStack.length - 1];
      }
      set emSize(value) {
        var {
          emSizeStack
        } = this;
        emSizeStack.push(value);
      }
      popEmSize() {
        var {
          emSizeStack
        } = this;
        emSizeStack.pop();
      }
      getUniqueId() {
        return "canvg".concat(++this.uniqueId);
      }
      isImagesLoaded() {
        return this.images.every((_3) => _3.loaded);
      }
      isFontsLoaded() {
        return this.fonts.every((_3) => _3.loaded);
      }
      createDocumentElement(document4) {
        var documentElement = this.createElement(document4.documentElement);
        documentElement.root = true;
        documentElement.addStylesFromStyleDefinition();
        this.documentElement = documentElement;
        return documentElement;
      }
      createElement(node3) {
        var elementType = node3.nodeName.replace(/^[^:]+:/, "");
        var ElementType = Document.elementTypes[elementType];
        if (typeof ElementType !== "undefined") {
          return new ElementType(this, node3);
        }
        return new UnknownElement(this, node3);
      }
      createTextNode(node3) {
        return new TextNode(this, node3);
      }
      setViewBox(config) {
        this.screen.setViewBox(_objectSpread$1({
          document: this
        }, config));
      }
    };
    Document.createCanvas = createCanvas;
    Document.createImage = createImage;
    Document.elementTypes = elements2;
    Canvg = class {
      /**
       * Main constructor.
       * @param ctx - Rendering context.
       * @param svg - SVG Document.
       * @param options - Rendering options.
       */
      constructor(ctx, svg2) {
        var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
        this.parser = new Parser(options);
        this.screen = new Screen(ctx, options);
        this.options = options;
        var document4 = new Document(this, options);
        var documentElement = document4.createDocumentElement(svg2);
        this.document = document4;
        this.documentElement = documentElement;
      }
      /**
       * Create Canvg instance from SVG source string or URL.
       * @param ctx - Rendering context.
       * @param svg - SVG source string or URL.
       * @param options - Rendering options.
       * @returns Canvg instance.
       */
      static from(ctx, svg2) {
        var _arguments = arguments;
        return _asyncToGenerator(function* () {
          var options = _arguments.length > 2 && _arguments[2] !== void 0 ? _arguments[2] : {};
          var parser2 = new Parser(options);
          var svgDocument = yield parser2.parse(svg2);
          return new Canvg(ctx, svgDocument, options);
        })();
      }
      /**
       * Create Canvg instance from SVG source string.
       * @param ctx - Rendering context.
       * @param svg - SVG source string.
       * @param options - Rendering options.
       * @returns Canvg instance.
       */
      static fromString(ctx, svg2) {
        var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
        var parser2 = new Parser(options);
        var svgDocument = parser2.parseFromString(svg2);
        return new Canvg(ctx, svgDocument, options);
      }
      /**
       * Create new Canvg instance with inherited options.
       * @param ctx - Rendering context.
       * @param svg - SVG source string or URL.
       * @param options - Rendering options.
       * @returns Canvg instance.
       */
      fork(ctx, svg2) {
        var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
        return Canvg.from(ctx, svg2, _objectSpread(_objectSpread({}, this.options), options));
      }
      /**
       * Create new Canvg instance with inherited options.
       * @param ctx - Rendering context.
       * @param svg - SVG source string.
       * @param options - Rendering options.
       * @returns Canvg instance.
       */
      forkString(ctx, svg2) {
        var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
        return Canvg.fromString(ctx, svg2, _objectSpread(_objectSpread({}, this.options), options));
      }
      /**
       * Document is ready promise.
       * @returns Ready promise.
       */
      ready() {
        return this.screen.ready();
      }
      /**
       * Document is ready value.
       * @returns Is ready or not.
       */
      isReady() {
        return this.screen.isReady();
      }
      /**
       * Render only first frame, ignoring animations and mouse.
       * @param options - Rendering options.
       */
      render() {
        var _arguments2 = arguments, _this = this;
        return _asyncToGenerator(function* () {
          var options = _arguments2.length > 0 && _arguments2[0] !== void 0 ? _arguments2[0] : {};
          _this.start(_objectSpread({
            enableRedraw: true,
            ignoreAnimation: true,
            ignoreMouse: true
          }, options));
          yield _this.ready();
          _this.stop();
        })();
      }
      /**
       * Start rendering.
       * @param options - Render options.
       */
      start() {
        var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
        var {
          documentElement,
          screen,
          options: baseOptions
        } = this;
        screen.start(documentElement, _objectSpread(_objectSpread({
          enableRedraw: true
        }, baseOptions), options));
      }
      /**
       * Stop rendering.
       */
      stop() {
        this.screen.stop();
      }
      /**
       * Resize SVG to fit in given size.
       * @param width
       * @param height
       * @param preserveAspectRatio
       */
      resize(width2) {
        var height2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : width2;
        var preserveAspectRatio = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
        this.documentElement.resize(width2, height2, preserveAspectRatio);
      }
    };
  }
});

// ../simple-mind-map/node_modules/quill/dist/quill.js
var require_quill = __commonJS({
  "../simple-mind-map/node_modules/quill/dist/quill.js"(exports, module) {
    (function webpackUniversalModuleDefinition(root2, factory) {
      if (typeof exports === "object" && typeof module === "object")
        module.exports = factory();
      else if (typeof define === "function" && define.amd)
        define([], factory);
      else if (typeof exports === "object")
        exports["Quill"] = factory();
      else
        root2["Quill"] = factory();
    })(typeof self !== "undefined" ? self : exports, function() {
      return (
        /******/
        function(modules) {
          var installedModules = {};
          function __webpack_require__(moduleId) {
            if (installedModules[moduleId]) {
              return installedModules[moduleId].exports;
            }
            var module2 = installedModules[moduleId] = {
              /******/
              i: moduleId,
              /******/
              l: false,
              /******/
              exports: {}
              /******/
            };
            modules[moduleId].call(module2.exports, module2, module2.exports, __webpack_require__);
            module2.l = true;
            return module2.exports;
          }
          __webpack_require__.m = modules;
          __webpack_require__.c = installedModules;
          __webpack_require__.d = function(exports2, name, getter) {
            if (!__webpack_require__.o(exports2, name)) {
              Object.defineProperty(exports2, name, {
                /******/
                configurable: false,
                /******/
                enumerable: true,
                /******/
                get: getter
                /******/
              });
            }
          };
          __webpack_require__.n = function(module2) {
            var getter = module2 && module2.__esModule ? (
              /******/
              function getDefault() {
                return module2["default"];
              }
            ) : (
              /******/
              function getModuleExports() {
                return module2;
              }
            );
            __webpack_require__.d(getter, "a", getter);
            return getter;
          };
          __webpack_require__.o = function(object, property) {
            return Object.prototype.hasOwnProperty.call(object, property);
          };
          __webpack_require__.p = "";
          return __webpack_require__(__webpack_require__.s = 109);
        }([
          /* 0 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", { value: true });
            var container_1 = __webpack_require__(17);
            var format_1 = __webpack_require__(18);
            var leaf_1 = __webpack_require__(19);
            var scroll_1 = __webpack_require__(45);
            var inline_1 = __webpack_require__(46);
            var block_1 = __webpack_require__(47);
            var embed_1 = __webpack_require__(48);
            var text_1 = __webpack_require__(49);
            var attributor_1 = __webpack_require__(12);
            var class_1 = __webpack_require__(32);
            var style_1 = __webpack_require__(33);
            var store_1 = __webpack_require__(31);
            var Registry = __webpack_require__(1);
            var Parchment = {
              Scope: Registry.Scope,
              create: Registry.create,
              find: Registry.find,
              query: Registry.query,
              register: Registry.register,
              Container: container_1.default,
              Format: format_1.default,
              Leaf: leaf_1.default,
              Embed: embed_1.default,
              Scroll: scroll_1.default,
              Block: block_1.default,
              Inline: inline_1.default,
              Text: text_1.default,
              Attributor: {
                Attribute: attributor_1.default,
                Class: class_1.default,
                Style: style_1.default,
                Store: store_1.default
              }
            };
            exports2.default = Parchment;
          },
          /* 1 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            var __extends = this && this.__extends || function() {
              var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
                d2.__proto__ = b2;
              } || function(d2, b2) {
                for (var p3 in b2)
                  if (b2.hasOwnProperty(p3))
                    d2[p3] = b2[p3];
              };
              return function(d2, b2) {
                extendStatics(d2, b2);
                function __() {
                  this.constructor = d2;
                }
                d2.prototype = b2 === null ? Object.create(b2) : (__.prototype = b2.prototype, new __());
              };
            }();
            Object.defineProperty(exports2, "__esModule", { value: true });
            var ParchmentError = (
              /** @class */
              function(_super) {
                __extends(ParchmentError2, _super);
                function ParchmentError2(message) {
                  var _this = this;
                  message = "[Parchment] " + message;
                  _this = _super.call(this, message) || this;
                  _this.message = message;
                  _this.name = _this.constructor.name;
                  return _this;
                }
                return ParchmentError2;
              }(Error)
            );
            exports2.ParchmentError = ParchmentError;
            var attributes = {};
            var classes2 = {};
            var tags = {};
            var types = {};
            exports2.DATA_KEY = "__blot";
            var Scope;
            (function(Scope2) {
              Scope2[Scope2["TYPE"] = 3] = "TYPE";
              Scope2[Scope2["LEVEL"] = 12] = "LEVEL";
              Scope2[Scope2["ATTRIBUTE"] = 13] = "ATTRIBUTE";
              Scope2[Scope2["BLOT"] = 14] = "BLOT";
              Scope2[Scope2["INLINE"] = 7] = "INLINE";
              Scope2[Scope2["BLOCK"] = 11] = "BLOCK";
              Scope2[Scope2["BLOCK_BLOT"] = 10] = "BLOCK_BLOT";
              Scope2[Scope2["INLINE_BLOT"] = 6] = "INLINE_BLOT";
              Scope2[Scope2["BLOCK_ATTRIBUTE"] = 9] = "BLOCK_ATTRIBUTE";
              Scope2[Scope2["INLINE_ATTRIBUTE"] = 5] = "INLINE_ATTRIBUTE";
              Scope2[Scope2["ANY"] = 15] = "ANY";
            })(Scope = exports2.Scope || (exports2.Scope = {}));
            function create2(input, value) {
              var match = query(input);
              if (match == null) {
                throw new ParchmentError("Unable to create " + input + " blot");
              }
              var BlotClass = match;
              var node3 = (
                // @ts-ignore
                input instanceof Node || input["nodeType"] === Node.TEXT_NODE ? input : BlotClass.create(value)
              );
              return new BlotClass(node3, value);
            }
            exports2.create = create2;
            function find2(node3, bubble) {
              if (bubble === void 0) {
                bubble = false;
              }
              if (node3 == null)
                return null;
              if (node3[exports2.DATA_KEY] != null)
                return node3[exports2.DATA_KEY].blot;
              if (bubble)
                return find2(node3.parentNode, bubble);
              return null;
            }
            exports2.find = find2;
            function query(query2, scope) {
              if (scope === void 0) {
                scope = Scope.ANY;
              }
              var match;
              if (typeof query2 === "string") {
                match = types[query2] || attributes[query2];
              } else if (query2 instanceof Text || query2["nodeType"] === Node.TEXT_NODE) {
                match = types["text"];
              } else if (typeof query2 === "number") {
                if (query2 & Scope.LEVEL & Scope.BLOCK) {
                  match = types["block"];
                } else if (query2 & Scope.LEVEL & Scope.INLINE) {
                  match = types["inline"];
                }
              } else if (query2 instanceof HTMLElement) {
                var names2 = (query2.getAttribute("class") || "").split(/\s+/);
                for (var i3 in names2) {
                  match = classes2[names2[i3]];
                  if (match)
                    break;
                }
                match = match || tags[query2.tagName];
              }
              if (match == null)
                return null;
              if (scope & Scope.LEVEL & match.scope && scope & Scope.TYPE & match.scope)
                return match;
              return null;
            }
            exports2.query = query;
            function register2() {
              var Definitions = [];
              for (var _i = 0; _i < arguments.length; _i++) {
                Definitions[_i] = arguments[_i];
              }
              if (Definitions.length > 1) {
                return Definitions.map(function(d2) {
                  return register2(d2);
                });
              }
              var Definition = Definitions[0];
              if (typeof Definition.blotName !== "string" && typeof Definition.attrName !== "string") {
                throw new ParchmentError("Invalid definition");
              } else if (Definition.blotName === "abstract") {
                throw new ParchmentError("Cannot register abstract class");
              }
              types[Definition.blotName || Definition.attrName] = Definition;
              if (typeof Definition.keyName === "string") {
                attributes[Definition.keyName] = Definition;
              } else {
                if (Definition.className != null) {
                  classes2[Definition.className] = Definition;
                }
                if (Definition.tagName != null) {
                  if (Array.isArray(Definition.tagName)) {
                    Definition.tagName = Definition.tagName.map(function(tagName) {
                      return tagName.toUpperCase();
                    });
                  } else {
                    Definition.tagName = Definition.tagName.toUpperCase();
                  }
                  var tagNames = Array.isArray(Definition.tagName) ? Definition.tagName : [Definition.tagName];
                  tagNames.forEach(function(tag) {
                    if (tags[tag] == null || Definition.className == null) {
                      tags[tag] = Definition;
                    }
                  });
                }
              }
              return Definition;
            }
            exports2.register = register2;
          },
          /* 2 */
          /***/
          function(module2, exports2, __webpack_require__) {
            var diff = __webpack_require__(51);
            var equal = __webpack_require__(11);
            var extend2 = __webpack_require__(3);
            var op = __webpack_require__(20);
            var NULL_CHARACTER = String.fromCharCode(0);
            var Delta = function(ops) {
              if (Array.isArray(ops)) {
                this.ops = ops;
              } else if (ops != null && Array.isArray(ops.ops)) {
                this.ops = ops.ops;
              } else {
                this.ops = [];
              }
            };
            Delta.prototype.insert = function(text3, attributes) {
              var newOp = {};
              if (text3.length === 0)
                return this;
              newOp.insert = text3;
              if (attributes != null && typeof attributes === "object" && Object.keys(attributes).length > 0) {
                newOp.attributes = attributes;
              }
              return this.push(newOp);
            };
            Delta.prototype["delete"] = function(length2) {
              if (length2 <= 0)
                return this;
              return this.push({ "delete": length2 });
            };
            Delta.prototype.retain = function(length2, attributes) {
              if (length2 <= 0)
                return this;
              var newOp = { retain: length2 };
              if (attributes != null && typeof attributes === "object" && Object.keys(attributes).length > 0) {
                newOp.attributes = attributes;
              }
              return this.push(newOp);
            };
            Delta.prototype.push = function(newOp) {
              var index3 = this.ops.length;
              var lastOp = this.ops[index3 - 1];
              newOp = extend2(true, {}, newOp);
              if (typeof lastOp === "object") {
                if (typeof newOp["delete"] === "number" && typeof lastOp["delete"] === "number") {
                  this.ops[index3 - 1] = { "delete": lastOp["delete"] + newOp["delete"] };
                  return this;
                }
                if (typeof lastOp["delete"] === "number" && newOp.insert != null) {
                  index3 -= 1;
                  lastOp = this.ops[index3 - 1];
                  if (typeof lastOp !== "object") {
                    this.ops.unshift(newOp);
                    return this;
                  }
                }
                if (equal(newOp.attributes, lastOp.attributes)) {
                  if (typeof newOp.insert === "string" && typeof lastOp.insert === "string") {
                    this.ops[index3 - 1] = { insert: lastOp.insert + newOp.insert };
                    if (typeof newOp.attributes === "object")
                      this.ops[index3 - 1].attributes = newOp.attributes;
                    return this;
                  } else if (typeof newOp.retain === "number" && typeof lastOp.retain === "number") {
                    this.ops[index3 - 1] = { retain: lastOp.retain + newOp.retain };
                    if (typeof newOp.attributes === "object")
                      this.ops[index3 - 1].attributes = newOp.attributes;
                    return this;
                  }
                }
              }
              if (index3 === this.ops.length) {
                this.ops.push(newOp);
              } else {
                this.ops.splice(index3, 0, newOp);
              }
              return this;
            };
            Delta.prototype.chop = function() {
              var lastOp = this.ops[this.ops.length - 1];
              if (lastOp && lastOp.retain && !lastOp.attributes) {
                this.ops.pop();
              }
              return this;
            };
            Delta.prototype.filter = function(predicate) {
              return this.ops.filter(predicate);
            };
            Delta.prototype.forEach = function(predicate) {
              this.ops.forEach(predicate);
            };
            Delta.prototype.map = function(predicate) {
              return this.ops.map(predicate);
            };
            Delta.prototype.partition = function(predicate) {
              var passed = [], failed = [];
              this.forEach(function(op2) {
                var target = predicate(op2) ? passed : failed;
                target.push(op2);
              });
              return [passed, failed];
            };
            Delta.prototype.reduce = function(predicate, initial) {
              return this.ops.reduce(predicate, initial);
            };
            Delta.prototype.changeLength = function() {
              return this.reduce(function(length2, elem) {
                if (elem.insert) {
                  return length2 + op.length(elem);
                } else if (elem.delete) {
                  return length2 - elem.delete;
                }
                return length2;
              }, 0);
            };
            Delta.prototype.length = function() {
              return this.reduce(function(length2, elem) {
                return length2 + op.length(elem);
              }, 0);
            };
            Delta.prototype.slice = function(start, end) {
              start = start || 0;
              if (typeof end !== "number")
                end = Infinity;
              var ops = [];
              var iter = op.iterator(this.ops);
              var index3 = 0;
              while (index3 < end && iter.hasNext()) {
                var nextOp;
                if (index3 < start) {
                  nextOp = iter.next(start - index3);
                } else {
                  nextOp = iter.next(end - index3);
                  ops.push(nextOp);
                }
                index3 += op.length(nextOp);
              }
              return new Delta(ops);
            };
            Delta.prototype.compose = function(other) {
              var thisIter = op.iterator(this.ops);
              var otherIter = op.iterator(other.ops);
              var delta = new Delta();
              while (thisIter.hasNext() || otherIter.hasNext()) {
                if (otherIter.peekType() === "insert") {
                  delta.push(otherIter.next());
                } else if (thisIter.peekType() === "delete") {
                  delta.push(thisIter.next());
                } else {
                  var length2 = Math.min(thisIter.peekLength(), otherIter.peekLength());
                  var thisOp = thisIter.next(length2);
                  var otherOp = otherIter.next(length2);
                  if (typeof otherOp.retain === "number") {
                    var newOp = {};
                    if (typeof thisOp.retain === "number") {
                      newOp.retain = length2;
                    } else {
                      newOp.insert = thisOp.insert;
                    }
                    var attributes = op.attributes.compose(thisOp.attributes, otherOp.attributes, typeof thisOp.retain === "number");
                    if (attributes)
                      newOp.attributes = attributes;
                    delta.push(newOp);
                  } else if (typeof otherOp["delete"] === "number" && typeof thisOp.retain === "number") {
                    delta.push(otherOp);
                  }
                }
              }
              return delta.chop();
            };
            Delta.prototype.concat = function(other) {
              var delta = new Delta(this.ops.slice());
              if (other.ops.length > 0) {
                delta.push(other.ops[0]);
                delta.ops = delta.ops.concat(other.ops.slice(1));
              }
              return delta;
            };
            Delta.prototype.diff = function(other, index3) {
              if (this.ops === other.ops) {
                return new Delta();
              }
              var strings = [this, other].map(function(delta2) {
                return delta2.map(function(op2) {
                  if (op2.insert != null) {
                    return typeof op2.insert === "string" ? op2.insert : NULL_CHARACTER;
                  }
                  var prep = delta2 === other ? "on" : "with";
                  throw new Error("diff() called " + prep + " non-document");
                }).join("");
              });
              var delta = new Delta();
              var diffResult = diff(strings[0], strings[1], index3);
              var thisIter = op.iterator(this.ops);
              var otherIter = op.iterator(other.ops);
              diffResult.forEach(function(component) {
                var length2 = component[1].length;
                while (length2 > 0) {
                  var opLength = 0;
                  switch (component[0]) {
                    case diff.INSERT:
                      opLength = Math.min(otherIter.peekLength(), length2);
                      delta.push(otherIter.next(opLength));
                      break;
                    case diff.DELETE:
                      opLength = Math.min(length2, thisIter.peekLength());
                      thisIter.next(opLength);
                      delta["delete"](opLength);
                      break;
                    case diff.EQUAL:
                      opLength = Math.min(thisIter.peekLength(), otherIter.peekLength(), length2);
                      var thisOp = thisIter.next(opLength);
                      var otherOp = otherIter.next(opLength);
                      if (equal(thisOp.insert, otherOp.insert)) {
                        delta.retain(opLength, op.attributes.diff(thisOp.attributes, otherOp.attributes));
                      } else {
                        delta.push(otherOp)["delete"](opLength);
                      }
                      break;
                  }
                  length2 -= opLength;
                }
              });
              return delta.chop();
            };
            Delta.prototype.eachLine = function(predicate, newline) {
              newline = newline || "\n";
              var iter = op.iterator(this.ops);
              var line = new Delta();
              var i3 = 0;
              while (iter.hasNext()) {
                if (iter.peekType() !== "insert")
                  return;
                var thisOp = iter.peek();
                var start = op.length(thisOp) - iter.peekLength();
                var index3 = typeof thisOp.insert === "string" ? thisOp.insert.indexOf(newline, start) - start : -1;
                if (index3 < 0) {
                  line.push(iter.next());
                } else if (index3 > 0) {
                  line.push(iter.next(index3));
                } else {
                  if (predicate(line, iter.next(1).attributes || {}, i3) === false) {
                    return;
                  }
                  i3 += 1;
                  line = new Delta();
                }
              }
              if (line.length() > 0) {
                predicate(line, {}, i3);
              }
            };
            Delta.prototype.transform = function(other, priority) {
              priority = !!priority;
              if (typeof other === "number") {
                return this.transformPosition(other, priority);
              }
              var thisIter = op.iterator(this.ops);
              var otherIter = op.iterator(other.ops);
              var delta = new Delta();
              while (thisIter.hasNext() || otherIter.hasNext()) {
                if (thisIter.peekType() === "insert" && (priority || otherIter.peekType() !== "insert")) {
                  delta.retain(op.length(thisIter.next()));
                } else if (otherIter.peekType() === "insert") {
                  delta.push(otherIter.next());
                } else {
                  var length2 = Math.min(thisIter.peekLength(), otherIter.peekLength());
                  var thisOp = thisIter.next(length2);
                  var otherOp = otherIter.next(length2);
                  if (thisOp["delete"]) {
                    continue;
                  } else if (otherOp["delete"]) {
                    delta.push(otherOp);
                  } else {
                    delta.retain(length2, op.attributes.transform(thisOp.attributes, otherOp.attributes, priority));
                  }
                }
              }
              return delta.chop();
            };
            Delta.prototype.transformPosition = function(index3, priority) {
              priority = !!priority;
              var thisIter = op.iterator(this.ops);
              var offset = 0;
              while (thisIter.hasNext() && offset <= index3) {
                var length2 = thisIter.peekLength();
                var nextType = thisIter.peekType();
                thisIter.next();
                if (nextType === "delete") {
                  index3 -= Math.min(length2, index3 - offset);
                  continue;
                } else if (nextType === "insert" && (offset < index3 || !priority)) {
                  index3 += length2;
                }
                offset += length2;
              }
              return index3;
            };
            module2.exports = Delta;
          },
          /* 3 */
          /***/
          function(module2, exports2) {
            "use strict";
            var hasOwn = Object.prototype.hasOwnProperty;
            var toStr = Object.prototype.toString;
            var isArray2 = function isArray3(arr) {
              if (typeof Array.isArray === "function") {
                return Array.isArray(arr);
              }
              return toStr.call(arr) === "[object Array]";
            };
            var isPlainObject = function isPlainObject2(obj) {
              if (!obj || toStr.call(obj) !== "[object Object]") {
                return false;
              }
              var hasOwnConstructor = hasOwn.call(obj, "constructor");
              var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, "isPrototypeOf");
              if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {
                return false;
              }
              var key;
              for (key in obj) {
              }
              return typeof key === "undefined" || hasOwn.call(obj, key);
            };
            module2.exports = function extend2() {
              var options, name, src, copy, copyIsArray, clone;
              var target = arguments[0];
              var i3 = 1;
              var length2 = arguments.length;
              var deep = false;
              if (typeof target === "boolean") {
                deep = target;
                target = arguments[1] || {};
                i3 = 2;
              }
              if (target == null || typeof target !== "object" && typeof target !== "function") {
                target = {};
              }
              for (; i3 < length2; ++i3) {
                options = arguments[i3];
                if (options != null) {
                  for (name in options) {
                    src = target[name];
                    copy = options[name];
                    if (target !== copy) {
                      if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray2(copy)))) {
                        if (copyIsArray) {
                          copyIsArray = false;
                          clone = src && isArray2(src) ? src : [];
                        } else {
                          clone = src && isPlainObject(src) ? src : {};
                        }
                        target[name] = extend2(deep, clone, copy);
                      } else if (typeof copy !== "undefined") {
                        target[name] = copy;
                      }
                    }
                  }
                }
              }
              return target;
            };
          },
          /* 4 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", {
              value: true
            });
            exports2.default = exports2.BlockEmbed = exports2.bubbleFormats = void 0;
            var _createClass = function() {
              function defineProperties(target, props) {
                for (var i3 = 0; i3 < props.length; i3++) {
                  var descriptor = props[i3];
                  descriptor.enumerable = descriptor.enumerable || false;
                  descriptor.configurable = true;
                  if ("value" in descriptor)
                    descriptor.writable = true;
                  Object.defineProperty(target, descriptor.key, descriptor);
                }
              }
              return function(Constructor, protoProps, staticProps) {
                if (protoProps)
                  defineProperties(Constructor.prototype, protoProps);
                if (staticProps)
                  defineProperties(Constructor, staticProps);
                return Constructor;
              };
            }();
            var _get = function get(object, property, receiver) {
              if (object === null)
                object = Function.prototype;
              var desc = Object.getOwnPropertyDescriptor(object, property);
              if (desc === void 0) {
                var parent = Object.getPrototypeOf(object);
                if (parent === null) {
                  return void 0;
                } else {
                  return get(parent, property, receiver);
                }
              } else if ("value" in desc) {
                return desc.value;
              } else {
                var getter = desc.get;
                if (getter === void 0) {
                  return void 0;
                }
                return getter.call(receiver);
              }
            };
            var _extend = __webpack_require__(3);
            var _extend2 = _interopRequireDefault(_extend);
            var _quillDelta = __webpack_require__(2);
            var _quillDelta2 = _interopRequireDefault(_quillDelta);
            var _parchment = __webpack_require__(0);
            var _parchment2 = _interopRequireDefault(_parchment);
            var _break = __webpack_require__(16);
            var _break2 = _interopRequireDefault(_break);
            var _inline = __webpack_require__(6);
            var _inline2 = _interopRequireDefault(_inline);
            var _text = __webpack_require__(7);
            var _text2 = _interopRequireDefault(_text);
            function _interopRequireDefault(obj) {
              return obj && obj.__esModule ? obj : { default: obj };
            }
            function _classCallCheck2(instance, Constructor) {
              if (!(instance instanceof Constructor)) {
                throw new TypeError("Cannot call a class as a function");
              }
            }
            function _possibleConstructorReturn(self2, call4) {
              if (!self2) {
                throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
              }
              return call4 && (typeof call4 === "object" || typeof call4 === "function") ? call4 : self2;
            }
            function _inherits(subClass, superClass) {
              if (typeof superClass !== "function" && superClass !== null) {
                throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
              }
              subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
              if (superClass)
                Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
            }
            var NEWLINE_LENGTH = 1;
            var BlockEmbed = function(_Parchment$Embed) {
              _inherits(BlockEmbed2, _Parchment$Embed);
              function BlockEmbed2() {
                _classCallCheck2(this, BlockEmbed2);
                return _possibleConstructorReturn(this, (BlockEmbed2.__proto__ || Object.getPrototypeOf(BlockEmbed2)).apply(this, arguments));
              }
              _createClass(BlockEmbed2, [{
                key: "attach",
                value: function attach() {
                  _get(BlockEmbed2.prototype.__proto__ || Object.getPrototypeOf(BlockEmbed2.prototype), "attach", this).call(this);
                  this.attributes = new _parchment2.default.Attributor.Store(this.domNode);
                }
              }, {
                key: "delta",
                value: function delta() {
                  return new _quillDelta2.default().insert(this.value(), (0, _extend2.default)(this.formats(), this.attributes.values()));
                }
              }, {
                key: "format",
                value: function format(name, value) {
                  var attribute = _parchment2.default.query(name, _parchment2.default.Scope.BLOCK_ATTRIBUTE);
                  if (attribute != null) {
                    this.attributes.attribute(attribute, value);
                  }
                }
              }, {
                key: "formatAt",
                value: function formatAt(index3, length2, name, value) {
                  this.format(name, value);
                }
              }, {
                key: "insertAt",
                value: function insertAt(index3, value, def) {
                  if (typeof value === "string" && value.endsWith("\n")) {
                    var block = _parchment2.default.create(Block.blotName);
                    this.parent.insertBefore(block, index3 === 0 ? this : this.next);
                    block.insertAt(0, value.slice(0, -1));
                  } else {
                    _get(BlockEmbed2.prototype.__proto__ || Object.getPrototypeOf(BlockEmbed2.prototype), "insertAt", this).call(this, index3, value, def);
                  }
                }
              }]);
              return BlockEmbed2;
            }(_parchment2.default.Embed);
            BlockEmbed.scope = _parchment2.default.Scope.BLOCK_BLOT;
            var Block = function(_Parchment$Block) {
              _inherits(Block2, _Parchment$Block);
              function Block2(domNode) {
                _classCallCheck2(this, Block2);
                var _this2 = _possibleConstructorReturn(this, (Block2.__proto__ || Object.getPrototypeOf(Block2)).call(this, domNode));
                _this2.cache = {};
                return _this2;
              }
              _createClass(Block2, [{
                key: "delta",
                value: function delta() {
                  if (this.cache.delta == null) {
                    this.cache.delta = this.descendants(_parchment2.default.Leaf).reduce(function(delta2, leaf) {
                      if (leaf.length() === 0) {
                        return delta2;
                      } else {
                        return delta2.insert(leaf.value(), bubbleFormats(leaf));
                      }
                    }, new _quillDelta2.default()).insert("\n", bubbleFormats(this));
                  }
                  return this.cache.delta;
                }
              }, {
                key: "deleteAt",
                value: function deleteAt(index3, length2) {
                  _get(Block2.prototype.__proto__ || Object.getPrototypeOf(Block2.prototype), "deleteAt", this).call(this, index3, length2);
                  this.cache = {};
                }
              }, {
                key: "formatAt",
                value: function formatAt(index3, length2, name, value) {
                  if (length2 <= 0)
                    return;
                  if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK)) {
                    if (index3 + length2 === this.length()) {
                      this.format(name, value);
                    }
                  } else {
                    _get(Block2.prototype.__proto__ || Object.getPrototypeOf(Block2.prototype), "formatAt", this).call(this, index3, Math.min(length2, this.length() - index3 - 1), name, value);
                  }
                  this.cache = {};
                }
              }, {
                key: "insertAt",
                value: function insertAt(index3, value, def) {
                  if (def != null)
                    return _get(Block2.prototype.__proto__ || Object.getPrototypeOf(Block2.prototype), "insertAt", this).call(this, index3, value, def);
                  if (value.length === 0)
                    return;
                  var lines = value.split("\n");
                  var text3 = lines.shift();
                  if (text3.length > 0) {
                    if (index3 < this.length() - 1 || this.children.tail == null) {
                      _get(Block2.prototype.__proto__ || Object.getPrototypeOf(Block2.prototype), "insertAt", this).call(this, Math.min(index3, this.length() - 1), text3);
                    } else {
                      this.children.tail.insertAt(this.children.tail.length(), text3);
                    }
                    this.cache = {};
                  }
                  var block = this;
                  lines.reduce(function(index4, line) {
                    block = block.split(index4, true);
                    block.insertAt(0, line);
                    return line.length;
                  }, index3 + text3.length);
                }
              }, {
                key: "insertBefore",
                value: function insertBefore2(blot, ref) {
                  var head = this.children.head;
                  _get(Block2.prototype.__proto__ || Object.getPrototypeOf(Block2.prototype), "insertBefore", this).call(this, blot, ref);
                  if (head instanceof _break2.default) {
                    head.remove();
                  }
                  this.cache = {};
                }
              }, {
                key: "length",
                value: function length2() {
                  if (this.cache.length == null) {
                    this.cache.length = _get(Block2.prototype.__proto__ || Object.getPrototypeOf(Block2.prototype), "length", this).call(this) + NEWLINE_LENGTH;
                  }
                  return this.cache.length;
                }
              }, {
                key: "moveChildren",
                value: function moveChildren(target, ref) {
                  _get(Block2.prototype.__proto__ || Object.getPrototypeOf(Block2.prototype), "moveChildren", this).call(this, target, ref);
                  this.cache = {};
                }
              }, {
                key: "optimize",
                value: function optimize(context) {
                  _get(Block2.prototype.__proto__ || Object.getPrototypeOf(Block2.prototype), "optimize", this).call(this, context);
                  this.cache = {};
                }
              }, {
                key: "path",
                value: function path(index3) {
                  return _get(Block2.prototype.__proto__ || Object.getPrototypeOf(Block2.prototype), "path", this).call(this, index3, true);
                }
              }, {
                key: "removeChild",
                value: function removeChild(child) {
                  _get(Block2.prototype.__proto__ || Object.getPrototypeOf(Block2.prototype), "removeChild", this).call(this, child);
                  this.cache = {};
                }
              }, {
                key: "split",
                value: function split(index3) {
                  var force = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
                  if (force && (index3 === 0 || index3 >= this.length() - NEWLINE_LENGTH)) {
                    var clone = this.clone();
                    if (index3 === 0) {
                      this.parent.insertBefore(clone, this);
                      return this;
                    } else {
                      this.parent.insertBefore(clone, this.next);
                      return clone;
                    }
                  } else {
                    var next2 = _get(Block2.prototype.__proto__ || Object.getPrototypeOf(Block2.prototype), "split", this).call(this, index3, force);
                    this.cache = {};
                    return next2;
                  }
                }
              }]);
              return Block2;
            }(_parchment2.default.Block);
            Block.blotName = "block";
            Block.tagName = "P";
            Block.defaultChild = "break";
            Block.allowedChildren = [_inline2.default, _parchment2.default.Embed, _text2.default];
            function bubbleFormats(blot) {
              var formats = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
              if (blot == null)
                return formats;
              if (typeof blot.formats === "function") {
                formats = (0, _extend2.default)(formats, blot.formats());
              }
              if (blot.parent == null || blot.parent.blotName == "scroll" || blot.parent.statics.scope !== blot.statics.scope) {
                return formats;
              }
              return bubbleFormats(blot.parent, formats);
            }
            exports2.bubbleFormats = bubbleFormats;
            exports2.BlockEmbed = BlockEmbed;
            exports2.default = Block;
          },
          /* 5 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", {
              value: true
            });
            exports2.default = exports2.overload = exports2.expandConfig = void 0;
            var _typeof3 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) {
              return typeof obj;
            } : function(obj) {
              return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
            };
            var _slicedToArray = function() {
              function sliceIterator(arr, i3) {
                var _arr = [];
                var _n = true;
                var _d = false;
                var _e = void 0;
                try {
                  for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
                    _arr.push(_s.value);
                    if (i3 && _arr.length === i3)
                      break;
                  }
                } catch (err) {
                  _d = true;
                  _e = err;
                } finally {
                  try {
                    if (!_n && _i["return"])
                      _i["return"]();
                  } finally {
                    if (_d)
                      throw _e;
                  }
                }
                return _arr;
              }
              return function(arr, i3) {
                if (Array.isArray(arr)) {
                  return arr;
                } else if (Symbol.iterator in Object(arr)) {
                  return sliceIterator(arr, i3);
                } else {
                  throw new TypeError("Invalid attempt to destructure non-iterable instance");
                }
              };
            }();
            var _createClass = function() {
              function defineProperties(target, props) {
                for (var i3 = 0; i3 < props.length; i3++) {
                  var descriptor = props[i3];
                  descriptor.enumerable = descriptor.enumerable || false;
                  descriptor.configurable = true;
                  if ("value" in descriptor)
                    descriptor.writable = true;
                  Object.defineProperty(target, descriptor.key, descriptor);
                }
              }
              return function(Constructor, protoProps, staticProps) {
                if (protoProps)
                  defineProperties(Constructor.prototype, protoProps);
                if (staticProps)
                  defineProperties(Constructor, staticProps);
                return Constructor;
              };
            }();
            __webpack_require__(50);
            var _quillDelta = __webpack_require__(2);
            var _quillDelta2 = _interopRequireDefault(_quillDelta);
            var _editor = __webpack_require__(14);
            var _editor2 = _interopRequireDefault(_editor);
            var _emitter3 = __webpack_require__(8);
            var _emitter4 = _interopRequireDefault(_emitter3);
            var _module = __webpack_require__(9);
            var _module2 = _interopRequireDefault(_module);
            var _parchment = __webpack_require__(0);
            var _parchment2 = _interopRequireDefault(_parchment);
            var _selection = __webpack_require__(15);
            var _selection2 = _interopRequireDefault(_selection);
            var _extend = __webpack_require__(3);
            var _extend2 = _interopRequireDefault(_extend);
            var _logger = __webpack_require__(10);
            var _logger2 = _interopRequireDefault(_logger);
            var _theme = __webpack_require__(34);
            var _theme2 = _interopRequireDefault(_theme);
            function _interopRequireDefault(obj) {
              return obj && obj.__esModule ? obj : { default: obj };
            }
            function _defineProperty2(obj, key, value) {
              if (key in obj) {
                Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
              } else {
                obj[key] = value;
              }
              return obj;
            }
            function _classCallCheck2(instance, Constructor) {
              if (!(instance instanceof Constructor)) {
                throw new TypeError("Cannot call a class as a function");
              }
            }
            var debug = (0, _logger2.default)("quill");
            var Quill2 = function() {
              _createClass(Quill3, null, [{
                key: "debug",
                value: function debug2(limit) {
                  if (limit === true) {
                    limit = "log";
                  }
                  _logger2.default.level(limit);
                }
              }, {
                key: "find",
                value: function find2(node3) {
                  return node3.__quill || _parchment2.default.find(node3);
                }
              }, {
                key: "import",
                value: function _import(name) {
                  if (this.imports[name] == null) {
                    debug.error("Cannot import " + name + ". Are you sure it was registered?");
                  }
                  return this.imports[name];
                }
              }, {
                key: "register",
                value: function register2(path, target) {
                  var _this = this;
                  var overwrite = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
                  if (typeof path !== "string") {
                    var name = path.attrName || path.blotName;
                    if (typeof name === "string") {
                      this.register("formats/" + name, path, target);
                    } else {
                      Object.keys(path).forEach(function(key) {
                        _this.register(key, path[key], target);
                      });
                    }
                  } else {
                    if (this.imports[path] != null && !overwrite) {
                      debug.warn("Overwriting " + path + " with", target);
                    }
                    this.imports[path] = target;
                    if ((path.startsWith("blots/") || path.startsWith("formats/")) && target.blotName !== "abstract") {
                      _parchment2.default.register(target);
                    } else if (path.startsWith("modules") && typeof target.register === "function") {
                      target.register();
                    }
                  }
                }
              }]);
              function Quill3(container) {
                var _this2 = this;
                var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
                _classCallCheck2(this, Quill3);
                this.options = expandConfig(container, options);
                this.container = this.options.container;
                if (this.container == null) {
                  return debug.error("Invalid Quill container", container);
                }
                if (this.options.debug) {
                  Quill3.debug(this.options.debug);
                }
                var html2 = this.container.innerHTML.trim();
                this.container.classList.add("ql-container");
                this.container.innerHTML = "";
                this.container.__quill = this;
                this.root = this.addContainer("ql-editor");
                this.root.classList.add("ql-blank");
                this.root.setAttribute("data-gramm", false);
                this.scrollingContainer = this.options.scrollingContainer || this.root;
                this.emitter = new _emitter4.default();
                this.scroll = _parchment2.default.create(this.root, {
                  emitter: this.emitter,
                  whitelist: this.options.formats
                });
                this.editor = new _editor2.default(this.scroll);
                this.selection = new _selection2.default(this.scroll, this.emitter);
                this.theme = new this.options.theme(this, this.options);
                this.keyboard = this.theme.addModule("keyboard");
                this.clipboard = this.theme.addModule("clipboard");
                this.history = this.theme.addModule("history");
                this.theme.init();
                this.emitter.on(_emitter4.default.events.EDITOR_CHANGE, function(type) {
                  if (type === _emitter4.default.events.TEXT_CHANGE) {
                    _this2.root.classList.toggle("ql-blank", _this2.editor.isBlank());
                  }
                });
                this.emitter.on(_emitter4.default.events.SCROLL_UPDATE, function(source, mutations) {
                  var range = _this2.selection.lastRange;
                  var index3 = range && range.length === 0 ? range.index : void 0;
                  modify.call(_this2, function() {
                    return _this2.editor.update(null, mutations, index3);
                  }, source);
                });
                var contents = this.clipboard.convert(`<div class='ql-editor' style="white-space: normal;">` + html2 + "<p><br></p></div>");
                this.setContents(contents);
                this.history.clear();
                if (this.options.placeholder) {
                  this.root.setAttribute("data-placeholder", this.options.placeholder);
                }
                if (this.options.readOnly) {
                  this.disable();
                }
              }
              _createClass(Quill3, [{
                key: "addContainer",
                value: function addContainer(container) {
                  var refNode = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null;
                  if (typeof container === "string") {
                    var className = container;
                    container = document.createElement("div");
                    container.classList.add(className);
                  }
                  this.container.insertBefore(container, refNode);
                  return container;
                }
              }, {
                key: "blur",
                value: function blur() {
                  this.selection.setRange(null);
                }
              }, {
                key: "deleteText",
                value: function deleteText(index3, length2, source) {
                  var _this3 = this;
                  var _overload = overload(index3, length2, source);
                  var _overload2 = _slicedToArray(_overload, 4);
                  index3 = _overload2[0];
                  length2 = _overload2[1];
                  source = _overload2[3];
                  return modify.call(this, function() {
                    return _this3.editor.deleteText(index3, length2);
                  }, source, index3, -1 * length2);
                }
              }, {
                key: "disable",
                value: function disable2() {
                  this.enable(false);
                }
              }, {
                key: "enable",
                value: function enable() {
                  var enabled = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
                  this.scroll.enable(enabled);
                  this.container.classList.toggle("ql-disabled", !enabled);
                }
              }, {
                key: "focus",
                value: function focus() {
                  var scrollTop = this.scrollingContainer.scrollTop;
                  this.selection.focus();
                  this.scrollingContainer.scrollTop = scrollTop;
                  this.scrollIntoView();
                }
              }, {
                key: "format",
                value: function format(name, value) {
                  var _this4 = this;
                  var source = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : _emitter4.default.sources.API;
                  return modify.call(this, function() {
                    var range = _this4.getSelection(true);
                    var change = new _quillDelta2.default();
                    if (range == null) {
                      return change;
                    } else if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK)) {
                      change = _this4.editor.formatLine(range.index, range.length, _defineProperty2({}, name, value));
                    } else if (range.length === 0) {
                      _this4.selection.format(name, value);
                      return change;
                    } else {
                      change = _this4.editor.formatText(range.index, range.length, _defineProperty2({}, name, value));
                    }
                    _this4.setSelection(range, _emitter4.default.sources.SILENT);
                    return change;
                  }, source);
                }
              }, {
                key: "formatLine",
                value: function formatLine(index3, length2, name, value, source) {
                  var _this5 = this;
                  var formats = void 0;
                  var _overload3 = overload(index3, length2, name, value, source);
                  var _overload4 = _slicedToArray(_overload3, 4);
                  index3 = _overload4[0];
                  length2 = _overload4[1];
                  formats = _overload4[2];
                  source = _overload4[3];
                  return modify.call(this, function() {
                    return _this5.editor.formatLine(index3, length2, formats);
                  }, source, index3, 0);
                }
              }, {
                key: "formatText",
                value: function formatText(index3, length2, name, value, source) {
                  var _this6 = this;
                  var formats = void 0;
                  var _overload5 = overload(index3, length2, name, value, source);
                  var _overload6 = _slicedToArray(_overload5, 4);
                  index3 = _overload6[0];
                  length2 = _overload6[1];
                  formats = _overload6[2];
                  source = _overload6[3];
                  return modify.call(this, function() {
                    return _this6.editor.formatText(index3, length2, formats);
                  }, source, index3, 0);
                }
              }, {
                key: "getBounds",
                value: function getBounds(index3) {
                  var length2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
                  var bounds = void 0;
                  if (typeof index3 === "number") {
                    bounds = this.selection.getBounds(index3, length2);
                  } else {
                    bounds = this.selection.getBounds(index3.index, index3.length);
                  }
                  var containerBounds = this.container.getBoundingClientRect();
                  return {
                    bottom: bounds.bottom - containerBounds.top,
                    height: bounds.height,
                    left: bounds.left - containerBounds.left,
                    right: bounds.right - containerBounds.left,
                    top: bounds.top - containerBounds.top,
                    width: bounds.width
                  };
                }
              }, {
                key: "getContents",
                value: function getContents() {
                  var index3 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
                  var length2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.getLength() - index3;
                  var _overload7 = overload(index3, length2);
                  var _overload8 = _slicedToArray(_overload7, 2);
                  index3 = _overload8[0];
                  length2 = _overload8[1];
                  return this.editor.getContents(index3, length2);
                }
              }, {
                key: "getFormat",
                value: function getFormat() {
                  var index3 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.getSelection(true);
                  var length2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
                  if (typeof index3 === "number") {
                    return this.editor.getFormat(index3, length2);
                  } else {
                    return this.editor.getFormat(index3.index, index3.length);
                  }
                }
              }, {
                key: "getIndex",
                value: function getIndex(blot) {
                  return blot.offset(this.scroll);
                }
              }, {
                key: "getLength",
                value: function getLength() {
                  return this.scroll.length();
                }
              }, {
                key: "getLeaf",
                value: function getLeaf(index3) {
                  return this.scroll.leaf(index3);
                }
              }, {
                key: "getLine",
                value: function getLine(index3) {
                  return this.scroll.line(index3);
                }
              }, {
                key: "getLines",
                value: function getLines() {
                  var index3 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
                  var length2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Number.MAX_VALUE;
                  if (typeof index3 !== "number") {
                    return this.scroll.lines(index3.index, index3.length);
                  } else {
                    return this.scroll.lines(index3, length2);
                  }
                }
              }, {
                key: "getModule",
                value: function getModule(name) {
                  return this.theme.modules[name];
                }
              }, {
                key: "getSelection",
                value: function getSelection() {
                  var focus = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
                  if (focus)
                    this.focus();
                  this.update();
                  return this.selection.getRange()[0];
                }
              }, {
                key: "getText",
                value: function getText3() {
                  var index3 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
                  var length2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.getLength() - index3;
                  var _overload9 = overload(index3, length2);
                  var _overload10 = _slicedToArray(_overload9, 2);
                  index3 = _overload10[0];
                  length2 = _overload10[1];
                  return this.editor.getText(index3, length2);
                }
              }, {
                key: "hasFocus",
                value: function hasFocus() {
                  return this.selection.hasFocus();
                }
              }, {
                key: "insertEmbed",
                value: function insertEmbed(index3, embed, value) {
                  var _this7 = this;
                  var source = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : Quill3.sources.API;
                  return modify.call(this, function() {
                    return _this7.editor.insertEmbed(index3, embed, value);
                  }, source, index3);
                }
              }, {
                key: "insertText",
                value: function insertText(index3, text3, name, value, source) {
                  var _this8 = this;
                  var formats = void 0;
                  var _overload11 = overload(index3, 0, name, value, source);
                  var _overload12 = _slicedToArray(_overload11, 4);
                  index3 = _overload12[0];
                  formats = _overload12[2];
                  source = _overload12[3];
                  return modify.call(this, function() {
                    return _this8.editor.insertText(index3, text3, formats);
                  }, source, index3, text3.length);
                }
              }, {
                key: "isEnabled",
                value: function isEnabled() {
                  return !this.container.classList.contains("ql-disabled");
                }
              }, {
                key: "off",
                value: function off2() {
                  return this.emitter.off.apply(this.emitter, arguments);
                }
              }, {
                key: "on",
                value: function on2() {
                  return this.emitter.on.apply(this.emitter, arguments);
                }
              }, {
                key: "once",
                value: function once() {
                  return this.emitter.once.apply(this.emitter, arguments);
                }
              }, {
                key: "pasteHTML",
                value: function pasteHTML(index3, html2, source) {
                  this.clipboard.dangerouslyPasteHTML(index3, html2, source);
                }
              }, {
                key: "removeFormat",
                value: function removeFormat(index3, length2, source) {
                  var _this9 = this;
                  var _overload13 = overload(index3, length2, source);
                  var _overload14 = _slicedToArray(_overload13, 4);
                  index3 = _overload14[0];
                  length2 = _overload14[1];
                  source = _overload14[3];
                  return modify.call(this, function() {
                    return _this9.editor.removeFormat(index3, length2);
                  }, source, index3);
                }
              }, {
                key: "scrollIntoView",
                value: function scrollIntoView() {
                  this.selection.scrollIntoView(this.scrollingContainer);
                }
              }, {
                key: "setContents",
                value: function setContents(delta) {
                  var _this10 = this;
                  var source = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : _emitter4.default.sources.API;
                  return modify.call(this, function() {
                    delta = new _quillDelta2.default(delta);
                    var length2 = _this10.getLength();
                    var deleted = _this10.editor.deleteText(0, length2);
                    var applied = _this10.editor.applyDelta(delta);
                    var lastOp = applied.ops[applied.ops.length - 1];
                    if (lastOp != null && typeof lastOp.insert === "string" && lastOp.insert[lastOp.insert.length - 1] === "\n") {
                      _this10.editor.deleteText(_this10.getLength() - 1, 1);
                      applied.delete(1);
                    }
                    var ret = deleted.compose(applied);
                    return ret;
                  }, source);
                }
              }, {
                key: "setSelection",
                value: function setSelection(index3, length2, source) {
                  if (index3 == null) {
                    this.selection.setRange(null, length2 || Quill3.sources.API);
                  } else {
                    var _overload15 = overload(index3, length2, source);
                    var _overload16 = _slicedToArray(_overload15, 4);
                    index3 = _overload16[0];
                    length2 = _overload16[1];
                    source = _overload16[3];
                    this.selection.setRange(new _selection.Range(index3, length2), source);
                    if (source !== _emitter4.default.sources.SILENT) {
                      this.selection.scrollIntoView(this.scrollingContainer);
                    }
                  }
                }
              }, {
                key: "setText",
                value: function setText2(text3) {
                  var source = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : _emitter4.default.sources.API;
                  var delta = new _quillDelta2.default().insert(text3);
                  return this.setContents(delta, source);
                }
              }, {
                key: "update",
                value: function update() {
                  var source = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : _emitter4.default.sources.USER;
                  var change = this.scroll.update(source);
                  this.selection.update(source);
                  return change;
                }
              }, {
                key: "updateContents",
                value: function updateContents(delta) {
                  var _this11 = this;
                  var source = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : _emitter4.default.sources.API;
                  return modify.call(this, function() {
                    delta = new _quillDelta2.default(delta);
                    return _this11.editor.applyDelta(delta, source);
                  }, source, true);
                }
              }]);
              return Quill3;
            }();
            Quill2.DEFAULTS = {
              bounds: null,
              formats: null,
              modules: {},
              placeholder: "",
              readOnly: false,
              scrollingContainer: null,
              strict: true,
              theme: "default"
            };
            Quill2.events = _emitter4.default.events;
            Quill2.sources = _emitter4.default.sources;
            Quill2.version = false ? "dev" : "1.3.6";
            Quill2.imports = {
              "delta": _quillDelta2.default,
              "parchment": _parchment2.default,
              "core/module": _module2.default,
              "core/theme": _theme2.default
            };
            function expandConfig(container, userConfig) {
              userConfig = (0, _extend2.default)(true, {
                container,
                modules: {
                  clipboard: true,
                  keyboard: true,
                  history: true
                }
              }, userConfig);
              if (!userConfig.theme || userConfig.theme === Quill2.DEFAULTS.theme) {
                userConfig.theme = _theme2.default;
              } else {
                userConfig.theme = Quill2.import("themes/" + userConfig.theme);
                if (userConfig.theme == null) {
                  throw new Error("Invalid theme " + userConfig.theme + ". Did you register it?");
                }
              }
              var themeConfig = (0, _extend2.default)(true, {}, userConfig.theme.DEFAULTS);
              [themeConfig, userConfig].forEach(function(config) {
                config.modules = config.modules || {};
                Object.keys(config.modules).forEach(function(module3) {
                  if (config.modules[module3] === true) {
                    config.modules[module3] = {};
                  }
                });
              });
              var moduleNames = Object.keys(themeConfig.modules).concat(Object.keys(userConfig.modules));
              var moduleConfig = moduleNames.reduce(function(config, name) {
                var moduleClass = Quill2.import("modules/" + name);
                if (moduleClass == null) {
                  debug.error("Cannot load " + name + " module. Are you sure you registered it?");
                } else {
                  config[name] = moduleClass.DEFAULTS || {};
                }
                return config;
              }, {});
              if (userConfig.modules != null && userConfig.modules.toolbar && userConfig.modules.toolbar.constructor !== Object) {
                userConfig.modules.toolbar = {
                  container: userConfig.modules.toolbar
                };
              }
              userConfig = (0, _extend2.default)(true, {}, Quill2.DEFAULTS, { modules: moduleConfig }, themeConfig, userConfig);
              ["bounds", "container", "scrollingContainer"].forEach(function(key) {
                if (typeof userConfig[key] === "string") {
                  userConfig[key] = document.querySelector(userConfig[key]);
                }
              });
              userConfig.modules = Object.keys(userConfig.modules).reduce(function(config, name) {
                if (userConfig.modules[name]) {
                  config[name] = userConfig.modules[name];
                }
                return config;
              }, {});
              return userConfig;
            }
            function modify(modifier, source, index3, shift) {
              if (this.options.strict && !this.isEnabled() && source === _emitter4.default.sources.USER) {
                return new _quillDelta2.default();
              }
              var range = index3 == null ? null : this.getSelection();
              var oldDelta = this.editor.delta;
              var change = modifier();
              if (range != null) {
                if (index3 === true)
                  index3 = range.index;
                if (shift == null) {
                  range = shiftRange(range, change, source);
                } else if (shift !== 0) {
                  range = shiftRange(range, index3, shift, source);
                }
                this.setSelection(range, _emitter4.default.sources.SILENT);
              }
              if (change.length() > 0) {
                var _emitter;
                var args = [_emitter4.default.events.TEXT_CHANGE, change, oldDelta, source];
                (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args));
                if (source !== _emitter4.default.sources.SILENT) {
                  var _emitter2;
                  (_emitter2 = this.emitter).emit.apply(_emitter2, args);
                }
              }
              return change;
            }
            function overload(index3, length2, name, value, source) {
              var formats = {};
              if (typeof index3.index === "number" && typeof index3.length === "number") {
                if (typeof length2 !== "number") {
                  source = value, value = name, name = length2, length2 = index3.length, index3 = index3.index;
                } else {
                  length2 = index3.length, index3 = index3.index;
                }
              } else if (typeof length2 !== "number") {
                source = value, value = name, name = length2, length2 = 0;
              }
              if ((typeof name === "undefined" ? "undefined" : _typeof3(name)) === "object") {
                formats = name;
                source = value;
              } else if (typeof name === "string") {
                if (value != null) {
                  formats[name] = value;
                } else {
                  source = name;
                }
              }
              source = source || _emitter4.default.sources.API;
              return [index3, length2, formats, source];
            }
            function shiftRange(range, index3, length2, source) {
              if (range == null)
                return null;
              var start = void 0, end = void 0;
              if (index3 instanceof _quillDelta2.default) {
                var _map = [range.index, range.index + range.length].map(function(pos) {
                  return index3.transformPosition(pos, source !== _emitter4.default.sources.USER);
                });
                var _map2 = _slicedToArray(_map, 2);
                start = _map2[0];
                end = _map2[1];
              } else {
                var _map3 = [range.index, range.index + range.length].map(function(pos) {
                  if (pos < index3 || pos === index3 && source === _emitter4.default.sources.USER)
                    return pos;
                  if (length2 >= 0) {
                    return pos + length2;
                  } else {
                    return Math.max(index3, pos + length2);
                  }
                });
                var _map4 = _slicedToArray(_map3, 2);
                start = _map4[0];
                end = _map4[1];
              }
              return new _selection.Range(start, end - start);
            }
            exports2.expandConfig = expandConfig;
            exports2.overload = overload;
            exports2.default = Quill2;
          },
          /* 6 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", {
              value: true
            });
            var _createClass = function() {
              function defineProperties(target, props) {
                for (var i3 = 0; i3 < props.length; i3++) {
                  var descriptor = props[i3];
                  descriptor.enumerable = descriptor.enumerable || false;
                  descriptor.configurable = true;
                  if ("value" in descriptor)
                    descriptor.writable = true;
                  Object.defineProperty(target, descriptor.key, descriptor);
                }
              }
              return function(Constructor, protoProps, staticProps) {
                if (protoProps)
                  defineProperties(Constructor.prototype, protoProps);
                if (staticProps)
                  defineProperties(Constructor, staticProps);
                return Constructor;
              };
            }();
            var _get = function get(object, property, receiver) {
              if (object === null)
                object = Function.prototype;
              var desc = Object.getOwnPropertyDescriptor(object, property);
              if (desc === void 0) {
                var parent = Object.getPrototypeOf(object);
                if (parent === null) {
                  return void 0;
                } else {
                  return get(parent, property, receiver);
                }
              } else if ("value" in desc) {
                return desc.value;
              } else {
                var getter = desc.get;
                if (getter === void 0) {
                  return void 0;
                }
                return getter.call(receiver);
              }
            };
            var _text = __webpack_require__(7);
            var _text2 = _interopRequireDefault(_text);
            var _parchment = __webpack_require__(0);
            var _parchment2 = _interopRequireDefault(_parchment);
            function _interopRequireDefault(obj) {
              return obj && obj.__esModule ? obj : { default: obj };
            }
            function _classCallCheck2(instance, Constructor) {
              if (!(instance instanceof Constructor)) {
                throw new TypeError("Cannot call a class as a function");
              }
            }
            function _possibleConstructorReturn(self2, call4) {
              if (!self2) {
                throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
              }
              return call4 && (typeof call4 === "object" || typeof call4 === "function") ? call4 : self2;
            }
            function _inherits(subClass, superClass) {
              if (typeof superClass !== "function" && superClass !== null) {
                throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
              }
              subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
              if (superClass)
                Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
            }
            var Inline = function(_Parchment$Inline) {
              _inherits(Inline2, _Parchment$Inline);
              function Inline2() {
                _classCallCheck2(this, Inline2);
                return _possibleConstructorReturn(this, (Inline2.__proto__ || Object.getPrototypeOf(Inline2)).apply(this, arguments));
              }
              _createClass(Inline2, [{
                key: "formatAt",
                value: function formatAt(index3, length2, name, value) {
                  if (Inline2.compare(this.statics.blotName, name) < 0 && _parchment2.default.query(name, _parchment2.default.Scope.BLOT)) {
                    var blot = this.isolate(index3, length2);
                    if (value) {
                      blot.wrap(name, value);
                    }
                  } else {
                    _get(Inline2.prototype.__proto__ || Object.getPrototypeOf(Inline2.prototype), "formatAt", this).call(this, index3, length2, name, value);
                  }
                }
              }, {
                key: "optimize",
                value: function optimize(context) {
                  _get(Inline2.prototype.__proto__ || Object.getPrototypeOf(Inline2.prototype), "optimize", this).call(this, context);
                  if (this.parent instanceof Inline2 && Inline2.compare(this.statics.blotName, this.parent.statics.blotName) > 0) {
                    var parent = this.parent.isolate(this.offset(), this.length());
                    this.moveChildren(parent);
                    parent.wrap(this);
                  }
                }
              }], [{
                key: "compare",
                value: function compare(self2, other) {
                  var selfIndex = Inline2.order.indexOf(self2);
                  var otherIndex = Inline2.order.indexOf(other);
                  if (selfIndex >= 0 || otherIndex >= 0) {
                    return selfIndex - otherIndex;
                  } else if (self2 === other) {
                    return 0;
                  } else if (self2 < other) {
                    return -1;
                  } else {
                    return 1;
                  }
                }
              }]);
              return Inline2;
            }(_parchment2.default.Inline);
            Inline.allowedChildren = [Inline, _parchment2.default.Embed, _text2.default];
            Inline.order = [
              "cursor",
              "inline",
              // Must be lower
              "underline",
              "strike",
              "italic",
              "bold",
              "script",
              "link",
              "code"
              // Must be higher
            ];
            exports2.default = Inline;
          },
          /* 7 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", {
              value: true
            });
            var _parchment = __webpack_require__(0);
            var _parchment2 = _interopRequireDefault(_parchment);
            function _interopRequireDefault(obj) {
              return obj && obj.__esModule ? obj : { default: obj };
            }
            function _classCallCheck2(instance, Constructor) {
              if (!(instance instanceof Constructor)) {
                throw new TypeError("Cannot call a class as a function");
              }
            }
            function _possibleConstructorReturn(self2, call4) {
              if (!self2) {
                throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
              }
              return call4 && (typeof call4 === "object" || typeof call4 === "function") ? call4 : self2;
            }
            function _inherits(subClass, superClass) {
              if (typeof superClass !== "function" && superClass !== null) {
                throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
              }
              subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
              if (superClass)
                Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
            }
            var TextBlot = function(_Parchment$Text) {
              _inherits(TextBlot2, _Parchment$Text);
              function TextBlot2() {
                _classCallCheck2(this, TextBlot2);
                return _possibleConstructorReturn(this, (TextBlot2.__proto__ || Object.getPrototypeOf(TextBlot2)).apply(this, arguments));
              }
              return TextBlot2;
            }(_parchment2.default.Text);
            exports2.default = TextBlot;
          },
          /* 8 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", {
              value: true
            });
            var _createClass = function() {
              function defineProperties(target, props) {
                for (var i3 = 0; i3 < props.length; i3++) {
                  var descriptor = props[i3];
                  descriptor.enumerable = descriptor.enumerable || false;
                  descriptor.configurable = true;
                  if ("value" in descriptor)
                    descriptor.writable = true;
                  Object.defineProperty(target, descriptor.key, descriptor);
                }
              }
              return function(Constructor, protoProps, staticProps) {
                if (protoProps)
                  defineProperties(Constructor.prototype, protoProps);
                if (staticProps)
                  defineProperties(Constructor, staticProps);
                return Constructor;
              };
            }();
            var _get = function get(object, property, receiver) {
              if (object === null)
                object = Function.prototype;
              var desc = Object.getOwnPropertyDescriptor(object, property);
              if (desc === void 0) {
                var parent = Object.getPrototypeOf(object);
                if (parent === null) {
                  return void 0;
                } else {
                  return get(parent, property, receiver);
                }
              } else if ("value" in desc) {
                return desc.value;
              } else {
                var getter = desc.get;
                if (getter === void 0) {
                  return void 0;
                }
                return getter.call(receiver);
              }
            };
            var _eventemitter = __webpack_require__(54);
            var _eventemitter2 = _interopRequireDefault(_eventemitter);
            var _logger = __webpack_require__(10);
            var _logger2 = _interopRequireDefault(_logger);
            function _interopRequireDefault(obj) {
              return obj && obj.__esModule ? obj : { default: obj };
            }
            function _classCallCheck2(instance, Constructor) {
              if (!(instance instanceof Constructor)) {
                throw new TypeError("Cannot call a class as a function");
              }
            }
            function _possibleConstructorReturn(self2, call4) {
              if (!self2) {
                throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
              }
              return call4 && (typeof call4 === "object" || typeof call4 === "function") ? call4 : self2;
            }
            function _inherits(subClass, superClass) {
              if (typeof superClass !== "function" && superClass !== null) {
                throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
              }
              subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
              if (superClass)
                Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
            }
            var debug = (0, _logger2.default)("quill:events");
            var EVENTS = ["selectionchange", "mousedown", "mouseup", "click"];
            EVENTS.forEach(function(eventName) {
              document.addEventListener(eventName, function() {
                for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
                  args[_key] = arguments[_key];
                }
                [].slice.call(document.querySelectorAll(".ql-container")).forEach(function(node3) {
                  if (node3.__quill && node3.__quill.emitter) {
                    var _node$__quill$emitter;
                    (_node$__quill$emitter = node3.__quill.emitter).handleDOM.apply(_node$__quill$emitter, args);
                  }
                });
              });
            });
            var Emitter = function(_EventEmitter) {
              _inherits(Emitter2, _EventEmitter);
              function Emitter2() {
                _classCallCheck2(this, Emitter2);
                var _this = _possibleConstructorReturn(this, (Emitter2.__proto__ || Object.getPrototypeOf(Emitter2)).call(this));
                _this.listeners = {};
                _this.on("error", debug.error);
                return _this;
              }
              _createClass(Emitter2, [{
                key: "emit",
                value: function emit() {
                  debug.log.apply(debug, arguments);
                  _get(Emitter2.prototype.__proto__ || Object.getPrototypeOf(Emitter2.prototype), "emit", this).apply(this, arguments);
                }
              }, {
                key: "handleDOM",
                value: function handleDOM(event) {
                  for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
                    args[_key2 - 1] = arguments[_key2];
                  }
                  (this.listeners[event.type] || []).forEach(function(_ref) {
                    var node3 = _ref.node, handler = _ref.handler;
                    if (event.target === node3 || node3.contains(event.target)) {
                      handler.apply(void 0, [event].concat(args));
                    }
                  });
                }
              }, {
                key: "listenDOM",
                value: function listenDOM(eventName, node3, handler) {
                  if (!this.listeners[eventName]) {
                    this.listeners[eventName] = [];
                  }
                  this.listeners[eventName].push({ node: node3, handler });
                }
              }]);
              return Emitter2;
            }(_eventemitter2.default);
            Emitter.events = {
              EDITOR_CHANGE: "editor-change",
              SCROLL_BEFORE_UPDATE: "scroll-before-update",
              SCROLL_OPTIMIZE: "scroll-optimize",
              SCROLL_UPDATE: "scroll-update",
              SELECTION_CHANGE: "selection-change",
              TEXT_CHANGE: "text-change"
            };
            Emitter.sources = {
              API: "api",
              SILENT: "silent",
              USER: "user"
            };
            exports2.default = Emitter;
          },
          /* 9 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", {
              value: true
            });
            function _classCallCheck2(instance, Constructor) {
              if (!(instance instanceof Constructor)) {
                throw new TypeError("Cannot call a class as a function");
              }
            }
            var Module = function Module2(quill) {
              var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
              _classCallCheck2(this, Module2);
              this.quill = quill;
              this.options = options;
            };
            Module.DEFAULTS = {};
            exports2.default = Module;
          },
          /* 10 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", {
              value: true
            });
            var levels = ["error", "warn", "log", "info"];
            var level = "warn";
            function debug(method) {
              if (levels.indexOf(method) <= levels.indexOf(level)) {
                var _console;
                for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
                  args[_key - 1] = arguments[_key];
                }
                (_console = console)[method].apply(_console, args);
              }
            }
            function namespace(ns) {
              return levels.reduce(function(logger, method) {
                logger[method] = debug.bind(console, method, ns);
                return logger;
              }, {});
            }
            debug.level = namespace.level = function(newLevel) {
              level = newLevel;
            };
            exports2.default = namespace;
          },
          /* 11 */
          /***/
          function(module2, exports2, __webpack_require__) {
            var pSlice = Array.prototype.slice;
            var objectKeys = __webpack_require__(52);
            var isArguments = __webpack_require__(53);
            var deepEqual = module2.exports = function(actual, expected, opts) {
              if (!opts)
                opts = {};
              if (actual === expected) {
                return true;
              } else if (actual instanceof Date && expected instanceof Date) {
                return actual.getTime() === expected.getTime();
              } else if (!actual || !expected || typeof actual != "object" && typeof expected != "object") {
                return opts.strict ? actual === expected : actual == expected;
              } else {
                return objEquiv(actual, expected, opts);
              }
            };
            function isUndefinedOrNull(value) {
              return value === null || value === void 0;
            }
            function isBuffer(x3) {
              if (!x3 || typeof x3 !== "object" || typeof x3.length !== "number")
                return false;
              if (typeof x3.copy !== "function" || typeof x3.slice !== "function") {
                return false;
              }
              if (x3.length > 0 && typeof x3[0] !== "number")
                return false;
              return true;
            }
            function objEquiv(a3, b2, opts) {
              var i3, key;
              if (isUndefinedOrNull(a3) || isUndefinedOrNull(b2))
                return false;
              if (a3.prototype !== b2.prototype)
                return false;
              if (isArguments(a3)) {
                if (!isArguments(b2)) {
                  return false;
                }
                a3 = pSlice.call(a3);
                b2 = pSlice.call(b2);
                return deepEqual(a3, b2, opts);
              }
              if (isBuffer(a3)) {
                if (!isBuffer(b2)) {
                  return false;
                }
                if (a3.length !== b2.length)
                  return false;
                for (i3 = 0; i3 < a3.length; i3++) {
                  if (a3[i3] !== b2[i3])
                    return false;
                }
                return true;
              }
              try {
                var ka = objectKeys(a3), kb = objectKeys(b2);
              } catch (e2) {
                return false;
              }
              if (ka.length != kb.length)
                return false;
              ka.sort();
              kb.sort();
              for (i3 = ka.length - 1; i3 >= 0; i3--) {
                if (ka[i3] != kb[i3])
                  return false;
              }
              for (i3 = ka.length - 1; i3 >= 0; i3--) {
                key = ka[i3];
                if (!deepEqual(a3[key], b2[key], opts))
                  return false;
              }
              return typeof a3 === typeof b2;
            }
          },
          /* 12 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", { value: true });
            var Registry = __webpack_require__(1);
            var Attributor = (
              /** @class */
              function() {
                function Attributor2(attrName, keyName, options) {
                  if (options === void 0) {
                    options = {};
                  }
                  this.attrName = attrName;
                  this.keyName = keyName;
                  var attributeBit = Registry.Scope.TYPE & Registry.Scope.ATTRIBUTE;
                  if (options.scope != null) {
                    this.scope = options.scope & Registry.Scope.LEVEL | attributeBit;
                  } else {
                    this.scope = Registry.Scope.ATTRIBUTE;
                  }
                  if (options.whitelist != null)
                    this.whitelist = options.whitelist;
                }
                Attributor2.keys = function(node3) {
                  return [].map.call(node3.attributes, function(item) {
                    return item.name;
                  });
                };
                Attributor2.prototype.add = function(node3, value) {
                  if (!this.canAdd(node3, value))
                    return false;
                  node3.setAttribute(this.keyName, value);
                  return true;
                };
                Attributor2.prototype.canAdd = function(node3, value) {
                  var match = Registry.query(node3, Registry.Scope.BLOT & (this.scope | Registry.Scope.TYPE));
                  if (match == null)
                    return false;
                  if (this.whitelist == null)
                    return true;
                  if (typeof value === "string") {
                    return this.whitelist.indexOf(value.replace(/["']/g, "")) > -1;
                  } else {
                    return this.whitelist.indexOf(value) > -1;
                  }
                };
                Attributor2.prototype.remove = function(node3) {
                  node3.removeAttribute(this.keyName);
                };
                Attributor2.prototype.value = function(node3) {
                  var value = node3.getAttribute(this.keyName);
                  if (this.canAdd(node3, value) && value) {
                    return value;
                  }
                  return "";
                };
                return Attributor2;
              }()
            );
            exports2.default = Attributor;
          },
          /* 13 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", {
              value: true
            });
            exports2.default = exports2.Code = void 0;
            var _slicedToArray = function() {
              function sliceIterator(arr, i3) {
                var _arr = [];
                var _n = true;
                var _d = false;
                var _e = void 0;
                try {
                  for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
                    _arr.push(_s.value);
                    if (i3 && _arr.length === i3)
                      break;
                  }
                } catch (err) {
                  _d = true;
                  _e = err;
                } finally {
                  try {
                    if (!_n && _i["return"])
                      _i["return"]();
                  } finally {
                    if (_d)
                      throw _e;
                  }
                }
                return _arr;
              }
              return function(arr, i3) {
                if (Array.isArray(arr)) {
                  return arr;
                } else if (Symbol.iterator in Object(arr)) {
                  return sliceIterator(arr, i3);
                } else {
                  throw new TypeError("Invalid attempt to destructure non-iterable instance");
                }
              };
            }();
            var _createClass = function() {
              function defineProperties(target, props) {
                for (var i3 = 0; i3 < props.length; i3++) {
                  var descriptor = props[i3];
                  descriptor.enumerable = descriptor.enumerable || false;
                  descriptor.configurable = true;
                  if ("value" in descriptor)
                    descriptor.writable = true;
                  Object.defineProperty(target, descriptor.key, descriptor);
                }
              }
              return function(Constructor, protoProps, staticProps) {
                if (protoProps)
                  defineProperties(Constructor.prototype, protoProps);
                if (staticProps)
                  defineProperties(Constructor, staticProps);
                return Constructor;
              };
            }();
            var _get = function get(object, property, receiver) {
              if (object === null)
                object = Function.prototype;
              var desc = Object.getOwnPropertyDescriptor(object, property);
              if (desc === void 0) {
                var parent = Object.getPrototypeOf(object);
                if (parent === null) {
                  return void 0;
                } else {
                  return get(parent, property, receiver);
                }
              } else if ("value" in desc) {
                return desc.value;
              } else {
                var getter = desc.get;
                if (getter === void 0) {
                  return void 0;
                }
                return getter.call(receiver);
              }
            };
            var _quillDelta = __webpack_require__(2);
            var _quillDelta2 = _interopRequireDefault(_quillDelta);
            var _parchment = __webpack_require__(0);
            var _parchment2 = _interopRequireDefault(_parchment);
            var _block = __webpack_require__(4);
            var _block2 = _interopRequireDefault(_block);
            var _inline = __webpack_require__(6);
            var _inline2 = _interopRequireDefault(_inline);
            var _text = __webpack_require__(7);
            var _text2 = _interopRequireDefault(_text);
            function _interopRequireDefault(obj) {
              return obj && obj.__esModule ? obj : { default: obj };
            }
            function _classCallCheck2(instance, Constructor) {
              if (!(instance instanceof Constructor)) {
                throw new TypeError("Cannot call a class as a function");
              }
            }
            function _possibleConstructorReturn(self2, call4) {
              if (!self2) {
                throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
              }
              return call4 && (typeof call4 === "object" || typeof call4 === "function") ? call4 : self2;
            }
            function _inherits(subClass, superClass) {
              if (typeof superClass !== "function" && superClass !== null) {
                throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
              }
              subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
              if (superClass)
                Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
            }
            var Code = function(_Inline) {
              _inherits(Code2, _Inline);
              function Code2() {
                _classCallCheck2(this, Code2);
                return _possibleConstructorReturn(this, (Code2.__proto__ || Object.getPrototypeOf(Code2)).apply(this, arguments));
              }
              return Code2;
            }(_inline2.default);
            Code.blotName = "code";
            Code.tagName = "CODE";
            var CodeBlock = function(_Block) {
              _inherits(CodeBlock2, _Block);
              function CodeBlock2() {
                _classCallCheck2(this, CodeBlock2);
                return _possibleConstructorReturn(this, (CodeBlock2.__proto__ || Object.getPrototypeOf(CodeBlock2)).apply(this, arguments));
              }
              _createClass(CodeBlock2, [{
                key: "delta",
                value: function delta() {
                  var _this3 = this;
                  var text3 = this.domNode.textContent;
                  if (text3.endsWith("\n")) {
                    text3 = text3.slice(0, -1);
                  }
                  return text3.split("\n").reduce(function(delta2, frag) {
                    return delta2.insert(frag).insert("\n", _this3.formats());
                  }, new _quillDelta2.default());
                }
              }, {
                key: "format",
                value: function format(name, value) {
                  if (name === this.statics.blotName && value)
                    return;
                  var _descendant = this.descendant(_text2.default, this.length() - 1), _descendant2 = _slicedToArray(_descendant, 1), text3 = _descendant2[0];
                  if (text3 != null) {
                    text3.deleteAt(text3.length() - 1, 1);
                  }
                  _get(CodeBlock2.prototype.__proto__ || Object.getPrototypeOf(CodeBlock2.prototype), "format", this).call(this, name, value);
                }
              }, {
                key: "formatAt",
                value: function formatAt(index3, length2, name, value) {
                  if (length2 === 0)
                    return;
                  if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK) == null || name === this.statics.blotName && value === this.statics.formats(this.domNode)) {
                    return;
                  }
                  var nextNewline = this.newlineIndex(index3);
                  if (nextNewline < 0 || nextNewline >= index3 + length2)
                    return;
                  var prevNewline = this.newlineIndex(index3, true) + 1;
                  var isolateLength = nextNewline - prevNewline + 1;
                  var blot = this.isolate(prevNewline, isolateLength);
                  var next2 = blot.next;
                  blot.format(name, value);
                  if (next2 instanceof CodeBlock2) {
                    next2.formatAt(0, index3 - prevNewline + length2 - isolateLength, name, value);
                  }
                }
              }, {
                key: "insertAt",
                value: function insertAt(index3, value, def) {
                  if (def != null)
                    return;
                  var _descendant3 = this.descendant(_text2.default, index3), _descendant4 = _slicedToArray(_descendant3, 2), text3 = _descendant4[0], offset = _descendant4[1];
                  text3.insertAt(offset, value);
                }
              }, {
                key: "length",
                value: function length2() {
                  var length3 = this.domNode.textContent.length;
                  if (!this.domNode.textContent.endsWith("\n")) {
                    return length3 + 1;
                  }
                  return length3;
                }
              }, {
                key: "newlineIndex",
                value: function newlineIndex(searchIndex) {
                  var reverse2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
                  if (!reverse2) {
                    var offset = this.domNode.textContent.slice(searchIndex).indexOf("\n");
                    return offset > -1 ? searchIndex + offset : -1;
                  } else {
                    return this.domNode.textContent.slice(0, searchIndex).lastIndexOf("\n");
                  }
                }
              }, {
                key: "optimize",
                value: function optimize(context) {
                  if (!this.domNode.textContent.endsWith("\n")) {
                    this.appendChild(_parchment2.default.create("text", "\n"));
                  }
                  _get(CodeBlock2.prototype.__proto__ || Object.getPrototypeOf(CodeBlock2.prototype), "optimize", this).call(this, context);
                  var next2 = this.next;
                  if (next2 != null && next2.prev === this && next2.statics.blotName === this.statics.blotName && this.statics.formats(this.domNode) === next2.statics.formats(next2.domNode)) {
                    next2.optimize(context);
                    next2.moveChildren(this);
                    next2.remove();
                  }
                }
              }, {
                key: "replace",
                value: function replace(target) {
                  _get(CodeBlock2.prototype.__proto__ || Object.getPrototypeOf(CodeBlock2.prototype), "replace", this).call(this, target);
                  [].slice.call(this.domNode.querySelectorAll("*")).forEach(function(node3) {
                    var blot = _parchment2.default.find(node3);
                    if (blot == null) {
                      node3.parentNode.removeChild(node3);
                    } else if (blot instanceof _parchment2.default.Embed) {
                      blot.remove();
                    } else {
                      blot.unwrap();
                    }
                  });
                }
              }], [{
                key: "create",
                value: function create2(value) {
                  var domNode = _get(CodeBlock2.__proto__ || Object.getPrototypeOf(CodeBlock2), "create", this).call(this, value);
                  domNode.setAttribute("spellcheck", false);
                  return domNode;
                }
              }, {
                key: "formats",
                value: function formats() {
                  return true;
                }
              }]);
              return CodeBlock2;
            }(_block2.default);
            CodeBlock.blotName = "code-block";
            CodeBlock.tagName = "PRE";
            CodeBlock.TAB = "  ";
            exports2.Code = Code;
            exports2.default = CodeBlock;
          },
          /* 14 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", {
              value: true
            });
            var _typeof3 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) {
              return typeof obj;
            } : function(obj) {
              return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
            };
            var _slicedToArray = function() {
              function sliceIterator(arr, i3) {
                var _arr = [];
                var _n = true;
                var _d = false;
                var _e = void 0;
                try {
                  for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
                    _arr.push(_s.value);
                    if (i3 && _arr.length === i3)
                      break;
                  }
                } catch (err) {
                  _d = true;
                  _e = err;
                } finally {
                  try {
                    if (!_n && _i["return"])
                      _i["return"]();
                  } finally {
                    if (_d)
                      throw _e;
                  }
                }
                return _arr;
              }
              return function(arr, i3) {
                if (Array.isArray(arr)) {
                  return arr;
                } else if (Symbol.iterator in Object(arr)) {
                  return sliceIterator(arr, i3);
                } else {
                  throw new TypeError("Invalid attempt to destructure non-iterable instance");
                }
              };
            }();
            var _createClass = function() {
              function defineProperties(target, props) {
                for (var i3 = 0; i3 < props.length; i3++) {
                  var descriptor = props[i3];
                  descriptor.enumerable = descriptor.enumerable || false;
                  descriptor.configurable = true;
                  if ("value" in descriptor)
                    descriptor.writable = true;
                  Object.defineProperty(target, descriptor.key, descriptor);
                }
              }
              return function(Constructor, protoProps, staticProps) {
                if (protoProps)
                  defineProperties(Constructor.prototype, protoProps);
                if (staticProps)
                  defineProperties(Constructor, staticProps);
                return Constructor;
              };
            }();
            var _quillDelta = __webpack_require__(2);
            var _quillDelta2 = _interopRequireDefault(_quillDelta);
            var _op = __webpack_require__(20);
            var _op2 = _interopRequireDefault(_op);
            var _parchment = __webpack_require__(0);
            var _parchment2 = _interopRequireDefault(_parchment);
            var _code = __webpack_require__(13);
            var _code2 = _interopRequireDefault(_code);
            var _cursor = __webpack_require__(24);
            var _cursor2 = _interopRequireDefault(_cursor);
            var _block = __webpack_require__(4);
            var _block2 = _interopRequireDefault(_block);
            var _break = __webpack_require__(16);
            var _break2 = _interopRequireDefault(_break);
            var _clone = __webpack_require__(21);
            var _clone2 = _interopRequireDefault(_clone);
            var _deepEqual = __webpack_require__(11);
            var _deepEqual2 = _interopRequireDefault(_deepEqual);
            var _extend = __webpack_require__(3);
            var _extend2 = _interopRequireDefault(_extend);
            function _interopRequireDefault(obj) {
              return obj && obj.__esModule ? obj : { default: obj };
            }
            function _defineProperty2(obj, key, value) {
              if (key in obj) {
                Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
              } else {
                obj[key] = value;
              }
              return obj;
            }
            function _classCallCheck2(instance, Constructor) {
              if (!(instance instanceof Constructor)) {
                throw new TypeError("Cannot call a class as a function");
              }
            }
            var ASCII = /^[ -~]*$/;
            var Editor = function() {
              function Editor2(scroll) {
                _classCallCheck2(this, Editor2);
                this.scroll = scroll;
                this.delta = this.getDelta();
              }
              _createClass(Editor2, [{
                key: "applyDelta",
                value: function applyDelta(delta) {
                  var _this = this;
                  var consumeNextNewline = false;
                  this.scroll.update();
                  var scrollLength = this.scroll.length();
                  this.scroll.batchStart();
                  delta = normalizeDelta(delta);
                  delta.reduce(function(index3, op) {
                    var length2 = op.retain || op.delete || op.insert.length || 1;
                    var attributes = op.attributes || {};
                    if (op.insert != null) {
                      if (typeof op.insert === "string") {
                        var text3 = op.insert;
                        if (text3.endsWith("\n") && consumeNextNewline) {
                          consumeNextNewline = false;
                          text3 = text3.slice(0, -1);
                        }
                        if (index3 >= scrollLength && !text3.endsWith("\n")) {
                          consumeNextNewline = true;
                        }
                        _this.scroll.insertAt(index3, text3);
                        var _scroll$line = _this.scroll.line(index3), _scroll$line2 = _slicedToArray(_scroll$line, 2), line = _scroll$line2[0], offset = _scroll$line2[1];
                        var formats = (0, _extend2.default)({}, (0, _block.bubbleFormats)(line));
                        if (line instanceof _block2.default) {
                          var _line$descendant = line.descendant(_parchment2.default.Leaf, offset), _line$descendant2 = _slicedToArray(_line$descendant, 1), leaf = _line$descendant2[0];
                          formats = (0, _extend2.default)(formats, (0, _block.bubbleFormats)(leaf));
                        }
                        attributes = _op2.default.attributes.diff(formats, attributes) || {};
                      } else if (_typeof3(op.insert) === "object") {
                        var key = Object.keys(op.insert)[0];
                        if (key == null)
                          return index3;
                        _this.scroll.insertAt(index3, key, op.insert[key]);
                      }
                      scrollLength += length2;
                    }
                    Object.keys(attributes).forEach(function(name) {
                      _this.scroll.formatAt(index3, length2, name, attributes[name]);
                    });
                    return index3 + length2;
                  }, 0);
                  delta.reduce(function(index3, op) {
                    if (typeof op.delete === "number") {
                      _this.scroll.deleteAt(index3, op.delete);
                      return index3;
                    }
                    return index3 + (op.retain || op.insert.length || 1);
                  }, 0);
                  this.scroll.batchEnd();
                  return this.update(delta);
                }
              }, {
                key: "deleteText",
                value: function deleteText(index3, length2) {
                  this.scroll.deleteAt(index3, length2);
                  return this.update(new _quillDelta2.default().retain(index3).delete(length2));
                }
              }, {
                key: "formatLine",
                value: function formatLine(index3, length2) {
                  var _this2 = this;
                  var formats = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
                  this.scroll.update();
                  Object.keys(formats).forEach(function(format) {
                    if (_this2.scroll.whitelist != null && !_this2.scroll.whitelist[format])
                      return;
                    var lines = _this2.scroll.lines(index3, Math.max(length2, 1));
                    var lengthRemaining = length2;
                    lines.forEach(function(line) {
                      var lineLength = line.length();
                      if (!(line instanceof _code2.default)) {
                        line.format(format, formats[format]);
                      } else {
                        var codeIndex = index3 - line.offset(_this2.scroll);
                        var codeLength = line.newlineIndex(codeIndex + lengthRemaining) - codeIndex + 1;
                        line.formatAt(codeIndex, codeLength, format, formats[format]);
                      }
                      lengthRemaining -= lineLength;
                    });
                  });
                  this.scroll.optimize();
                  return this.update(new _quillDelta2.default().retain(index3).retain(length2, (0, _clone2.default)(formats)));
                }
              }, {
                key: "formatText",
                value: function formatText(index3, length2) {
                  var _this3 = this;
                  var formats = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
                  Object.keys(formats).forEach(function(format) {
                    _this3.scroll.formatAt(index3, length2, format, formats[format]);
                  });
                  return this.update(new _quillDelta2.default().retain(index3).retain(length2, (0, _clone2.default)(formats)));
                }
              }, {
                key: "getContents",
                value: function getContents(index3, length2) {
                  return this.delta.slice(index3, index3 + length2);
                }
              }, {
                key: "getDelta",
                value: function getDelta() {
                  return this.scroll.lines().reduce(function(delta, line) {
                    return delta.concat(line.delta());
                  }, new _quillDelta2.default());
                }
              }, {
                key: "getFormat",
                value: function getFormat(index3) {
                  var length2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
                  var lines = [], leaves = [];
                  if (length2 === 0) {
                    this.scroll.path(index3).forEach(function(path) {
                      var _path = _slicedToArray(path, 1), blot = _path[0];
                      if (blot instanceof _block2.default) {
                        lines.push(blot);
                      } else if (blot instanceof _parchment2.default.Leaf) {
                        leaves.push(blot);
                      }
                    });
                  } else {
                    lines = this.scroll.lines(index3, length2);
                    leaves = this.scroll.descendants(_parchment2.default.Leaf, index3, length2);
                  }
                  var formatsArr = [lines, leaves].map(function(blots) {
                    if (blots.length === 0)
                      return {};
                    var formats = (0, _block.bubbleFormats)(blots.shift());
                    while (Object.keys(formats).length > 0) {
                      var blot = blots.shift();
                      if (blot == null)
                        return formats;
                      formats = combineFormats((0, _block.bubbleFormats)(blot), formats);
                    }
                    return formats;
                  });
                  return _extend2.default.apply(_extend2.default, formatsArr);
                }
              }, {
                key: "getText",
                value: function getText3(index3, length2) {
                  return this.getContents(index3, length2).filter(function(op) {
                    return typeof op.insert === "string";
                  }).map(function(op) {
                    return op.insert;
                  }).join("");
                }
              }, {
                key: "insertEmbed",
                value: function insertEmbed(index3, embed, value) {
                  this.scroll.insertAt(index3, embed, value);
                  return this.update(new _quillDelta2.default().retain(index3).insert(_defineProperty2({}, embed, value)));
                }
              }, {
                key: "insertText",
                value: function insertText(index3, text3) {
                  var _this4 = this;
                  var formats = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
                  text3 = text3.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
                  this.scroll.insertAt(index3, text3);
                  Object.keys(formats).forEach(function(format) {
                    _this4.scroll.formatAt(index3, text3.length, format, formats[format]);
                  });
                  return this.update(new _quillDelta2.default().retain(index3).insert(text3, (0, _clone2.default)(formats)));
                }
              }, {
                key: "isBlank",
                value: function isBlank2() {
                  if (this.scroll.children.length == 0)
                    return true;
                  if (this.scroll.children.length > 1)
                    return false;
                  var block = this.scroll.children.head;
                  if (block.statics.blotName !== _block2.default.blotName)
                    return false;
                  if (block.children.length > 1)
                    return false;
                  return block.children.head instanceof _break2.default;
                }
              }, {
                key: "removeFormat",
                value: function removeFormat(index3, length2) {
                  var text3 = this.getText(index3, length2);
                  var _scroll$line3 = this.scroll.line(index3 + length2), _scroll$line4 = _slicedToArray(_scroll$line3, 2), line = _scroll$line4[0], offset = _scroll$line4[1];
                  var suffixLength = 0, suffix = new _quillDelta2.default();
                  if (line != null) {
                    if (!(line instanceof _code2.default)) {
                      suffixLength = line.length() - offset;
                    } else {
                      suffixLength = line.newlineIndex(offset) - offset + 1;
                    }
                    suffix = line.delta().slice(offset, offset + suffixLength - 1).insert("\n");
                  }
                  var contents = this.getContents(index3, length2 + suffixLength);
                  var diff = contents.diff(new _quillDelta2.default().insert(text3).concat(suffix));
                  var delta = new _quillDelta2.default().retain(index3).concat(diff);
                  return this.applyDelta(delta);
                }
              }, {
                key: "update",
                value: function update(change) {
                  var mutations = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
                  var cursorIndex = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : void 0;
                  var oldDelta = this.delta;
                  if (mutations.length === 1 && mutations[0].type === "characterData" && mutations[0].target.data.match(ASCII) && _parchment2.default.find(mutations[0].target)) {
                    var textBlot = _parchment2.default.find(mutations[0].target);
                    var formats = (0, _block.bubbleFormats)(textBlot);
                    var index3 = textBlot.offset(this.scroll);
                    var oldValue = mutations[0].oldValue.replace(_cursor2.default.CONTENTS, "");
                    var oldText = new _quillDelta2.default().insert(oldValue);
                    var newText = new _quillDelta2.default().insert(textBlot.value());
                    var diffDelta = new _quillDelta2.default().retain(index3).concat(oldText.diff(newText, cursorIndex));
                    change = diffDelta.reduce(function(delta, op) {
                      if (op.insert) {
                        return delta.insert(op.insert, formats);
                      } else {
                        return delta.push(op);
                      }
                    }, new _quillDelta2.default());
                    this.delta = oldDelta.compose(change);
                  } else {
                    this.delta = this.getDelta();
                    if (!change || !(0, _deepEqual2.default)(oldDelta.compose(change), this.delta)) {
                      change = oldDelta.diff(this.delta, cursorIndex);
                    }
                  }
                  return change;
                }
              }]);
              return Editor2;
            }();
            function combineFormats(formats, combined) {
              return Object.keys(combined).reduce(function(merged, name) {
                if (formats[name] == null)
                  return merged;
                if (combined[name] === formats[name]) {
                  merged[name] = combined[name];
                } else if (Array.isArray(combined[name])) {
                  if (combined[name].indexOf(formats[name]) < 0) {
                    merged[name] = combined[name].concat([formats[name]]);
                  }
                } else {
                  merged[name] = [combined[name], formats[name]];
                }
                return merged;
              }, {});
            }
            function normalizeDelta(delta) {
              return delta.reduce(function(delta2, op) {
                if (op.insert === 1) {
                  var attributes = (0, _clone2.default)(op.attributes);
                  delete attributes["image"];
                  return delta2.insert({ image: op.attributes.image }, attributes);
                }
                if (op.attributes != null && (op.attributes.list === true || op.attributes.bullet === true)) {
                  op = (0, _clone2.default)(op);
                  if (op.attributes.list) {
                    op.attributes.list = "ordered";
                  } else {
                    op.attributes.list = "bullet";
                    delete op.attributes.bullet;
                  }
                }
                if (typeof op.insert === "string") {
                  var text3 = op.insert.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
                  return delta2.insert(text3, op.attributes);
                }
                return delta2.push(op);
              }, new _quillDelta2.default());
            }
            exports2.default = Editor;
          },
          /* 15 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", {
              value: true
            });
            exports2.default = exports2.Range = void 0;
            var _slicedToArray = function() {
              function sliceIterator(arr, i3) {
                var _arr = [];
                var _n = true;
                var _d = false;
                var _e = void 0;
                try {
                  for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
                    _arr.push(_s.value);
                    if (i3 && _arr.length === i3)
                      break;
                  }
                } catch (err) {
                  _d = true;
                  _e = err;
                } finally {
                  try {
                    if (!_n && _i["return"])
                      _i["return"]();
                  } finally {
                    if (_d)
                      throw _e;
                  }
                }
                return _arr;
              }
              return function(arr, i3) {
                if (Array.isArray(arr)) {
                  return arr;
                } else if (Symbol.iterator in Object(arr)) {
                  return sliceIterator(arr, i3);
                } else {
                  throw new TypeError("Invalid attempt to destructure non-iterable instance");
                }
              };
            }();
            var _createClass = function() {
              function defineProperties(target, props) {
                for (var i3 = 0; i3 < props.length; i3++) {
                  var descriptor = props[i3];
                  descriptor.enumerable = descriptor.enumerable || false;
                  descriptor.configurable = true;
                  if ("value" in descriptor)
                    descriptor.writable = true;
                  Object.defineProperty(target, descriptor.key, descriptor);
                }
              }
              return function(Constructor, protoProps, staticProps) {
                if (protoProps)
                  defineProperties(Constructor.prototype, protoProps);
                if (staticProps)
                  defineProperties(Constructor, staticProps);
                return Constructor;
              };
            }();
            var _parchment = __webpack_require__(0);
            var _parchment2 = _interopRequireDefault(_parchment);
            var _clone = __webpack_require__(21);
            var _clone2 = _interopRequireDefault(_clone);
            var _deepEqual = __webpack_require__(11);
            var _deepEqual2 = _interopRequireDefault(_deepEqual);
            var _emitter3 = __webpack_require__(8);
            var _emitter4 = _interopRequireDefault(_emitter3);
            var _logger = __webpack_require__(10);
            var _logger2 = _interopRequireDefault(_logger);
            function _interopRequireDefault(obj) {
              return obj && obj.__esModule ? obj : { default: obj };
            }
            function _toConsumableArray(arr) {
              if (Array.isArray(arr)) {
                for (var i3 = 0, arr2 = Array(arr.length); i3 < arr.length; i3++) {
                  arr2[i3] = arr[i3];
                }
                return arr2;
              } else {
                return Array.from(arr);
              }
            }
            function _classCallCheck2(instance, Constructor) {
              if (!(instance instanceof Constructor)) {
                throw new TypeError("Cannot call a class as a function");
              }
            }
            var debug = (0, _logger2.default)("quill:selection");
            var Range = function Range2(index3) {
              var length2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
              _classCallCheck2(this, Range2);
              this.index = index3;
              this.length = length2;
            };
            var Selection = function() {
              function Selection2(scroll, emitter) {
                var _this = this;
                _classCallCheck2(this, Selection2);
                this.emitter = emitter;
                this.scroll = scroll;
                this.composing = false;
                this.mouseDown = false;
                this.root = this.scroll.domNode;
                this.cursor = _parchment2.default.create("cursor", this);
                this.lastRange = this.savedRange = new Range(0, 0);
                this.handleComposition();
                this.handleDragging();
                this.emitter.listenDOM("selectionchange", document, function() {
                  if (!_this.mouseDown) {
                    setTimeout(_this.update.bind(_this, _emitter4.default.sources.USER), 1);
                  }
                });
                this.emitter.on(_emitter4.default.events.EDITOR_CHANGE, function(type, delta) {
                  if (type === _emitter4.default.events.TEXT_CHANGE && delta.length() > 0) {
                    _this.update(_emitter4.default.sources.SILENT);
                  }
                });
                this.emitter.on(_emitter4.default.events.SCROLL_BEFORE_UPDATE, function() {
                  if (!_this.hasFocus())
                    return;
                  var native = _this.getNativeRange();
                  if (native == null)
                    return;
                  if (native.start.node === _this.cursor.textNode)
                    return;
                  _this.emitter.once(_emitter4.default.events.SCROLL_UPDATE, function() {
                    try {
                      _this.setNativeRange(native.start.node, native.start.offset, native.end.node, native.end.offset);
                    } catch (ignored) {
                    }
                  });
                });
                this.emitter.on(_emitter4.default.events.SCROLL_OPTIMIZE, function(mutations, context) {
                  if (context.range) {
                    var _context$range = context.range, startNode = _context$range.startNode, startOffset = _context$range.startOffset, endNode = _context$range.endNode, endOffset = _context$range.endOffset;
                    _this.setNativeRange(startNode, startOffset, endNode, endOffset);
                  }
                });
                this.update(_emitter4.default.sources.SILENT);
              }
              _createClass(Selection2, [{
                key: "handleComposition",
                value: function handleComposition() {
                  var _this2 = this;
                  this.root.addEventListener("compositionstart", function() {
                    _this2.composing = true;
                  });
                  this.root.addEventListener("compositionend", function() {
                    _this2.composing = false;
                    if (_this2.cursor.parent) {
                      var range = _this2.cursor.restore();
                      if (!range)
                        return;
                      setTimeout(function() {
                        _this2.setNativeRange(range.startNode, range.startOffset, range.endNode, range.endOffset);
                      }, 1);
                    }
                  });
                }
              }, {
                key: "handleDragging",
                value: function handleDragging() {
                  var _this3 = this;
                  this.emitter.listenDOM("mousedown", document.body, function() {
                    _this3.mouseDown = true;
                  });
                  this.emitter.listenDOM("mouseup", document.body, function() {
                    _this3.mouseDown = false;
                    _this3.update(_emitter4.default.sources.USER);
                  });
                }
              }, {
                key: "focus",
                value: function focus() {
                  if (this.hasFocus())
                    return;
                  this.root.focus();
                  this.setRange(this.savedRange);
                }
              }, {
                key: "format",
                value: function format(_format, value) {
                  if (this.scroll.whitelist != null && !this.scroll.whitelist[_format])
                    return;
                  this.scroll.update();
                  var nativeRange = this.getNativeRange();
                  if (nativeRange == null || !nativeRange.native.collapsed || _parchment2.default.query(_format, _parchment2.default.Scope.BLOCK))
                    return;
                  if (nativeRange.start.node !== this.cursor.textNode) {
                    var blot = _parchment2.default.find(nativeRange.start.node, false);
                    if (blot == null)
                      return;
                    if (blot instanceof _parchment2.default.Leaf) {
                      var after2 = blot.split(nativeRange.start.offset);
                      blot.parent.insertBefore(this.cursor, after2);
                    } else {
                      blot.insertBefore(this.cursor, nativeRange.start.node);
                    }
                    this.cursor.attach();
                  }
                  this.cursor.format(_format, value);
                  this.scroll.optimize();
                  this.setNativeRange(this.cursor.textNode, this.cursor.textNode.data.length);
                  this.update();
                }
              }, {
                key: "getBounds",
                value: function getBounds(index3) {
                  var length2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
                  var scrollLength = this.scroll.length();
                  index3 = Math.min(index3, scrollLength - 1);
                  length2 = Math.min(index3 + length2, scrollLength - 1) - index3;
                  var node3 = void 0, _scroll$leaf = this.scroll.leaf(index3), _scroll$leaf2 = _slicedToArray(_scroll$leaf, 2), leaf = _scroll$leaf2[0], offset = _scroll$leaf2[1];
                  if (leaf == null)
                    return null;
                  var _leaf$position = leaf.position(offset, true);
                  var _leaf$position2 = _slicedToArray(_leaf$position, 2);
                  node3 = _leaf$position2[0];
                  offset = _leaf$position2[1];
                  var range = document.createRange();
                  if (length2 > 0) {
                    range.setStart(node3, offset);
                    var _scroll$leaf3 = this.scroll.leaf(index3 + length2);
                    var _scroll$leaf4 = _slicedToArray(_scroll$leaf3, 2);
                    leaf = _scroll$leaf4[0];
                    offset = _scroll$leaf4[1];
                    if (leaf == null)
                      return null;
                    var _leaf$position3 = leaf.position(offset, true);
                    var _leaf$position4 = _slicedToArray(_leaf$position3, 2);
                    node3 = _leaf$position4[0];
                    offset = _leaf$position4[1];
                    range.setEnd(node3, offset);
                    return range.getBoundingClientRect();
                  } else {
                    var side = "left";
                    var rect = void 0;
                    if (node3 instanceof Text) {
                      if (offset < node3.data.length) {
                        range.setStart(node3, offset);
                        range.setEnd(node3, offset + 1);
                      } else {
                        range.setStart(node3, offset - 1);
                        range.setEnd(node3, offset);
                        side = "right";
                      }
                      rect = range.getBoundingClientRect();
                    } else {
                      rect = leaf.domNode.getBoundingClientRect();
                      if (offset > 0)
                        side = "right";
                    }
                    return {
                      bottom: rect.top + rect.height,
                      height: rect.height,
                      left: rect[side],
                      right: rect[side],
                      top: rect.top,
                      width: 0
                    };
                  }
                }
              }, {
                key: "getNativeRange",
                value: function getNativeRange() {
                  var selection = document.getSelection();
                  if (selection == null || selection.rangeCount <= 0)
                    return null;
                  var nativeRange = selection.getRangeAt(0);
                  if (nativeRange == null)
                    return null;
                  var range = this.normalizeNative(nativeRange);
                  debug.info("getNativeRange", range);
                  return range;
                }
              }, {
                key: "getRange",
                value: function getRange() {
                  var normalized = this.getNativeRange();
                  if (normalized == null)
                    return [null, null];
                  var range = this.normalizedToRange(normalized);
                  return [range, normalized];
                }
              }, {
                key: "hasFocus",
                value: function hasFocus() {
                  return document.activeElement === this.root;
                }
              }, {
                key: "normalizedToRange",
                value: function normalizedToRange(range) {
                  var _this4 = this;
                  var positions = [[range.start.node, range.start.offset]];
                  if (!range.native.collapsed) {
                    positions.push([range.end.node, range.end.offset]);
                  }
                  var indexes = positions.map(function(position3) {
                    var _position = _slicedToArray(position3, 2), node3 = _position[0], offset = _position[1];
                    var blot = _parchment2.default.find(node3, true);
                    var index3 = blot.offset(_this4.scroll);
                    if (offset === 0) {
                      return index3;
                    } else if (blot instanceof _parchment2.default.Container) {
                      return index3 + blot.length();
                    } else {
                      return index3 + blot.index(node3, offset);
                    }
                  });
                  var end = Math.min(Math.max.apply(Math, _toConsumableArray(indexes)), this.scroll.length() - 1);
                  var start = Math.min.apply(Math, [end].concat(_toConsumableArray(indexes)));
                  return new Range(start, end - start);
                }
              }, {
                key: "normalizeNative",
                value: function normalizeNative(nativeRange) {
                  if (!contains(this.root, nativeRange.startContainer) || !nativeRange.collapsed && !contains(this.root, nativeRange.endContainer)) {
                    return null;
                  }
                  var range = {
                    start: { node: nativeRange.startContainer, offset: nativeRange.startOffset },
                    end: { node: nativeRange.endContainer, offset: nativeRange.endOffset },
                    native: nativeRange
                  };
                  [range.start, range.end].forEach(function(position3) {
                    var node3 = position3.node, offset = position3.offset;
                    while (!(node3 instanceof Text) && node3.childNodes.length > 0) {
                      if (node3.childNodes.length > offset) {
                        node3 = node3.childNodes[offset];
                        offset = 0;
                      } else if (node3.childNodes.length === offset) {
                        node3 = node3.lastChild;
                        offset = node3 instanceof Text ? node3.data.length : node3.childNodes.length + 1;
                      } else {
                        break;
                      }
                    }
                    position3.node = node3, position3.offset = offset;
                  });
                  return range;
                }
              }, {
                key: "rangeToNative",
                value: function rangeToNative(range) {
                  var _this5 = this;
                  var indexes = range.collapsed ? [range.index] : [range.index, range.index + range.length];
                  var args = [];
                  var scrollLength = this.scroll.length();
                  indexes.forEach(function(index3, i3) {
                    index3 = Math.min(scrollLength - 1, index3);
                    var node3 = void 0, _scroll$leaf5 = _this5.scroll.leaf(index3), _scroll$leaf6 = _slicedToArray(_scroll$leaf5, 2), leaf = _scroll$leaf6[0], offset = _scroll$leaf6[1];
                    var _leaf$position5 = leaf.position(offset, i3 !== 0);
                    var _leaf$position6 = _slicedToArray(_leaf$position5, 2);
                    node3 = _leaf$position6[0];
                    offset = _leaf$position6[1];
                    args.push(node3, offset);
                  });
                  if (args.length < 2) {
                    args = args.concat(args);
                  }
                  return args;
                }
              }, {
                key: "scrollIntoView",
                value: function scrollIntoView(scrollingContainer) {
                  var range = this.lastRange;
                  if (range == null)
                    return;
                  var bounds = this.getBounds(range.index, range.length);
                  if (bounds == null)
                    return;
                  var limit = this.scroll.length() - 1;
                  var _scroll$line = this.scroll.line(Math.min(range.index, limit)), _scroll$line2 = _slicedToArray(_scroll$line, 1), first = _scroll$line2[0];
                  var last = first;
                  if (range.length > 0) {
                    var _scroll$line3 = this.scroll.line(Math.min(range.index + range.length, limit));
                    var _scroll$line4 = _slicedToArray(_scroll$line3, 1);
                    last = _scroll$line4[0];
                  }
                  if (first == null || last == null)
                    return;
                  var scrollBounds = scrollingContainer.getBoundingClientRect();
                  if (bounds.top < scrollBounds.top) {
                    scrollingContainer.scrollTop -= scrollBounds.top - bounds.top;
                  } else if (bounds.bottom > scrollBounds.bottom) {
                    scrollingContainer.scrollTop += bounds.bottom - scrollBounds.bottom;
                  }
                }
              }, {
                key: "setNativeRange",
                value: function setNativeRange(startNode, startOffset) {
                  var endNode = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : startNode;
                  var endOffset = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : startOffset;
                  var force = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : false;
                  debug.info("setNativeRange", startNode, startOffset, endNode, endOffset);
                  if (startNode != null && (this.root.parentNode == null || startNode.parentNode == null || endNode.parentNode == null)) {
                    return;
                  }
                  var selection = document.getSelection();
                  if (selection == null)
                    return;
                  if (startNode != null) {
                    if (!this.hasFocus())
                      this.root.focus();
                    var native = (this.getNativeRange() || {}).native;
                    if (native == null || force || startNode !== native.startContainer || startOffset !== native.startOffset || endNode !== native.endContainer || endOffset !== native.endOffset) {
                      if (startNode.tagName == "BR") {
                        startOffset = [].indexOf.call(startNode.parentNode.childNodes, startNode);
                        startNode = startNode.parentNode;
                      }
                      if (endNode.tagName == "BR") {
                        endOffset = [].indexOf.call(endNode.parentNode.childNodes, endNode);
                        endNode = endNode.parentNode;
                      }
                      var range = document.createRange();
                      range.setStart(startNode, startOffset);
                      range.setEnd(endNode, endOffset);
                      selection.removeAllRanges();
                      selection.addRange(range);
                    }
                  } else {
                    selection.removeAllRanges();
                    this.root.blur();
                    document.body.focus();
                  }
                }
              }, {
                key: "setRange",
                value: function setRange(range) {
                  var force = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
                  var source = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : _emitter4.default.sources.API;
                  if (typeof force === "string") {
                    source = force;
                    force = false;
                  }
                  debug.info("setRange", range);
                  if (range != null) {
                    var args = this.rangeToNative(range);
                    this.setNativeRange.apply(this, _toConsumableArray(args).concat([force]));
                  } else {
                    this.setNativeRange(null);
                  }
                  this.update(source);
                }
              }, {
                key: "update",
                value: function update() {
                  var source = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : _emitter4.default.sources.USER;
                  var oldRange = this.lastRange;
                  var _getRange = this.getRange(), _getRange2 = _slicedToArray(_getRange, 2), lastRange = _getRange2[0], nativeRange = _getRange2[1];
                  this.lastRange = lastRange;
                  if (this.lastRange != null) {
                    this.savedRange = this.lastRange;
                  }
                  if (!(0, _deepEqual2.default)(oldRange, this.lastRange)) {
                    var _emitter;
                    if (!this.composing && nativeRange != null && nativeRange.native.collapsed && nativeRange.start.node !== this.cursor.textNode) {
                      this.cursor.restore();
                    }
                    var args = [_emitter4.default.events.SELECTION_CHANGE, (0, _clone2.default)(this.lastRange), (0, _clone2.default)(oldRange), source];
                    (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args));
                    if (source !== _emitter4.default.sources.SILENT) {
                      var _emitter2;
                      (_emitter2 = this.emitter).emit.apply(_emitter2, args);
                    }
                  }
                }
              }]);
              return Selection2;
            }();
            function contains(parent, descendant) {
              try {
                descendant.parentNode;
              } catch (e2) {
                return false;
              }
              if (descendant instanceof Text) {
                descendant = descendant.parentNode;
              }
              return parent.contains(descendant);
            }
            exports2.Range = Range;
            exports2.default = Selection;
          },
          /* 16 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", {
              value: true
            });
            var _createClass = function() {
              function defineProperties(target, props) {
                for (var i3 = 0; i3 < props.length; i3++) {
                  var descriptor = props[i3];
                  descriptor.enumerable = descriptor.enumerable || false;
                  descriptor.configurable = true;
                  if ("value" in descriptor)
                    descriptor.writable = true;
                  Object.defineProperty(target, descriptor.key, descriptor);
                }
              }
              return function(Constructor, protoProps, staticProps) {
                if (protoProps)
                  defineProperties(Constructor.prototype, protoProps);
                if (staticProps)
                  defineProperties(Constructor, staticProps);
                return Constructor;
              };
            }();
            var _get = function get(object, property, receiver) {
              if (object === null)
                object = Function.prototype;
              var desc = Object.getOwnPropertyDescriptor(object, property);
              if (desc === void 0) {
                var parent = Object.getPrototypeOf(object);
                if (parent === null) {
                  return void 0;
                } else {
                  return get(parent, property, receiver);
                }
              } else if ("value" in desc) {
                return desc.value;
              } else {
                var getter = desc.get;
                if (getter === void 0) {
                  return void 0;
                }
                return getter.call(receiver);
              }
            };
            var _parchment = __webpack_require__(0);
            var _parchment2 = _interopRequireDefault(_parchment);
            function _interopRequireDefault(obj) {
              return obj && obj.__esModule ? obj : { default: obj };
            }
            function _classCallCheck2(instance, Constructor) {
              if (!(instance instanceof Constructor)) {
                throw new TypeError("Cannot call a class as a function");
              }
            }
            function _possibleConstructorReturn(self2, call4) {
              if (!self2) {
                throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
              }
              return call4 && (typeof call4 === "object" || typeof call4 === "function") ? call4 : self2;
            }
            function _inherits(subClass, superClass) {
              if (typeof superClass !== "function" && superClass !== null) {
                throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
              }
              subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
              if (superClass)
                Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
            }
            var Break = function(_Parchment$Embed) {
              _inherits(Break2, _Parchment$Embed);
              function Break2() {
                _classCallCheck2(this, Break2);
                return _possibleConstructorReturn(this, (Break2.__proto__ || Object.getPrototypeOf(Break2)).apply(this, arguments));
              }
              _createClass(Break2, [{
                key: "insertInto",
                value: function insertInto(parent, ref) {
                  if (parent.children.length === 0) {
                    _get(Break2.prototype.__proto__ || Object.getPrototypeOf(Break2.prototype), "insertInto", this).call(this, parent, ref);
                  } else {
                    this.remove();
                  }
                }
              }, {
                key: "length",
                value: function length2() {
                  return 0;
                }
              }, {
                key: "value",
                value: function value() {
                  return "";
                }
              }], [{
                key: "value",
                value: function value() {
                  return void 0;
                }
              }]);
              return Break2;
            }(_parchment2.default.Embed);
            Break.blotName = "break";
            Break.tagName = "BR";
            exports2.default = Break;
          },
          /* 17 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            var __extends = this && this.__extends || function() {
              var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
                d2.__proto__ = b2;
              } || function(d2, b2) {
                for (var p3 in b2)
                  if (b2.hasOwnProperty(p3))
                    d2[p3] = b2[p3];
              };
              return function(d2, b2) {
                extendStatics(d2, b2);
                function __() {
                  this.constructor = d2;
                }
                d2.prototype = b2 === null ? Object.create(b2) : (__.prototype = b2.prototype, new __());
              };
            }();
            Object.defineProperty(exports2, "__esModule", { value: true });
            var linked_list_1 = __webpack_require__(44);
            var shadow_1 = __webpack_require__(30);
            var Registry = __webpack_require__(1);
            var ContainerBlot = (
              /** @class */
              function(_super) {
                __extends(ContainerBlot2, _super);
                function ContainerBlot2(domNode) {
                  var _this = _super.call(this, domNode) || this;
                  _this.build();
                  return _this;
                }
                ContainerBlot2.prototype.appendChild = function(other) {
                  this.insertBefore(other);
                };
                ContainerBlot2.prototype.attach = function() {
                  _super.prototype.attach.call(this);
                  this.children.forEach(function(child) {
                    child.attach();
                  });
                };
                ContainerBlot2.prototype.build = function() {
                  var _this = this;
                  this.children = new linked_list_1.default();
                  [].slice.call(this.domNode.childNodes).reverse().forEach(function(node3) {
                    try {
                      var child = makeBlot(node3);
                      _this.insertBefore(child, _this.children.head || void 0);
                    } catch (err) {
                      if (err instanceof Registry.ParchmentError)
                        return;
                      else
                        throw err;
                    }
                  });
                };
                ContainerBlot2.prototype.deleteAt = function(index3, length2) {
                  if (index3 === 0 && length2 === this.length()) {
                    return this.remove();
                  }
                  this.children.forEachAt(index3, length2, function(child, offset, length3) {
                    child.deleteAt(offset, length3);
                  });
                };
                ContainerBlot2.prototype.descendant = function(criteria, index3) {
                  var _a2 = this.children.find(index3), child = _a2[0], offset = _a2[1];
                  if (criteria.blotName == null && criteria(child) || criteria.blotName != null && child instanceof criteria) {
                    return [child, offset];
                  } else if (child instanceof ContainerBlot2) {
                    return child.descendant(criteria, offset);
                  } else {
                    return [null, -1];
                  }
                };
                ContainerBlot2.prototype.descendants = function(criteria, index3, length2) {
                  if (index3 === void 0) {
                    index3 = 0;
                  }
                  if (length2 === void 0) {
                    length2 = Number.MAX_VALUE;
                  }
                  var descendants = [];
                  var lengthLeft = length2;
                  this.children.forEachAt(index3, length2, function(child, index4, length3) {
                    if (criteria.blotName == null && criteria(child) || criteria.blotName != null && child instanceof criteria) {
                      descendants.push(child);
                    }
                    if (child instanceof ContainerBlot2) {
                      descendants = descendants.concat(child.descendants(criteria, index4, lengthLeft));
                    }
                    lengthLeft -= length3;
                  });
                  return descendants;
                };
                ContainerBlot2.prototype.detach = function() {
                  this.children.forEach(function(child) {
                    child.detach();
                  });
                  _super.prototype.detach.call(this);
                };
                ContainerBlot2.prototype.formatAt = function(index3, length2, name, value) {
                  this.children.forEachAt(index3, length2, function(child, offset, length3) {
                    child.formatAt(offset, length3, name, value);
                  });
                };
                ContainerBlot2.prototype.insertAt = function(index3, value, def) {
                  var _a2 = this.children.find(index3), child = _a2[0], offset = _a2[1];
                  if (child) {
                    child.insertAt(offset, value, def);
                  } else {
                    var blot = def == null ? Registry.create("text", value) : Registry.create(value, def);
                    this.appendChild(blot);
                  }
                };
                ContainerBlot2.prototype.insertBefore = function(childBlot, refBlot) {
                  if (this.statics.allowedChildren != null && !this.statics.allowedChildren.some(function(child) {
                    return childBlot instanceof child;
                  })) {
                    throw new Registry.ParchmentError("Cannot insert " + childBlot.statics.blotName + " into " + this.statics.blotName);
                  }
                  childBlot.insertInto(this, refBlot);
                };
                ContainerBlot2.prototype.length = function() {
                  return this.children.reduce(function(memo, child) {
                    return memo + child.length();
                  }, 0);
                };
                ContainerBlot2.prototype.moveChildren = function(targetParent, refNode) {
                  this.children.forEach(function(child) {
                    targetParent.insertBefore(child, refNode);
                  });
                };
                ContainerBlot2.prototype.optimize = function(context) {
                  _super.prototype.optimize.call(this, context);
                  if (this.children.length === 0) {
                    if (this.statics.defaultChild != null) {
                      var child = Registry.create(this.statics.defaultChild);
                      this.appendChild(child);
                      child.optimize(context);
                    } else {
                      this.remove();
                    }
                  }
                };
                ContainerBlot2.prototype.path = function(index3, inclusive) {
                  if (inclusive === void 0) {
                    inclusive = false;
                  }
                  var _a2 = this.children.find(index3, inclusive), child = _a2[0], offset = _a2[1];
                  var position3 = [[this, index3]];
                  if (child instanceof ContainerBlot2) {
                    return position3.concat(child.path(offset, inclusive));
                  } else if (child != null) {
                    position3.push([child, offset]);
                  }
                  return position3;
                };
                ContainerBlot2.prototype.removeChild = function(child) {
                  this.children.remove(child);
                };
                ContainerBlot2.prototype.replace = function(target) {
                  if (target instanceof ContainerBlot2) {
                    target.moveChildren(this);
                  }
                  _super.prototype.replace.call(this, target);
                };
                ContainerBlot2.prototype.split = function(index3, force) {
                  if (force === void 0) {
                    force = false;
                  }
                  if (!force) {
                    if (index3 === 0)
                      return this;
                    if (index3 === this.length())
                      return this.next;
                  }
                  var after2 = this.clone();
                  this.parent.insertBefore(after2, this.next);
                  this.children.forEachAt(index3, this.length(), function(child, offset, length2) {
                    child = child.split(offset, force);
                    after2.appendChild(child);
                  });
                  return after2;
                };
                ContainerBlot2.prototype.unwrap = function() {
                  this.moveChildren(this.parent, this.next);
                  this.remove();
                };
                ContainerBlot2.prototype.update = function(mutations, context) {
                  var _this = this;
                  var addedNodes = [];
                  var removedNodes = [];
                  mutations.forEach(function(mutation) {
                    if (mutation.target === _this.domNode && mutation.type === "childList") {
                      addedNodes.push.apply(addedNodes, mutation.addedNodes);
                      removedNodes.push.apply(removedNodes, mutation.removedNodes);
                    }
                  });
                  removedNodes.forEach(function(node3) {
                    if (node3.parentNode != null && // @ts-ignore
                    node3.tagName !== "IFRAME" && document.body.compareDocumentPosition(node3) & Node.DOCUMENT_POSITION_CONTAINED_BY) {
                      return;
                    }
                    var blot = Registry.find(node3);
                    if (blot == null)
                      return;
                    if (blot.domNode.parentNode == null || blot.domNode.parentNode === _this.domNode) {
                      blot.detach();
                    }
                  });
                  addedNodes.filter(function(node3) {
                    return node3.parentNode == _this.domNode;
                  }).sort(function(a3, b2) {
                    if (a3 === b2)
                      return 0;
                    if (a3.compareDocumentPosition(b2) & Node.DOCUMENT_POSITION_FOLLOWING) {
                      return 1;
                    }
                    return -1;
                  }).forEach(function(node3) {
                    var refBlot = null;
                    if (node3.nextSibling != null) {
                      refBlot = Registry.find(node3.nextSibling);
                    }
                    var blot = makeBlot(node3);
                    if (blot.next != refBlot || blot.next == null) {
                      if (blot.parent != null) {
                        blot.parent.removeChild(_this);
                      }
                      _this.insertBefore(blot, refBlot || void 0);
                    }
                  });
                };
                return ContainerBlot2;
              }(shadow_1.default)
            );
            function makeBlot(node3) {
              var blot = Registry.find(node3);
              if (blot == null) {
                try {
                  blot = Registry.create(node3);
                } catch (e2) {
                  blot = Registry.create(Registry.Scope.INLINE);
                  [].slice.call(node3.childNodes).forEach(function(child) {
                    blot.domNode.appendChild(child);
                  });
                  if (node3.parentNode) {
                    node3.parentNode.replaceChild(blot.domNode, node3);
                  }
                  blot.attach();
                }
              }
              return blot;
            }
            exports2.default = ContainerBlot;
          },
          /* 18 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            var __extends = this && this.__extends || function() {
              var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
                d2.__proto__ = b2;
              } || function(d2, b2) {
                for (var p3 in b2)
                  if (b2.hasOwnProperty(p3))
                    d2[p3] = b2[p3];
              };
              return function(d2, b2) {
                extendStatics(d2, b2);
                function __() {
                  this.constructor = d2;
                }
                d2.prototype = b2 === null ? Object.create(b2) : (__.prototype = b2.prototype, new __());
              };
            }();
            Object.defineProperty(exports2, "__esModule", { value: true });
            var attributor_1 = __webpack_require__(12);
            var store_1 = __webpack_require__(31);
            var container_1 = __webpack_require__(17);
            var Registry = __webpack_require__(1);
            var FormatBlot = (
              /** @class */
              function(_super) {
                __extends(FormatBlot2, _super);
                function FormatBlot2(domNode) {
                  var _this = _super.call(this, domNode) || this;
                  _this.attributes = new store_1.default(_this.domNode);
                  return _this;
                }
                FormatBlot2.formats = function(domNode) {
                  if (typeof this.tagName === "string") {
                    return true;
                  } else if (Array.isArray(this.tagName)) {
                    return domNode.tagName.toLowerCase();
                  }
                  return void 0;
                };
                FormatBlot2.prototype.format = function(name, value) {
                  var format = Registry.query(name);
                  if (format instanceof attributor_1.default) {
                    this.attributes.attribute(format, value);
                  } else if (value) {
                    if (format != null && (name !== this.statics.blotName || this.formats()[name] !== value)) {
                      this.replaceWith(name, value);
                    }
                  }
                };
                FormatBlot2.prototype.formats = function() {
                  var formats = this.attributes.values();
                  var format = this.statics.formats(this.domNode);
                  if (format != null) {
                    formats[this.statics.blotName] = format;
                  }
                  return formats;
                };
                FormatBlot2.prototype.replaceWith = function(name, value) {
                  var replacement = _super.prototype.replaceWith.call(this, name, value);
                  this.attributes.copy(replacement);
                  return replacement;
                };
                FormatBlot2.prototype.update = function(mutations, context) {
                  var _this = this;
                  _super.prototype.update.call(this, mutations, context);
                  if (mutations.some(function(mutation) {
                    return mutation.target === _this.domNode && mutation.type === "attributes";
                  })) {
                    this.attributes.build();
                  }
                };
                FormatBlot2.prototype.wrap = function(name, value) {
                  var wrapper = _super.prototype.wrap.call(this, name, value);
                  if (wrapper instanceof FormatBlot2 && wrapper.statics.scope === this.statics.scope) {
                    this.attributes.move(wrapper);
                  }
                  return wrapper;
                };
                return FormatBlot2;
              }(container_1.default)
            );
            exports2.default = FormatBlot;
          },
          /* 19 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            var __extends = this && this.__extends || function() {
              var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
                d2.__proto__ = b2;
              } || function(d2, b2) {
                for (var p3 in b2)
                  if (b2.hasOwnProperty(p3))
                    d2[p3] = b2[p3];
              };
              return function(d2, b2) {
                extendStatics(d2, b2);
                function __() {
                  this.constructor = d2;
                }
                d2.prototype = b2 === null ? Object.create(b2) : (__.prototype = b2.prototype, new __());
              };
            }();
            Object.defineProperty(exports2, "__esModule", { value: true });
            var shadow_1 = __webpack_require__(30);
            var Registry = __webpack_require__(1);
            var LeafBlot = (
              /** @class */
              function(_super) {
                __extends(LeafBlot2, _super);
                function LeafBlot2() {
                  return _super !== null && _super.apply(this, arguments) || this;
                }
                LeafBlot2.value = function(domNode) {
                  return true;
                };
                LeafBlot2.prototype.index = function(node3, offset) {
                  if (this.domNode === node3 || this.domNode.compareDocumentPosition(node3) & Node.DOCUMENT_POSITION_CONTAINED_BY) {
                    return Math.min(offset, 1);
                  }
                  return -1;
                };
                LeafBlot2.prototype.position = function(index3, inclusive) {
                  var offset = [].indexOf.call(this.parent.domNode.childNodes, this.domNode);
                  if (index3 > 0)
                    offset += 1;
                  return [this.parent.domNode, offset];
                };
                LeafBlot2.prototype.value = function() {
                  return _a2 = {}, _a2[this.statics.blotName] = this.statics.value(this.domNode) || true, _a2;
                  var _a2;
                };
                LeafBlot2.scope = Registry.Scope.INLINE_BLOT;
                return LeafBlot2;
              }(shadow_1.default)
            );
            exports2.default = LeafBlot;
          },
          /* 20 */
          /***/
          function(module2, exports2, __webpack_require__) {
            var equal = __webpack_require__(11);
            var extend2 = __webpack_require__(3);
            var lib = {
              attributes: {
                compose: function(a3, b2, keepNull) {
                  if (typeof a3 !== "object")
                    a3 = {};
                  if (typeof b2 !== "object")
                    b2 = {};
                  var attributes = extend2(true, {}, b2);
                  if (!keepNull) {
                    attributes = Object.keys(attributes).reduce(function(copy, key2) {
                      if (attributes[key2] != null) {
                        copy[key2] = attributes[key2];
                      }
                      return copy;
                    }, {});
                  }
                  for (var key in a3) {
                    if (a3[key] !== void 0 && b2[key] === void 0) {
                      attributes[key] = a3[key];
                    }
                  }
                  return Object.keys(attributes).length > 0 ? attributes : void 0;
                },
                diff: function(a3, b2) {
                  if (typeof a3 !== "object")
                    a3 = {};
                  if (typeof b2 !== "object")
                    b2 = {};
                  var attributes = Object.keys(a3).concat(Object.keys(b2)).reduce(function(attributes2, key) {
                    if (!equal(a3[key], b2[key])) {
                      attributes2[key] = b2[key] === void 0 ? null : b2[key];
                    }
                    return attributes2;
                  }, {});
                  return Object.keys(attributes).length > 0 ? attributes : void 0;
                },
                transform: function(a3, b2, priority) {
                  if (typeof a3 !== "object")
                    return b2;
                  if (typeof b2 !== "object")
                    return void 0;
                  if (!priority)
                    return b2;
                  var attributes = Object.keys(b2).reduce(function(attributes2, key) {
                    if (a3[key] === void 0)
                      attributes2[key] = b2[key];
                    return attributes2;
                  }, {});
                  return Object.keys(attributes).length > 0 ? attributes : void 0;
                }
              },
              iterator: function(ops) {
                return new Iterator(ops);
              },
              length: function(op) {
                if (typeof op["delete"] === "number") {
                  return op["delete"];
                } else if (typeof op.retain === "number") {
                  return op.retain;
                } else {
                  return typeof op.insert === "string" ? op.insert.length : 1;
                }
              }
            };
            function Iterator(ops) {
              this.ops = ops;
              this.index = 0;
              this.offset = 0;
            }
            ;
            Iterator.prototype.hasNext = function() {
              return this.peekLength() < Infinity;
            };
            Iterator.prototype.next = function(length2) {
              if (!length2)
                length2 = Infinity;
              var nextOp = this.ops[this.index];
              if (nextOp) {
                var offset = this.offset;
                var opLength = lib.length(nextOp);
                if (length2 >= opLength - offset) {
                  length2 = opLength - offset;
                  this.index += 1;
                  this.offset = 0;
                } else {
                  this.offset += length2;
                }
                if (typeof nextOp["delete"] === "number") {
                  return { "delete": length2 };
                } else {
                  var retOp = {};
                  if (nextOp.attributes) {
                    retOp.attributes = nextOp.attributes;
                  }
                  if (typeof nextOp.retain === "number") {
                    retOp.retain = length2;
                  } else if (typeof nextOp.insert === "string") {
                    retOp.insert = nextOp.insert.substr(offset, length2);
                  } else {
                    retOp.insert = nextOp.insert;
                  }
                  return retOp;
                }
              } else {
                return { retain: Infinity };
              }
            };
            Iterator.prototype.peek = function() {
              return this.ops[this.index];
            };
            Iterator.prototype.peekLength = function() {
              if (this.ops[this.index]) {
                return lib.length(this.ops[this.index]) - this.offset;
              } else {
                return Infinity;
              }
            };
            Iterator.prototype.peekType = function() {
              if (this.ops[this.index]) {
                if (typeof this.ops[this.index]["delete"] === "number") {
                  return "delete";
                } else if (typeof this.ops[this.index].retain === "number") {
                  return "retain";
                } else {
                  return "insert";
                }
              }
              return "retain";
            };
            module2.exports = lib;
          },
          /* 21 */
          /***/
          function(module2, exports2) {
            var clone = function() {
              "use strict";
              function _instanceof(obj, type) {
                return type != null && obj instanceof type;
              }
              var nativeMap;
              try {
                nativeMap = Map;
              } catch (_3) {
                nativeMap = function() {
                };
              }
              var nativeSet;
              try {
                nativeSet = Set;
              } catch (_3) {
                nativeSet = function() {
                };
              }
              var nativePromise;
              try {
                nativePromise = Promise;
              } catch (_3) {
                nativePromise = function() {
                };
              }
              function clone2(parent, circular, depth, prototype, includeNonEnumerable) {
                if (typeof circular === "object") {
                  depth = circular.depth;
                  prototype = circular.prototype;
                  includeNonEnumerable = circular.includeNonEnumerable;
                  circular = circular.circular;
                }
                var allParents = [];
                var allChildren = [];
                var useBuffer = typeof Buffer != "undefined";
                if (typeof circular == "undefined")
                  circular = true;
                if (typeof depth == "undefined")
                  depth = Infinity;
                function _clone(parent2, depth2) {
                  if (parent2 === null)
                    return null;
                  if (depth2 === 0)
                    return parent2;
                  var child;
                  var proto;
                  if (typeof parent2 != "object") {
                    return parent2;
                  }
                  if (_instanceof(parent2, nativeMap)) {
                    child = new nativeMap();
                  } else if (_instanceof(parent2, nativeSet)) {
                    child = new nativeSet();
                  } else if (_instanceof(parent2, nativePromise)) {
                    child = new nativePromise(function(resolve, reject) {
                      parent2.then(function(value) {
                        resolve(_clone(value, depth2 - 1));
                      }, function(err) {
                        reject(_clone(err, depth2 - 1));
                      });
                    });
                  } else if (clone2.__isArray(parent2)) {
                    child = [];
                  } else if (clone2.__isRegExp(parent2)) {
                    child = new RegExp(parent2.source, __getRegExpFlags(parent2));
                    if (parent2.lastIndex)
                      child.lastIndex = parent2.lastIndex;
                  } else if (clone2.__isDate(parent2)) {
                    child = new Date(parent2.getTime());
                  } else if (useBuffer && Buffer.isBuffer(parent2)) {
                    child = new Buffer(parent2.length);
                    parent2.copy(child);
                    return child;
                  } else if (_instanceof(parent2, Error)) {
                    child = Object.create(parent2);
                  } else {
                    if (typeof prototype == "undefined") {
                      proto = Object.getPrototypeOf(parent2);
                      child = Object.create(proto);
                    } else {
                      child = Object.create(prototype);
                      proto = prototype;
                    }
                  }
                  if (circular) {
                    var index3 = allParents.indexOf(parent2);
                    if (index3 != -1) {
                      return allChildren[index3];
                    }
                    allParents.push(parent2);
                    allChildren.push(child);
                  }
                  if (_instanceof(parent2, nativeMap)) {
                    parent2.forEach(function(value, key) {
                      var keyChild = _clone(key, depth2 - 1);
                      var valueChild = _clone(value, depth2 - 1);
                      child.set(keyChild, valueChild);
                    });
                  }
                  if (_instanceof(parent2, nativeSet)) {
                    parent2.forEach(function(value) {
                      var entryChild = _clone(value, depth2 - 1);
                      child.add(entryChild);
                    });
                  }
                  for (var i3 in parent2) {
                    var attrs2;
                    if (proto) {
                      attrs2 = Object.getOwnPropertyDescriptor(proto, i3);
                    }
                    if (attrs2 && attrs2.set == null) {
                      continue;
                    }
                    child[i3] = _clone(parent2[i3], depth2 - 1);
                  }
                  if (Object.getOwnPropertySymbols) {
                    var symbols = Object.getOwnPropertySymbols(parent2);
                    for (var i3 = 0; i3 < symbols.length; i3++) {
                      var symbol = symbols[i3];
                      var descriptor = Object.getOwnPropertyDescriptor(parent2, symbol);
                      if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {
                        continue;
                      }
                      child[symbol] = _clone(parent2[symbol], depth2 - 1);
                      if (!descriptor.enumerable) {
                        Object.defineProperty(child, symbol, {
                          enumerable: false
                        });
                      }
                    }
                  }
                  if (includeNonEnumerable) {
                    var allPropertyNames = Object.getOwnPropertyNames(parent2);
                    for (var i3 = 0; i3 < allPropertyNames.length; i3++) {
                      var propertyName = allPropertyNames[i3];
                      var descriptor = Object.getOwnPropertyDescriptor(parent2, propertyName);
                      if (descriptor && descriptor.enumerable) {
                        continue;
                      }
                      child[propertyName] = _clone(parent2[propertyName], depth2 - 1);
                      Object.defineProperty(child, propertyName, {
                        enumerable: false
                      });
                    }
                  }
                  return child;
                }
                return _clone(parent, depth);
              }
              clone2.clonePrototype = function clonePrototype(parent) {
                if (parent === null)
                  return null;
                var c4 = function() {
                };
                c4.prototype = parent;
                return new c4();
              };
              function __objToStr(o3) {
                return Object.prototype.toString.call(o3);
              }
              clone2.__objToStr = __objToStr;
              function __isDate(o3) {
                return typeof o3 === "object" && __objToStr(o3) === "[object Date]";
              }
              clone2.__isDate = __isDate;
              function __isArray(o3) {
                return typeof o3 === "object" && __objToStr(o3) === "[object Array]";
              }
              clone2.__isArray = __isArray;
              function __isRegExp(o3) {
                return typeof o3 === "object" && __objToStr(o3) === "[object RegExp]";
              }
              clone2.__isRegExp = __isRegExp;
              function __getRegExpFlags(re2) {
                var flags = "";
                if (re2.global)
                  flags += "g";
                if (re2.ignoreCase)
                  flags += "i";
                if (re2.multiline)
                  flags += "m";
                return flags;
              }
              clone2.__getRegExpFlags = __getRegExpFlags;
              return clone2;
            }();
            if (typeof module2 === "object" && module2.exports) {
              module2.exports = clone;
            }
          },
          /* 22 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", {
              value: true
            });
            var _slicedToArray = function() {
              function sliceIterator(arr, i3) {
                var _arr = [];
                var _n = true;
                var _d = false;
                var _e = void 0;
                try {
                  for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
                    _arr.push(_s.value);
                    if (i3 && _arr.length === i3)
                      break;
                  }
                } catch (err) {
                  _d = true;
                  _e = err;
                } finally {
                  try {
                    if (!_n && _i["return"])
                      _i["return"]();
                  } finally {
                    if (_d)
                      throw _e;
                  }
                }
                return _arr;
              }
              return function(arr, i3) {
                if (Array.isArray(arr)) {
                  return arr;
                } else if (Symbol.iterator in Object(arr)) {
                  return sliceIterator(arr, i3);
                } else {
                  throw new TypeError("Invalid attempt to destructure non-iterable instance");
                }
              };
            }();
            var _createClass = function() {
              function defineProperties(target, props) {
                for (var i3 = 0; i3 < props.length; i3++) {
                  var descriptor = props[i3];
                  descriptor.enumerable = descriptor.enumerable || false;
                  descriptor.configurable = true;
                  if ("value" in descriptor)
                    descriptor.writable = true;
                  Object.defineProperty(target, descriptor.key, descriptor);
                }
              }
              return function(Constructor, protoProps, staticProps) {
                if (protoProps)
                  defineProperties(Constructor.prototype, protoProps);
                if (staticProps)
                  defineProperties(Constructor, staticProps);
                return Constructor;
              };
            }();
            var _get = function get(object, property, receiver) {
              if (object === null)
                object = Function.prototype;
              var desc = Object.getOwnPropertyDescriptor(object, property);
              if (desc === void 0) {
                var parent = Object.getPrototypeOf(object);
                if (parent === null) {
                  return void 0;
                } else {
                  return get(parent, property, receiver);
                }
              } else if ("value" in desc) {
                return desc.value;
              } else {
                var getter = desc.get;
                if (getter === void 0) {
                  return void 0;
                }
                return getter.call(receiver);
              }
            };
            var _parchment = __webpack_require__(0);
            var _parchment2 = _interopRequireDefault(_parchment);
            var _emitter = __webpack_require__(8);
            var _emitter2 = _interopRequireDefault(_emitter);
            var _block = __webpack_require__(4);
            var _block2 = _interopRequireDefault(_block);
            var _break = __webpack_require__(16);
            var _break2 = _interopRequireDefault(_break);
            var _code = __webpack_require__(13);
            var _code2 = _interopRequireDefault(_code);
            var _container = __webpack_require__(25);
            var _container2 = _interopRequireDefault(_container);
            function _interopRequireDefault(obj) {
              return obj && obj.__esModule ? obj : { default: obj };
            }
            function _classCallCheck2(instance, Constructor) {
              if (!(instance instanceof Constructor)) {
                throw new TypeError("Cannot call a class as a function");
              }
            }
            function _possibleConstructorReturn(self2, call4) {
              if (!self2) {
                throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
              }
              return call4 && (typeof call4 === "object" || typeof call4 === "function") ? call4 : self2;
            }
            function _inherits(subClass, superClass) {
              if (typeof superClass !== "function" && superClass !== null) {
                throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
              }
              subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
              if (superClass)
                Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
            }
            function isLine(blot) {
              return blot instanceof _block2.default || blot instanceof _block.BlockEmbed;
            }
            var Scroll = function(_Parchment$Scroll) {
              _inherits(Scroll2, _Parchment$Scroll);
              function Scroll2(domNode, config) {
                _classCallCheck2(this, Scroll2);
                var _this = _possibleConstructorReturn(this, (Scroll2.__proto__ || Object.getPrototypeOf(Scroll2)).call(this, domNode));
                _this.emitter = config.emitter;
                if (Array.isArray(config.whitelist)) {
                  _this.whitelist = config.whitelist.reduce(function(whitelist, format) {
                    whitelist[format] = true;
                    return whitelist;
                  }, {});
                }
                _this.domNode.addEventListener("DOMNodeInserted", function() {
                });
                _this.optimize();
                _this.enable();
                return _this;
              }
              _createClass(Scroll2, [{
                key: "batchStart",
                value: function batchStart() {
                  this.batch = true;
                }
              }, {
                key: "batchEnd",
                value: function batchEnd() {
                  this.batch = false;
                  this.optimize();
                }
              }, {
                key: "deleteAt",
                value: function deleteAt(index3, length2) {
                  var _line = this.line(index3), _line2 = _slicedToArray(_line, 2), first = _line2[0], offset = _line2[1];
                  var _line3 = this.line(index3 + length2), _line4 = _slicedToArray(_line3, 1), last = _line4[0];
                  _get(Scroll2.prototype.__proto__ || Object.getPrototypeOf(Scroll2.prototype), "deleteAt", this).call(this, index3, length2);
                  if (last != null && first !== last && offset > 0) {
                    if (first instanceof _block.BlockEmbed || last instanceof _block.BlockEmbed) {
                      this.optimize();
                      return;
                    }
                    if (first instanceof _code2.default) {
                      var newlineIndex = first.newlineIndex(first.length(), true);
                      if (newlineIndex > -1) {
                        first = first.split(newlineIndex + 1);
                        if (first === last) {
                          this.optimize();
                          return;
                        }
                      }
                    } else if (last instanceof _code2.default) {
                      var _newlineIndex = last.newlineIndex(0);
                      if (_newlineIndex > -1) {
                        last.split(_newlineIndex + 1);
                      }
                    }
                    var ref = last.children.head instanceof _break2.default ? null : last.children.head;
                    first.moveChildren(last, ref);
                    first.remove();
                  }
                  this.optimize();
                }
              }, {
                key: "enable",
                value: function enable() {
                  var enabled = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
                  this.domNode.setAttribute("contenteditable", enabled);
                }
              }, {
                key: "formatAt",
                value: function formatAt(index3, length2, format, value) {
                  if (this.whitelist != null && !this.whitelist[format])
                    return;
                  _get(Scroll2.prototype.__proto__ || Object.getPrototypeOf(Scroll2.prototype), "formatAt", this).call(this, index3, length2, format, value);
                  this.optimize();
                }
              }, {
                key: "insertAt",
                value: function insertAt(index3, value, def) {
                  if (def != null && this.whitelist != null && !this.whitelist[value])
                    return;
                  if (index3 >= this.length()) {
                    if (def == null || _parchment2.default.query(value, _parchment2.default.Scope.BLOCK) == null) {
                      var blot = _parchment2.default.create(this.statics.defaultChild);
                      this.appendChild(blot);
                      if (def == null && value.endsWith("\n")) {
                        value = value.slice(0, -1);
                      }
                      blot.insertAt(0, value, def);
                    } else {
                      var embed = _parchment2.default.create(value, def);
                      this.appendChild(embed);
                    }
                  } else {
                    _get(Scroll2.prototype.__proto__ || Object.getPrototypeOf(Scroll2.prototype), "insertAt", this).call(this, index3, value, def);
                  }
                  this.optimize();
                }
              }, {
                key: "insertBefore",
                value: function insertBefore2(blot, ref) {
                  if (blot.statics.scope === _parchment2.default.Scope.INLINE_BLOT) {
                    var wrapper = _parchment2.default.create(this.statics.defaultChild);
                    wrapper.appendChild(blot);
                    blot = wrapper;
                  }
                  _get(Scroll2.prototype.__proto__ || Object.getPrototypeOf(Scroll2.prototype), "insertBefore", this).call(this, blot, ref);
                }
              }, {
                key: "leaf",
                value: function leaf(index3) {
                  return this.path(index3).pop() || [null, -1];
                }
              }, {
                key: "line",
                value: function line(index3) {
                  if (index3 === this.length()) {
                    return this.line(index3 - 1);
                  }
                  return this.descendant(isLine, index3);
                }
              }, {
                key: "lines",
                value: function lines() {
                  var index3 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
                  var length2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Number.MAX_VALUE;
                  var getLines = function getLines2(blot, index4, length3) {
                    var lines2 = [], lengthLeft = length3;
                    blot.children.forEachAt(index4, length3, function(child, index5, length4) {
                      if (isLine(child)) {
                        lines2.push(child);
                      } else if (child instanceof _parchment2.default.Container) {
                        lines2 = lines2.concat(getLines2(child, index5, lengthLeft));
                      }
                      lengthLeft -= length4;
                    });
                    return lines2;
                  };
                  return getLines(this, index3, length2);
                }
              }, {
                key: "optimize",
                value: function optimize() {
                  var mutations = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
                  var context = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
                  if (this.batch === true)
                    return;
                  _get(Scroll2.prototype.__proto__ || Object.getPrototypeOf(Scroll2.prototype), "optimize", this).call(this, mutations, context);
                  if (mutations.length > 0) {
                    this.emitter.emit(_emitter2.default.events.SCROLL_OPTIMIZE, mutations, context);
                  }
                }
              }, {
                key: "path",
                value: function path(index3) {
                  return _get(Scroll2.prototype.__proto__ || Object.getPrototypeOf(Scroll2.prototype), "path", this).call(this, index3).slice(1);
                }
              }, {
                key: "update",
                value: function update(mutations) {
                  if (this.batch === true)
                    return;
                  var source = _emitter2.default.sources.USER;
                  if (typeof mutations === "string") {
                    source = mutations;
                  }
                  if (!Array.isArray(mutations)) {
                    mutations = this.observer.takeRecords();
                  }
                  if (mutations.length > 0) {
                    this.emitter.emit(_emitter2.default.events.SCROLL_BEFORE_UPDATE, source, mutations);
                  }
                  _get(Scroll2.prototype.__proto__ || Object.getPrototypeOf(Scroll2.prototype), "update", this).call(this, mutations.concat([]));
                  if (mutations.length > 0) {
                    this.emitter.emit(_emitter2.default.events.SCROLL_UPDATE, source, mutations);
                  }
                }
              }]);
              return Scroll2;
            }(_parchment2.default.Scroll);
            Scroll.blotName = "scroll";
            Scroll.className = "ql-editor";
            Scroll.tagName = "DIV";
            Scroll.defaultChild = "block";
            Scroll.allowedChildren = [_block2.default, _block.BlockEmbed, _container2.default];
            exports2.default = Scroll;
          },
          /* 23 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", {
              value: true
            });
            exports2.SHORTKEY = exports2.default = void 0;
            var _typeof3 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) {
              return typeof obj;
            } : function(obj) {
              return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
            };
            var _slicedToArray = function() {
              function sliceIterator(arr, i3) {
                var _arr = [];
                var _n = true;
                var _d = false;
                var _e = void 0;
                try {
                  for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
                    _arr.push(_s.value);
                    if (i3 && _arr.length === i3)
                      break;
                  }
                } catch (err) {
                  _d = true;
                  _e = err;
                } finally {
                  try {
                    if (!_n && _i["return"])
                      _i["return"]();
                  } finally {
                    if (_d)
                      throw _e;
                  }
                }
                return _arr;
              }
              return function(arr, i3) {
                if (Array.isArray(arr)) {
                  return arr;
                } else if (Symbol.iterator in Object(arr)) {
                  return sliceIterator(arr, i3);
                } else {
                  throw new TypeError("Invalid attempt to destructure non-iterable instance");
                }
              };
            }();
            var _createClass = function() {
              function defineProperties(target, props) {
                for (var i3 = 0; i3 < props.length; i3++) {
                  var descriptor = props[i3];
                  descriptor.enumerable = descriptor.enumerable || false;
                  descriptor.configurable = true;
                  if ("value" in descriptor)
                    descriptor.writable = true;
                  Object.defineProperty(target, descriptor.key, descriptor);
                }
              }
              return function(Constructor, protoProps, staticProps) {
                if (protoProps)
                  defineProperties(Constructor.prototype, protoProps);
                if (staticProps)
                  defineProperties(Constructor, staticProps);
                return Constructor;
              };
            }();
            var _clone = __webpack_require__(21);
            var _clone2 = _interopRequireDefault(_clone);
            var _deepEqual = __webpack_require__(11);
            var _deepEqual2 = _interopRequireDefault(_deepEqual);
            var _extend = __webpack_require__(3);
            var _extend2 = _interopRequireDefault(_extend);
            var _quillDelta = __webpack_require__(2);
            var _quillDelta2 = _interopRequireDefault(_quillDelta);
            var _op = __webpack_require__(20);
            var _op2 = _interopRequireDefault(_op);
            var _parchment = __webpack_require__(0);
            var _parchment2 = _interopRequireDefault(_parchment);
            var _quill = __webpack_require__(5);
            var _quill2 = _interopRequireDefault(_quill);
            var _logger = __webpack_require__(10);
            var _logger2 = _interopRequireDefault(_logger);
            var _module = __webpack_require__(9);
            var _module2 = _interopRequireDefault(_module);
            function _interopRequireDefault(obj) {
              return obj && obj.__esModule ? obj : { default: obj };
            }
            function _defineProperty2(obj, key, value) {
              if (key in obj) {
                Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
              } else {
                obj[key] = value;
              }
              return obj;
            }
            function _classCallCheck2(instance, Constructor) {
              if (!(instance instanceof Constructor)) {
                throw new TypeError("Cannot call a class as a function");
              }
            }
            function _possibleConstructorReturn(self2, call4) {
              if (!self2) {
                throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
              }
              return call4 && (typeof call4 === "object" || typeof call4 === "function") ? call4 : self2;
            }
            function _inherits(subClass, superClass) {
              if (typeof superClass !== "function" && superClass !== null) {
                throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
              }
              subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
              if (superClass)
                Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
            }
            var debug = (0, _logger2.default)("quill:keyboard");
            var SHORTKEY = /Mac/i.test(navigator.platform) ? "metaKey" : "ctrlKey";
            var Keyboard = function(_Module) {
              _inherits(Keyboard2, _Module);
              _createClass(Keyboard2, null, [{
                key: "match",
                value: function match(evt, binding) {
                  binding = normalize(binding);
                  if (["altKey", "ctrlKey", "metaKey", "shiftKey"].some(function(key) {
                    return !!binding[key] !== evt[key] && binding[key] !== null;
                  })) {
                    return false;
                  }
                  return binding.key === (evt.which || evt.keyCode);
                }
              }]);
              function Keyboard2(quill, options) {
                _classCallCheck2(this, Keyboard2);
                var _this = _possibleConstructorReturn(this, (Keyboard2.__proto__ || Object.getPrototypeOf(Keyboard2)).call(this, quill, options));
                _this.bindings = {};
                Object.keys(_this.options.bindings).forEach(function(name) {
                  if (name === "list autofill" && quill.scroll.whitelist != null && !quill.scroll.whitelist["list"]) {
                    return;
                  }
                  if (_this.options.bindings[name]) {
                    _this.addBinding(_this.options.bindings[name]);
                  }
                });
                _this.addBinding({ key: Keyboard2.keys.ENTER, shiftKey: null }, handleEnter);
                _this.addBinding({ key: Keyboard2.keys.ENTER, metaKey: null, ctrlKey: null, altKey: null }, function() {
                });
                if (/Firefox/i.test(navigator.userAgent)) {
                  _this.addBinding({ key: Keyboard2.keys.BACKSPACE }, { collapsed: true }, handleBackspace);
                  _this.addBinding({ key: Keyboard2.keys.DELETE }, { collapsed: true }, handleDelete);
                } else {
                  _this.addBinding({ key: Keyboard2.keys.BACKSPACE }, { collapsed: true, prefix: /^.?$/ }, handleBackspace);
                  _this.addBinding({ key: Keyboard2.keys.DELETE }, { collapsed: true, suffix: /^.?$/ }, handleDelete);
                }
                _this.addBinding({ key: Keyboard2.keys.BACKSPACE }, { collapsed: false }, handleDeleteRange);
                _this.addBinding({ key: Keyboard2.keys.DELETE }, { collapsed: false }, handleDeleteRange);
                _this.addBinding({ key: Keyboard2.keys.BACKSPACE, altKey: null, ctrlKey: null, metaKey: null, shiftKey: null }, { collapsed: true, offset: 0 }, handleBackspace);
                _this.listen();
                return _this;
              }
              _createClass(Keyboard2, [{
                key: "addBinding",
                value: function addBinding(key) {
                  var context = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
                  var handler = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
                  var binding = normalize(key);
                  if (binding == null || binding.key == null) {
                    return debug.warn("Attempted to add invalid keyboard binding", binding);
                  }
                  if (typeof context === "function") {
                    context = { handler: context };
                  }
                  if (typeof handler === "function") {
                    handler = { handler };
                  }
                  binding = (0, _extend2.default)(binding, context, handler);
                  this.bindings[binding.key] = this.bindings[binding.key] || [];
                  this.bindings[binding.key].push(binding);
                }
              }, {
                key: "listen",
                value: function listen() {
                  var _this2 = this;
                  this.quill.root.addEventListener("keydown", function(evt) {
                    if (evt.defaultPrevented)
                      return;
                    var which = evt.which || evt.keyCode;
                    var bindings = (_this2.bindings[which] || []).filter(function(binding) {
                      return Keyboard2.match(evt, binding);
                    });
                    if (bindings.length === 0)
                      return;
                    var range = _this2.quill.getSelection();
                    if (range == null || !_this2.quill.hasFocus())
                      return;
                    var _quill$getLine = _this2.quill.getLine(range.index), _quill$getLine2 = _slicedToArray(_quill$getLine, 2), line = _quill$getLine2[0], offset = _quill$getLine2[1];
                    var _quill$getLeaf = _this2.quill.getLeaf(range.index), _quill$getLeaf2 = _slicedToArray(_quill$getLeaf, 2), leafStart = _quill$getLeaf2[0], offsetStart = _quill$getLeaf2[1];
                    var _ref = range.length === 0 ? [leafStart, offsetStart] : _this2.quill.getLeaf(range.index + range.length), _ref2 = _slicedToArray(_ref, 2), leafEnd = _ref2[0], offsetEnd = _ref2[1];
                    var prefixText = leafStart instanceof _parchment2.default.Text ? leafStart.value().slice(0, offsetStart) : "";
                    var suffixText = leafEnd instanceof _parchment2.default.Text ? leafEnd.value().slice(offsetEnd) : "";
                    var curContext = {
                      collapsed: range.length === 0,
                      empty: range.length === 0 && line.length() <= 1,
                      format: _this2.quill.getFormat(range),
                      offset,
                      prefix: prefixText,
                      suffix: suffixText
                    };
                    var prevented = bindings.some(function(binding) {
                      if (binding.collapsed != null && binding.collapsed !== curContext.collapsed)
                        return false;
                      if (binding.empty != null && binding.empty !== curContext.empty)
                        return false;
                      if (binding.offset != null && binding.offset !== curContext.offset)
                        return false;
                      if (Array.isArray(binding.format)) {
                        if (binding.format.every(function(name) {
                          return curContext.format[name] == null;
                        })) {
                          return false;
                        }
                      } else if (_typeof3(binding.format) === "object") {
                        if (!Object.keys(binding.format).every(function(name) {
                          if (binding.format[name] === true)
                            return curContext.format[name] != null;
                          if (binding.format[name] === false)
                            return curContext.format[name] == null;
                          return (0, _deepEqual2.default)(binding.format[name], curContext.format[name]);
                        })) {
                          return false;
                        }
                      }
                      if (binding.prefix != null && !binding.prefix.test(curContext.prefix))
                        return false;
                      if (binding.suffix != null && !binding.suffix.test(curContext.suffix))
                        return false;
                      return binding.handler.call(_this2, range, curContext) !== true;
                    });
                    if (prevented) {
                      evt.preventDefault();
                    }
                  });
                }
              }]);
              return Keyboard2;
            }(_module2.default);
            Keyboard.keys = {
              BACKSPACE: 8,
              TAB: 9,
              ENTER: 13,
              ESCAPE: 27,
              LEFT: 37,
              UP: 38,
              RIGHT: 39,
              DOWN: 40,
              DELETE: 46
            };
            Keyboard.DEFAULTS = {
              bindings: {
                "bold": makeFormatHandler("bold"),
                "italic": makeFormatHandler("italic"),
                "underline": makeFormatHandler("underline"),
                "indent": {
                  // highlight tab or tab at beginning of list, indent or blockquote
                  key: Keyboard.keys.TAB,
                  format: ["blockquote", "indent", "list"],
                  handler: function handler(range, context) {
                    if (context.collapsed && context.offset !== 0)
                      return true;
                    this.quill.format("indent", "+1", _quill2.default.sources.USER);
                  }
                },
                "outdent": {
                  key: Keyboard.keys.TAB,
                  shiftKey: true,
                  format: ["blockquote", "indent", "list"],
                  // highlight tab or tab at beginning of list, indent or blockquote
                  handler: function handler(range, context) {
                    if (context.collapsed && context.offset !== 0)
                      return true;
                    this.quill.format("indent", "-1", _quill2.default.sources.USER);
                  }
                },
                "outdent backspace": {
                  key: Keyboard.keys.BACKSPACE,
                  collapsed: true,
                  shiftKey: null,
                  metaKey: null,
                  ctrlKey: null,
                  altKey: null,
                  format: ["indent", "list"],
                  offset: 0,
                  handler: function handler(range, context) {
                    if (context.format.indent != null) {
                      this.quill.format("indent", "-1", _quill2.default.sources.USER);
                    } else if (context.format.list != null) {
                      this.quill.format("list", false, _quill2.default.sources.USER);
                    }
                  }
                },
                "indent code-block": makeCodeBlockHandler(true),
                "outdent code-block": makeCodeBlockHandler(false),
                "remove tab": {
                  key: Keyboard.keys.TAB,
                  shiftKey: true,
                  collapsed: true,
                  prefix: /\t$/,
                  handler: function handler(range) {
                    this.quill.deleteText(range.index - 1, 1, _quill2.default.sources.USER);
                  }
                },
                "tab": {
                  key: Keyboard.keys.TAB,
                  handler: function handler(range) {
                    this.quill.history.cutoff();
                    var delta = new _quillDelta2.default().retain(range.index).delete(range.length).insert("	");
                    this.quill.updateContents(delta, _quill2.default.sources.USER);
                    this.quill.history.cutoff();
                    this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT);
                  }
                },
                "list empty enter": {
                  key: Keyboard.keys.ENTER,
                  collapsed: true,
                  format: ["list"],
                  empty: true,
                  handler: function handler(range, context) {
                    this.quill.format("list", false, _quill2.default.sources.USER);
                    if (context.format.indent) {
                      this.quill.format("indent", false, _quill2.default.sources.USER);
                    }
                  }
                },
                "checklist enter": {
                  key: Keyboard.keys.ENTER,
                  collapsed: true,
                  format: { list: "checked" },
                  handler: function handler(range) {
                    var _quill$getLine3 = this.quill.getLine(range.index), _quill$getLine4 = _slicedToArray(_quill$getLine3, 2), line = _quill$getLine4[0], offset = _quill$getLine4[1];
                    var formats = (0, _extend2.default)({}, line.formats(), { list: "checked" });
                    var delta = new _quillDelta2.default().retain(range.index).insert("\n", formats).retain(line.length() - offset - 1).retain(1, { list: "unchecked" });
                    this.quill.updateContents(delta, _quill2.default.sources.USER);
                    this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT);
                    this.quill.scrollIntoView();
                  }
                },
                "header enter": {
                  key: Keyboard.keys.ENTER,
                  collapsed: true,
                  format: ["header"],
                  suffix: /^$/,
                  handler: function handler(range, context) {
                    var _quill$getLine5 = this.quill.getLine(range.index), _quill$getLine6 = _slicedToArray(_quill$getLine5, 2), line = _quill$getLine6[0], offset = _quill$getLine6[1];
                    var delta = new _quillDelta2.default().retain(range.index).insert("\n", context.format).retain(line.length() - offset - 1).retain(1, { header: null });
                    this.quill.updateContents(delta, _quill2.default.sources.USER);
                    this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT);
                    this.quill.scrollIntoView();
                  }
                },
                "list autofill": {
                  key: " ",
                  collapsed: true,
                  format: { list: false },
                  prefix: /^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,
                  handler: function handler(range, context) {
                    var length2 = context.prefix.length;
                    var _quill$getLine7 = this.quill.getLine(range.index), _quill$getLine8 = _slicedToArray(_quill$getLine7, 2), line = _quill$getLine8[0], offset = _quill$getLine8[1];
                    if (offset > length2)
                      return true;
                    var value = void 0;
                    switch (context.prefix.trim()) {
                      case "[]":
                      case "[ ]":
                        value = "unchecked";
                        break;
                      case "[x]":
                        value = "checked";
                        break;
                      case "-":
                      case "*":
                        value = "bullet";
                        break;
                      default:
                        value = "ordered";
                    }
                    this.quill.insertText(range.index, " ", _quill2.default.sources.USER);
                    this.quill.history.cutoff();
                    var delta = new _quillDelta2.default().retain(range.index - offset).delete(length2 + 1).retain(line.length() - 2 - offset).retain(1, { list: value });
                    this.quill.updateContents(delta, _quill2.default.sources.USER);
                    this.quill.history.cutoff();
                    this.quill.setSelection(range.index - length2, _quill2.default.sources.SILENT);
                  }
                },
                "code exit": {
                  key: Keyboard.keys.ENTER,
                  collapsed: true,
                  format: ["code-block"],
                  prefix: /\n\n$/,
                  suffix: /^\s+$/,
                  handler: function handler(range) {
                    var _quill$getLine9 = this.quill.getLine(range.index), _quill$getLine10 = _slicedToArray(_quill$getLine9, 2), line = _quill$getLine10[0], offset = _quill$getLine10[1];
                    var delta = new _quillDelta2.default().retain(range.index + line.length() - offset - 2).retain(1, { "code-block": null }).delete(1);
                    this.quill.updateContents(delta, _quill2.default.sources.USER);
                  }
                },
                "embed left": makeEmbedArrowHandler(Keyboard.keys.LEFT, false),
                "embed left shift": makeEmbedArrowHandler(Keyboard.keys.LEFT, true),
                "embed right": makeEmbedArrowHandler(Keyboard.keys.RIGHT, false),
                "embed right shift": makeEmbedArrowHandler(Keyboard.keys.RIGHT, true)
              }
            };
            function makeEmbedArrowHandler(key, shiftKey) {
              var _ref3;
              var where = key === Keyboard.keys.LEFT ? "prefix" : "suffix";
              return _ref3 = {
                key,
                shiftKey,
                altKey: null
              }, _defineProperty2(_ref3, where, /^$/), _defineProperty2(_ref3, "handler", function handler(range) {
                var index3 = range.index;
                if (key === Keyboard.keys.RIGHT) {
                  index3 += range.length + 1;
                }
                var _quill$getLeaf3 = this.quill.getLeaf(index3), _quill$getLeaf4 = _slicedToArray(_quill$getLeaf3, 1), leaf = _quill$getLeaf4[0];
                if (!(leaf instanceof _parchment2.default.Embed))
                  return true;
                if (key === Keyboard.keys.LEFT) {
                  if (shiftKey) {
                    this.quill.setSelection(range.index - 1, range.length + 1, _quill2.default.sources.USER);
                  } else {
                    this.quill.setSelection(range.index - 1, _quill2.default.sources.USER);
                  }
                } else {
                  if (shiftKey) {
                    this.quill.setSelection(range.index, range.length + 1, _quill2.default.sources.USER);
                  } else {
                    this.quill.setSelection(range.index + range.length + 1, _quill2.default.sources.USER);
                  }
                }
                return false;
              }), _ref3;
            }
            function handleBackspace(range, context) {
              if (range.index === 0 || this.quill.getLength() <= 1)
                return;
              var _quill$getLine11 = this.quill.getLine(range.index), _quill$getLine12 = _slicedToArray(_quill$getLine11, 1), line = _quill$getLine12[0];
              var formats = {};
              if (context.offset === 0) {
                var _quill$getLine13 = this.quill.getLine(range.index - 1), _quill$getLine14 = _slicedToArray(_quill$getLine13, 1), prev2 = _quill$getLine14[0];
                if (prev2 != null && prev2.length() > 1) {
                  var curFormats = line.formats();
                  var prevFormats = this.quill.getFormat(range.index - 1, 1);
                  formats = _op2.default.attributes.diff(curFormats, prevFormats) || {};
                }
              }
              var length2 = /[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(context.prefix) ? 2 : 1;
              this.quill.deleteText(range.index - length2, length2, _quill2.default.sources.USER);
              if (Object.keys(formats).length > 0) {
                this.quill.formatLine(range.index - length2, length2, formats, _quill2.default.sources.USER);
              }
              this.quill.focus();
            }
            function handleDelete(range, context) {
              var length2 = /^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(context.suffix) ? 2 : 1;
              if (range.index >= this.quill.getLength() - length2)
                return;
              var formats = {}, nextLength = 0;
              var _quill$getLine15 = this.quill.getLine(range.index), _quill$getLine16 = _slicedToArray(_quill$getLine15, 1), line = _quill$getLine16[0];
              if (context.offset >= line.length() - 1) {
                var _quill$getLine17 = this.quill.getLine(range.index + 1), _quill$getLine18 = _slicedToArray(_quill$getLine17, 1), next2 = _quill$getLine18[0];
                if (next2) {
                  var curFormats = line.formats();
                  var nextFormats = this.quill.getFormat(range.index, 1);
                  formats = _op2.default.attributes.diff(curFormats, nextFormats) || {};
                  nextLength = next2.length();
                }
              }
              this.quill.deleteText(range.index, length2, _quill2.default.sources.USER);
              if (Object.keys(formats).length > 0) {
                this.quill.formatLine(range.index + nextLength - 1, length2, formats, _quill2.default.sources.USER);
              }
            }
            function handleDeleteRange(range) {
              var lines = this.quill.getLines(range);
              var formats = {};
              if (lines.length > 1) {
                var firstFormats = lines[0].formats();
                var lastFormats = lines[lines.length - 1].formats();
                formats = _op2.default.attributes.diff(lastFormats, firstFormats) || {};
              }
              this.quill.deleteText(range, _quill2.default.sources.USER);
              if (Object.keys(formats).length > 0) {
                this.quill.formatLine(range.index, 1, formats, _quill2.default.sources.USER);
              }
              this.quill.setSelection(range.index, _quill2.default.sources.SILENT);
              this.quill.focus();
            }
            function handleEnter(range, context) {
              var _this3 = this;
              if (range.length > 0) {
                this.quill.scroll.deleteAt(range.index, range.length);
              }
              var lineFormats = Object.keys(context.format).reduce(function(lineFormats2, format) {
                if (_parchment2.default.query(format, _parchment2.default.Scope.BLOCK) && !Array.isArray(context.format[format])) {
                  lineFormats2[format] = context.format[format];
                }
                return lineFormats2;
              }, {});
              this.quill.insertText(range.index, "\n", lineFormats, _quill2.default.sources.USER);
              this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT);
              this.quill.focus();
              Object.keys(context.format).forEach(function(name) {
                if (lineFormats[name] != null)
                  return;
                if (Array.isArray(context.format[name]))
                  return;
                if (name === "link")
                  return;
                _this3.quill.format(name, context.format[name], _quill2.default.sources.USER);
              });
            }
            function makeCodeBlockHandler(indent) {
              return {
                key: Keyboard.keys.TAB,
                shiftKey: !indent,
                format: { "code-block": true },
                handler: function handler(range) {
                  var CodeBlock = _parchment2.default.query("code-block");
                  var index3 = range.index, length2 = range.length;
                  var _quill$scroll$descend = this.quill.scroll.descendant(CodeBlock, index3), _quill$scroll$descend2 = _slicedToArray(_quill$scroll$descend, 2), block = _quill$scroll$descend2[0], offset = _quill$scroll$descend2[1];
                  if (block == null)
                    return;
                  var scrollIndex = this.quill.getIndex(block);
                  var start = block.newlineIndex(offset, true) + 1;
                  var end = block.newlineIndex(scrollIndex + offset + length2);
                  var lines = block.domNode.textContent.slice(start, end).split("\n");
                  offset = 0;
                  lines.forEach(function(line, i3) {
                    if (indent) {
                      block.insertAt(start + offset, CodeBlock.TAB);
                      offset += CodeBlock.TAB.length;
                      if (i3 === 0) {
                        index3 += CodeBlock.TAB.length;
                      } else {
                        length2 += CodeBlock.TAB.length;
                      }
                    } else if (line.startsWith(CodeBlock.TAB)) {
                      block.deleteAt(start + offset, CodeBlock.TAB.length);
                      offset -= CodeBlock.TAB.length;
                      if (i3 === 0) {
                        index3 -= CodeBlock.TAB.length;
                      } else {
                        length2 -= CodeBlock.TAB.length;
                      }
                    }
                    offset += line.length + 1;
                  });
                  this.quill.update(_quill2.default.sources.USER);
                  this.quill.setSelection(index3, length2, _quill2.default.sources.SILENT);
                }
              };
            }
            function makeFormatHandler(format) {
              return {
                key: format[0].toUpperCase(),
                shortKey: true,
                handler: function handler(range, context) {
                  this.quill.format(format, !context.format[format], _quill2.default.sources.USER);
                }
              };
            }
            function normalize(binding) {
              if (typeof binding === "string" || typeof binding === "number") {
                return normalize({ key: binding });
              }
              if ((typeof binding === "undefined" ? "undefined" : _typeof3(binding)) === "object") {
                binding = (0, _clone2.default)(binding, false);
              }
              if (typeof binding.key === "string") {
                if (Keyboard.keys[binding.key.toUpperCase()] != null) {
                  binding.key = Keyboard.keys[binding.key.toUpperCase()];
                } else if (binding.key.length === 1) {
                  binding.key = binding.key.toUpperCase().charCodeAt(0);
                } else {
                  return null;
                }
              }
              if (binding.shortKey) {
                binding[SHORTKEY] = binding.shortKey;
                delete binding.shortKey;
              }
              return binding;
            }
            exports2.default = Keyboard;
            exports2.SHORTKEY = SHORTKEY;
          },
          /* 24 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", {
              value: true
            });
            var _slicedToArray = function() {
              function sliceIterator(arr, i3) {
                var _arr = [];
                var _n = true;
                var _d = false;
                var _e = void 0;
                try {
                  for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
                    _arr.push(_s.value);
                    if (i3 && _arr.length === i3)
                      break;
                  }
                } catch (err) {
                  _d = true;
                  _e = err;
                } finally {
                  try {
                    if (!_n && _i["return"])
                      _i["return"]();
                  } finally {
                    if (_d)
                      throw _e;
                  }
                }
                return _arr;
              }
              return function(arr, i3) {
                if (Array.isArray(arr)) {
                  return arr;
                } else if (Symbol.iterator in Object(arr)) {
                  return sliceIterator(arr, i3);
                } else {
                  throw new TypeError("Invalid attempt to destructure non-iterable instance");
                }
              };
            }();
            var _get = function get(object, property, receiver) {
              if (object === null)
                object = Function.prototype;
              var desc = Object.getOwnPropertyDescriptor(object, property);
              if (desc === void 0) {
                var parent = Object.getPrototypeOf(object);
                if (parent === null) {
                  return void 0;
                } else {
                  return get(parent, property, receiver);
                }
              } else if ("value" in desc) {
                return desc.value;
              } else {
                var getter = desc.get;
                if (getter === void 0) {
                  return void 0;
                }
                return getter.call(receiver);
              }
            };
            var _createClass = function() {
              function defineProperties(target, props) {
                for (var i3 = 0; i3 < props.length; i3++) {
                  var descriptor = props[i3];
                  descriptor.enumerable = descriptor.enumerable || false;
                  descriptor.configurable = true;
                  if ("value" in descriptor)
                    descriptor.writable = true;
                  Object.defineProperty(target, descriptor.key, descriptor);
                }
              }
              return function(Constructor, protoProps, staticProps) {
                if (protoProps)
                  defineProperties(Constructor.prototype, protoProps);
                if (staticProps)
                  defineProperties(Constructor, staticProps);
                return Constructor;
              };
            }();
            var _parchment = __webpack_require__(0);
            var _parchment2 = _interopRequireDefault(_parchment);
            var _text = __webpack_require__(7);
            var _text2 = _interopRequireDefault(_text);
            function _interopRequireDefault(obj) {
              return obj && obj.__esModule ? obj : { default: obj };
            }
            function _classCallCheck2(instance, Constructor) {
              if (!(instance instanceof Constructor)) {
                throw new TypeError("Cannot call a class as a function");
              }
            }
            function _possibleConstructorReturn(self2, call4) {
              if (!self2) {
                throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
              }
              return call4 && (typeof call4 === "object" || typeof call4 === "function") ? call4 : self2;
            }
            function _inherits(subClass, superClass) {
              if (typeof superClass !== "function" && superClass !== null) {
                throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
              }
              subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
              if (superClass)
                Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
            }
            var Cursor = function(_Parchment$Embed) {
              _inherits(Cursor2, _Parchment$Embed);
              _createClass(Cursor2, null, [{
                key: "value",
                value: function value() {
                  return void 0;
                }
              }]);
              function Cursor2(domNode, selection) {
                _classCallCheck2(this, Cursor2);
                var _this = _possibleConstructorReturn(this, (Cursor2.__proto__ || Object.getPrototypeOf(Cursor2)).call(this, domNode));
                _this.selection = selection;
                _this.textNode = document.createTextNode(Cursor2.CONTENTS);
                _this.domNode.appendChild(_this.textNode);
                _this._length = 0;
                return _this;
              }
              _createClass(Cursor2, [{
                key: "detach",
                value: function detach() {
                  if (this.parent != null)
                    this.parent.removeChild(this);
                }
              }, {
                key: "format",
                value: function format(name, value) {
                  if (this._length !== 0) {
                    return _get(Cursor2.prototype.__proto__ || Object.getPrototypeOf(Cursor2.prototype), "format", this).call(this, name, value);
                  }
                  var target = this, index3 = 0;
                  while (target != null && target.statics.scope !== _parchment2.default.Scope.BLOCK_BLOT) {
                    index3 += target.offset(target.parent);
                    target = target.parent;
                  }
                  if (target != null) {
                    this._length = Cursor2.CONTENTS.length;
                    target.optimize();
                    target.formatAt(index3, Cursor2.CONTENTS.length, name, value);
                    this._length = 0;
                  }
                }
              }, {
                key: "index",
                value: function index3(node3, offset) {
                  if (node3 === this.textNode)
                    return 0;
                  return _get(Cursor2.prototype.__proto__ || Object.getPrototypeOf(Cursor2.prototype), "index", this).call(this, node3, offset);
                }
              }, {
                key: "length",
                value: function length2() {
                  return this._length;
                }
              }, {
                key: "position",
                value: function position3() {
                  return [this.textNode, this.textNode.data.length];
                }
              }, {
                key: "remove",
                value: function remove() {
                  _get(Cursor2.prototype.__proto__ || Object.getPrototypeOf(Cursor2.prototype), "remove", this).call(this);
                  this.parent = null;
                }
              }, {
                key: "restore",
                value: function restore() {
                  if (this.selection.composing || this.parent == null)
                    return;
                  var textNode = this.textNode;
                  var range = this.selection.getNativeRange();
                  var restoreText = void 0, start = void 0, end = void 0;
                  if (range != null && range.start.node === textNode && range.end.node === textNode) {
                    var _ref = [textNode, range.start.offset, range.end.offset];
                    restoreText = _ref[0];
                    start = _ref[1];
                    end = _ref[2];
                  }
                  while (this.domNode.lastChild != null && this.domNode.lastChild !== this.textNode) {
                    this.domNode.parentNode.insertBefore(this.domNode.lastChild, this.domNode);
                  }
                  if (this.textNode.data !== Cursor2.CONTENTS) {
                    var text3 = this.textNode.data.split(Cursor2.CONTENTS).join("");
                    if (this.next instanceof _text2.default) {
                      restoreText = this.next.domNode;
                      this.next.insertAt(0, text3);
                      this.textNode.data = Cursor2.CONTENTS;
                    } else {
                      this.textNode.data = text3;
                      this.parent.insertBefore(_parchment2.default.create(this.textNode), this);
                      this.textNode = document.createTextNode(Cursor2.CONTENTS);
                      this.domNode.appendChild(this.textNode);
                    }
                  }
                  this.remove();
                  if (start != null) {
                    var _map = [start, end].map(function(offset) {
                      return Math.max(0, Math.min(restoreText.data.length, offset - 1));
                    });
                    var _map2 = _slicedToArray(_map, 2);
                    start = _map2[0];
                    end = _map2[1];
                    return {
                      startNode: restoreText,
                      startOffset: start,
                      endNode: restoreText,
                      endOffset: end
                    };
                  }
                }
              }, {
                key: "update",
                value: function update(mutations, context) {
                  var _this2 = this;
                  if (mutations.some(function(mutation) {
                    return mutation.type === "characterData" && mutation.target === _this2.textNode;
                  })) {
                    var range = this.restore();
                    if (range)
                      context.range = range;
                  }
                }
              }, {
                key: "value",
                value: function value() {
                  return "";
                }
              }]);
              return Cursor2;
            }(_parchment2.default.Embed);
            Cursor.blotName = "cursor";
            Cursor.className = "ql-cursor";
            Cursor.tagName = "span";
            Cursor.CONTENTS = "\uFEFF";
            exports2.default = Cursor;
          },
          /* 25 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", {
              value: true
            });
            var _parchment = __webpack_require__(0);
            var _parchment2 = _interopRequireDefault(_parchment);
            var _block = __webpack_require__(4);
            var _block2 = _interopRequireDefault(_block);
            function _interopRequireDefault(obj) {
              return obj && obj.__esModule ? obj : { default: obj };
            }
            function _classCallCheck2(instance, Constructor) {
              if (!(instance instanceof Constructor)) {
                throw new TypeError("Cannot call a class as a function");
              }
            }
            function _possibleConstructorReturn(self2, call4) {
              if (!self2) {
                throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
              }
              return call4 && (typeof call4 === "object" || typeof call4 === "function") ? call4 : self2;
            }
            function _inherits(subClass, superClass) {
              if (typeof superClass !== "function" && superClass !== null) {
                throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
              }
              subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
              if (superClass)
                Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
            }
            var Container2 = function(_Parchment$Container) {
              _inherits(Container3, _Parchment$Container);
              function Container3() {
                _classCallCheck2(this, Container3);
                return _possibleConstructorReturn(this, (Container3.__proto__ || Object.getPrototypeOf(Container3)).apply(this, arguments));
              }
              return Container3;
            }(_parchment2.default.Container);
            Container2.allowedChildren = [_block2.default, _block.BlockEmbed, Container2];
            exports2.default = Container2;
          },
          /* 26 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", {
              value: true
            });
            exports2.ColorStyle = exports2.ColorClass = exports2.ColorAttributor = void 0;
            var _createClass = function() {
              function defineProperties(target, props) {
                for (var i3 = 0; i3 < props.length; i3++) {
                  var descriptor = props[i3];
                  descriptor.enumerable = descriptor.enumerable || false;
                  descriptor.configurable = true;
                  if ("value" in descriptor)
                    descriptor.writable = true;
                  Object.defineProperty(target, descriptor.key, descriptor);
                }
              }
              return function(Constructor, protoProps, staticProps) {
                if (protoProps)
                  defineProperties(Constructor.prototype, protoProps);
                if (staticProps)
                  defineProperties(Constructor, staticProps);
                return Constructor;
              };
            }();
            var _get = function get(object, property, receiver) {
              if (object === null)
                object = Function.prototype;
              var desc = Object.getOwnPropertyDescriptor(object, property);
              if (desc === void 0) {
                var parent = Object.getPrototypeOf(object);
                if (parent === null) {
                  return void 0;
                } else {
                  return get(parent, property, receiver);
                }
              } else if ("value" in desc) {
                return desc.value;
              } else {
                var getter = desc.get;
                if (getter === void 0) {
                  return void 0;
                }
                return getter.call(receiver);
              }
            };
            var _parchment = __webpack_require__(0);
            var _parchment2 = _interopRequireDefault(_parchment);
            function _interopRequireDefault(obj) {
              return obj && obj.__esModule ? obj : { default: obj };
            }
            function _classCallCheck2(instance, Constructor) {
              if (!(instance instanceof Constructor)) {
                throw new TypeError("Cannot call a class as a function");
              }
            }
            function _possibleConstructorReturn(self2, call4) {
              if (!self2) {
                throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
              }
              return call4 && (typeof call4 === "object" || typeof call4 === "function") ? call4 : self2;
            }
            function _inherits(subClass, superClass) {
              if (typeof superClass !== "function" && superClass !== null) {
                throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
              }
              subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
              if (superClass)
                Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
            }
            var ColorAttributor = function(_Parchment$Attributor) {
              _inherits(ColorAttributor2, _Parchment$Attributor);
              function ColorAttributor2() {
                _classCallCheck2(this, ColorAttributor2);
                return _possibleConstructorReturn(this, (ColorAttributor2.__proto__ || Object.getPrototypeOf(ColorAttributor2)).apply(this, arguments));
              }
              _createClass(ColorAttributor2, [{
                key: "value",
                value: function value(domNode) {
                  var value2 = _get(ColorAttributor2.prototype.__proto__ || Object.getPrototypeOf(ColorAttributor2.prototype), "value", this).call(this, domNode);
                  if (!value2.startsWith("rgb("))
                    return value2;
                  value2 = value2.replace(/^[^\d]+/, "").replace(/[^\d]+$/, "");
                  return "#" + value2.split(",").map(function(component) {
                    return ("00" + parseInt(component).toString(16)).slice(-2);
                  }).join("");
                }
              }]);
              return ColorAttributor2;
            }(_parchment2.default.Attributor.Style);
            var ColorClass = new _parchment2.default.Attributor.Class("color", "ql-color", {
              scope: _parchment2.default.Scope.INLINE
            });
            var ColorStyle = new ColorAttributor("color", "color", {
              scope: _parchment2.default.Scope.INLINE
            });
            exports2.ColorAttributor = ColorAttributor;
            exports2.ColorClass = ColorClass;
            exports2.ColorStyle = ColorStyle;
          },
          /* 27 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", {
              value: true
            });
            exports2.sanitize = exports2.default = void 0;
            var _createClass = function() {
              function defineProperties(target, props) {
                for (var i3 = 0; i3 < props.length; i3++) {
                  var descriptor = props[i3];
                  descriptor.enumerable = descriptor.enumerable || false;
                  descriptor.configurable = true;
                  if ("value" in descriptor)
                    descriptor.writable = true;
                  Object.defineProperty(target, descriptor.key, descriptor);
                }
              }
              return function(Constructor, protoProps, staticProps) {
                if (protoProps)
                  defineProperties(Constructor.prototype, protoProps);
                if (staticProps)
                  defineProperties(Constructor, staticProps);
                return Constructor;
              };
            }();
            var _get = function get(object, property, receiver) {
              if (object === null)
                object = Function.prototype;
              var desc = Object.getOwnPropertyDescriptor(object, property);
              if (desc === void 0) {
                var parent = Object.getPrototypeOf(object);
                if (parent === null) {
                  return void 0;
                } else {
                  return get(parent, property, receiver);
                }
              } else if ("value" in desc) {
                return desc.value;
              } else {
                var getter = desc.get;
                if (getter === void 0) {
                  return void 0;
                }
                return getter.call(receiver);
              }
            };
            var _inline = __webpack_require__(6);
            var _inline2 = _interopRequireDefault(_inline);
            function _interopRequireDefault(obj) {
              return obj && obj.__esModule ? obj : { default: obj };
            }
            function _classCallCheck2(instance, Constructor) {
              if (!(instance instanceof Constructor)) {
                throw new TypeError("Cannot call a class as a function");
              }
            }
            function _possibleConstructorReturn(self2, call4) {
              if (!self2) {
                throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
              }
              return call4 && (typeof call4 === "object" || typeof call4 === "function") ? call4 : self2;
            }
            function _inherits(subClass, superClass) {
              if (typeof superClass !== "function" && superClass !== null) {
                throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
              }
              subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
              if (superClass)
                Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
            }
            var Link = function(_Inline) {
              _inherits(Link2, _Inline);
              function Link2() {
                _classCallCheck2(this, Link2);
                return _possibleConstructorReturn(this, (Link2.__proto__ || Object.getPrototypeOf(Link2)).apply(this, arguments));
              }
              _createClass(Link2, [{
                key: "format",
                value: function format(name, value) {
                  if (name !== this.statics.blotName || !value)
                    return _get(Link2.prototype.__proto__ || Object.getPrototypeOf(Link2.prototype), "format", this).call(this, name, value);
                  value = this.constructor.sanitize(value);
                  this.domNode.setAttribute("href", value);
                }
              }], [{
                key: "create",
                value: function create2(value) {
                  var node3 = _get(Link2.__proto__ || Object.getPrototypeOf(Link2), "create", this).call(this, value);
                  value = this.sanitize(value);
                  node3.setAttribute("href", value);
                  node3.setAttribute("target", "_blank");
                  return node3;
                }
              }, {
                key: "formats",
                value: function formats(domNode) {
                  return domNode.getAttribute("href");
                }
              }, {
                key: "sanitize",
                value: function sanitize(url) {
                  return _sanitize(url, this.PROTOCOL_WHITELIST) ? url : this.SANITIZED_URL;
                }
              }]);
              return Link2;
            }(_inline2.default);
            Link.blotName = "link";
            Link.tagName = "A";
            Link.SANITIZED_URL = "about:blank";
            Link.PROTOCOL_WHITELIST = ["http", "https", "mailto", "tel"];
            function _sanitize(url, protocols) {
              var anchor = document.createElement("a");
              anchor.href = url;
              var protocol = anchor.href.slice(0, anchor.href.indexOf(":"));
              return protocols.indexOf(protocol) > -1;
            }
            exports2.default = Link;
            exports2.sanitize = _sanitize;
          },
          /* 28 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", {
              value: true
            });
            var _typeof3 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) {
              return typeof obj;
            } : function(obj) {
              return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
            };
            var _createClass = function() {
              function defineProperties(target, props) {
                for (var i3 = 0; i3 < props.length; i3++) {
                  var descriptor = props[i3];
                  descriptor.enumerable = descriptor.enumerable || false;
                  descriptor.configurable = true;
                  if ("value" in descriptor)
                    descriptor.writable = true;
                  Object.defineProperty(target, descriptor.key, descriptor);
                }
              }
              return function(Constructor, protoProps, staticProps) {
                if (protoProps)
                  defineProperties(Constructor.prototype, protoProps);
                if (staticProps)
                  defineProperties(Constructor, staticProps);
                return Constructor;
              };
            }();
            var _keyboard = __webpack_require__(23);
            var _keyboard2 = _interopRequireDefault(_keyboard);
            var _dropdown = __webpack_require__(107);
            var _dropdown2 = _interopRequireDefault(_dropdown);
            function _interopRequireDefault(obj) {
              return obj && obj.__esModule ? obj : { default: obj };
            }
            function _classCallCheck2(instance, Constructor) {
              if (!(instance instanceof Constructor)) {
                throw new TypeError("Cannot call a class as a function");
              }
            }
            var optionsCounter = 0;
            function toggleAriaAttribute(element2, attribute) {
              element2.setAttribute(attribute, !(element2.getAttribute(attribute) === "true"));
            }
            var Picker = function() {
              function Picker2(select) {
                var _this = this;
                _classCallCheck2(this, Picker2);
                this.select = select;
                this.container = document.createElement("span");
                this.buildPicker();
                this.select.style.display = "none";
                this.select.parentNode.insertBefore(this.container, this.select);
                this.label.addEventListener("mousedown", function() {
                  _this.togglePicker();
                });
                this.label.addEventListener("keydown", function(event) {
                  switch (event.keyCode) {
                    case _keyboard2.default.keys.ENTER:
                      _this.togglePicker();
                      break;
                    case _keyboard2.default.keys.ESCAPE:
                      _this.escape();
                      event.preventDefault();
                      break;
                    default:
                  }
                });
                this.select.addEventListener("change", this.update.bind(this));
              }
              _createClass(Picker2, [{
                key: "togglePicker",
                value: function togglePicker() {
                  this.container.classList.toggle("ql-expanded");
                  toggleAriaAttribute(this.label, "aria-expanded");
                  toggleAriaAttribute(this.options, "aria-hidden");
                }
              }, {
                key: "buildItem",
                value: function buildItem(option) {
                  var _this2 = this;
                  var item = document.createElement("span");
                  item.tabIndex = "0";
                  item.setAttribute("role", "button");
                  item.classList.add("ql-picker-item");
                  if (option.hasAttribute("value")) {
                    item.setAttribute("data-value", option.getAttribute("value"));
                  }
                  if (option.textContent) {
                    item.setAttribute("data-label", option.textContent);
                  }
                  item.addEventListener("click", function() {
                    _this2.selectItem(item, true);
                  });
                  item.addEventListener("keydown", function(event) {
                    switch (event.keyCode) {
                      case _keyboard2.default.keys.ENTER:
                        _this2.selectItem(item, true);
                        event.preventDefault();
                        break;
                      case _keyboard2.default.keys.ESCAPE:
                        _this2.escape();
                        event.preventDefault();
                        break;
                      default:
                    }
                  });
                  return item;
                }
              }, {
                key: "buildLabel",
                value: function buildLabel() {
                  var label = document.createElement("span");
                  label.classList.add("ql-picker-label");
                  label.innerHTML = _dropdown2.default;
                  label.tabIndex = "0";
                  label.setAttribute("role", "button");
                  label.setAttribute("aria-expanded", "false");
                  this.container.appendChild(label);
                  return label;
                }
              }, {
                key: "buildOptions",
                value: function buildOptions() {
                  var _this3 = this;
                  var options = document.createElement("span");
                  options.classList.add("ql-picker-options");
                  options.setAttribute("aria-hidden", "true");
                  options.tabIndex = "-1";
                  options.id = "ql-picker-options-" + optionsCounter;
                  optionsCounter += 1;
                  this.label.setAttribute("aria-controls", options.id);
                  this.options = options;
                  [].slice.call(this.select.options).forEach(function(option) {
                    var item = _this3.buildItem(option);
                    options.appendChild(item);
                    if (option.selected === true) {
                      _this3.selectItem(item);
                    }
                  });
                  this.container.appendChild(options);
                }
              }, {
                key: "buildPicker",
                value: function buildPicker() {
                  var _this4 = this;
                  [].slice.call(this.select.attributes).forEach(function(item) {
                    _this4.container.setAttribute(item.name, item.value);
                  });
                  this.container.classList.add("ql-picker");
                  this.label = this.buildLabel();
                  this.buildOptions();
                }
              }, {
                key: "escape",
                value: function escape() {
                  var _this5 = this;
                  this.close();
                  setTimeout(function() {
                    return _this5.label.focus();
                  }, 1);
                }
              }, {
                key: "close",
                value: function close2() {
                  this.container.classList.remove("ql-expanded");
                  this.label.setAttribute("aria-expanded", "false");
                  this.options.setAttribute("aria-hidden", "true");
                }
              }, {
                key: "selectItem",
                value: function selectItem(item) {
                  var trigger = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
                  var selected = this.container.querySelector(".ql-selected");
                  if (item === selected)
                    return;
                  if (selected != null) {
                    selected.classList.remove("ql-selected");
                  }
                  if (item == null)
                    return;
                  item.classList.add("ql-selected");
                  this.select.selectedIndex = [].indexOf.call(item.parentNode.children, item);
                  if (item.hasAttribute("data-value")) {
                    this.label.setAttribute("data-value", item.getAttribute("data-value"));
                  } else {
                    this.label.removeAttribute("data-value");
                  }
                  if (item.hasAttribute("data-label")) {
                    this.label.setAttribute("data-label", item.getAttribute("data-label"));
                  } else {
                    this.label.removeAttribute("data-label");
                  }
                  if (trigger) {
                    if (typeof Event === "function") {
                      this.select.dispatchEvent(new Event("change"));
                    } else if ((typeof Event === "undefined" ? "undefined" : _typeof3(Event)) === "object") {
                      var event = document.createEvent("Event");
                      event.initEvent("change", true, true);
                      this.select.dispatchEvent(event);
                    }
                    this.close();
                  }
                }
              }, {
                key: "update",
                value: function update() {
                  var option = void 0;
                  if (this.select.selectedIndex > -1) {
                    var item = this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];
                    option = this.select.options[this.select.selectedIndex];
                    this.selectItem(item);
                  } else {
                    this.selectItem(null);
                  }
                  var isActive = option != null && option !== this.select.querySelector("option[selected]");
                  this.label.classList.toggle("ql-active", isActive);
                }
              }]);
              return Picker2;
            }();
            exports2.default = Picker;
          },
          /* 29 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", {
              value: true
            });
            var _parchment = __webpack_require__(0);
            var _parchment2 = _interopRequireDefault(_parchment);
            var _quill = __webpack_require__(5);
            var _quill2 = _interopRequireDefault(_quill);
            var _block = __webpack_require__(4);
            var _block2 = _interopRequireDefault(_block);
            var _break = __webpack_require__(16);
            var _break2 = _interopRequireDefault(_break);
            var _container = __webpack_require__(25);
            var _container2 = _interopRequireDefault(_container);
            var _cursor = __webpack_require__(24);
            var _cursor2 = _interopRequireDefault(_cursor);
            var _embed = __webpack_require__(35);
            var _embed2 = _interopRequireDefault(_embed);
            var _inline = __webpack_require__(6);
            var _inline2 = _interopRequireDefault(_inline);
            var _scroll = __webpack_require__(22);
            var _scroll2 = _interopRequireDefault(_scroll);
            var _text = __webpack_require__(7);
            var _text2 = _interopRequireDefault(_text);
            var _clipboard = __webpack_require__(55);
            var _clipboard2 = _interopRequireDefault(_clipboard);
            var _history = __webpack_require__(42);
            var _history2 = _interopRequireDefault(_history);
            var _keyboard = __webpack_require__(23);
            var _keyboard2 = _interopRequireDefault(_keyboard);
            function _interopRequireDefault(obj) {
              return obj && obj.__esModule ? obj : { default: obj };
            }
            _quill2.default.register({
              "blots/block": _block2.default,
              "blots/block/embed": _block.BlockEmbed,
              "blots/break": _break2.default,
              "blots/container": _container2.default,
              "blots/cursor": _cursor2.default,
              "blots/embed": _embed2.default,
              "blots/inline": _inline2.default,
              "blots/scroll": _scroll2.default,
              "blots/text": _text2.default,
              "modules/clipboard": _clipboard2.default,
              "modules/history": _history2.default,
              "modules/keyboard": _keyboard2.default
            });
            _parchment2.default.register(_block2.default, _break2.default, _cursor2.default, _inline2.default, _scroll2.default, _text2.default);
            exports2.default = _quill2.default;
          },
          /* 30 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", { value: true });
            var Registry = __webpack_require__(1);
            var ShadowBlot = (
              /** @class */
              function() {
                function ShadowBlot2(domNode) {
                  this.domNode = domNode;
                  this.domNode[Registry.DATA_KEY] = { blot: this };
                }
                Object.defineProperty(ShadowBlot2.prototype, "statics", {
                  // Hack for accessing inherited static methods
                  get: function() {
                    return this.constructor;
                  },
                  enumerable: true,
                  configurable: true
                });
                ShadowBlot2.create = function(value) {
                  if (this.tagName == null) {
                    throw new Registry.ParchmentError("Blot definition missing tagName");
                  }
                  var node3;
                  if (Array.isArray(this.tagName)) {
                    if (typeof value === "string") {
                      value = value.toUpperCase();
                      if (parseInt(value).toString() === value) {
                        value = parseInt(value);
                      }
                    }
                    if (typeof value === "number") {
                      node3 = document.createElement(this.tagName[value - 1]);
                    } else if (this.tagName.indexOf(value) > -1) {
                      node3 = document.createElement(value);
                    } else {
                      node3 = document.createElement(this.tagName[0]);
                    }
                  } else {
                    node3 = document.createElement(this.tagName);
                  }
                  if (this.className) {
                    node3.classList.add(this.className);
                  }
                  return node3;
                };
                ShadowBlot2.prototype.attach = function() {
                  if (this.parent != null) {
                    this.scroll = this.parent.scroll;
                  }
                };
                ShadowBlot2.prototype.clone = function() {
                  var domNode = this.domNode.cloneNode(false);
                  return Registry.create(domNode);
                };
                ShadowBlot2.prototype.detach = function() {
                  if (this.parent != null)
                    this.parent.removeChild(this);
                  delete this.domNode[Registry.DATA_KEY];
                };
                ShadowBlot2.prototype.deleteAt = function(index3, length2) {
                  var blot = this.isolate(index3, length2);
                  blot.remove();
                };
                ShadowBlot2.prototype.formatAt = function(index3, length2, name, value) {
                  var blot = this.isolate(index3, length2);
                  if (Registry.query(name, Registry.Scope.BLOT) != null && value) {
                    blot.wrap(name, value);
                  } else if (Registry.query(name, Registry.Scope.ATTRIBUTE) != null) {
                    var parent = Registry.create(this.statics.scope);
                    blot.wrap(parent);
                    parent.format(name, value);
                  }
                };
                ShadowBlot2.prototype.insertAt = function(index3, value, def) {
                  var blot = def == null ? Registry.create("text", value) : Registry.create(value, def);
                  var ref = this.split(index3);
                  this.parent.insertBefore(blot, ref);
                };
                ShadowBlot2.prototype.insertInto = function(parentBlot, refBlot) {
                  if (refBlot === void 0) {
                    refBlot = null;
                  }
                  if (this.parent != null) {
                    this.parent.children.remove(this);
                  }
                  var refDomNode = null;
                  parentBlot.children.insertBefore(this, refBlot);
                  if (refBlot != null) {
                    refDomNode = refBlot.domNode;
                  }
                  if (this.domNode.parentNode != parentBlot.domNode || this.domNode.nextSibling != refDomNode) {
                    parentBlot.domNode.insertBefore(this.domNode, refDomNode);
                  }
                  this.parent = parentBlot;
                  this.attach();
                };
                ShadowBlot2.prototype.isolate = function(index3, length2) {
                  var target = this.split(index3);
                  target.split(length2);
                  return target;
                };
                ShadowBlot2.prototype.length = function() {
                  return 1;
                };
                ShadowBlot2.prototype.offset = function(root2) {
                  if (root2 === void 0) {
                    root2 = this.parent;
                  }
                  if (this.parent == null || this == root2)
                    return 0;
                  return this.parent.children.offset(this) + this.parent.offset(root2);
                };
                ShadowBlot2.prototype.optimize = function(context) {
                  if (this.domNode[Registry.DATA_KEY] != null) {
                    delete this.domNode[Registry.DATA_KEY].mutations;
                  }
                };
                ShadowBlot2.prototype.remove = function() {
                  if (this.domNode.parentNode != null) {
                    this.domNode.parentNode.removeChild(this.domNode);
                  }
                  this.detach();
                };
                ShadowBlot2.prototype.replace = function(target) {
                  if (target.parent == null)
                    return;
                  target.parent.insertBefore(this, target.next);
                  target.remove();
                };
                ShadowBlot2.prototype.replaceWith = function(name, value) {
                  var replacement = typeof name === "string" ? Registry.create(name, value) : name;
                  replacement.replace(this);
                  return replacement;
                };
                ShadowBlot2.prototype.split = function(index3, force) {
                  return index3 === 0 ? this : this.next;
                };
                ShadowBlot2.prototype.update = function(mutations, context) {
                };
                ShadowBlot2.prototype.wrap = function(name, value) {
                  var wrapper = typeof name === "string" ? Registry.create(name, value) : name;
                  if (this.parent != null) {
                    this.parent.insertBefore(wrapper, this.next);
                  }
                  wrapper.appendChild(this);
                  return wrapper;
                };
                ShadowBlot2.blotName = "abstract";
                return ShadowBlot2;
              }()
            );
            exports2.default = ShadowBlot;
          },
          /* 31 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", { value: true });
            var attributor_1 = __webpack_require__(12);
            var class_1 = __webpack_require__(32);
            var style_1 = __webpack_require__(33);
            var Registry = __webpack_require__(1);
            var AttributorStore = (
              /** @class */
              function() {
                function AttributorStore2(domNode) {
                  this.attributes = {};
                  this.domNode = domNode;
                  this.build();
                }
                AttributorStore2.prototype.attribute = function(attribute, value) {
                  if (value) {
                    if (attribute.add(this.domNode, value)) {
                      if (attribute.value(this.domNode) != null) {
                        this.attributes[attribute.attrName] = attribute;
                      } else {
                        delete this.attributes[attribute.attrName];
                      }
                    }
                  } else {
                    attribute.remove(this.domNode);
                    delete this.attributes[attribute.attrName];
                  }
                };
                AttributorStore2.prototype.build = function() {
                  var _this = this;
                  this.attributes = {};
                  var attributes = attributor_1.default.keys(this.domNode);
                  var classes2 = class_1.default.keys(this.domNode);
                  var styles = style_1.default.keys(this.domNode);
                  attributes.concat(classes2).concat(styles).forEach(function(name) {
                    var attr2 = Registry.query(name, Registry.Scope.ATTRIBUTE);
                    if (attr2 instanceof attributor_1.default) {
                      _this.attributes[attr2.attrName] = attr2;
                    }
                  });
                };
                AttributorStore2.prototype.copy = function(target) {
                  var _this = this;
                  Object.keys(this.attributes).forEach(function(key) {
                    var value = _this.attributes[key].value(_this.domNode);
                    target.format(key, value);
                  });
                };
                AttributorStore2.prototype.move = function(target) {
                  var _this = this;
                  this.copy(target);
                  Object.keys(this.attributes).forEach(function(key) {
                    _this.attributes[key].remove(_this.domNode);
                  });
                  this.attributes = {};
                };
                AttributorStore2.prototype.values = function() {
                  var _this = this;
                  return Object.keys(this.attributes).reduce(function(attributes, name) {
                    attributes[name] = _this.attributes[name].value(_this.domNode);
                    return attributes;
                  }, {});
                };
                return AttributorStore2;
              }()
            );
            exports2.default = AttributorStore;
          },
          /* 32 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            var __extends = this && this.__extends || function() {
              var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
                d2.__proto__ = b2;
              } || function(d2, b2) {
                for (var p3 in b2)
                  if (b2.hasOwnProperty(p3))
                    d2[p3] = b2[p3];
              };
              return function(d2, b2) {
                extendStatics(d2, b2);
                function __() {
                  this.constructor = d2;
                }
                d2.prototype = b2 === null ? Object.create(b2) : (__.prototype = b2.prototype, new __());
              };
            }();
            Object.defineProperty(exports2, "__esModule", { value: true });
            var attributor_1 = __webpack_require__(12);
            function match(node3, prefix) {
              var className = node3.getAttribute("class") || "";
              return className.split(/\s+/).filter(function(name) {
                return name.indexOf(prefix + "-") === 0;
              });
            }
            var ClassAttributor = (
              /** @class */
              function(_super) {
                __extends(ClassAttributor2, _super);
                function ClassAttributor2() {
                  return _super !== null && _super.apply(this, arguments) || this;
                }
                ClassAttributor2.keys = function(node3) {
                  return (node3.getAttribute("class") || "").split(/\s+/).map(function(name) {
                    return name.split("-").slice(0, -1).join("-");
                  });
                };
                ClassAttributor2.prototype.add = function(node3, value) {
                  if (!this.canAdd(node3, value))
                    return false;
                  this.remove(node3);
                  node3.classList.add(this.keyName + "-" + value);
                  return true;
                };
                ClassAttributor2.prototype.remove = function(node3) {
                  var matches = match(node3, this.keyName);
                  matches.forEach(function(name) {
                    node3.classList.remove(name);
                  });
                  if (node3.classList.length === 0) {
                    node3.removeAttribute("class");
                  }
                };
                ClassAttributor2.prototype.value = function(node3) {
                  var result = match(node3, this.keyName)[0] || "";
                  var value = result.slice(this.keyName.length + 1);
                  return this.canAdd(node3, value) ? value : "";
                };
                return ClassAttributor2;
              }(attributor_1.default)
            );
            exports2.default = ClassAttributor;
          },
          /* 33 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            var __extends = this && this.__extends || function() {
              var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
                d2.__proto__ = b2;
              } || function(d2, b2) {
                for (var p3 in b2)
                  if (b2.hasOwnProperty(p3))
                    d2[p3] = b2[p3];
              };
              return function(d2, b2) {
                extendStatics(d2, b2);
                function __() {
                  this.constructor = d2;
                }
                d2.prototype = b2 === null ? Object.create(b2) : (__.prototype = b2.prototype, new __());
              };
            }();
            Object.defineProperty(exports2, "__esModule", { value: true });
            var attributor_1 = __webpack_require__(12);
            function camelize(name) {
              var parts = name.split("-");
              var rest = parts.slice(1).map(function(part) {
                return part[0].toUpperCase() + part.slice(1);
              }).join("");
              return parts[0] + rest;
            }
            var StyleAttributor = (
              /** @class */
              function(_super) {
                __extends(StyleAttributor2, _super);
                function StyleAttributor2() {
                  return _super !== null && _super.apply(this, arguments) || this;
                }
                StyleAttributor2.keys = function(node3) {
                  return (node3.getAttribute("style") || "").split(";").map(function(value) {
                    var arr = value.split(":");
                    return arr[0].trim();
                  });
                };
                StyleAttributor2.prototype.add = function(node3, value) {
                  if (!this.canAdd(node3, value))
                    return false;
                  node3.style[camelize(this.keyName)] = value;
                  return true;
                };
                StyleAttributor2.prototype.remove = function(node3) {
                  node3.style[camelize(this.keyName)] = "";
                  if (!node3.getAttribute("style")) {
                    node3.removeAttribute("style");
                  }
                };
                StyleAttributor2.prototype.value = function(node3) {
                  var value = node3.style[camelize(this.keyName)];
                  return this.canAdd(node3, value) ? value : "";
                };
                return StyleAttributor2;
              }(attributor_1.default)
            );
            exports2.default = StyleAttributor;
          },
          /* 34 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", {
              value: true
            });
            var _createClass = function() {
              function defineProperties(target, props) {
                for (var i3 = 0; i3 < props.length; i3++) {
                  var descriptor = props[i3];
                  descriptor.enumerable = descriptor.enumerable || false;
                  descriptor.configurable = true;
                  if ("value" in descriptor)
                    descriptor.writable = true;
                  Object.defineProperty(target, descriptor.key, descriptor);
                }
              }
              return function(Constructor, protoProps, staticProps) {
                if (protoProps)
                  defineProperties(Constructor.prototype, protoProps);
                if (staticProps)
                  defineProperties(Constructor, staticProps);
                return Constructor;
              };
            }();
            function _classCallCheck2(instance, Constructor) {
              if (!(instance instanceof Constructor)) {
                throw new TypeError("Cannot call a class as a function");
              }
            }
            var Theme = function() {
              function Theme2(quill, options) {
                _classCallCheck2(this, Theme2);
                this.quill = quill;
                this.options = options;
                this.modules = {};
              }
              _createClass(Theme2, [{
                key: "init",
                value: function init() {
                  var _this = this;
                  Object.keys(this.options.modules).forEach(function(name) {
                    if (_this.modules[name] == null) {
                      _this.addModule(name);
                    }
                  });
                }
              }, {
                key: "addModule",
                value: function addModule(name) {
                  var moduleClass = this.quill.constructor.import("modules/" + name);
                  this.modules[name] = new moduleClass(this.quill, this.options.modules[name] || {});
                  return this.modules[name];
                }
              }]);
              return Theme2;
            }();
            Theme.DEFAULTS = {
              modules: {}
            };
            Theme.themes = {
              "default": Theme
            };
            exports2.default = Theme;
          },
          /* 35 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", {
              value: true
            });
            var _createClass = function() {
              function defineProperties(target, props) {
                for (var i3 = 0; i3 < props.length; i3++) {
                  var descriptor = props[i3];
                  descriptor.enumerable = descriptor.enumerable || false;
                  descriptor.configurable = true;
                  if ("value" in descriptor)
                    descriptor.writable = true;
                  Object.defineProperty(target, descriptor.key, descriptor);
                }
              }
              return function(Constructor, protoProps, staticProps) {
                if (protoProps)
                  defineProperties(Constructor.prototype, protoProps);
                if (staticProps)
                  defineProperties(Constructor, staticProps);
                return Constructor;
              };
            }();
            var _get = function get(object, property, receiver) {
              if (object === null)
                object = Function.prototype;
              var desc = Object.getOwnPropertyDescriptor(object, property);
              if (desc === void 0) {
                var parent = Object.getPrototypeOf(object);
                if (parent === null) {
                  return void 0;
                } else {
                  return get(parent, property, receiver);
                }
              } else if ("value" in desc) {
                return desc.value;
              } else {
                var getter = desc.get;
                if (getter === void 0) {
                  return void 0;
                }
                return getter.call(receiver);
              }
            };
            var _parchment = __webpack_require__(0);
            var _parchment2 = _interopRequireDefault(_parchment);
            var _text = __webpack_require__(7);
            var _text2 = _interopRequireDefault(_text);
            function _interopRequireDefault(obj) {
              return obj && obj.__esModule ? obj : { default: obj };
            }
            function _classCallCheck2(instance, Constructor) {
              if (!(instance instanceof Constructor)) {
                throw new TypeError("Cannot call a class as a function");
              }
            }
            function _possibleConstructorReturn(self2, call4) {
              if (!self2) {
                throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
              }
              return call4 && (typeof call4 === "object" || typeof call4 === "function") ? call4 : self2;
            }
            function _inherits(subClass, superClass) {
              if (typeof superClass !== "function" && superClass !== null) {
                throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
              }
              subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
              if (superClass)
                Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
            }
            var GUARD_TEXT = "\uFEFF";
            var Embed = function(_Parchment$Embed) {
              _inherits(Embed2, _Parchment$Embed);
              function Embed2(node3) {
                _classCallCheck2(this, Embed2);
                var _this = _possibleConstructorReturn(this, (Embed2.__proto__ || Object.getPrototypeOf(Embed2)).call(this, node3));
                _this.contentNode = document.createElement("span");
                _this.contentNode.setAttribute("contenteditable", false);
                [].slice.call(_this.domNode.childNodes).forEach(function(childNode) {
                  _this.contentNode.appendChild(childNode);
                });
                _this.leftGuard = document.createTextNode(GUARD_TEXT);
                _this.rightGuard = document.createTextNode(GUARD_TEXT);
                _this.domNode.appendChild(_this.leftGuard);
                _this.domNode.appendChild(_this.contentNode);
                _this.domNode.appendChild(_this.rightGuard);
                return _this;
              }
              _createClass(Embed2, [{
                key: "index",
                value: function index3(node3, offset) {
                  if (node3 === this.leftGuard)
                    return 0;
                  if (node3 === this.rightGuard)
                    return 1;
                  return _get(Embed2.prototype.__proto__ || Object.getPrototypeOf(Embed2.prototype), "index", this).call(this, node3, offset);
                }
              }, {
                key: "restore",
                value: function restore(node3) {
                  var range = void 0, textNode = void 0;
                  var text3 = node3.data.split(GUARD_TEXT).join("");
                  if (node3 === this.leftGuard) {
                    if (this.prev instanceof _text2.default) {
                      var prevLength = this.prev.length();
                      this.prev.insertAt(prevLength, text3);
                      range = {
                        startNode: this.prev.domNode,
                        startOffset: prevLength + text3.length
                      };
                    } else {
                      textNode = document.createTextNode(text3);
                      this.parent.insertBefore(_parchment2.default.create(textNode), this);
                      range = {
                        startNode: textNode,
                        startOffset: text3.length
                      };
                    }
                  } else if (node3 === this.rightGuard) {
                    if (this.next instanceof _text2.default) {
                      this.next.insertAt(0, text3);
                      range = {
                        startNode: this.next.domNode,
                        startOffset: text3.length
                      };
                    } else {
                      textNode = document.createTextNode(text3);
                      this.parent.insertBefore(_parchment2.default.create(textNode), this.next);
                      range = {
                        startNode: textNode,
                        startOffset: text3.length
                      };
                    }
                  }
                  node3.data = GUARD_TEXT;
                  return range;
                }
              }, {
                key: "update",
                value: function update(mutations, context) {
                  var _this2 = this;
                  mutations.forEach(function(mutation) {
                    if (mutation.type === "characterData" && (mutation.target === _this2.leftGuard || mutation.target === _this2.rightGuard)) {
                      var range = _this2.restore(mutation.target);
                      if (range)
                        context.range = range;
                    }
                  });
                }
              }]);
              return Embed2;
            }(_parchment2.default.Embed);
            exports2.default = Embed;
          },
          /* 36 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", {
              value: true
            });
            exports2.AlignStyle = exports2.AlignClass = exports2.AlignAttribute = void 0;
            var _parchment = __webpack_require__(0);
            var _parchment2 = _interopRequireDefault(_parchment);
            function _interopRequireDefault(obj) {
              return obj && obj.__esModule ? obj : { default: obj };
            }
            var config = {
              scope: _parchment2.default.Scope.BLOCK,
              whitelist: ["right", "center", "justify"]
            };
            var AlignAttribute = new _parchment2.default.Attributor.Attribute("align", "align", config);
            var AlignClass = new _parchment2.default.Attributor.Class("align", "ql-align", config);
            var AlignStyle = new _parchment2.default.Attributor.Style("align", "text-align", config);
            exports2.AlignAttribute = AlignAttribute;
            exports2.AlignClass = AlignClass;
            exports2.AlignStyle = AlignStyle;
          },
          /* 37 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", {
              value: true
            });
            exports2.BackgroundStyle = exports2.BackgroundClass = void 0;
            var _parchment = __webpack_require__(0);
            var _parchment2 = _interopRequireDefault(_parchment);
            var _color = __webpack_require__(26);
            function _interopRequireDefault(obj) {
              return obj && obj.__esModule ? obj : { default: obj };
            }
            var BackgroundClass = new _parchment2.default.Attributor.Class("background", "ql-bg", {
              scope: _parchment2.default.Scope.INLINE
            });
            var BackgroundStyle = new _color.ColorAttributor("background", "background-color", {
              scope: _parchment2.default.Scope.INLINE
            });
            exports2.BackgroundClass = BackgroundClass;
            exports2.BackgroundStyle = BackgroundStyle;
          },
          /* 38 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", {
              value: true
            });
            exports2.DirectionStyle = exports2.DirectionClass = exports2.DirectionAttribute = void 0;
            var _parchment = __webpack_require__(0);
            var _parchment2 = _interopRequireDefault(_parchment);
            function _interopRequireDefault(obj) {
              return obj && obj.__esModule ? obj : { default: obj };
            }
            var config = {
              scope: _parchment2.default.Scope.BLOCK,
              whitelist: ["rtl"]
            };
            var DirectionAttribute = new _parchment2.default.Attributor.Attribute("direction", "dir", config);
            var DirectionClass = new _parchment2.default.Attributor.Class("direction", "ql-direction", config);
            var DirectionStyle = new _parchment2.default.Attributor.Style("direction", "direction", config);
            exports2.DirectionAttribute = DirectionAttribute;
            exports2.DirectionClass = DirectionClass;
            exports2.DirectionStyle = DirectionStyle;
          },
          /* 39 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", {
              value: true
            });
            exports2.FontClass = exports2.FontStyle = void 0;
            var _createClass = function() {
              function defineProperties(target, props) {
                for (var i3 = 0; i3 < props.length; i3++) {
                  var descriptor = props[i3];
                  descriptor.enumerable = descriptor.enumerable || false;
                  descriptor.configurable = true;
                  if ("value" in descriptor)
                    descriptor.writable = true;
                  Object.defineProperty(target, descriptor.key, descriptor);
                }
              }
              return function(Constructor, protoProps, staticProps) {
                if (protoProps)
                  defineProperties(Constructor.prototype, protoProps);
                if (staticProps)
                  defineProperties(Constructor, staticProps);
                return Constructor;
              };
            }();
            var _get = function get(object, property, receiver) {
              if (object === null)
                object = Function.prototype;
              var desc = Object.getOwnPropertyDescriptor(object, property);
              if (desc === void 0) {
                var parent = Object.getPrototypeOf(object);
                if (parent === null) {
                  return void 0;
                } else {
                  return get(parent, property, receiver);
                }
              } else if ("value" in desc) {
                return desc.value;
              } else {
                var getter = desc.get;
                if (getter === void 0) {
                  return void 0;
                }
                return getter.call(receiver);
              }
            };
            var _parchment = __webpack_require__(0);
            var _parchment2 = _interopRequireDefault(_parchment);
            function _interopRequireDefault(obj) {
              return obj && obj.__esModule ? obj : { default: obj };
            }
            function _classCallCheck2(instance, Constructor) {
              if (!(instance instanceof Constructor)) {
                throw new TypeError("Cannot call a class as a function");
              }
            }
            function _possibleConstructorReturn(self2, call4) {
              if (!self2) {
                throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
              }
              return call4 && (typeof call4 === "object" || typeof call4 === "function") ? call4 : self2;
            }
            function _inherits(subClass, superClass) {
              if (typeof superClass !== "function" && superClass !== null) {
                throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
              }
              subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
              if (superClass)
                Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
            }
            var config = {
              scope: _parchment2.default.Scope.INLINE,
              whitelist: ["serif", "monospace"]
            };
            var FontClass = new _parchment2.default.Attributor.Class("font", "ql-font", config);
            var FontStyleAttributor = function(_Parchment$Attributor) {
              _inherits(FontStyleAttributor2, _Parchment$Attributor);
              function FontStyleAttributor2() {
                _classCallCheck2(this, FontStyleAttributor2);
                return _possibleConstructorReturn(this, (FontStyleAttributor2.__proto__ || Object.getPrototypeOf(FontStyleAttributor2)).apply(this, arguments));
              }
              _createClass(FontStyleAttributor2, [{
                key: "value",
                value: function value(node3) {
                  return _get(FontStyleAttributor2.prototype.__proto__ || Object.getPrototypeOf(FontStyleAttributor2.prototype), "value", this).call(this, node3).replace(/["']/g, "");
                }
              }]);
              return FontStyleAttributor2;
            }(_parchment2.default.Attributor.Style);
            var FontStyle = new FontStyleAttributor("font", "font-family", config);
            exports2.FontStyle = FontStyle;
            exports2.FontClass = FontClass;
          },
          /* 40 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", {
              value: true
            });
            exports2.SizeStyle = exports2.SizeClass = void 0;
            var _parchment = __webpack_require__(0);
            var _parchment2 = _interopRequireDefault(_parchment);
            function _interopRequireDefault(obj) {
              return obj && obj.__esModule ? obj : { default: obj };
            }
            var SizeClass = new _parchment2.default.Attributor.Class("size", "ql-size", {
              scope: _parchment2.default.Scope.INLINE,
              whitelist: ["small", "large", "huge"]
            });
            var SizeStyle = new _parchment2.default.Attributor.Style("size", "font-size", {
              scope: _parchment2.default.Scope.INLINE,
              whitelist: ["10px", "18px", "32px"]
            });
            exports2.SizeClass = SizeClass;
            exports2.SizeStyle = SizeStyle;
          },
          /* 41 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            module2.exports = {
              "align": {
                "": __webpack_require__(76),
                "center": __webpack_require__(77),
                "right": __webpack_require__(78),
                "justify": __webpack_require__(79)
              },
              "background": __webpack_require__(80),
              "blockquote": __webpack_require__(81),
              "bold": __webpack_require__(82),
              "clean": __webpack_require__(83),
              "code": __webpack_require__(58),
              "code-block": __webpack_require__(58),
              "color": __webpack_require__(84),
              "direction": {
                "": __webpack_require__(85),
                "rtl": __webpack_require__(86)
              },
              "float": {
                "center": __webpack_require__(87),
                "full": __webpack_require__(88),
                "left": __webpack_require__(89),
                "right": __webpack_require__(90)
              },
              "formula": __webpack_require__(91),
              "header": {
                "1": __webpack_require__(92),
                "2": __webpack_require__(93)
              },
              "italic": __webpack_require__(94),
              "image": __webpack_require__(95),
              "indent": {
                "+1": __webpack_require__(96),
                "-1": __webpack_require__(97)
              },
              "link": __webpack_require__(98),
              "list": {
                "ordered": __webpack_require__(99),
                "bullet": __webpack_require__(100),
                "check": __webpack_require__(101)
              },
              "script": {
                "sub": __webpack_require__(102),
                "super": __webpack_require__(103)
              },
              "strike": __webpack_require__(104),
              "underline": __webpack_require__(105),
              "video": __webpack_require__(106)
            };
          },
          /* 42 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", {
              value: true
            });
            exports2.getLastChangeIndex = exports2.default = void 0;
            var _createClass = function() {
              function defineProperties(target, props) {
                for (var i3 = 0; i3 < props.length; i3++) {
                  var descriptor = props[i3];
                  descriptor.enumerable = descriptor.enumerable || false;
                  descriptor.configurable = true;
                  if ("value" in descriptor)
                    descriptor.writable = true;
                  Object.defineProperty(target, descriptor.key, descriptor);
                }
              }
              return function(Constructor, protoProps, staticProps) {
                if (protoProps)
                  defineProperties(Constructor.prototype, protoProps);
                if (staticProps)
                  defineProperties(Constructor, staticProps);
                return Constructor;
              };
            }();
            var _parchment = __webpack_require__(0);
            var _parchment2 = _interopRequireDefault(_parchment);
            var _quill = __webpack_require__(5);
            var _quill2 = _interopRequireDefault(_quill);
            var _module = __webpack_require__(9);
            var _module2 = _interopRequireDefault(_module);
            function _interopRequireDefault(obj) {
              return obj && obj.__esModule ? obj : { default: obj };
            }
            function _classCallCheck2(instance, Constructor) {
              if (!(instance instanceof Constructor)) {
                throw new TypeError("Cannot call a class as a function");
              }
            }
            function _possibleConstructorReturn(self2, call4) {
              if (!self2) {
                throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
              }
              return call4 && (typeof call4 === "object" || typeof call4 === "function") ? call4 : self2;
            }
            function _inherits(subClass, superClass) {
              if (typeof superClass !== "function" && superClass !== null) {
                throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
              }
              subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
              if (superClass)
                Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
            }
            var History = function(_Module) {
              _inherits(History2, _Module);
              function History2(quill, options) {
                _classCallCheck2(this, History2);
                var _this = _possibleConstructorReturn(this, (History2.__proto__ || Object.getPrototypeOf(History2)).call(this, quill, options));
                _this.lastRecorded = 0;
                _this.ignoreChange = false;
                _this.clear();
                _this.quill.on(_quill2.default.events.EDITOR_CHANGE, function(eventName, delta, oldDelta, source) {
                  if (eventName !== _quill2.default.events.TEXT_CHANGE || _this.ignoreChange)
                    return;
                  if (!_this.options.userOnly || source === _quill2.default.sources.USER) {
                    _this.record(delta, oldDelta);
                  } else {
                    _this.transform(delta);
                  }
                });
                _this.quill.keyboard.addBinding({ key: "Z", shortKey: true }, _this.undo.bind(_this));
                _this.quill.keyboard.addBinding({ key: "Z", shortKey: true, shiftKey: true }, _this.redo.bind(_this));
                if (/Win/i.test(navigator.platform)) {
                  _this.quill.keyboard.addBinding({ key: "Y", shortKey: true }, _this.redo.bind(_this));
                }
                return _this;
              }
              _createClass(History2, [{
                key: "change",
                value: function change(source, dest) {
                  if (this.stack[source].length === 0)
                    return;
                  var delta = this.stack[source].pop();
                  this.stack[dest].push(delta);
                  this.lastRecorded = 0;
                  this.ignoreChange = true;
                  this.quill.updateContents(delta[source], _quill2.default.sources.USER);
                  this.ignoreChange = false;
                  var index3 = getLastChangeIndex(delta[source]);
                  this.quill.setSelection(index3);
                }
              }, {
                key: "clear",
                value: function clear2() {
                  this.stack = { undo: [], redo: [] };
                }
              }, {
                key: "cutoff",
                value: function cutoff() {
                  this.lastRecorded = 0;
                }
              }, {
                key: "record",
                value: function record(changeDelta, oldDelta) {
                  if (changeDelta.ops.length === 0)
                    return;
                  this.stack.redo = [];
                  var undoDelta = this.quill.getContents().diff(oldDelta);
                  var timestamp = Date.now();
                  if (this.lastRecorded + this.options.delay > timestamp && this.stack.undo.length > 0) {
                    var delta = this.stack.undo.pop();
                    undoDelta = undoDelta.compose(delta.undo);
                    changeDelta = delta.redo.compose(changeDelta);
                  } else {
                    this.lastRecorded = timestamp;
                  }
                  this.stack.undo.push({
                    redo: changeDelta,
                    undo: undoDelta
                  });
                  if (this.stack.undo.length > this.options.maxStack) {
                    this.stack.undo.shift();
                  }
                }
              }, {
                key: "redo",
                value: function redo() {
                  this.change("redo", "undo");
                }
              }, {
                key: "transform",
                value: function transform2(delta) {
                  this.stack.undo.forEach(function(change) {
                    change.undo = delta.transform(change.undo, true);
                    change.redo = delta.transform(change.redo, true);
                  });
                  this.stack.redo.forEach(function(change) {
                    change.undo = delta.transform(change.undo, true);
                    change.redo = delta.transform(change.redo, true);
                  });
                }
              }, {
                key: "undo",
                value: function undo() {
                  this.change("undo", "redo");
                }
              }]);
              return History2;
            }(_module2.default);
            History.DEFAULTS = {
              delay: 1e3,
              maxStack: 100,
              userOnly: false
            };
            function endsWithNewlineChange(delta) {
              var lastOp = delta.ops[delta.ops.length - 1];
              if (lastOp == null)
                return false;
              if (lastOp.insert != null) {
                return typeof lastOp.insert === "string" && lastOp.insert.endsWith("\n");
              }
              if (lastOp.attributes != null) {
                return Object.keys(lastOp.attributes).some(function(attr2) {
                  return _parchment2.default.query(attr2, _parchment2.default.Scope.BLOCK) != null;
                });
              }
              return false;
            }
            function getLastChangeIndex(delta) {
              var deleteLength = delta.reduce(function(length2, op) {
                length2 += op.delete || 0;
                return length2;
              }, 0);
              var changeIndex = delta.length() - deleteLength;
              if (endsWithNewlineChange(delta)) {
                changeIndex -= 1;
              }
              return changeIndex;
            }
            exports2.default = History;
            exports2.getLastChangeIndex = getLastChangeIndex;
          },
          /* 43 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", {
              value: true
            });
            exports2.default = exports2.BaseTooltip = void 0;
            var _createClass = function() {
              function defineProperties(target, props) {
                for (var i3 = 0; i3 < props.length; i3++) {
                  var descriptor = props[i3];
                  descriptor.enumerable = descriptor.enumerable || false;
                  descriptor.configurable = true;
                  if ("value" in descriptor)
                    descriptor.writable = true;
                  Object.defineProperty(target, descriptor.key, descriptor);
                }
              }
              return function(Constructor, protoProps, staticProps) {
                if (protoProps)
                  defineProperties(Constructor.prototype, protoProps);
                if (staticProps)
                  defineProperties(Constructor, staticProps);
                return Constructor;
              };
            }();
            var _get = function get(object, property, receiver) {
              if (object === null)
                object = Function.prototype;
              var desc = Object.getOwnPropertyDescriptor(object, property);
              if (desc === void 0) {
                var parent = Object.getPrototypeOf(object);
                if (parent === null) {
                  return void 0;
                } else {
                  return get(parent, property, receiver);
                }
              } else if ("value" in desc) {
                return desc.value;
              } else {
                var getter = desc.get;
                if (getter === void 0) {
                  return void 0;
                }
                return getter.call(receiver);
              }
            };
            var _extend = __webpack_require__(3);
            var _extend2 = _interopRequireDefault(_extend);
            var _quillDelta = __webpack_require__(2);
            var _quillDelta2 = _interopRequireDefault(_quillDelta);
            var _emitter = __webpack_require__(8);
            var _emitter2 = _interopRequireDefault(_emitter);
            var _keyboard = __webpack_require__(23);
            var _keyboard2 = _interopRequireDefault(_keyboard);
            var _theme = __webpack_require__(34);
            var _theme2 = _interopRequireDefault(_theme);
            var _colorPicker = __webpack_require__(59);
            var _colorPicker2 = _interopRequireDefault(_colorPicker);
            var _iconPicker = __webpack_require__(60);
            var _iconPicker2 = _interopRequireDefault(_iconPicker);
            var _picker = __webpack_require__(28);
            var _picker2 = _interopRequireDefault(_picker);
            var _tooltip = __webpack_require__(61);
            var _tooltip2 = _interopRequireDefault(_tooltip);
            function _interopRequireDefault(obj) {
              return obj && obj.__esModule ? obj : { default: obj };
            }
            function _classCallCheck2(instance, Constructor) {
              if (!(instance instanceof Constructor)) {
                throw new TypeError("Cannot call a class as a function");
              }
            }
            function _possibleConstructorReturn(self2, call4) {
              if (!self2) {
                throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
              }
              return call4 && (typeof call4 === "object" || typeof call4 === "function") ? call4 : self2;
            }
            function _inherits(subClass, superClass) {
              if (typeof superClass !== "function" && superClass !== null) {
                throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
              }
              subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
              if (superClass)
                Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
            }
            var ALIGNS = [false, "center", "right", "justify"];
            var COLORS = ["#000000", "#e60000", "#ff9900", "#ffff00", "#008a00", "#0066cc", "#9933ff", "#ffffff", "#facccc", "#ffebcc", "#ffffcc", "#cce8cc", "#cce0f5", "#ebd6ff", "#bbbbbb", "#f06666", "#ffc266", "#ffff66", "#66b966", "#66a3e0", "#c285ff", "#888888", "#a10000", "#b26b00", "#b2b200", "#006100", "#0047b2", "#6b24b2", "#444444", "#5c0000", "#663d00", "#666600", "#003700", "#002966", "#3d1466"];
            var FONTS = [false, "serif", "monospace"];
            var HEADERS = ["1", "2", "3", false];
            var SIZES = ["small", false, "large", "huge"];
            var BaseTheme = function(_Theme) {
              _inherits(BaseTheme2, _Theme);
              function BaseTheme2(quill, options) {
                _classCallCheck2(this, BaseTheme2);
                var _this = _possibleConstructorReturn(this, (BaseTheme2.__proto__ || Object.getPrototypeOf(BaseTheme2)).call(this, quill, options));
                var listener = function listener2(e2) {
                  if (!document.body.contains(quill.root)) {
                    return document.body.removeEventListener("click", listener2);
                  }
                  if (_this.tooltip != null && !_this.tooltip.root.contains(e2.target) && document.activeElement !== _this.tooltip.textbox && !_this.quill.hasFocus()) {
                    _this.tooltip.hide();
                  }
                  if (_this.pickers != null) {
                    _this.pickers.forEach(function(picker) {
                      if (!picker.container.contains(e2.target)) {
                        picker.close();
                      }
                    });
                  }
                };
                quill.emitter.listenDOM("click", document.body, listener);
                return _this;
              }
              _createClass(BaseTheme2, [{
                key: "addModule",
                value: function addModule(name) {
                  var module3 = _get(BaseTheme2.prototype.__proto__ || Object.getPrototypeOf(BaseTheme2.prototype), "addModule", this).call(this, name);
                  if (name === "toolbar") {
                    this.extendToolbar(module3);
                  }
                  return module3;
                }
              }, {
                key: "buildButtons",
                value: function buildButtons(buttons, icons) {
                  buttons.forEach(function(button) {
                    var className = button.getAttribute("class") || "";
                    className.split(/\s+/).forEach(function(name) {
                      if (!name.startsWith("ql-"))
                        return;
                      name = name.slice("ql-".length);
                      if (icons[name] == null)
                        return;
                      if (name === "direction") {
                        button.innerHTML = icons[name][""] + icons[name]["rtl"];
                      } else if (typeof icons[name] === "string") {
                        button.innerHTML = icons[name];
                      } else {
                        var value = button.value || "";
                        if (value != null && icons[name][value]) {
                          button.innerHTML = icons[name][value];
                        }
                      }
                    });
                  });
                }
              }, {
                key: "buildPickers",
                value: function buildPickers(selects, icons) {
                  var _this2 = this;
                  this.pickers = selects.map(function(select) {
                    if (select.classList.contains("ql-align")) {
                      if (select.querySelector("option") == null) {
                        fillSelect(select, ALIGNS);
                      }
                      return new _iconPicker2.default(select, icons.align);
                    } else if (select.classList.contains("ql-background") || select.classList.contains("ql-color")) {
                      var format = select.classList.contains("ql-background") ? "background" : "color";
                      if (select.querySelector("option") == null) {
                        fillSelect(select, COLORS, format === "background" ? "#ffffff" : "#000000");
                      }
                      return new _colorPicker2.default(select, icons[format]);
                    } else {
                      if (select.querySelector("option") == null) {
                        if (select.classList.contains("ql-font")) {
                          fillSelect(select, FONTS);
                        } else if (select.classList.contains("ql-header")) {
                          fillSelect(select, HEADERS);
                        } else if (select.classList.contains("ql-size")) {
                          fillSelect(select, SIZES);
                        }
                      }
                      return new _picker2.default(select);
                    }
                  });
                  var update = function update2() {
                    _this2.pickers.forEach(function(picker) {
                      picker.update();
                    });
                  };
                  this.quill.on(_emitter2.default.events.EDITOR_CHANGE, update);
                }
              }]);
              return BaseTheme2;
            }(_theme2.default);
            BaseTheme.DEFAULTS = (0, _extend2.default)(true, {}, _theme2.default.DEFAULTS, {
              modules: {
                toolbar: {
                  handlers: {
                    formula: function formula() {
                      this.quill.theme.tooltip.edit("formula");
                    },
                    image: function image() {
                      var _this3 = this;
                      var fileInput = this.container.querySelector("input.ql-image[type=file]");
                      if (fileInput == null) {
                        fileInput = document.createElement("input");
                        fileInput.setAttribute("type", "file");
                        fileInput.setAttribute("accept", "image/png, image/gif, image/jpeg, image/bmp, image/x-icon");
                        fileInput.classList.add("ql-image");
                        fileInput.addEventListener("change", function() {
                          if (fileInput.files != null && fileInput.files[0] != null) {
                            var reader = new FileReader();
                            reader.onload = function(e2) {
                              var range = _this3.quill.getSelection(true);
                              _this3.quill.updateContents(new _quillDelta2.default().retain(range.index).delete(range.length).insert({ image: e2.target.result }), _emitter2.default.sources.USER);
                              _this3.quill.setSelection(range.index + 1, _emitter2.default.sources.SILENT);
                              fileInput.value = "";
                            };
                            reader.readAsDataURL(fileInput.files[0]);
                          }
                        });
                        this.container.appendChild(fileInput);
                      }
                      fileInput.click();
                    },
                    video: function video() {
                      this.quill.theme.tooltip.edit("video");
                    }
                  }
                }
              }
            });
            var BaseTooltip = function(_Tooltip) {
              _inherits(BaseTooltip2, _Tooltip);
              function BaseTooltip2(quill, boundsContainer) {
                _classCallCheck2(this, BaseTooltip2);
                var _this4 = _possibleConstructorReturn(this, (BaseTooltip2.__proto__ || Object.getPrototypeOf(BaseTooltip2)).call(this, quill, boundsContainer));
                _this4.textbox = _this4.root.querySelector('input[type="text"]');
                _this4.listen();
                return _this4;
              }
              _createClass(BaseTooltip2, [{
                key: "listen",
                value: function listen() {
                  var _this5 = this;
                  this.textbox.addEventListener("keydown", function(event) {
                    if (_keyboard2.default.match(event, "enter")) {
                      _this5.save();
                      event.preventDefault();
                    } else if (_keyboard2.default.match(event, "escape")) {
                      _this5.cancel();
                      event.preventDefault();
                    }
                  });
                }
              }, {
                key: "cancel",
                value: function cancel() {
                  this.hide();
                }
              }, {
                key: "edit",
                value: function edit() {
                  var mode = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "link";
                  var preview = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null;
                  this.root.classList.remove("ql-hidden");
                  this.root.classList.add("ql-editing");
                  if (preview != null) {
                    this.textbox.value = preview;
                  } else if (mode !== this.root.getAttribute("data-mode")) {
                    this.textbox.value = "";
                  }
                  this.position(this.quill.getBounds(this.quill.selection.savedRange));
                  this.textbox.select();
                  this.textbox.setAttribute("placeholder", this.textbox.getAttribute("data-" + mode) || "");
                  this.root.setAttribute("data-mode", mode);
                }
              }, {
                key: "restoreFocus",
                value: function restoreFocus() {
                  var scrollTop = this.quill.scrollingContainer.scrollTop;
                  this.quill.focus();
                  this.quill.scrollingContainer.scrollTop = scrollTop;
                }
              }, {
                key: "save",
                value: function save() {
                  var value = this.textbox.value;
                  switch (this.root.getAttribute("data-mode")) {
                    case "link": {
                      var scrollTop = this.quill.root.scrollTop;
                      if (this.linkRange) {
                        this.quill.formatText(this.linkRange, "link", value, _emitter2.default.sources.USER);
                        delete this.linkRange;
                      } else {
                        this.restoreFocus();
                        this.quill.format("link", value, _emitter2.default.sources.USER);
                      }
                      this.quill.root.scrollTop = scrollTop;
                      break;
                    }
                    case "video": {
                      value = extractVideoUrl(value);
                    }
                    case "formula": {
                      if (!value)
                        break;
                      var range = this.quill.getSelection(true);
                      if (range != null) {
                        var index3 = range.index + range.length;
                        this.quill.insertEmbed(index3, this.root.getAttribute("data-mode"), value, _emitter2.default.sources.USER);
                        if (this.root.getAttribute("data-mode") === "formula") {
                          this.quill.insertText(index3 + 1, " ", _emitter2.default.sources.USER);
                        }
                        this.quill.setSelection(index3 + 2, _emitter2.default.sources.USER);
                      }
                      break;
                    }
                    default:
                  }
                  this.textbox.value = "";
                  this.hide();
                }
              }]);
              return BaseTooltip2;
            }(_tooltip2.default);
            function extractVideoUrl(url) {
              var match = url.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/) || url.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);
              if (match) {
                return (match[1] || "https") + "://www.youtube.com/embed/" + match[2] + "?showinfo=0";
              }
              if (match = url.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/)) {
                return (match[1] || "https") + "://player.vimeo.com/video/" + match[2] + "/";
              }
              return url;
            }
            function fillSelect(select, values) {
              var defaultValue = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
              values.forEach(function(value) {
                var option = document.createElement("option");
                if (value === defaultValue) {
                  option.setAttribute("selected", "selected");
                } else {
                  option.setAttribute("value", value);
                }
                select.appendChild(option);
              });
            }
            exports2.BaseTooltip = BaseTooltip;
            exports2.default = BaseTheme;
          },
          /* 44 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", { value: true });
            var LinkedList = (
              /** @class */
              function() {
                function LinkedList2() {
                  this.head = this.tail = null;
                  this.length = 0;
                }
                LinkedList2.prototype.append = function() {
                  var nodes = [];
                  for (var _i = 0; _i < arguments.length; _i++) {
                    nodes[_i] = arguments[_i];
                  }
                  this.insertBefore(nodes[0], null);
                  if (nodes.length > 1) {
                    this.append.apply(this, nodes.slice(1));
                  }
                };
                LinkedList2.prototype.contains = function(node3) {
                  var cur, next2 = this.iterator();
                  while (cur = next2()) {
                    if (cur === node3)
                      return true;
                  }
                  return false;
                };
                LinkedList2.prototype.insertBefore = function(node3, refNode) {
                  if (!node3)
                    return;
                  node3.next = refNode;
                  if (refNode != null) {
                    node3.prev = refNode.prev;
                    if (refNode.prev != null) {
                      refNode.prev.next = node3;
                    }
                    refNode.prev = node3;
                    if (refNode === this.head) {
                      this.head = node3;
                    }
                  } else if (this.tail != null) {
                    this.tail.next = node3;
                    node3.prev = this.tail;
                    this.tail = node3;
                  } else {
                    node3.prev = null;
                    this.head = this.tail = node3;
                  }
                  this.length += 1;
                };
                LinkedList2.prototype.offset = function(target) {
                  var index3 = 0, cur = this.head;
                  while (cur != null) {
                    if (cur === target)
                      return index3;
                    index3 += cur.length();
                    cur = cur.next;
                  }
                  return -1;
                };
                LinkedList2.prototype.remove = function(node3) {
                  if (!this.contains(node3))
                    return;
                  if (node3.prev != null)
                    node3.prev.next = node3.next;
                  if (node3.next != null)
                    node3.next.prev = node3.prev;
                  if (node3 === this.head)
                    this.head = node3.next;
                  if (node3 === this.tail)
                    this.tail = node3.prev;
                  this.length -= 1;
                };
                LinkedList2.prototype.iterator = function(curNode) {
                  if (curNode === void 0) {
                    curNode = this.head;
                  }
                  return function() {
                    var ret = curNode;
                    if (curNode != null)
                      curNode = curNode.next;
                    return ret;
                  };
                };
                LinkedList2.prototype.find = function(index3, inclusive) {
                  if (inclusive === void 0) {
                    inclusive = false;
                  }
                  var cur, next2 = this.iterator();
                  while (cur = next2()) {
                    var length2 = cur.length();
                    if (index3 < length2 || inclusive && index3 === length2 && (cur.next == null || cur.next.length() !== 0)) {
                      return [cur, index3];
                    }
                    index3 -= length2;
                  }
                  return [null, 0];
                };
                LinkedList2.prototype.forEach = function(callback) {
                  var cur, next2 = this.iterator();
                  while (cur = next2()) {
                    callback(cur);
                  }
                };
                LinkedList2.prototype.forEachAt = function(index3, length2, callback) {
                  if (length2 <= 0)
                    return;
                  var _a2 = this.find(index3), startNode = _a2[0], offset = _a2[1];
                  var cur, curIndex = index3 - offset, next2 = this.iterator(startNode);
                  while ((cur = next2()) && curIndex < index3 + length2) {
                    var curLength = cur.length();
                    if (index3 > curIndex) {
                      callback(cur, index3 - curIndex, Math.min(length2, curIndex + curLength - index3));
                    } else {
                      callback(cur, 0, Math.min(curLength, index3 + length2 - curIndex));
                    }
                    curIndex += curLength;
                  }
                };
                LinkedList2.prototype.map = function(callback) {
                  return this.reduce(function(memo, cur) {
                    memo.push(callback(cur));
                    return memo;
                  }, []);
                };
                LinkedList2.prototype.reduce = function(callback, memo) {
                  var cur, next2 = this.iterator();
                  while (cur = next2()) {
                    memo = callback(memo, cur);
                  }
                  return memo;
                };
                return LinkedList2;
              }()
            );
            exports2.default = LinkedList;
          },
          /* 45 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            var __extends = this && this.__extends || function() {
              var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
                d2.__proto__ = b2;
              } || function(d2, b2) {
                for (var p3 in b2)
                  if (b2.hasOwnProperty(p3))
                    d2[p3] = b2[p3];
              };
              return function(d2, b2) {
                extendStatics(d2, b2);
                function __() {
                  this.constructor = d2;
                }
                d2.prototype = b2 === null ? Object.create(b2) : (__.prototype = b2.prototype, new __());
              };
            }();
            Object.defineProperty(exports2, "__esModule", { value: true });
            var container_1 = __webpack_require__(17);
            var Registry = __webpack_require__(1);
            var OBSERVER_CONFIG = {
              attributes: true,
              characterData: true,
              characterDataOldValue: true,
              childList: true,
              subtree: true
            };
            var MAX_OPTIMIZE_ITERATIONS = 100;
            var ScrollBlot = (
              /** @class */
              function(_super) {
                __extends(ScrollBlot2, _super);
                function ScrollBlot2(node3) {
                  var _this = _super.call(this, node3) || this;
                  _this.scroll = _this;
                  _this.observer = new MutationObserver(function(mutations) {
                    _this.update(mutations);
                  });
                  _this.observer.observe(_this.domNode, OBSERVER_CONFIG);
                  _this.attach();
                  return _this;
                }
                ScrollBlot2.prototype.detach = function() {
                  _super.prototype.detach.call(this);
                  this.observer.disconnect();
                };
                ScrollBlot2.prototype.deleteAt = function(index3, length2) {
                  this.update();
                  if (index3 === 0 && length2 === this.length()) {
                    this.children.forEach(function(child) {
                      child.remove();
                    });
                  } else {
                    _super.prototype.deleteAt.call(this, index3, length2);
                  }
                };
                ScrollBlot2.prototype.formatAt = function(index3, length2, name, value) {
                  this.update();
                  _super.prototype.formatAt.call(this, index3, length2, name, value);
                };
                ScrollBlot2.prototype.insertAt = function(index3, value, def) {
                  this.update();
                  _super.prototype.insertAt.call(this, index3, value, def);
                };
                ScrollBlot2.prototype.optimize = function(mutations, context) {
                  var _this = this;
                  if (mutations === void 0) {
                    mutations = [];
                  }
                  if (context === void 0) {
                    context = {};
                  }
                  _super.prototype.optimize.call(this, context);
                  var records = [].slice.call(this.observer.takeRecords());
                  while (records.length > 0)
                    mutations.push(records.pop());
                  var mark = function(blot, markParent) {
                    if (markParent === void 0) {
                      markParent = true;
                    }
                    if (blot == null || blot === _this)
                      return;
                    if (blot.domNode.parentNode == null)
                      return;
                    if (blot.domNode[Registry.DATA_KEY].mutations == null) {
                      blot.domNode[Registry.DATA_KEY].mutations = [];
                    }
                    if (markParent)
                      mark(blot.parent);
                  };
                  var optimize = function(blot) {
                    if (
                      // @ts-ignore
                      blot.domNode[Registry.DATA_KEY] == null || // @ts-ignore
                      blot.domNode[Registry.DATA_KEY].mutations == null
                    ) {
                      return;
                    }
                    if (blot instanceof container_1.default) {
                      blot.children.forEach(optimize);
                    }
                    blot.optimize(context);
                  };
                  var remaining = mutations;
                  for (var i3 = 0; remaining.length > 0; i3 += 1) {
                    if (i3 >= MAX_OPTIMIZE_ITERATIONS) {
                      throw new Error("[Parchment] Maximum optimize iterations reached");
                    }
                    remaining.forEach(function(mutation) {
                      var blot = Registry.find(mutation.target, true);
                      if (blot == null)
                        return;
                      if (blot.domNode === mutation.target) {
                        if (mutation.type === "childList") {
                          mark(Registry.find(mutation.previousSibling, false));
                          [].forEach.call(mutation.addedNodes, function(node3) {
                            var child = Registry.find(node3, false);
                            mark(child, false);
                            if (child instanceof container_1.default) {
                              child.children.forEach(function(grandChild) {
                                mark(grandChild, false);
                              });
                            }
                          });
                        } else if (mutation.type === "attributes") {
                          mark(blot.prev);
                        }
                      }
                      mark(blot);
                    });
                    this.children.forEach(optimize);
                    remaining = [].slice.call(this.observer.takeRecords());
                    records = remaining.slice();
                    while (records.length > 0)
                      mutations.push(records.pop());
                  }
                };
                ScrollBlot2.prototype.update = function(mutations, context) {
                  var _this = this;
                  if (context === void 0) {
                    context = {};
                  }
                  mutations = mutations || this.observer.takeRecords();
                  mutations.map(function(mutation) {
                    var blot = Registry.find(mutation.target, true);
                    if (blot == null)
                      return null;
                    if (blot.domNode[Registry.DATA_KEY].mutations == null) {
                      blot.domNode[Registry.DATA_KEY].mutations = [mutation];
                      return blot;
                    } else {
                      blot.domNode[Registry.DATA_KEY].mutations.push(mutation);
                      return null;
                    }
                  }).forEach(function(blot) {
                    if (blot == null || blot === _this || //@ts-ignore
                    blot.domNode[Registry.DATA_KEY] == null)
                      return;
                    blot.update(blot.domNode[Registry.DATA_KEY].mutations || [], context);
                  });
                  if (this.domNode[Registry.DATA_KEY].mutations != null) {
                    _super.prototype.update.call(this, this.domNode[Registry.DATA_KEY].mutations, context);
                  }
                  this.optimize(mutations, context);
                };
                ScrollBlot2.blotName = "scroll";
                ScrollBlot2.defaultChild = "block";
                ScrollBlot2.scope = Registry.Scope.BLOCK_BLOT;
                ScrollBlot2.tagName = "DIV";
                return ScrollBlot2;
              }(container_1.default)
            );
            exports2.default = ScrollBlot;
          },
          /* 46 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            var __extends = this && this.__extends || function() {
              var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
                d2.__proto__ = b2;
              } || function(d2, b2) {
                for (var p3 in b2)
                  if (b2.hasOwnProperty(p3))
                    d2[p3] = b2[p3];
              };
              return function(d2, b2) {
                extendStatics(d2, b2);
                function __() {
                  this.constructor = d2;
                }
                d2.prototype = b2 === null ? Object.create(b2) : (__.prototype = b2.prototype, new __());
              };
            }();
            Object.defineProperty(exports2, "__esModule", { value: true });
            var format_1 = __webpack_require__(18);
            var Registry = __webpack_require__(1);
            function isEqual(obj1, obj2) {
              if (Object.keys(obj1).length !== Object.keys(obj2).length)
                return false;
              for (var prop in obj1) {
                if (obj1[prop] !== obj2[prop])
                  return false;
              }
              return true;
            }
            var InlineBlot = (
              /** @class */
              function(_super) {
                __extends(InlineBlot2, _super);
                function InlineBlot2() {
                  return _super !== null && _super.apply(this, arguments) || this;
                }
                InlineBlot2.formats = function(domNode) {
                  if (domNode.tagName === InlineBlot2.tagName)
                    return void 0;
                  return _super.formats.call(this, domNode);
                };
                InlineBlot2.prototype.format = function(name, value) {
                  var _this = this;
                  if (name === this.statics.blotName && !value) {
                    this.children.forEach(function(child) {
                      if (!(child instanceof format_1.default)) {
                        child = child.wrap(InlineBlot2.blotName, true);
                      }
                      _this.attributes.copy(child);
                    });
                    this.unwrap();
                  } else {
                    _super.prototype.format.call(this, name, value);
                  }
                };
                InlineBlot2.prototype.formatAt = function(index3, length2, name, value) {
                  if (this.formats()[name] != null || Registry.query(name, Registry.Scope.ATTRIBUTE)) {
                    var blot = this.isolate(index3, length2);
                    blot.format(name, value);
                  } else {
                    _super.prototype.formatAt.call(this, index3, length2, name, value);
                  }
                };
                InlineBlot2.prototype.optimize = function(context) {
                  _super.prototype.optimize.call(this, context);
                  var formats = this.formats();
                  if (Object.keys(formats).length === 0) {
                    return this.unwrap();
                  }
                  var next2 = this.next;
                  if (next2 instanceof InlineBlot2 && next2.prev === this && isEqual(formats, next2.formats())) {
                    next2.moveChildren(this);
                    next2.remove();
                  }
                };
                InlineBlot2.blotName = "inline";
                InlineBlot2.scope = Registry.Scope.INLINE_BLOT;
                InlineBlot2.tagName = "SPAN";
                return InlineBlot2;
              }(format_1.default)
            );
            exports2.default = InlineBlot;
          },
          /* 47 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            var __extends = this && this.__extends || function() {
              var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
                d2.__proto__ = b2;
              } || function(d2, b2) {
                for (var p3 in b2)
                  if (b2.hasOwnProperty(p3))
                    d2[p3] = b2[p3];
              };
              return function(d2, b2) {
                extendStatics(d2, b2);
                function __() {
                  this.constructor = d2;
                }
                d2.prototype = b2 === null ? Object.create(b2) : (__.prototype = b2.prototype, new __());
              };
            }();
            Object.defineProperty(exports2, "__esModule", { value: true });
            var format_1 = __webpack_require__(18);
            var Registry = __webpack_require__(1);
            var BlockBlot = (
              /** @class */
              function(_super) {
                __extends(BlockBlot2, _super);
                function BlockBlot2() {
                  return _super !== null && _super.apply(this, arguments) || this;
                }
                BlockBlot2.formats = function(domNode) {
                  var tagName = Registry.query(BlockBlot2.blotName).tagName;
                  if (domNode.tagName === tagName)
                    return void 0;
                  return _super.formats.call(this, domNode);
                };
                BlockBlot2.prototype.format = function(name, value) {
                  if (Registry.query(name, Registry.Scope.BLOCK) == null) {
                    return;
                  } else if (name === this.statics.blotName && !value) {
                    this.replaceWith(BlockBlot2.blotName);
                  } else {
                    _super.prototype.format.call(this, name, value);
                  }
                };
                BlockBlot2.prototype.formatAt = function(index3, length2, name, value) {
                  if (Registry.query(name, Registry.Scope.BLOCK) != null) {
                    this.format(name, value);
                  } else {
                    _super.prototype.formatAt.call(this, index3, length2, name, value);
                  }
                };
                BlockBlot2.prototype.insertAt = function(index3, value, def) {
                  if (def == null || Registry.query(value, Registry.Scope.INLINE) != null) {
                    _super.prototype.insertAt.call(this, index3, value, def);
                  } else {
                    var after2 = this.split(index3);
                    var blot = Registry.create(value, def);
                    after2.parent.insertBefore(blot, after2);
                  }
                };
                BlockBlot2.prototype.update = function(mutations, context) {
                  if (navigator.userAgent.match(/Trident/)) {
                    this.build();
                  } else {
                    _super.prototype.update.call(this, mutations, context);
                  }
                };
                BlockBlot2.blotName = "block";
                BlockBlot2.scope = Registry.Scope.BLOCK_BLOT;
                BlockBlot2.tagName = "P";
                return BlockBlot2;
              }(format_1.default)
            );
            exports2.default = BlockBlot;
          },
          /* 48 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            var __extends = this && this.__extends || function() {
              var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
                d2.__proto__ = b2;
              } || function(d2, b2) {
                for (var p3 in b2)
                  if (b2.hasOwnProperty(p3))
                    d2[p3] = b2[p3];
              };
              return function(d2, b2) {
                extendStatics(d2, b2);
                function __() {
                  this.constructor = d2;
                }
                d2.prototype = b2 === null ? Object.create(b2) : (__.prototype = b2.prototype, new __());
              };
            }();
            Object.defineProperty(exports2, "__esModule", { value: true });
            var leaf_1 = __webpack_require__(19);
            var EmbedBlot = (
              /** @class */
              function(_super) {
                __extends(EmbedBlot2, _super);
                function EmbedBlot2() {
                  return _super !== null && _super.apply(this, arguments) || this;
                }
                EmbedBlot2.formats = function(domNode) {
                  return void 0;
                };
                EmbedBlot2.prototype.format = function(name, value) {
                  _super.prototype.formatAt.call(this, 0, this.length(), name, value);
                };
                EmbedBlot2.prototype.formatAt = function(index3, length2, name, value) {
                  if (index3 === 0 && length2 === this.length()) {
                    this.format(name, value);
                  } else {
                    _super.prototype.formatAt.call(this, index3, length2, name, value);
                  }
                };
                EmbedBlot2.prototype.formats = function() {
                  return this.statics.formats(this.domNode);
                };
                return EmbedBlot2;
              }(leaf_1.default)
            );
            exports2.default = EmbedBlot;
          },
          /* 49 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            var __extends = this && this.__extends || function() {
              var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
                d2.__proto__ = b2;
              } || function(d2, b2) {
                for (var p3 in b2)
                  if (b2.hasOwnProperty(p3))
                    d2[p3] = b2[p3];
              };
              return function(d2, b2) {
                extendStatics(d2, b2);
                function __() {
                  this.constructor = d2;
                }
                d2.prototype = b2 === null ? Object.create(b2) : (__.prototype = b2.prototype, new __());
              };
            }();
            Object.defineProperty(exports2, "__esModule", { value: true });
            var leaf_1 = __webpack_require__(19);
            var Registry = __webpack_require__(1);
            var TextBlot = (
              /** @class */
              function(_super) {
                __extends(TextBlot2, _super);
                function TextBlot2(node3) {
                  var _this = _super.call(this, node3) || this;
                  _this.text = _this.statics.value(_this.domNode);
                  return _this;
                }
                TextBlot2.create = function(value) {
                  return document.createTextNode(value);
                };
                TextBlot2.value = function(domNode) {
                  var text3 = domNode.data;
                  if (text3["normalize"])
                    text3 = text3["normalize"]();
                  return text3;
                };
                TextBlot2.prototype.deleteAt = function(index3, length2) {
                  this.domNode.data = this.text = this.text.slice(0, index3) + this.text.slice(index3 + length2);
                };
                TextBlot2.prototype.index = function(node3, offset) {
                  if (this.domNode === node3) {
                    return offset;
                  }
                  return -1;
                };
                TextBlot2.prototype.insertAt = function(index3, value, def) {
                  if (def == null) {
                    this.text = this.text.slice(0, index3) + value + this.text.slice(index3);
                    this.domNode.data = this.text;
                  } else {
                    _super.prototype.insertAt.call(this, index3, value, def);
                  }
                };
                TextBlot2.prototype.length = function() {
                  return this.text.length;
                };
                TextBlot2.prototype.optimize = function(context) {
                  _super.prototype.optimize.call(this, context);
                  this.text = this.statics.value(this.domNode);
                  if (this.text.length === 0) {
                    this.remove();
                  } else if (this.next instanceof TextBlot2 && this.next.prev === this) {
                    this.insertAt(this.length(), this.next.value());
                    this.next.remove();
                  }
                };
                TextBlot2.prototype.position = function(index3, inclusive) {
                  if (inclusive === void 0) {
                    inclusive = false;
                  }
                  return [this.domNode, index3];
                };
                TextBlot2.prototype.split = function(index3, force) {
                  if (force === void 0) {
                    force = false;
                  }
                  if (!force) {
                    if (index3 === 0)
                      return this;
                    if (index3 === this.length())
                      return this.next;
                  }
                  var after2 = Registry.create(this.domNode.splitText(index3));
                  this.parent.insertBefore(after2, this.next);
                  this.text = this.statics.value(this.domNode);
                  return after2;
                };
                TextBlot2.prototype.update = function(mutations, context) {
                  var _this = this;
                  if (mutations.some(function(mutation) {
                    return mutation.type === "characterData" && mutation.target === _this.domNode;
                  })) {
                    this.text = this.statics.value(this.domNode);
                  }
                };
                TextBlot2.prototype.value = function() {
                  return this.text;
                };
                TextBlot2.blotName = "text";
                TextBlot2.scope = Registry.Scope.INLINE_BLOT;
                return TextBlot2;
              }(leaf_1.default)
            );
            exports2.default = TextBlot;
          },
          /* 50 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            var elem = document.createElement("div");
            elem.classList.toggle("test-class", false);
            if (elem.classList.contains("test-class")) {
              var _toggle = DOMTokenList.prototype.toggle;
              DOMTokenList.prototype.toggle = function(token, force) {
                if (arguments.length > 1 && !this.contains(token) === !force) {
                  return force;
                } else {
                  return _toggle.call(this, token);
                }
              };
            }
            if (!String.prototype.startsWith) {
              String.prototype.startsWith = function(searchString, position3) {
                position3 = position3 || 0;
                return this.substr(position3, searchString.length) === searchString;
              };
            }
            if (!String.prototype.endsWith) {
              String.prototype.endsWith = function(searchString, position3) {
                var subjectString = this.toString();
                if (typeof position3 !== "number" || !isFinite(position3) || Math.floor(position3) !== position3 || position3 > subjectString.length) {
                  position3 = subjectString.length;
                }
                position3 -= searchString.length;
                var lastIndex = subjectString.indexOf(searchString, position3);
                return lastIndex !== -1 && lastIndex === position3;
              };
            }
            if (!Array.prototype.find) {
              Object.defineProperty(Array.prototype, "find", {
                value: function value(predicate) {
                  if (this === null) {
                    throw new TypeError("Array.prototype.find called on null or undefined");
                  }
                  if (typeof predicate !== "function") {
                    throw new TypeError("predicate must be a function");
                  }
                  var list2 = Object(this);
                  var length2 = list2.length >>> 0;
                  var thisArg = arguments[1];
                  var value2;
                  for (var i3 = 0; i3 < length2; i3++) {
                    value2 = list2[i3];
                    if (predicate.call(thisArg, value2, i3, list2)) {
                      return value2;
                    }
                  }
                  return void 0;
                }
              });
            }
            document.addEventListener("DOMContentLoaded", function() {
              document.execCommand("enableObjectResizing", false, false);
              document.execCommand("autoUrlDetect", false, false);
            });
          },
          /* 51 */
          /***/
          function(module2, exports2) {
            var DIFF_DELETE = -1;
            var DIFF_INSERT = 1;
            var DIFF_EQUAL = 0;
            function diff_main(text1, text22, cursor_pos) {
              if (text1 == text22) {
                if (text1) {
                  return [[DIFF_EQUAL, text1]];
                }
                return [];
              }
              if (cursor_pos < 0 || text1.length < cursor_pos) {
                cursor_pos = null;
              }
              var commonlength = diff_commonPrefix(text1, text22);
              var commonprefix = text1.substring(0, commonlength);
              text1 = text1.substring(commonlength);
              text22 = text22.substring(commonlength);
              commonlength = diff_commonSuffix(text1, text22);
              var commonsuffix = text1.substring(text1.length - commonlength);
              text1 = text1.substring(0, text1.length - commonlength);
              text22 = text22.substring(0, text22.length - commonlength);
              var diffs = diff_compute_(text1, text22);
              if (commonprefix) {
                diffs.unshift([DIFF_EQUAL, commonprefix]);
              }
              if (commonsuffix) {
                diffs.push([DIFF_EQUAL, commonsuffix]);
              }
              diff_cleanupMerge(diffs);
              if (cursor_pos != null) {
                diffs = fix_cursor(diffs, cursor_pos);
              }
              diffs = fix_emoji(diffs);
              return diffs;
            }
            ;
            function diff_compute_(text1, text22) {
              var diffs;
              if (!text1) {
                return [[DIFF_INSERT, text22]];
              }
              if (!text22) {
                return [[DIFF_DELETE, text1]];
              }
              var longtext = text1.length > text22.length ? text1 : text22;
              var shorttext = text1.length > text22.length ? text22 : text1;
              var i3 = longtext.indexOf(shorttext);
              if (i3 != -1) {
                diffs = [
                  [DIFF_INSERT, longtext.substring(0, i3)],
                  [DIFF_EQUAL, shorttext],
                  [DIFF_INSERT, longtext.substring(i3 + shorttext.length)]
                ];
                if (text1.length > text22.length) {
                  diffs[0][0] = diffs[2][0] = DIFF_DELETE;
                }
                return diffs;
              }
              if (shorttext.length == 1) {
                return [[DIFF_DELETE, text1], [DIFF_INSERT, text22]];
              }
              var hm = diff_halfMatch_(text1, text22);
              if (hm) {
                var text1_a = hm[0];
                var text1_b = hm[1];
                var text2_a = hm[2];
                var text2_b = hm[3];
                var mid_common = hm[4];
                var diffs_a = diff_main(text1_a, text2_a);
                var diffs_b = diff_main(text1_b, text2_b);
                return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b);
              }
              return diff_bisect_(text1, text22);
            }
            ;
            function diff_bisect_(text1, text22) {
              var text1_length = text1.length;
              var text2_length = text22.length;
              var max_d = Math.ceil((text1_length + text2_length) / 2);
              var v_offset = max_d;
              var v_length = 2 * max_d;
              var v1 = new Array(v_length);
              var v22 = new Array(v_length);
              for (var x3 = 0; x3 < v_length; x3++) {
                v1[x3] = -1;
                v22[x3] = -1;
              }
              v1[v_offset + 1] = 0;
              v22[v_offset + 1] = 0;
              var delta = text1_length - text2_length;
              var front2 = delta % 2 != 0;
              var k1start = 0;
              var k1end = 0;
              var k2start = 0;
              var k2end = 0;
              for (var d2 = 0; d2 < max_d; d2++) {
                for (var k1 = -d2 + k1start; k1 <= d2 - k1end; k1 += 2) {
                  var k1_offset = v_offset + k1;
                  var x1;
                  if (k1 == -d2 || k1 != d2 && v1[k1_offset - 1] < v1[k1_offset + 1]) {
                    x1 = v1[k1_offset + 1];
                  } else {
                    x1 = v1[k1_offset - 1] + 1;
                  }
                  var y1 = x1 - k1;
                  while (x1 < text1_length && y1 < text2_length && text1.charAt(x1) == text22.charAt(y1)) {
                    x1++;
                    y1++;
                  }
                  v1[k1_offset] = x1;
                  if (x1 > text1_length) {
                    k1end += 2;
                  } else if (y1 > text2_length) {
                    k1start += 2;
                  } else if (front2) {
                    var k2_offset = v_offset + delta - k1;
                    if (k2_offset >= 0 && k2_offset < v_length && v22[k2_offset] != -1) {
                      var x22 = text1_length - v22[k2_offset];
                      if (x1 >= x22) {
                        return diff_bisectSplit_(text1, text22, x1, y1);
                      }
                    }
                  }
                }
                for (var k2 = -d2 + k2start; k2 <= d2 - k2end; k2 += 2) {
                  var k2_offset = v_offset + k2;
                  var x22;
                  if (k2 == -d2 || k2 != d2 && v22[k2_offset - 1] < v22[k2_offset + 1]) {
                    x22 = v22[k2_offset + 1];
                  } else {
                    x22 = v22[k2_offset - 1] + 1;
                  }
                  var y22 = x22 - k2;
                  while (x22 < text1_length && y22 < text2_length && text1.charAt(text1_length - x22 - 1) == text22.charAt(text2_length - y22 - 1)) {
                    x22++;
                    y22++;
                  }
                  v22[k2_offset] = x22;
                  if (x22 > text1_length) {
                    k2end += 2;
                  } else if (y22 > text2_length) {
                    k2start += 2;
                  } else if (!front2) {
                    var k1_offset = v_offset + delta - k2;
                    if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset] != -1) {
                      var x1 = v1[k1_offset];
                      var y1 = v_offset + x1 - k1_offset;
                      x22 = text1_length - x22;
                      if (x1 >= x22) {
                        return diff_bisectSplit_(text1, text22, x1, y1);
                      }
                    }
                  }
                }
              }
              return [[DIFF_DELETE, text1], [DIFF_INSERT, text22]];
            }
            ;
            function diff_bisectSplit_(text1, text22, x3, y4) {
              var text1a = text1.substring(0, x3);
              var text2a = text22.substring(0, y4);
              var text1b = text1.substring(x3);
              var text2b = text22.substring(y4);
              var diffs = diff_main(text1a, text2a);
              var diffsb = diff_main(text1b, text2b);
              return diffs.concat(diffsb);
            }
            ;
            function diff_commonPrefix(text1, text22) {
              if (!text1 || !text22 || text1.charAt(0) != text22.charAt(0)) {
                return 0;
              }
              var pointermin = 0;
              var pointermax = Math.min(text1.length, text22.length);
              var pointermid = pointermax;
              var pointerstart = 0;
              while (pointermin < pointermid) {
                if (text1.substring(pointerstart, pointermid) == text22.substring(pointerstart, pointermid)) {
                  pointermin = pointermid;
                  pointerstart = pointermin;
                } else {
                  pointermax = pointermid;
                }
                pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);
              }
              return pointermid;
            }
            ;
            function diff_commonSuffix(text1, text22) {
              if (!text1 || !text22 || text1.charAt(text1.length - 1) != text22.charAt(text22.length - 1)) {
                return 0;
              }
              var pointermin = 0;
              var pointermax = Math.min(text1.length, text22.length);
              var pointermid = pointermax;
              var pointerend = 0;
              while (pointermin < pointermid) {
                if (text1.substring(text1.length - pointermid, text1.length - pointerend) == text22.substring(text22.length - pointermid, text22.length - pointerend)) {
                  pointermin = pointermid;
                  pointerend = pointermin;
                } else {
                  pointermax = pointermid;
                }
                pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);
              }
              return pointermid;
            }
            ;
            function diff_halfMatch_(text1, text22) {
              var longtext = text1.length > text22.length ? text1 : text22;
              var shorttext = text1.length > text22.length ? text22 : text1;
              if (longtext.length < 4 || shorttext.length * 2 < longtext.length) {
                return null;
              }
              function diff_halfMatchI_(longtext2, shorttext2, i3) {
                var seed = longtext2.substring(i3, i3 + Math.floor(longtext2.length / 4));
                var j2 = -1;
                var best_common = "";
                var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b;
                while ((j2 = shorttext2.indexOf(seed, j2 + 1)) != -1) {
                  var prefixLength = diff_commonPrefix(
                    longtext2.substring(i3),
                    shorttext2.substring(j2)
                  );
                  var suffixLength = diff_commonSuffix(
                    longtext2.substring(0, i3),
                    shorttext2.substring(0, j2)
                  );
                  if (best_common.length < suffixLength + prefixLength) {
                    best_common = shorttext2.substring(j2 - suffixLength, j2) + shorttext2.substring(j2, j2 + prefixLength);
                    best_longtext_a = longtext2.substring(0, i3 - suffixLength);
                    best_longtext_b = longtext2.substring(i3 + prefixLength);
                    best_shorttext_a = shorttext2.substring(0, j2 - suffixLength);
                    best_shorttext_b = shorttext2.substring(j2 + prefixLength);
                  }
                }
                if (best_common.length * 2 >= longtext2.length) {
                  return [
                    best_longtext_a,
                    best_longtext_b,
                    best_shorttext_a,
                    best_shorttext_b,
                    best_common
                  ];
                } else {
                  return null;
                }
              }
              var hm1 = diff_halfMatchI_(
                longtext,
                shorttext,
                Math.ceil(longtext.length / 4)
              );
              var hm2 = diff_halfMatchI_(
                longtext,
                shorttext,
                Math.ceil(longtext.length / 2)
              );
              var hm;
              if (!hm1 && !hm2) {
                return null;
              } else if (!hm2) {
                hm = hm1;
              } else if (!hm1) {
                hm = hm2;
              } else {
                hm = hm1[4].length > hm2[4].length ? hm1 : hm2;
              }
              var text1_a, text1_b, text2_a, text2_b;
              if (text1.length > text22.length) {
                text1_a = hm[0];
                text1_b = hm[1];
                text2_a = hm[2];
                text2_b = hm[3];
              } else {
                text2_a = hm[0];
                text2_b = hm[1];
                text1_a = hm[2];
                text1_b = hm[3];
              }
              var mid_common = hm[4];
              return [text1_a, text1_b, text2_a, text2_b, mid_common];
            }
            ;
            function diff_cleanupMerge(diffs) {
              diffs.push([DIFF_EQUAL, ""]);
              var pointer = 0;
              var count_delete = 0;
              var count_insert = 0;
              var text_delete = "";
              var text_insert = "";
              var commonlength;
              while (pointer < diffs.length) {
                switch (diffs[pointer][0]) {
                  case DIFF_INSERT:
                    count_insert++;
                    text_insert += diffs[pointer][1];
                    pointer++;
                    break;
                  case DIFF_DELETE:
                    count_delete++;
                    text_delete += diffs[pointer][1];
                    pointer++;
                    break;
                  case DIFF_EQUAL:
                    if (count_delete + count_insert > 1) {
                      if (count_delete !== 0 && count_insert !== 0) {
                        commonlength = diff_commonPrefix(text_insert, text_delete);
                        if (commonlength !== 0) {
                          if (pointer - count_delete - count_insert > 0 && diffs[pointer - count_delete - count_insert - 1][0] == DIFF_EQUAL) {
                            diffs[pointer - count_delete - count_insert - 1][1] += text_insert.substring(0, commonlength);
                          } else {
                            diffs.splice(0, 0, [
                              DIFF_EQUAL,
                              text_insert.substring(0, commonlength)
                            ]);
                            pointer++;
                          }
                          text_insert = text_insert.substring(commonlength);
                          text_delete = text_delete.substring(commonlength);
                        }
                        commonlength = diff_commonSuffix(text_insert, text_delete);
                        if (commonlength !== 0) {
                          diffs[pointer][1] = text_insert.substring(text_insert.length - commonlength) + diffs[pointer][1];
                          text_insert = text_insert.substring(0, text_insert.length - commonlength);
                          text_delete = text_delete.substring(0, text_delete.length - commonlength);
                        }
                      }
                      if (count_delete === 0) {
                        diffs.splice(
                          pointer - count_insert,
                          count_delete + count_insert,
                          [DIFF_INSERT, text_insert]
                        );
                      } else if (count_insert === 0) {
                        diffs.splice(
                          pointer - count_delete,
                          count_delete + count_insert,
                          [DIFF_DELETE, text_delete]
                        );
                      } else {
                        diffs.splice(
                          pointer - count_delete - count_insert,
                          count_delete + count_insert,
                          [DIFF_DELETE, text_delete],
                          [DIFF_INSERT, text_insert]
                        );
                      }
                      pointer = pointer - count_delete - count_insert + (count_delete ? 1 : 0) + (count_insert ? 1 : 0) + 1;
                    } else if (pointer !== 0 && diffs[pointer - 1][0] == DIFF_EQUAL) {
                      diffs[pointer - 1][1] += diffs[pointer][1];
                      diffs.splice(pointer, 1);
                    } else {
                      pointer++;
                    }
                    count_insert = 0;
                    count_delete = 0;
                    text_delete = "";
                    text_insert = "";
                    break;
                }
              }
              if (diffs[diffs.length - 1][1] === "") {
                diffs.pop();
              }
              var changes = false;
              pointer = 1;
              while (pointer < diffs.length - 1) {
                if (diffs[pointer - 1][0] == DIFF_EQUAL && diffs[pointer + 1][0] == DIFF_EQUAL) {
                  if (diffs[pointer][1].substring(diffs[pointer][1].length - diffs[pointer - 1][1].length) == diffs[pointer - 1][1]) {
                    diffs[pointer][1] = diffs[pointer - 1][1] + diffs[pointer][1].substring(0, diffs[pointer][1].length - diffs[pointer - 1][1].length);
                    diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];
                    diffs.splice(pointer - 1, 1);
                    changes = true;
                  } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) == diffs[pointer + 1][1]) {
                    diffs[pointer - 1][1] += diffs[pointer + 1][1];
                    diffs[pointer][1] = diffs[pointer][1].substring(diffs[pointer + 1][1].length) + diffs[pointer + 1][1];
                    diffs.splice(pointer + 1, 1);
                    changes = true;
                  }
                }
                pointer++;
              }
              if (changes) {
                diff_cleanupMerge(diffs);
              }
            }
            ;
            var diff = diff_main;
            diff.INSERT = DIFF_INSERT;
            diff.DELETE = DIFF_DELETE;
            diff.EQUAL = DIFF_EQUAL;
            module2.exports = diff;
            function cursor_normalize_diff(diffs, cursor_pos) {
              if (cursor_pos === 0) {
                return [DIFF_EQUAL, diffs];
              }
              for (var current_pos = 0, i3 = 0; i3 < diffs.length; i3++) {
                var d2 = diffs[i3];
                if (d2[0] === DIFF_DELETE || d2[0] === DIFF_EQUAL) {
                  var next_pos = current_pos + d2[1].length;
                  if (cursor_pos === next_pos) {
                    return [i3 + 1, diffs];
                  } else if (cursor_pos < next_pos) {
                    diffs = diffs.slice();
                    var split_pos = cursor_pos - current_pos;
                    var d_left = [d2[0], d2[1].slice(0, split_pos)];
                    var d_right = [d2[0], d2[1].slice(split_pos)];
                    diffs.splice(i3, 1, d_left, d_right);
                    return [i3 + 1, diffs];
                  } else {
                    current_pos = next_pos;
                  }
                }
              }
              throw new Error("cursor_pos is out of bounds!");
            }
            function fix_cursor(diffs, cursor_pos) {
              var norm = cursor_normalize_diff(diffs, cursor_pos);
              var ndiffs = norm[1];
              var cursor_pointer = norm[0];
              var d2 = ndiffs[cursor_pointer];
              var d_next = ndiffs[cursor_pointer + 1];
              if (d2 == null) {
                return diffs;
              } else if (d2[0] !== DIFF_EQUAL) {
                return diffs;
              } else {
                if (d_next != null && d2[1] + d_next[1] === d_next[1] + d2[1]) {
                  ndiffs.splice(cursor_pointer, 2, d_next, d2);
                  return merge_tuples(ndiffs, cursor_pointer, 2);
                } else if (d_next != null && d_next[1].indexOf(d2[1]) === 0) {
                  ndiffs.splice(cursor_pointer, 2, [d_next[0], d2[1]], [0, d2[1]]);
                  var suffix = d_next[1].slice(d2[1].length);
                  if (suffix.length > 0) {
                    ndiffs.splice(cursor_pointer + 2, 0, [d_next[0], suffix]);
                  }
                  return merge_tuples(ndiffs, cursor_pointer, 3);
                } else {
                  return diffs;
                }
              }
            }
            function fix_emoji(diffs) {
              var compact = false;
              var starts_with_pair_end = function(str) {
                return str.charCodeAt(0) >= 56320 && str.charCodeAt(0) <= 57343;
              };
              var ends_with_pair_start = function(str) {
                return str.charCodeAt(str.length - 1) >= 55296 && str.charCodeAt(str.length - 1) <= 56319;
              };
              for (var i3 = 2; i3 < diffs.length; i3 += 1) {
                if (diffs[i3 - 2][0] === DIFF_EQUAL && ends_with_pair_start(diffs[i3 - 2][1]) && diffs[i3 - 1][0] === DIFF_DELETE && starts_with_pair_end(diffs[i3 - 1][1]) && diffs[i3][0] === DIFF_INSERT && starts_with_pair_end(diffs[i3][1])) {
                  compact = true;
                  diffs[i3 - 1][1] = diffs[i3 - 2][1].slice(-1) + diffs[i3 - 1][1];
                  diffs[i3][1] = diffs[i3 - 2][1].slice(-1) + diffs[i3][1];
                  diffs[i3 - 2][1] = diffs[i3 - 2][1].slice(0, -1);
                }
              }
              if (!compact) {
                return diffs;
              }
              var fixed_diffs = [];
              for (var i3 = 0; i3 < diffs.length; i3 += 1) {
                if (diffs[i3][1].length > 0) {
                  fixed_diffs.push(diffs[i3]);
                }
              }
              return fixed_diffs;
            }
            function merge_tuples(diffs, start, length2) {
              for (var i3 = start + length2 - 1; i3 >= 0 && i3 >= start - 1; i3--) {
                if (i3 + 1 < diffs.length) {
                  var left_d = diffs[i3];
                  var right_d = diffs[i3 + 1];
                  if (left_d[0] === right_d[1]) {
                    diffs.splice(i3, 2, [left_d[0], left_d[1] + right_d[1]]);
                  }
                }
              }
              return diffs;
            }
          },
          /* 52 */
          /***/
          function(module2, exports2) {
            exports2 = module2.exports = typeof Object.keys === "function" ? Object.keys : shim;
            exports2.shim = shim;
            function shim(obj) {
              var keys = [];
              for (var key in obj)
                keys.push(key);
              return keys;
            }
          },
          /* 53 */
          /***/
          function(module2, exports2) {
            var supportsArgumentsClass = function() {
              return Object.prototype.toString.call(arguments);
            }() == "[object Arguments]";
            exports2 = module2.exports = supportsArgumentsClass ? supported : unsupported;
            exports2.supported = supported;
            function supported(object) {
              return Object.prototype.toString.call(object) == "[object Arguments]";
            }
            ;
            exports2.unsupported = unsupported;
            function unsupported(object) {
              return object && typeof object == "object" && typeof object.length == "number" && Object.prototype.hasOwnProperty.call(object, "callee") && !Object.prototype.propertyIsEnumerable.call(object, "callee") || false;
            }
            ;
          },
          /* 54 */
          /***/
          function(module2, exports2) {
            "use strict";
            var has = Object.prototype.hasOwnProperty, prefix = "~";
            function Events() {
            }
            if (Object.create) {
              Events.prototype = /* @__PURE__ */ Object.create(null);
              if (!new Events().__proto__)
                prefix = false;
            }
            function EE(fn, context, once) {
              this.fn = fn;
              this.context = context;
              this.once = once || false;
            }
            function EventEmitter2() {
              this._events = new Events();
              this._eventsCount = 0;
            }
            EventEmitter2.prototype.eventNames = function eventNames() {
              var names2 = [], events, name;
              if (this._eventsCount === 0)
                return names2;
              for (name in events = this._events) {
                if (has.call(events, name))
                  names2.push(prefix ? name.slice(1) : name);
              }
              if (Object.getOwnPropertySymbols) {
                return names2.concat(Object.getOwnPropertySymbols(events));
              }
              return names2;
            };
            EventEmitter2.prototype.listeners = function listeners(event, exists) {
              var evt = prefix ? prefix + event : event, available = this._events[evt];
              if (exists)
                return !!available;
              if (!available)
                return [];
              if (available.fn)
                return [available.fn];
              for (var i3 = 0, l3 = available.length, ee2 = new Array(l3); i3 < l3; i3++) {
                ee2[i3] = available[i3].fn;
              }
              return ee2;
            };
            EventEmitter2.prototype.emit = function emit(event, a1, a22, a3, a4, a5) {
              var evt = prefix ? prefix + event : event;
              if (!this._events[evt])
                return false;
              var listeners = this._events[evt], len = arguments.length, args, i3;
              if (listeners.fn) {
                if (listeners.once)
                  this.removeListener(event, listeners.fn, void 0, true);
                switch (len) {
                  case 1:
                    return listeners.fn.call(listeners.context), true;
                  case 2:
                    return listeners.fn.call(listeners.context, a1), true;
                  case 3:
                    return listeners.fn.call(listeners.context, a1, a22), true;
                  case 4:
                    return listeners.fn.call(listeners.context, a1, a22, a3), true;
                  case 5:
                    return listeners.fn.call(listeners.context, a1, a22, a3, a4), true;
                  case 6:
                    return listeners.fn.call(listeners.context, a1, a22, a3, a4, a5), true;
                }
                for (i3 = 1, args = new Array(len - 1); i3 < len; i3++) {
                  args[i3 - 1] = arguments[i3];
                }
                listeners.fn.apply(listeners.context, args);
              } else {
                var length2 = listeners.length, j2;
                for (i3 = 0; i3 < length2; i3++) {
                  if (listeners[i3].once)
                    this.removeListener(event, listeners[i3].fn, void 0, true);
                  switch (len) {
                    case 1:
                      listeners[i3].fn.call(listeners[i3].context);
                      break;
                    case 2:
                      listeners[i3].fn.call(listeners[i3].context, a1);
                      break;
                    case 3:
                      listeners[i3].fn.call(listeners[i3].context, a1, a22);
                      break;
                    case 4:
                      listeners[i3].fn.call(listeners[i3].context, a1, a22, a3);
                      break;
                    default:
                      if (!args)
                        for (j2 = 1, args = new Array(len - 1); j2 < len; j2++) {
                          args[j2 - 1] = arguments[j2];
                        }
                      listeners[i3].fn.apply(listeners[i3].context, args);
                  }
                }
              }
              return true;
            };
            EventEmitter2.prototype.on = function on2(event, fn, context) {
              var listener = new EE(fn, context || this), evt = prefix ? prefix + event : event;
              if (!this._events[evt])
                this._events[evt] = listener, this._eventsCount++;
              else if (!this._events[evt].fn)
                this._events[evt].push(listener);
              else
                this._events[evt] = [this._events[evt], listener];
              return this;
            };
            EventEmitter2.prototype.once = function once(event, fn, context) {
              var listener = new EE(fn, context || this, true), evt = prefix ? prefix + event : event;
              if (!this._events[evt])
                this._events[evt] = listener, this._eventsCount++;
              else if (!this._events[evt].fn)
                this._events[evt].push(listener);
              else
                this._events[evt] = [this._events[evt], listener];
              return this;
            };
            EventEmitter2.prototype.removeListener = function removeListener(event, fn, context, once) {
              var evt = prefix ? prefix + event : event;
              if (!this._events[evt])
                return this;
              if (!fn) {
                if (--this._eventsCount === 0)
                  this._events = new Events();
                else
                  delete this._events[evt];
                return this;
              }
              var listeners = this._events[evt];
              if (listeners.fn) {
                if (listeners.fn === fn && (!once || listeners.once) && (!context || listeners.context === context)) {
                  if (--this._eventsCount === 0)
                    this._events = new Events();
                  else
                    delete this._events[evt];
                }
              } else {
                for (var i3 = 0, events = [], length2 = listeners.length; i3 < length2; i3++) {
                  if (listeners[i3].fn !== fn || once && !listeners[i3].once || context && listeners[i3].context !== context) {
                    events.push(listeners[i3]);
                  }
                }
                if (events.length)
                  this._events[evt] = events.length === 1 ? events[0] : events;
                else if (--this._eventsCount === 0)
                  this._events = new Events();
                else
                  delete this._events[evt];
              }
              return this;
            };
            EventEmitter2.prototype.removeAllListeners = function removeAllListeners(event) {
              var evt;
              if (event) {
                evt = prefix ? prefix + event : event;
                if (this._events[evt]) {
                  if (--this._eventsCount === 0)
                    this._events = new Events();
                  else
                    delete this._events[evt];
                }
              } else {
                this._events = new Events();
                this._eventsCount = 0;
              }
              return this;
            };
            EventEmitter2.prototype.off = EventEmitter2.prototype.removeListener;
            EventEmitter2.prototype.addListener = EventEmitter2.prototype.on;
            EventEmitter2.prototype.setMaxListeners = function setMaxListeners() {
              return this;
            };
            EventEmitter2.prefixed = prefix;
            EventEmitter2.EventEmitter = EventEmitter2;
            if ("undefined" !== typeof module2) {
              module2.exports = EventEmitter2;
            }
          },
          /* 55 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", {
              value: true
            });
            exports2.matchText = exports2.matchSpacing = exports2.matchNewline = exports2.matchBlot = exports2.matchAttributor = exports2.default = void 0;
            var _typeof3 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) {
              return typeof obj;
            } : function(obj) {
              return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
            };
            var _slicedToArray = function() {
              function sliceIterator(arr, i3) {
                var _arr = [];
                var _n = true;
                var _d = false;
                var _e = void 0;
                try {
                  for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
                    _arr.push(_s.value);
                    if (i3 && _arr.length === i3)
                      break;
                  }
                } catch (err) {
                  _d = true;
                  _e = err;
                } finally {
                  try {
                    if (!_n && _i["return"])
                      _i["return"]();
                  } finally {
                    if (_d)
                      throw _e;
                  }
                }
                return _arr;
              }
              return function(arr, i3) {
                if (Array.isArray(arr)) {
                  return arr;
                } else if (Symbol.iterator in Object(arr)) {
                  return sliceIterator(arr, i3);
                } else {
                  throw new TypeError("Invalid attempt to destructure non-iterable instance");
                }
              };
            }();
            var _createClass = function() {
              function defineProperties(target, props) {
                for (var i3 = 0; i3 < props.length; i3++) {
                  var descriptor = props[i3];
                  descriptor.enumerable = descriptor.enumerable || false;
                  descriptor.configurable = true;
                  if ("value" in descriptor)
                    descriptor.writable = true;
                  Object.defineProperty(target, descriptor.key, descriptor);
                }
              }
              return function(Constructor, protoProps, staticProps) {
                if (protoProps)
                  defineProperties(Constructor.prototype, protoProps);
                if (staticProps)
                  defineProperties(Constructor, staticProps);
                return Constructor;
              };
            }();
            var _extend2 = __webpack_require__(3);
            var _extend3 = _interopRequireDefault(_extend2);
            var _quillDelta = __webpack_require__(2);
            var _quillDelta2 = _interopRequireDefault(_quillDelta);
            var _parchment = __webpack_require__(0);
            var _parchment2 = _interopRequireDefault(_parchment);
            var _quill = __webpack_require__(5);
            var _quill2 = _interopRequireDefault(_quill);
            var _logger = __webpack_require__(10);
            var _logger2 = _interopRequireDefault(_logger);
            var _module = __webpack_require__(9);
            var _module2 = _interopRequireDefault(_module);
            var _align = __webpack_require__(36);
            var _background = __webpack_require__(37);
            var _code = __webpack_require__(13);
            var _code2 = _interopRequireDefault(_code);
            var _color = __webpack_require__(26);
            var _direction = __webpack_require__(38);
            var _font = __webpack_require__(39);
            var _size = __webpack_require__(40);
            function _interopRequireDefault(obj) {
              return obj && obj.__esModule ? obj : { default: obj };
            }
            function _defineProperty2(obj, key, value) {
              if (key in obj) {
                Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
              } else {
                obj[key] = value;
              }
              return obj;
            }
            function _classCallCheck2(instance, Constructor) {
              if (!(instance instanceof Constructor)) {
                throw new TypeError("Cannot call a class as a function");
              }
            }
            function _possibleConstructorReturn(self2, call4) {
              if (!self2) {
                throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
              }
              return call4 && (typeof call4 === "object" || typeof call4 === "function") ? call4 : self2;
            }
            function _inherits(subClass, superClass) {
              if (typeof superClass !== "function" && superClass !== null) {
                throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
              }
              subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
              if (superClass)
                Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
            }
            var debug = (0, _logger2.default)("quill:clipboard");
            var DOM_KEY = "__ql-matcher";
            var CLIPBOARD_CONFIG = [[Node.TEXT_NODE, matchText], [Node.TEXT_NODE, matchNewline], ["br", matchBreak], [Node.ELEMENT_NODE, matchNewline], [Node.ELEMENT_NODE, matchBlot], [Node.ELEMENT_NODE, matchSpacing], [Node.ELEMENT_NODE, matchAttributor], [Node.ELEMENT_NODE, matchStyles], ["li", matchIndent], ["b", matchAlias.bind(matchAlias, "bold")], ["i", matchAlias.bind(matchAlias, "italic")], ["style", matchIgnore]];
            var ATTRIBUTE_ATTRIBUTORS = [_align.AlignAttribute, _direction.DirectionAttribute].reduce(function(memo, attr2) {
              memo[attr2.keyName] = attr2;
              return memo;
            }, {});
            var STYLE_ATTRIBUTORS = [_align.AlignStyle, _background.BackgroundStyle, _color.ColorStyle, _direction.DirectionStyle, _font.FontStyle, _size.SizeStyle].reduce(function(memo, attr2) {
              memo[attr2.keyName] = attr2;
              return memo;
            }, {});
            var Clipboard = function(_Module) {
              _inherits(Clipboard2, _Module);
              function Clipboard2(quill, options) {
                _classCallCheck2(this, Clipboard2);
                var _this = _possibleConstructorReturn(this, (Clipboard2.__proto__ || Object.getPrototypeOf(Clipboard2)).call(this, quill, options));
                _this.quill.root.addEventListener("paste", _this.onPaste.bind(_this));
                _this.container = _this.quill.addContainer("ql-clipboard");
                _this.container.setAttribute("contenteditable", true);
                _this.container.setAttribute("tabindex", -1);
                _this.matchers = [];
                CLIPBOARD_CONFIG.concat(_this.options.matchers).forEach(function(_ref) {
                  var _ref2 = _slicedToArray(_ref, 2), selector = _ref2[0], matcher = _ref2[1];
                  if (!options.matchVisual && matcher === matchSpacing)
                    return;
                  _this.addMatcher(selector, matcher);
                });
                return _this;
              }
              _createClass(Clipboard2, [{
                key: "addMatcher",
                value: function addMatcher(selector, matcher) {
                  this.matchers.push([selector, matcher]);
                }
              }, {
                key: "convert",
                value: function convert(html2) {
                  if (typeof html2 === "string") {
                    this.container.innerHTML = html2.replace(/\>\r?\n +\</g, "><");
                    return this.convert();
                  }
                  var formats = this.quill.getFormat(this.quill.selection.savedRange.index);
                  if (formats[_code2.default.blotName]) {
                    var text3 = this.container.innerText;
                    this.container.innerHTML = "";
                    return new _quillDelta2.default().insert(text3, _defineProperty2({}, _code2.default.blotName, formats[_code2.default.blotName]));
                  }
                  var _prepareMatching = this.prepareMatching(), _prepareMatching2 = _slicedToArray(_prepareMatching, 2), elementMatchers = _prepareMatching2[0], textMatchers = _prepareMatching2[1];
                  var delta = traverse(this.container, elementMatchers, textMatchers);
                  if (deltaEndsWith(delta, "\n") && delta.ops[delta.ops.length - 1].attributes == null) {
                    delta = delta.compose(new _quillDelta2.default().retain(delta.length() - 1).delete(1));
                  }
                  debug.log("convert", this.container.innerHTML, delta);
                  this.container.innerHTML = "";
                  return delta;
                }
              }, {
                key: "dangerouslyPasteHTML",
                value: function dangerouslyPasteHTML(index3, html2) {
                  var source = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : _quill2.default.sources.API;
                  if (typeof index3 === "string") {
                    this.quill.setContents(this.convert(index3), html2);
                    this.quill.setSelection(0, _quill2.default.sources.SILENT);
                  } else {
                    var paste = this.convert(html2);
                    this.quill.updateContents(new _quillDelta2.default().retain(index3).concat(paste), source);
                    this.quill.setSelection(index3 + paste.length(), _quill2.default.sources.SILENT);
                  }
                }
              }, {
                key: "onPaste",
                value: function onPaste(e2) {
                  var _this2 = this;
                  if (e2.defaultPrevented || !this.quill.isEnabled())
                    return;
                  var range = this.quill.getSelection();
                  var delta = new _quillDelta2.default().retain(range.index);
                  var scrollTop = this.quill.scrollingContainer.scrollTop;
                  this.container.focus();
                  this.quill.selection.update(_quill2.default.sources.SILENT);
                  setTimeout(function() {
                    delta = delta.concat(_this2.convert()).delete(range.length);
                    _this2.quill.updateContents(delta, _quill2.default.sources.USER);
                    _this2.quill.setSelection(delta.length() - range.length, _quill2.default.sources.SILENT);
                    _this2.quill.scrollingContainer.scrollTop = scrollTop;
                    _this2.quill.focus();
                  }, 1);
                }
              }, {
                key: "prepareMatching",
                value: function prepareMatching() {
                  var _this3 = this;
                  var elementMatchers = [], textMatchers = [];
                  this.matchers.forEach(function(pair) {
                    var _pair = _slicedToArray(pair, 2), selector = _pair[0], matcher = _pair[1];
                    switch (selector) {
                      case Node.TEXT_NODE:
                        textMatchers.push(matcher);
                        break;
                      case Node.ELEMENT_NODE:
                        elementMatchers.push(matcher);
                        break;
                      default:
                        [].forEach.call(_this3.container.querySelectorAll(selector), function(node3) {
                          node3[DOM_KEY] = node3[DOM_KEY] || [];
                          node3[DOM_KEY].push(matcher);
                        });
                        break;
                    }
                  });
                  return [elementMatchers, textMatchers];
                }
              }]);
              return Clipboard2;
            }(_module2.default);
            Clipboard.DEFAULTS = {
              matchers: [],
              matchVisual: true
            };
            function applyFormat(delta, format, value) {
              if ((typeof format === "undefined" ? "undefined" : _typeof3(format)) === "object") {
                return Object.keys(format).reduce(function(delta2, key) {
                  return applyFormat(delta2, key, format[key]);
                }, delta);
              } else {
                return delta.reduce(function(delta2, op) {
                  if (op.attributes && op.attributes[format]) {
                    return delta2.push(op);
                  } else {
                    return delta2.insert(op.insert, (0, _extend3.default)({}, _defineProperty2({}, format, value), op.attributes));
                  }
                }, new _quillDelta2.default());
              }
            }
            function computeStyle(node3) {
              if (node3.nodeType !== Node.ELEMENT_NODE)
                return {};
              var DOM_KEY2 = "__ql-computed-style";
              return node3[DOM_KEY2] || (node3[DOM_KEY2] = window.getComputedStyle(node3));
            }
            function deltaEndsWith(delta, text3) {
              var endText = "";
              for (var i3 = delta.ops.length - 1; i3 >= 0 && endText.length < text3.length; --i3) {
                var op = delta.ops[i3];
                if (typeof op.insert !== "string")
                  break;
                endText = op.insert + endText;
              }
              return endText.slice(-1 * text3.length) === text3;
            }
            function isLine(node3) {
              if (node3.childNodes.length === 0)
                return false;
              var style = computeStyle(node3);
              return ["block", "list-item"].indexOf(style.display) > -1;
            }
            function traverse(node3, elementMatchers, textMatchers) {
              if (node3.nodeType === node3.TEXT_NODE) {
                return textMatchers.reduce(function(delta, matcher) {
                  return matcher(node3, delta);
                }, new _quillDelta2.default());
              } else if (node3.nodeType === node3.ELEMENT_NODE) {
                return [].reduce.call(node3.childNodes || [], function(delta, childNode) {
                  var childrenDelta = traverse(childNode, elementMatchers, textMatchers);
                  if (childNode.nodeType === node3.ELEMENT_NODE) {
                    childrenDelta = elementMatchers.reduce(function(childrenDelta2, matcher) {
                      return matcher(childNode, childrenDelta2);
                    }, childrenDelta);
                    childrenDelta = (childNode[DOM_KEY] || []).reduce(function(childrenDelta2, matcher) {
                      return matcher(childNode, childrenDelta2);
                    }, childrenDelta);
                  }
                  return delta.concat(childrenDelta);
                }, new _quillDelta2.default());
              } else {
                return new _quillDelta2.default();
              }
            }
            function matchAlias(format, node3, delta) {
              return applyFormat(delta, format, true);
            }
            function matchAttributor(node3, delta) {
              var attributes = _parchment2.default.Attributor.Attribute.keys(node3);
              var classes2 = _parchment2.default.Attributor.Class.keys(node3);
              var styles = _parchment2.default.Attributor.Style.keys(node3);
              var formats = {};
              attributes.concat(classes2).concat(styles).forEach(function(name) {
                var attr2 = _parchment2.default.query(name, _parchment2.default.Scope.ATTRIBUTE);
                if (attr2 != null) {
                  formats[attr2.attrName] = attr2.value(node3);
                  if (formats[attr2.attrName])
                    return;
                }
                attr2 = ATTRIBUTE_ATTRIBUTORS[name];
                if (attr2 != null && (attr2.attrName === name || attr2.keyName === name)) {
                  formats[attr2.attrName] = attr2.value(node3) || void 0;
                }
                attr2 = STYLE_ATTRIBUTORS[name];
                if (attr2 != null && (attr2.attrName === name || attr2.keyName === name)) {
                  attr2 = STYLE_ATTRIBUTORS[name];
                  formats[attr2.attrName] = attr2.value(node3) || void 0;
                }
              });
              if (Object.keys(formats).length > 0) {
                delta = applyFormat(delta, formats);
              }
              return delta;
            }
            function matchBlot(node3, delta) {
              var match = _parchment2.default.query(node3);
              if (match == null)
                return delta;
              if (match.prototype instanceof _parchment2.default.Embed) {
                var embed = {};
                var value = match.value(node3);
                if (value != null) {
                  embed[match.blotName] = value;
                  delta = new _quillDelta2.default().insert(embed, match.formats(node3));
                }
              } else if (typeof match.formats === "function") {
                delta = applyFormat(delta, match.blotName, match.formats(node3));
              }
              return delta;
            }
            function matchBreak(node3, delta) {
              if (!deltaEndsWith(delta, "\n")) {
                delta.insert("\n");
              }
              return delta;
            }
            function matchIgnore() {
              return new _quillDelta2.default();
            }
            function matchIndent(node3, delta) {
              var match = _parchment2.default.query(node3);
              if (match == null || match.blotName !== "list-item" || !deltaEndsWith(delta, "\n")) {
                return delta;
              }
              var indent = -1, parent = node3.parentNode;
              while (!parent.classList.contains("ql-clipboard")) {
                if ((_parchment2.default.query(parent) || {}).blotName === "list") {
                  indent += 1;
                }
                parent = parent.parentNode;
              }
              if (indent <= 0)
                return delta;
              return delta.compose(new _quillDelta2.default().retain(delta.length() - 1).retain(1, { indent }));
            }
            function matchNewline(node3, delta) {
              if (!deltaEndsWith(delta, "\n")) {
                if (isLine(node3) || delta.length() > 0 && node3.nextSibling && isLine(node3.nextSibling)) {
                  delta.insert("\n");
                }
              }
              return delta;
            }
            function matchSpacing(node3, delta) {
              if (isLine(node3) && node3.nextElementSibling != null && !deltaEndsWith(delta, "\n\n")) {
                var nodeHeight = node3.offsetHeight + parseFloat(computeStyle(node3).marginTop) + parseFloat(computeStyle(node3).marginBottom);
                if (node3.nextElementSibling.offsetTop > node3.offsetTop + nodeHeight * 1.5) {
                  delta.insert("\n");
                }
              }
              return delta;
            }
            function matchStyles(node3, delta) {
              var formats = {};
              var style = node3.style || {};
              if (style.fontStyle && computeStyle(node3).fontStyle === "italic") {
                formats.italic = true;
              }
              if (style.fontWeight && (computeStyle(node3).fontWeight.startsWith("bold") || parseInt(computeStyle(node3).fontWeight) >= 700)) {
                formats.bold = true;
              }
              if (Object.keys(formats).length > 0) {
                delta = applyFormat(delta, formats);
              }
              if (parseFloat(style.textIndent || 0) > 0) {
                delta = new _quillDelta2.default().insert("	").concat(delta);
              }
              return delta;
            }
            function matchText(node3, delta) {
              var text3 = node3.data;
              if (node3.parentNode.tagName === "O:P") {
                return delta.insert(text3.trim());
              }
              if (text3.trim().length === 0 && node3.parentNode.classList.contains("ql-clipboard")) {
                return delta;
              }
              if (!computeStyle(node3.parentNode).whiteSpace.startsWith("pre")) {
                var replacer = function replacer2(collapse, match) {
                  match = match.replace(/[^\u00a0]/g, "");
                  return match.length < 1 && collapse ? " " : match;
                };
                text3 = text3.replace(/\r\n/g, " ").replace(/\n/g, " ");
                text3 = text3.replace(/\s\s+/g, replacer.bind(replacer, true));
                if (node3.previousSibling == null && isLine(node3.parentNode) || node3.previousSibling != null && isLine(node3.previousSibling)) {
                  text3 = text3.replace(/^\s+/, replacer.bind(replacer, false));
                }
                if (node3.nextSibling == null && isLine(node3.parentNode) || node3.nextSibling != null && isLine(node3.nextSibling)) {
                  text3 = text3.replace(/\s+$/, replacer.bind(replacer, false));
                }
              }
              return delta.insert(text3);
            }
            exports2.default = Clipboard;
            exports2.matchAttributor = matchAttributor;
            exports2.matchBlot = matchBlot;
            exports2.matchNewline = matchNewline;
            exports2.matchSpacing = matchSpacing;
            exports2.matchText = matchText;
          },
          /* 56 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", {
              value: true
            });
            var _createClass = function() {
              function defineProperties(target, props) {
                for (var i3 = 0; i3 < props.length; i3++) {
                  var descriptor = props[i3];
                  descriptor.enumerable = descriptor.enumerable || false;
                  descriptor.configurable = true;
                  if ("value" in descriptor)
                    descriptor.writable = true;
                  Object.defineProperty(target, descriptor.key, descriptor);
                }
              }
              return function(Constructor, protoProps, staticProps) {
                if (protoProps)
                  defineProperties(Constructor.prototype, protoProps);
                if (staticProps)
                  defineProperties(Constructor, staticProps);
                return Constructor;
              };
            }();
            var _get = function get(object, property, receiver) {
              if (object === null)
                object = Function.prototype;
              var desc = Object.getOwnPropertyDescriptor(object, property);
              if (desc === void 0) {
                var parent = Object.getPrototypeOf(object);
                if (parent === null) {
                  return void 0;
                } else {
                  return get(parent, property, receiver);
                }
              } else if ("value" in desc) {
                return desc.value;
              } else {
                var getter = desc.get;
                if (getter === void 0) {
                  return void 0;
                }
                return getter.call(receiver);
              }
            };
            var _inline = __webpack_require__(6);
            var _inline2 = _interopRequireDefault(_inline);
            function _interopRequireDefault(obj) {
              return obj && obj.__esModule ? obj : { default: obj };
            }
            function _classCallCheck2(instance, Constructor) {
              if (!(instance instanceof Constructor)) {
                throw new TypeError("Cannot call a class as a function");
              }
            }
            function _possibleConstructorReturn(self2, call4) {
              if (!self2) {
                throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
              }
              return call4 && (typeof call4 === "object" || typeof call4 === "function") ? call4 : self2;
            }
            function _inherits(subClass, superClass) {
              if (typeof superClass !== "function" && superClass !== null) {
                throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
              }
              subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
              if (superClass)
                Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
            }
            var Bold = function(_Inline) {
              _inherits(Bold2, _Inline);
              function Bold2() {
                _classCallCheck2(this, Bold2);
                return _possibleConstructorReturn(this, (Bold2.__proto__ || Object.getPrototypeOf(Bold2)).apply(this, arguments));
              }
              _createClass(Bold2, [{
                key: "optimize",
                value: function optimize(context) {
                  _get(Bold2.prototype.__proto__ || Object.getPrototypeOf(Bold2.prototype), "optimize", this).call(this, context);
                  if (this.domNode.tagName !== this.statics.tagName[0]) {
                    this.replaceWith(this.statics.blotName);
                  }
                }
              }], [{
                key: "create",
                value: function create2() {
                  return _get(Bold2.__proto__ || Object.getPrototypeOf(Bold2), "create", this).call(this);
                }
              }, {
                key: "formats",
                value: function formats() {
                  return true;
                }
              }]);
              return Bold2;
            }(_inline2.default);
            Bold.blotName = "bold";
            Bold.tagName = ["STRONG", "B"];
            exports2.default = Bold;
          },
          /* 57 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", {
              value: true
            });
            exports2.addControls = exports2.default = void 0;
            var _slicedToArray = function() {
              function sliceIterator(arr, i3) {
                var _arr = [];
                var _n = true;
                var _d = false;
                var _e = void 0;
                try {
                  for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
                    _arr.push(_s.value);
                    if (i3 && _arr.length === i3)
                      break;
                  }
                } catch (err) {
                  _d = true;
                  _e = err;
                } finally {
                  try {
                    if (!_n && _i["return"])
                      _i["return"]();
                  } finally {
                    if (_d)
                      throw _e;
                  }
                }
                return _arr;
              }
              return function(arr, i3) {
                if (Array.isArray(arr)) {
                  return arr;
                } else if (Symbol.iterator in Object(arr)) {
                  return sliceIterator(arr, i3);
                } else {
                  throw new TypeError("Invalid attempt to destructure non-iterable instance");
                }
              };
            }();
            var _createClass = function() {
              function defineProperties(target, props) {
                for (var i3 = 0; i3 < props.length; i3++) {
                  var descriptor = props[i3];
                  descriptor.enumerable = descriptor.enumerable || false;
                  descriptor.configurable = true;
                  if ("value" in descriptor)
                    descriptor.writable = true;
                  Object.defineProperty(target, descriptor.key, descriptor);
                }
              }
              return function(Constructor, protoProps, staticProps) {
                if (protoProps)
                  defineProperties(Constructor.prototype, protoProps);
                if (staticProps)
                  defineProperties(Constructor, staticProps);
                return Constructor;
              };
            }();
            var _quillDelta = __webpack_require__(2);
            var _quillDelta2 = _interopRequireDefault(_quillDelta);
            var _parchment = __webpack_require__(0);
            var _parchment2 = _interopRequireDefault(_parchment);
            var _quill = __webpack_require__(5);
            var _quill2 = _interopRequireDefault(_quill);
            var _logger = __webpack_require__(10);
            var _logger2 = _interopRequireDefault(_logger);
            var _module = __webpack_require__(9);
            var _module2 = _interopRequireDefault(_module);
            function _interopRequireDefault(obj) {
              return obj && obj.__esModule ? obj : { default: obj };
            }
            function _defineProperty2(obj, key, value) {
              if (key in obj) {
                Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
              } else {
                obj[key] = value;
              }
              return obj;
            }
            function _classCallCheck2(instance, Constructor) {
              if (!(instance instanceof Constructor)) {
                throw new TypeError("Cannot call a class as a function");
              }
            }
            function _possibleConstructorReturn(self2, call4) {
              if (!self2) {
                throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
              }
              return call4 && (typeof call4 === "object" || typeof call4 === "function") ? call4 : self2;
            }
            function _inherits(subClass, superClass) {
              if (typeof superClass !== "function" && superClass !== null) {
                throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
              }
              subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
              if (superClass)
                Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
            }
            var debug = (0, _logger2.default)("quill:toolbar");
            var Toolbar = function(_Module) {
              _inherits(Toolbar2, _Module);
              function Toolbar2(quill, options) {
                _classCallCheck2(this, Toolbar2);
                var _this = _possibleConstructorReturn(this, (Toolbar2.__proto__ || Object.getPrototypeOf(Toolbar2)).call(this, quill, options));
                if (Array.isArray(_this.options.container)) {
                  var container = document.createElement("div");
                  addControls(container, _this.options.container);
                  quill.container.parentNode.insertBefore(container, quill.container);
                  _this.container = container;
                } else if (typeof _this.options.container === "string") {
                  _this.container = document.querySelector(_this.options.container);
                } else {
                  _this.container = _this.options.container;
                }
                if (!(_this.container instanceof HTMLElement)) {
                  var _ret;
                  return _ret = debug.error("Container required for toolbar", _this.options), _possibleConstructorReturn(_this, _ret);
                }
                _this.container.classList.add("ql-toolbar");
                _this.controls = [];
                _this.handlers = {};
                Object.keys(_this.options.handlers).forEach(function(format) {
                  _this.addHandler(format, _this.options.handlers[format]);
                });
                [].forEach.call(_this.container.querySelectorAll("button, select"), function(input) {
                  _this.attach(input);
                });
                _this.quill.on(_quill2.default.events.EDITOR_CHANGE, function(type, range) {
                  if (type === _quill2.default.events.SELECTION_CHANGE) {
                    _this.update(range);
                  }
                });
                _this.quill.on(_quill2.default.events.SCROLL_OPTIMIZE, function() {
                  var _this$quill$selection = _this.quill.selection.getRange(), _this$quill$selection2 = _slicedToArray(_this$quill$selection, 1), range = _this$quill$selection2[0];
                  _this.update(range);
                });
                return _this;
              }
              _createClass(Toolbar2, [{
                key: "addHandler",
                value: function addHandler(format, handler) {
                  this.handlers[format] = handler;
                }
              }, {
                key: "attach",
                value: function attach(input) {
                  var _this2 = this;
                  var format = [].find.call(input.classList, function(className) {
                    return className.indexOf("ql-") === 0;
                  });
                  if (!format)
                    return;
                  format = format.slice("ql-".length);
                  if (input.tagName === "BUTTON") {
                    input.setAttribute("type", "button");
                  }
                  if (this.handlers[format] == null) {
                    if (this.quill.scroll.whitelist != null && this.quill.scroll.whitelist[format] == null) {
                      debug.warn("ignoring attaching to disabled format", format, input);
                      return;
                    }
                    if (_parchment2.default.query(format) == null) {
                      debug.warn("ignoring attaching to nonexistent format", format, input);
                      return;
                    }
                  }
                  var eventName = input.tagName === "SELECT" ? "change" : "click";
                  input.addEventListener(eventName, function(e2) {
                    var value = void 0;
                    if (input.tagName === "SELECT") {
                      if (input.selectedIndex < 0)
                        return;
                      var selected = input.options[input.selectedIndex];
                      if (selected.hasAttribute("selected")) {
                        value = false;
                      } else {
                        value = selected.value || false;
                      }
                    } else {
                      if (input.classList.contains("ql-active")) {
                        value = false;
                      } else {
                        value = input.value || !input.hasAttribute("value");
                      }
                      e2.preventDefault();
                    }
                    _this2.quill.focus();
                    var _quill$selection$getR = _this2.quill.selection.getRange(), _quill$selection$getR2 = _slicedToArray(_quill$selection$getR, 1), range = _quill$selection$getR2[0];
                    if (_this2.handlers[format] != null) {
                      _this2.handlers[format].call(_this2, value);
                    } else if (_parchment2.default.query(format).prototype instanceof _parchment2.default.Embed) {
                      value = prompt("Enter " + format);
                      if (!value)
                        return;
                      _this2.quill.updateContents(new _quillDelta2.default().retain(range.index).delete(range.length).insert(_defineProperty2({}, format, value)), _quill2.default.sources.USER);
                    } else {
                      _this2.quill.format(format, value, _quill2.default.sources.USER);
                    }
                    _this2.update(range);
                  });
                  this.controls.push([format, input]);
                }
              }, {
                key: "update",
                value: function update(range) {
                  var formats = range == null ? {} : this.quill.getFormat(range);
                  this.controls.forEach(function(pair) {
                    var _pair = _slicedToArray(pair, 2), format = _pair[0], input = _pair[1];
                    if (input.tagName === "SELECT") {
                      var option = void 0;
                      if (range == null) {
                        option = null;
                      } else if (formats[format] == null) {
                        option = input.querySelector("option[selected]");
                      } else if (!Array.isArray(formats[format])) {
                        var value = formats[format];
                        if (typeof value === "string") {
                          value = value.replace(/\"/g, '\\"');
                        }
                        option = input.querySelector('option[value="' + value + '"]');
                      }
                      if (option == null) {
                        input.value = "";
                        input.selectedIndex = -1;
                      } else {
                        option.selected = true;
                      }
                    } else {
                      if (range == null) {
                        input.classList.remove("ql-active");
                      } else if (input.hasAttribute("value")) {
                        var isActive = formats[format] === input.getAttribute("value") || formats[format] != null && formats[format].toString() === input.getAttribute("value") || formats[format] == null && !input.getAttribute("value");
                        input.classList.toggle("ql-active", isActive);
                      } else {
                        input.classList.toggle("ql-active", formats[format] != null);
                      }
                    }
                  });
                }
              }]);
              return Toolbar2;
            }(_module2.default);
            Toolbar.DEFAULTS = {};
            function addButton(container, format, value) {
              var input = document.createElement("button");
              input.setAttribute("type", "button");
              input.classList.add("ql-" + format);
              if (value != null) {
                input.value = value;
              }
              container.appendChild(input);
            }
            function addControls(container, groups) {
              if (!Array.isArray(groups[0])) {
                groups = [groups];
              }
              groups.forEach(function(controls) {
                var group = document.createElement("span");
                group.classList.add("ql-formats");
                controls.forEach(function(control) {
                  if (typeof control === "string") {
                    addButton(group, control);
                  } else {
                    var format = Object.keys(control)[0];
                    var value = control[format];
                    if (Array.isArray(value)) {
                      addSelect(group, format, value);
                    } else {
                      addButton(group, format, value);
                    }
                  }
                });
                container.appendChild(group);
              });
            }
            function addSelect(container, format, values) {
              var input = document.createElement("select");
              input.classList.add("ql-" + format);
              values.forEach(function(value) {
                var option = document.createElement("option");
                if (value !== false) {
                  option.setAttribute("value", value);
                } else {
                  option.setAttribute("selected", "selected");
                }
                input.appendChild(option);
              });
              container.appendChild(input);
            }
            Toolbar.DEFAULTS = {
              container: null,
              handlers: {
                clean: function clean() {
                  var _this3 = this;
                  var range = this.quill.getSelection();
                  if (range == null)
                    return;
                  if (range.length == 0) {
                    var formats = this.quill.getFormat();
                    Object.keys(formats).forEach(function(name) {
                      if (_parchment2.default.query(name, _parchment2.default.Scope.INLINE) != null) {
                        _this3.quill.format(name, false);
                      }
                    });
                  } else {
                    this.quill.removeFormat(range, _quill2.default.sources.USER);
                  }
                },
                direction: function direction(value) {
                  var align = this.quill.getFormat()["align"];
                  if (value === "rtl" && align == null) {
                    this.quill.format("align", "right", _quill2.default.sources.USER);
                  } else if (!value && align === "right") {
                    this.quill.format("align", false, _quill2.default.sources.USER);
                  }
                  this.quill.format("direction", value, _quill2.default.sources.USER);
                },
                indent: function indent(value) {
                  var range = this.quill.getSelection();
                  var formats = this.quill.getFormat(range);
                  var indent2 = parseInt(formats.indent || 0);
                  if (value === "+1" || value === "-1") {
                    var modifier = value === "+1" ? 1 : -1;
                    if (formats.direction === "rtl")
                      modifier *= -1;
                    this.quill.format("indent", indent2 + modifier, _quill2.default.sources.USER);
                  }
                },
                link: function link(value) {
                  if (value === true) {
                    value = prompt("Enter link URL:");
                  }
                  this.quill.format("link", value, _quill2.default.sources.USER);
                },
                list: function list2(value) {
                  var range = this.quill.getSelection();
                  var formats = this.quill.getFormat(range);
                  if (value === "check") {
                    if (formats["list"] === "checked" || formats["list"] === "unchecked") {
                      this.quill.format("list", false, _quill2.default.sources.USER);
                    } else {
                      this.quill.format("list", "unchecked", _quill2.default.sources.USER);
                    }
                  } else {
                    this.quill.format("list", value, _quill2.default.sources.USER);
                  }
                }
              }
            };
            exports2.default = Toolbar;
            exports2.addControls = addControls;
          },
          /* 58 */
          /***/
          function(module2, exports2) {
            module2.exports = '<svg viewbox="0 0 18 18"> <polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"></polyline> <polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"></polyline> <line class=ql-stroke x1=10 x2=8 y1=5 y2=13></line> </svg>';
          },
          /* 59 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", {
              value: true
            });
            var _createClass = function() {
              function defineProperties(target, props) {
                for (var i3 = 0; i3 < props.length; i3++) {
                  var descriptor = props[i3];
                  descriptor.enumerable = descriptor.enumerable || false;
                  descriptor.configurable = true;
                  if ("value" in descriptor)
                    descriptor.writable = true;
                  Object.defineProperty(target, descriptor.key, descriptor);
                }
              }
              return function(Constructor, protoProps, staticProps) {
                if (protoProps)
                  defineProperties(Constructor.prototype, protoProps);
                if (staticProps)
                  defineProperties(Constructor, staticProps);
                return Constructor;
              };
            }();
            var _get = function get(object, property, receiver) {
              if (object === null)
                object = Function.prototype;
              var desc = Object.getOwnPropertyDescriptor(object, property);
              if (desc === void 0) {
                var parent = Object.getPrototypeOf(object);
                if (parent === null) {
                  return void 0;
                } else {
                  return get(parent, property, receiver);
                }
              } else if ("value" in desc) {
                return desc.value;
              } else {
                var getter = desc.get;
                if (getter === void 0) {
                  return void 0;
                }
                return getter.call(receiver);
              }
            };
            var _picker = __webpack_require__(28);
            var _picker2 = _interopRequireDefault(_picker);
            function _interopRequireDefault(obj) {
              return obj && obj.__esModule ? obj : { default: obj };
            }
            function _classCallCheck2(instance, Constructor) {
              if (!(instance instanceof Constructor)) {
                throw new TypeError("Cannot call a class as a function");
              }
            }
            function _possibleConstructorReturn(self2, call4) {
              if (!self2) {
                throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
              }
              return call4 && (typeof call4 === "object" || typeof call4 === "function") ? call4 : self2;
            }
            function _inherits(subClass, superClass) {
              if (typeof superClass !== "function" && superClass !== null) {
                throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
              }
              subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
              if (superClass)
                Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
            }
            var ColorPicker = function(_Picker) {
              _inherits(ColorPicker2, _Picker);
              function ColorPicker2(select, label) {
                _classCallCheck2(this, ColorPicker2);
                var _this = _possibleConstructorReturn(this, (ColorPicker2.__proto__ || Object.getPrototypeOf(ColorPicker2)).call(this, select));
                _this.label.innerHTML = label;
                _this.container.classList.add("ql-color-picker");
                [].slice.call(_this.container.querySelectorAll(".ql-picker-item"), 0, 7).forEach(function(item) {
                  item.classList.add("ql-primary");
                });
                return _this;
              }
              _createClass(ColorPicker2, [{
                key: "buildItem",
                value: function buildItem(option) {
                  var item = _get(ColorPicker2.prototype.__proto__ || Object.getPrototypeOf(ColorPicker2.prototype), "buildItem", this).call(this, option);
                  item.style.backgroundColor = option.getAttribute("value") || "";
                  return item;
                }
              }, {
                key: "selectItem",
                value: function selectItem(item, trigger) {
                  _get(ColorPicker2.prototype.__proto__ || Object.getPrototypeOf(ColorPicker2.prototype), "selectItem", this).call(this, item, trigger);
                  var colorLabel = this.label.querySelector(".ql-color-label");
                  var value = item ? item.getAttribute("data-value") || "" : "";
                  if (colorLabel) {
                    if (colorLabel.tagName === "line") {
                      colorLabel.style.stroke = value;
                    } else {
                      colorLabel.style.fill = value;
                    }
                  }
                }
              }]);
              return ColorPicker2;
            }(_picker2.default);
            exports2.default = ColorPicker;
          },
          /* 60 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", {
              value: true
            });
            var _createClass = function() {
              function defineProperties(target, props) {
                for (var i3 = 0; i3 < props.length; i3++) {
                  var descriptor = props[i3];
                  descriptor.enumerable = descriptor.enumerable || false;
                  descriptor.configurable = true;
                  if ("value" in descriptor)
                    descriptor.writable = true;
                  Object.defineProperty(target, descriptor.key, descriptor);
                }
              }
              return function(Constructor, protoProps, staticProps) {
                if (protoProps)
                  defineProperties(Constructor.prototype, protoProps);
                if (staticProps)
                  defineProperties(Constructor, staticProps);
                return Constructor;
              };
            }();
            var _get = function get(object, property, receiver) {
              if (object === null)
                object = Function.prototype;
              var desc = Object.getOwnPropertyDescriptor(object, property);
              if (desc === void 0) {
                var parent = Object.getPrototypeOf(object);
                if (parent === null) {
                  return void 0;
                } else {
                  return get(parent, property, receiver);
                }
              } else if ("value" in desc) {
                return desc.value;
              } else {
                var getter = desc.get;
                if (getter === void 0) {
                  return void 0;
                }
                return getter.call(receiver);
              }
            };
            var _picker = __webpack_require__(28);
            var _picker2 = _interopRequireDefault(_picker);
            function _interopRequireDefault(obj) {
              return obj && obj.__esModule ? obj : { default: obj };
            }
            function _classCallCheck2(instance, Constructor) {
              if (!(instance instanceof Constructor)) {
                throw new TypeError("Cannot call a class as a function");
              }
            }
            function _possibleConstructorReturn(self2, call4) {
              if (!self2) {
                throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
              }
              return call4 && (typeof call4 === "object" || typeof call4 === "function") ? call4 : self2;
            }
            function _inherits(subClass, superClass) {
              if (typeof superClass !== "function" && superClass !== null) {
                throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
              }
              subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
              if (superClass)
                Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
            }
            var IconPicker = function(_Picker) {
              _inherits(IconPicker2, _Picker);
              function IconPicker2(select, icons) {
                _classCallCheck2(this, IconPicker2);
                var _this = _possibleConstructorReturn(this, (IconPicker2.__proto__ || Object.getPrototypeOf(IconPicker2)).call(this, select));
                _this.container.classList.add("ql-icon-picker");
                [].forEach.call(_this.container.querySelectorAll(".ql-picker-item"), function(item) {
                  item.innerHTML = icons[item.getAttribute("data-value") || ""];
                });
                _this.defaultItem = _this.container.querySelector(".ql-selected");
                _this.selectItem(_this.defaultItem);
                return _this;
              }
              _createClass(IconPicker2, [{
                key: "selectItem",
                value: function selectItem(item, trigger) {
                  _get(IconPicker2.prototype.__proto__ || Object.getPrototypeOf(IconPicker2.prototype), "selectItem", this).call(this, item, trigger);
                  item = item || this.defaultItem;
                  this.label.innerHTML = item.innerHTML;
                }
              }]);
              return IconPicker2;
            }(_picker2.default);
            exports2.default = IconPicker;
          },
          /* 61 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", {
              value: true
            });
            var _createClass = function() {
              function defineProperties(target, props) {
                for (var i3 = 0; i3 < props.length; i3++) {
                  var descriptor = props[i3];
                  descriptor.enumerable = descriptor.enumerable || false;
                  descriptor.configurable = true;
                  if ("value" in descriptor)
                    descriptor.writable = true;
                  Object.defineProperty(target, descriptor.key, descriptor);
                }
              }
              return function(Constructor, protoProps, staticProps) {
                if (protoProps)
                  defineProperties(Constructor.prototype, protoProps);
                if (staticProps)
                  defineProperties(Constructor, staticProps);
                return Constructor;
              };
            }();
            function _classCallCheck2(instance, Constructor) {
              if (!(instance instanceof Constructor)) {
                throw new TypeError("Cannot call a class as a function");
              }
            }
            var Tooltip = function() {
              function Tooltip2(quill, boundsContainer) {
                var _this = this;
                _classCallCheck2(this, Tooltip2);
                this.quill = quill;
                this.boundsContainer = boundsContainer || document.body;
                this.root = quill.addContainer("ql-tooltip");
                this.root.innerHTML = this.constructor.TEMPLATE;
                if (this.quill.root === this.quill.scrollingContainer) {
                  this.quill.root.addEventListener("scroll", function() {
                    _this.root.style.marginTop = -1 * _this.quill.root.scrollTop + "px";
                  });
                }
                this.hide();
              }
              _createClass(Tooltip2, [{
                key: "hide",
                value: function hide2() {
                  this.root.classList.add("ql-hidden");
                }
              }, {
                key: "position",
                value: function position3(reference2) {
                  var left = reference2.left + reference2.width / 2 - this.root.offsetWidth / 2;
                  var top = reference2.bottom + this.quill.root.scrollTop;
                  this.root.style.left = left + "px";
                  this.root.style.top = top + "px";
                  this.root.classList.remove("ql-flip");
                  var containerBounds = this.boundsContainer.getBoundingClientRect();
                  var rootBounds = this.root.getBoundingClientRect();
                  var shift = 0;
                  if (rootBounds.right > containerBounds.right) {
                    shift = containerBounds.right - rootBounds.right;
                    this.root.style.left = left + shift + "px";
                  }
                  if (rootBounds.left < containerBounds.left) {
                    shift = containerBounds.left - rootBounds.left;
                    this.root.style.left = left + shift + "px";
                  }
                  if (rootBounds.bottom > containerBounds.bottom) {
                    var height2 = rootBounds.bottom - rootBounds.top;
                    var verticalShift = reference2.bottom - reference2.top + height2;
                    this.root.style.top = top - verticalShift + "px";
                    this.root.classList.add("ql-flip");
                  }
                  return shift;
                }
              }, {
                key: "show",
                value: function show2() {
                  this.root.classList.remove("ql-editing");
                  this.root.classList.remove("ql-hidden");
                }
              }]);
              return Tooltip2;
            }();
            exports2.default = Tooltip;
          },
          /* 62 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", {
              value: true
            });
            var _slicedToArray = function() {
              function sliceIterator(arr, i3) {
                var _arr = [];
                var _n = true;
                var _d = false;
                var _e = void 0;
                try {
                  for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
                    _arr.push(_s.value);
                    if (i3 && _arr.length === i3)
                      break;
                  }
                } catch (err) {
                  _d = true;
                  _e = err;
                } finally {
                  try {
                    if (!_n && _i["return"])
                      _i["return"]();
                  } finally {
                    if (_d)
                      throw _e;
                  }
                }
                return _arr;
              }
              return function(arr, i3) {
                if (Array.isArray(arr)) {
                  return arr;
                } else if (Symbol.iterator in Object(arr)) {
                  return sliceIterator(arr, i3);
                } else {
                  throw new TypeError("Invalid attempt to destructure non-iterable instance");
                }
              };
            }();
            var _get = function get(object, property, receiver) {
              if (object === null)
                object = Function.prototype;
              var desc = Object.getOwnPropertyDescriptor(object, property);
              if (desc === void 0) {
                var parent = Object.getPrototypeOf(object);
                if (parent === null) {
                  return void 0;
                } else {
                  return get(parent, property, receiver);
                }
              } else if ("value" in desc) {
                return desc.value;
              } else {
                var getter = desc.get;
                if (getter === void 0) {
                  return void 0;
                }
                return getter.call(receiver);
              }
            };
            var _createClass = function() {
              function defineProperties(target, props) {
                for (var i3 = 0; i3 < props.length; i3++) {
                  var descriptor = props[i3];
                  descriptor.enumerable = descriptor.enumerable || false;
                  descriptor.configurable = true;
                  if ("value" in descriptor)
                    descriptor.writable = true;
                  Object.defineProperty(target, descriptor.key, descriptor);
                }
              }
              return function(Constructor, protoProps, staticProps) {
                if (protoProps)
                  defineProperties(Constructor.prototype, protoProps);
                if (staticProps)
                  defineProperties(Constructor, staticProps);
                return Constructor;
              };
            }();
            var _extend = __webpack_require__(3);
            var _extend2 = _interopRequireDefault(_extend);
            var _emitter = __webpack_require__(8);
            var _emitter2 = _interopRequireDefault(_emitter);
            var _base = __webpack_require__(43);
            var _base2 = _interopRequireDefault(_base);
            var _link = __webpack_require__(27);
            var _link2 = _interopRequireDefault(_link);
            var _selection = __webpack_require__(15);
            var _icons = __webpack_require__(41);
            var _icons2 = _interopRequireDefault(_icons);
            function _interopRequireDefault(obj) {
              return obj && obj.__esModule ? obj : { default: obj };
            }
            function _classCallCheck2(instance, Constructor) {
              if (!(instance instanceof Constructor)) {
                throw new TypeError("Cannot call a class as a function");
              }
            }
            function _possibleConstructorReturn(self2, call4) {
              if (!self2) {
                throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
              }
              return call4 && (typeof call4 === "object" || typeof call4 === "function") ? call4 : self2;
            }
            function _inherits(subClass, superClass) {
              if (typeof superClass !== "function" && superClass !== null) {
                throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
              }
              subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
              if (superClass)
                Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
            }
            var TOOLBAR_CONFIG = [[{ header: ["1", "2", "3", false] }], ["bold", "italic", "underline", "link"], [{ list: "ordered" }, { list: "bullet" }], ["clean"]];
            var SnowTheme = function(_BaseTheme) {
              _inherits(SnowTheme2, _BaseTheme);
              function SnowTheme2(quill, options) {
                _classCallCheck2(this, SnowTheme2);
                if (options.modules.toolbar != null && options.modules.toolbar.container == null) {
                  options.modules.toolbar.container = TOOLBAR_CONFIG;
                }
                var _this = _possibleConstructorReturn(this, (SnowTheme2.__proto__ || Object.getPrototypeOf(SnowTheme2)).call(this, quill, options));
                _this.quill.container.classList.add("ql-snow");
                return _this;
              }
              _createClass(SnowTheme2, [{
                key: "extendToolbar",
                value: function extendToolbar(toolbar) {
                  toolbar.container.classList.add("ql-snow");
                  this.buildButtons([].slice.call(toolbar.container.querySelectorAll("button")), _icons2.default);
                  this.buildPickers([].slice.call(toolbar.container.querySelectorAll("select")), _icons2.default);
                  this.tooltip = new SnowTooltip(this.quill, this.options.bounds);
                  if (toolbar.container.querySelector(".ql-link")) {
                    this.quill.keyboard.addBinding({ key: "K", shortKey: true }, function(range, context) {
                      toolbar.handlers["link"].call(toolbar, !context.format.link);
                    });
                  }
                }
              }]);
              return SnowTheme2;
            }(_base2.default);
            SnowTheme.DEFAULTS = (0, _extend2.default)(true, {}, _base2.default.DEFAULTS, {
              modules: {
                toolbar: {
                  handlers: {
                    link: function link(value) {
                      if (value) {
                        var range = this.quill.getSelection();
                        if (range == null || range.length == 0)
                          return;
                        var preview = this.quill.getText(range);
                        if (/^\S+@\S+\.\S+$/.test(preview) && preview.indexOf("mailto:") !== 0) {
                          preview = "mailto:" + preview;
                        }
                        var tooltip = this.quill.theme.tooltip;
                        tooltip.edit("link", preview);
                      } else {
                        this.quill.format("link", false);
                      }
                    }
                  }
                }
              }
            });
            var SnowTooltip = function(_BaseTooltip) {
              _inherits(SnowTooltip2, _BaseTooltip);
              function SnowTooltip2(quill, bounds) {
                _classCallCheck2(this, SnowTooltip2);
                var _this2 = _possibleConstructorReturn(this, (SnowTooltip2.__proto__ || Object.getPrototypeOf(SnowTooltip2)).call(this, quill, bounds));
                _this2.preview = _this2.root.querySelector("a.ql-preview");
                return _this2;
              }
              _createClass(SnowTooltip2, [{
                key: "listen",
                value: function listen() {
                  var _this3 = this;
                  _get(SnowTooltip2.prototype.__proto__ || Object.getPrototypeOf(SnowTooltip2.prototype), "listen", this).call(this);
                  this.root.querySelector("a.ql-action").addEventListener("click", function(event) {
                    if (_this3.root.classList.contains("ql-editing")) {
                      _this3.save();
                    } else {
                      _this3.edit("link", _this3.preview.textContent);
                    }
                    event.preventDefault();
                  });
                  this.root.querySelector("a.ql-remove").addEventListener("click", function(event) {
                    if (_this3.linkRange != null) {
                      var range = _this3.linkRange;
                      _this3.restoreFocus();
                      _this3.quill.formatText(range, "link", false, _emitter2.default.sources.USER);
                      delete _this3.linkRange;
                    }
                    event.preventDefault();
                    _this3.hide();
                  });
                  this.quill.on(_emitter2.default.events.SELECTION_CHANGE, function(range, oldRange, source) {
                    if (range == null)
                      return;
                    if (range.length === 0 && source === _emitter2.default.sources.USER) {
                      var _quill$scroll$descend = _this3.quill.scroll.descendant(_link2.default, range.index), _quill$scroll$descend2 = _slicedToArray(_quill$scroll$descend, 2), link = _quill$scroll$descend2[0], offset = _quill$scroll$descend2[1];
                      if (link != null) {
                        _this3.linkRange = new _selection.Range(range.index - offset, link.length());
                        var preview = _link2.default.formats(link.domNode);
                        _this3.preview.textContent = preview;
                        _this3.preview.setAttribute("href", preview);
                        _this3.show();
                        _this3.position(_this3.quill.getBounds(_this3.linkRange));
                        return;
                      }
                    } else {
                      delete _this3.linkRange;
                    }
                    _this3.hide();
                  });
                }
              }, {
                key: "show",
                value: function show2() {
                  _get(SnowTooltip2.prototype.__proto__ || Object.getPrototypeOf(SnowTooltip2.prototype), "show", this).call(this);
                  this.root.removeAttribute("data-mode");
                }
              }]);
              return SnowTooltip2;
            }(_base.BaseTooltip);
            SnowTooltip.TEMPLATE = ['<a class="ql-preview" target="_blank" href="about:blank"></a>', '<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">', '<a class="ql-action"></a>', '<a class="ql-remove"></a>'].join("");
            exports2.default = SnowTheme;
          },
          /* 63 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", {
              value: true
            });
            var _core = __webpack_require__(29);
            var _core2 = _interopRequireDefault(_core);
            var _align = __webpack_require__(36);
            var _direction = __webpack_require__(38);
            var _indent = __webpack_require__(64);
            var _blockquote = __webpack_require__(65);
            var _blockquote2 = _interopRequireDefault(_blockquote);
            var _header = __webpack_require__(66);
            var _header2 = _interopRequireDefault(_header);
            var _list = __webpack_require__(67);
            var _list2 = _interopRequireDefault(_list);
            var _background = __webpack_require__(37);
            var _color = __webpack_require__(26);
            var _font = __webpack_require__(39);
            var _size = __webpack_require__(40);
            var _bold = __webpack_require__(56);
            var _bold2 = _interopRequireDefault(_bold);
            var _italic = __webpack_require__(68);
            var _italic2 = _interopRequireDefault(_italic);
            var _link = __webpack_require__(27);
            var _link2 = _interopRequireDefault(_link);
            var _script = __webpack_require__(69);
            var _script2 = _interopRequireDefault(_script);
            var _strike = __webpack_require__(70);
            var _strike2 = _interopRequireDefault(_strike);
            var _underline = __webpack_require__(71);
            var _underline2 = _interopRequireDefault(_underline);
            var _image = __webpack_require__(72);
            var _image2 = _interopRequireDefault(_image);
            var _video = __webpack_require__(73);
            var _video2 = _interopRequireDefault(_video);
            var _code = __webpack_require__(13);
            var _code2 = _interopRequireDefault(_code);
            var _formula = __webpack_require__(74);
            var _formula2 = _interopRequireDefault(_formula);
            var _syntax = __webpack_require__(75);
            var _syntax2 = _interopRequireDefault(_syntax);
            var _toolbar = __webpack_require__(57);
            var _toolbar2 = _interopRequireDefault(_toolbar);
            var _icons = __webpack_require__(41);
            var _icons2 = _interopRequireDefault(_icons);
            var _picker = __webpack_require__(28);
            var _picker2 = _interopRequireDefault(_picker);
            var _colorPicker = __webpack_require__(59);
            var _colorPicker2 = _interopRequireDefault(_colorPicker);
            var _iconPicker = __webpack_require__(60);
            var _iconPicker2 = _interopRequireDefault(_iconPicker);
            var _tooltip = __webpack_require__(61);
            var _tooltip2 = _interopRequireDefault(_tooltip);
            var _bubble = __webpack_require__(108);
            var _bubble2 = _interopRequireDefault(_bubble);
            var _snow = __webpack_require__(62);
            var _snow2 = _interopRequireDefault(_snow);
            function _interopRequireDefault(obj) {
              return obj && obj.__esModule ? obj : { default: obj };
            }
            _core2.default.register({
              "attributors/attribute/direction": _direction.DirectionAttribute,
              "attributors/class/align": _align.AlignClass,
              "attributors/class/background": _background.BackgroundClass,
              "attributors/class/color": _color.ColorClass,
              "attributors/class/direction": _direction.DirectionClass,
              "attributors/class/font": _font.FontClass,
              "attributors/class/size": _size.SizeClass,
              "attributors/style/align": _align.AlignStyle,
              "attributors/style/background": _background.BackgroundStyle,
              "attributors/style/color": _color.ColorStyle,
              "attributors/style/direction": _direction.DirectionStyle,
              "attributors/style/font": _font.FontStyle,
              "attributors/style/size": _size.SizeStyle
            }, true);
            _core2.default.register({
              "formats/align": _align.AlignClass,
              "formats/direction": _direction.DirectionClass,
              "formats/indent": _indent.IndentClass,
              "formats/background": _background.BackgroundStyle,
              "formats/color": _color.ColorStyle,
              "formats/font": _font.FontClass,
              "formats/size": _size.SizeClass,
              "formats/blockquote": _blockquote2.default,
              "formats/code-block": _code2.default,
              "formats/header": _header2.default,
              "formats/list": _list2.default,
              "formats/bold": _bold2.default,
              "formats/code": _code.Code,
              "formats/italic": _italic2.default,
              "formats/link": _link2.default,
              "formats/script": _script2.default,
              "formats/strike": _strike2.default,
              "formats/underline": _underline2.default,
              "formats/image": _image2.default,
              "formats/video": _video2.default,
              "formats/list/item": _list.ListItem,
              "modules/formula": _formula2.default,
              "modules/syntax": _syntax2.default,
              "modules/toolbar": _toolbar2.default,
              "themes/bubble": _bubble2.default,
              "themes/snow": _snow2.default,
              "ui/icons": _icons2.default,
              "ui/picker": _picker2.default,
              "ui/icon-picker": _iconPicker2.default,
              "ui/color-picker": _colorPicker2.default,
              "ui/tooltip": _tooltip2.default
            }, true);
            exports2.default = _core2.default;
          },
          /* 64 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", {
              value: true
            });
            exports2.IndentClass = void 0;
            var _createClass = function() {
              function defineProperties(target, props) {
                for (var i3 = 0; i3 < props.length; i3++) {
                  var descriptor = props[i3];
                  descriptor.enumerable = descriptor.enumerable || false;
                  descriptor.configurable = true;
                  if ("value" in descriptor)
                    descriptor.writable = true;
                  Object.defineProperty(target, descriptor.key, descriptor);
                }
              }
              return function(Constructor, protoProps, staticProps) {
                if (protoProps)
                  defineProperties(Constructor.prototype, protoProps);
                if (staticProps)
                  defineProperties(Constructor, staticProps);
                return Constructor;
              };
            }();
            var _get = function get(object, property, receiver) {
              if (object === null)
                object = Function.prototype;
              var desc = Object.getOwnPropertyDescriptor(object, property);
              if (desc === void 0) {
                var parent = Object.getPrototypeOf(object);
                if (parent === null) {
                  return void 0;
                } else {
                  return get(parent, property, receiver);
                }
              } else if ("value" in desc) {
                return desc.value;
              } else {
                var getter = desc.get;
                if (getter === void 0) {
                  return void 0;
                }
                return getter.call(receiver);
              }
            };
            var _parchment = __webpack_require__(0);
            var _parchment2 = _interopRequireDefault(_parchment);
            function _interopRequireDefault(obj) {
              return obj && obj.__esModule ? obj : { default: obj };
            }
            function _classCallCheck2(instance, Constructor) {
              if (!(instance instanceof Constructor)) {
                throw new TypeError("Cannot call a class as a function");
              }
            }
            function _possibleConstructorReturn(self2, call4) {
              if (!self2) {
                throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
              }
              return call4 && (typeof call4 === "object" || typeof call4 === "function") ? call4 : self2;
            }
            function _inherits(subClass, superClass) {
              if (typeof superClass !== "function" && superClass !== null) {
                throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
              }
              subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
              if (superClass)
                Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
            }
            var IdentAttributor = function(_Parchment$Attributor) {
              _inherits(IdentAttributor2, _Parchment$Attributor);
              function IdentAttributor2() {
                _classCallCheck2(this, IdentAttributor2);
                return _possibleConstructorReturn(this, (IdentAttributor2.__proto__ || Object.getPrototypeOf(IdentAttributor2)).apply(this, arguments));
              }
              _createClass(IdentAttributor2, [{
                key: "add",
                value: function add(node3, value) {
                  if (value === "+1" || value === "-1") {
                    var indent = this.value(node3) || 0;
                    value = value === "+1" ? indent + 1 : indent - 1;
                  }
                  if (value === 0) {
                    this.remove(node3);
                    return true;
                  } else {
                    return _get(IdentAttributor2.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor2.prototype), "add", this).call(this, node3, value);
                  }
                }
              }, {
                key: "canAdd",
                value: function canAdd(node3, value) {
                  return _get(IdentAttributor2.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor2.prototype), "canAdd", this).call(this, node3, value) || _get(IdentAttributor2.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor2.prototype), "canAdd", this).call(this, node3, parseInt(value));
                }
              }, {
                key: "value",
                value: function value(node3) {
                  return parseInt(_get(IdentAttributor2.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor2.prototype), "value", this).call(this, node3)) || void 0;
                }
              }]);
              return IdentAttributor2;
            }(_parchment2.default.Attributor.Class);
            var IndentClass = new IdentAttributor("indent", "ql-indent", {
              scope: _parchment2.default.Scope.BLOCK,
              whitelist: [1, 2, 3, 4, 5, 6, 7, 8]
            });
            exports2.IndentClass = IndentClass;
          },
          /* 65 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", {
              value: true
            });
            var _block = __webpack_require__(4);
            var _block2 = _interopRequireDefault(_block);
            function _interopRequireDefault(obj) {
              return obj && obj.__esModule ? obj : { default: obj };
            }
            function _classCallCheck2(instance, Constructor) {
              if (!(instance instanceof Constructor)) {
                throw new TypeError("Cannot call a class as a function");
              }
            }
            function _possibleConstructorReturn(self2, call4) {
              if (!self2) {
                throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
              }
              return call4 && (typeof call4 === "object" || typeof call4 === "function") ? call4 : self2;
            }
            function _inherits(subClass, superClass) {
              if (typeof superClass !== "function" && superClass !== null) {
                throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
              }
              subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
              if (superClass)
                Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
            }
            var Blockquote = function(_Block) {
              _inherits(Blockquote2, _Block);
              function Blockquote2() {
                _classCallCheck2(this, Blockquote2);
                return _possibleConstructorReturn(this, (Blockquote2.__proto__ || Object.getPrototypeOf(Blockquote2)).apply(this, arguments));
              }
              return Blockquote2;
            }(_block2.default);
            Blockquote.blotName = "blockquote";
            Blockquote.tagName = "blockquote";
            exports2.default = Blockquote;
          },
          /* 66 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", {
              value: true
            });
            var _createClass = function() {
              function defineProperties(target, props) {
                for (var i3 = 0; i3 < props.length; i3++) {
                  var descriptor = props[i3];
                  descriptor.enumerable = descriptor.enumerable || false;
                  descriptor.configurable = true;
                  if ("value" in descriptor)
                    descriptor.writable = true;
                  Object.defineProperty(target, descriptor.key, descriptor);
                }
              }
              return function(Constructor, protoProps, staticProps) {
                if (protoProps)
                  defineProperties(Constructor.prototype, protoProps);
                if (staticProps)
                  defineProperties(Constructor, staticProps);
                return Constructor;
              };
            }();
            var _block = __webpack_require__(4);
            var _block2 = _interopRequireDefault(_block);
            function _interopRequireDefault(obj) {
              return obj && obj.__esModule ? obj : { default: obj };
            }
            function _classCallCheck2(instance, Constructor) {
              if (!(instance instanceof Constructor)) {
                throw new TypeError("Cannot call a class as a function");
              }
            }
            function _possibleConstructorReturn(self2, call4) {
              if (!self2) {
                throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
              }
              return call4 && (typeof call4 === "object" || typeof call4 === "function") ? call4 : self2;
            }
            function _inherits(subClass, superClass) {
              if (typeof superClass !== "function" && superClass !== null) {
                throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
              }
              subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
              if (superClass)
                Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
            }
            var Header = function(_Block) {
              _inherits(Header2, _Block);
              function Header2() {
                _classCallCheck2(this, Header2);
                return _possibleConstructorReturn(this, (Header2.__proto__ || Object.getPrototypeOf(Header2)).apply(this, arguments));
              }
              _createClass(Header2, null, [{
                key: "formats",
                value: function formats(domNode) {
                  return this.tagName.indexOf(domNode.tagName) + 1;
                }
              }]);
              return Header2;
            }(_block2.default);
            Header.blotName = "header";
            Header.tagName = ["H1", "H2", "H3", "H4", "H5", "H6"];
            exports2.default = Header;
          },
          /* 67 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", {
              value: true
            });
            exports2.default = exports2.ListItem = void 0;
            var _createClass = function() {
              function defineProperties(target, props) {
                for (var i3 = 0; i3 < props.length; i3++) {
                  var descriptor = props[i3];
                  descriptor.enumerable = descriptor.enumerable || false;
                  descriptor.configurable = true;
                  if ("value" in descriptor)
                    descriptor.writable = true;
                  Object.defineProperty(target, descriptor.key, descriptor);
                }
              }
              return function(Constructor, protoProps, staticProps) {
                if (protoProps)
                  defineProperties(Constructor.prototype, protoProps);
                if (staticProps)
                  defineProperties(Constructor, staticProps);
                return Constructor;
              };
            }();
            var _get = function get(object, property, receiver) {
              if (object === null)
                object = Function.prototype;
              var desc = Object.getOwnPropertyDescriptor(object, property);
              if (desc === void 0) {
                var parent = Object.getPrototypeOf(object);
                if (parent === null) {
                  return void 0;
                } else {
                  return get(parent, property, receiver);
                }
              } else if ("value" in desc) {
                return desc.value;
              } else {
                var getter = desc.get;
                if (getter === void 0) {
                  return void 0;
                }
                return getter.call(receiver);
              }
            };
            var _parchment = __webpack_require__(0);
            var _parchment2 = _interopRequireDefault(_parchment);
            var _block = __webpack_require__(4);
            var _block2 = _interopRequireDefault(_block);
            var _container = __webpack_require__(25);
            var _container2 = _interopRequireDefault(_container);
            function _interopRequireDefault(obj) {
              return obj && obj.__esModule ? obj : { default: obj };
            }
            function _defineProperty2(obj, key, value) {
              if (key in obj) {
                Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
              } else {
                obj[key] = value;
              }
              return obj;
            }
            function _classCallCheck2(instance, Constructor) {
              if (!(instance instanceof Constructor)) {
                throw new TypeError("Cannot call a class as a function");
              }
            }
            function _possibleConstructorReturn(self2, call4) {
              if (!self2) {
                throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
              }
              return call4 && (typeof call4 === "object" || typeof call4 === "function") ? call4 : self2;
            }
            function _inherits(subClass, superClass) {
              if (typeof superClass !== "function" && superClass !== null) {
                throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
              }
              subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
              if (superClass)
                Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
            }
            var ListItem = function(_Block) {
              _inherits(ListItem2, _Block);
              function ListItem2() {
                _classCallCheck2(this, ListItem2);
                return _possibleConstructorReturn(this, (ListItem2.__proto__ || Object.getPrototypeOf(ListItem2)).apply(this, arguments));
              }
              _createClass(ListItem2, [{
                key: "format",
                value: function format(name, value) {
                  if (name === List2.blotName && !value) {
                    this.replaceWith(_parchment2.default.create(this.statics.scope));
                  } else {
                    _get(ListItem2.prototype.__proto__ || Object.getPrototypeOf(ListItem2.prototype), "format", this).call(this, name, value);
                  }
                }
              }, {
                key: "remove",
                value: function remove() {
                  if (this.prev == null && this.next == null) {
                    this.parent.remove();
                  } else {
                    _get(ListItem2.prototype.__proto__ || Object.getPrototypeOf(ListItem2.prototype), "remove", this).call(this);
                  }
                }
              }, {
                key: "replaceWith",
                value: function replaceWith(name, value) {
                  this.parent.isolate(this.offset(this.parent), this.length());
                  if (name === this.parent.statics.blotName) {
                    this.parent.replaceWith(name, value);
                    return this;
                  } else {
                    this.parent.unwrap();
                    return _get(ListItem2.prototype.__proto__ || Object.getPrototypeOf(ListItem2.prototype), "replaceWith", this).call(this, name, value);
                  }
                }
              }], [{
                key: "formats",
                value: function formats(domNode) {
                  return domNode.tagName === this.tagName ? void 0 : _get(ListItem2.__proto__ || Object.getPrototypeOf(ListItem2), "formats", this).call(this, domNode);
                }
              }]);
              return ListItem2;
            }(_block2.default);
            ListItem.blotName = "list-item";
            ListItem.tagName = "LI";
            var List2 = function(_Container) {
              _inherits(List3, _Container);
              _createClass(List3, null, [{
                key: "create",
                value: function create2(value) {
                  var tagName = value === "ordered" ? "OL" : "UL";
                  var node3 = _get(List3.__proto__ || Object.getPrototypeOf(List3), "create", this).call(this, tagName);
                  if (value === "checked" || value === "unchecked") {
                    node3.setAttribute("data-checked", value === "checked");
                  }
                  return node3;
                }
              }, {
                key: "formats",
                value: function formats(domNode) {
                  if (domNode.tagName === "OL")
                    return "ordered";
                  if (domNode.tagName === "UL") {
                    if (domNode.hasAttribute("data-checked")) {
                      return domNode.getAttribute("data-checked") === "true" ? "checked" : "unchecked";
                    } else {
                      return "bullet";
                    }
                  }
                  return void 0;
                }
              }]);
              function List3(domNode) {
                _classCallCheck2(this, List3);
                var _this2 = _possibleConstructorReturn(this, (List3.__proto__ || Object.getPrototypeOf(List3)).call(this, domNode));
                var listEventHandler = function listEventHandler2(e2) {
                  if (e2.target.parentNode !== domNode)
                    return;
                  var format = _this2.statics.formats(domNode);
                  var blot = _parchment2.default.find(e2.target);
                  if (format === "checked") {
                    blot.format("list", "unchecked");
                  } else if (format === "unchecked") {
                    blot.format("list", "checked");
                  }
                };
                domNode.addEventListener("touchstart", listEventHandler);
                domNode.addEventListener("mousedown", listEventHandler);
                return _this2;
              }
              _createClass(List3, [{
                key: "format",
                value: function format(name, value) {
                  if (this.children.length > 0) {
                    this.children.tail.format(name, value);
                  }
                }
              }, {
                key: "formats",
                value: function formats() {
                  return _defineProperty2({}, this.statics.blotName, this.statics.formats(this.domNode));
                }
              }, {
                key: "insertBefore",
                value: function insertBefore2(blot, ref) {
                  if (blot instanceof ListItem) {
                    _get(List3.prototype.__proto__ || Object.getPrototypeOf(List3.prototype), "insertBefore", this).call(this, blot, ref);
                  } else {
                    var index3 = ref == null ? this.length() : ref.offset(this);
                    var after2 = this.split(index3);
                    after2.parent.insertBefore(blot, after2);
                  }
                }
              }, {
                key: "optimize",
                value: function optimize(context) {
                  _get(List3.prototype.__proto__ || Object.getPrototypeOf(List3.prototype), "optimize", this).call(this, context);
                  var next2 = this.next;
                  if (next2 != null && next2.prev === this && next2.statics.blotName === this.statics.blotName && next2.domNode.tagName === this.domNode.tagName && next2.domNode.getAttribute("data-checked") === this.domNode.getAttribute("data-checked")) {
                    next2.moveChildren(this);
                    next2.remove();
                  }
                }
              }, {
                key: "replace",
                value: function replace(target) {
                  if (target.statics.blotName !== this.statics.blotName) {
                    var item = _parchment2.default.create(this.statics.defaultChild);
                    target.moveChildren(item);
                    this.appendChild(item);
                  }
                  _get(List3.prototype.__proto__ || Object.getPrototypeOf(List3.prototype), "replace", this).call(this, target);
                }
              }]);
              return List3;
            }(_container2.default);
            List2.blotName = "list";
            List2.scope = _parchment2.default.Scope.BLOCK_BLOT;
            List2.tagName = ["OL", "UL"];
            List2.defaultChild = "list-item";
            List2.allowedChildren = [ListItem];
            exports2.ListItem = ListItem;
            exports2.default = List2;
          },
          /* 68 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", {
              value: true
            });
            var _bold = __webpack_require__(56);
            var _bold2 = _interopRequireDefault(_bold);
            function _interopRequireDefault(obj) {
              return obj && obj.__esModule ? obj : { default: obj };
            }
            function _classCallCheck2(instance, Constructor) {
              if (!(instance instanceof Constructor)) {
                throw new TypeError("Cannot call a class as a function");
              }
            }
            function _possibleConstructorReturn(self2, call4) {
              if (!self2) {
                throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
              }
              return call4 && (typeof call4 === "object" || typeof call4 === "function") ? call4 : self2;
            }
            function _inherits(subClass, superClass) {
              if (typeof superClass !== "function" && superClass !== null) {
                throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
              }
              subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
              if (superClass)
                Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
            }
            var Italic = function(_Bold) {
              _inherits(Italic2, _Bold);
              function Italic2() {
                _classCallCheck2(this, Italic2);
                return _possibleConstructorReturn(this, (Italic2.__proto__ || Object.getPrototypeOf(Italic2)).apply(this, arguments));
              }
              return Italic2;
            }(_bold2.default);
            Italic.blotName = "italic";
            Italic.tagName = ["EM", "I"];
            exports2.default = Italic;
          },
          /* 69 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", {
              value: true
            });
            var _createClass = function() {
              function defineProperties(target, props) {
                for (var i3 = 0; i3 < props.length; i3++) {
                  var descriptor = props[i3];
                  descriptor.enumerable = descriptor.enumerable || false;
                  descriptor.configurable = true;
                  if ("value" in descriptor)
                    descriptor.writable = true;
                  Object.defineProperty(target, descriptor.key, descriptor);
                }
              }
              return function(Constructor, protoProps, staticProps) {
                if (protoProps)
                  defineProperties(Constructor.prototype, protoProps);
                if (staticProps)
                  defineProperties(Constructor, staticProps);
                return Constructor;
              };
            }();
            var _get = function get(object, property, receiver) {
              if (object === null)
                object = Function.prototype;
              var desc = Object.getOwnPropertyDescriptor(object, property);
              if (desc === void 0) {
                var parent = Object.getPrototypeOf(object);
                if (parent === null) {
                  return void 0;
                } else {
                  return get(parent, property, receiver);
                }
              } else if ("value" in desc) {
                return desc.value;
              } else {
                var getter = desc.get;
                if (getter === void 0) {
                  return void 0;
                }
                return getter.call(receiver);
              }
            };
            var _inline = __webpack_require__(6);
            var _inline2 = _interopRequireDefault(_inline);
            function _interopRequireDefault(obj) {
              return obj && obj.__esModule ? obj : { default: obj };
            }
            function _classCallCheck2(instance, Constructor) {
              if (!(instance instanceof Constructor)) {
                throw new TypeError("Cannot call a class as a function");
              }
            }
            function _possibleConstructorReturn(self2, call4) {
              if (!self2) {
                throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
              }
              return call4 && (typeof call4 === "object" || typeof call4 === "function") ? call4 : self2;
            }
            function _inherits(subClass, superClass) {
              if (typeof superClass !== "function" && superClass !== null) {
                throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
              }
              subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
              if (superClass)
                Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
            }
            var Script = function(_Inline) {
              _inherits(Script2, _Inline);
              function Script2() {
                _classCallCheck2(this, Script2);
                return _possibleConstructorReturn(this, (Script2.__proto__ || Object.getPrototypeOf(Script2)).apply(this, arguments));
              }
              _createClass(Script2, null, [{
                key: "create",
                value: function create2(value) {
                  if (value === "super") {
                    return document.createElement("sup");
                  } else if (value === "sub") {
                    return document.createElement("sub");
                  } else {
                    return _get(Script2.__proto__ || Object.getPrototypeOf(Script2), "create", this).call(this, value);
                  }
                }
              }, {
                key: "formats",
                value: function formats(domNode) {
                  if (domNode.tagName === "SUB")
                    return "sub";
                  if (domNode.tagName === "SUP")
                    return "super";
                  return void 0;
                }
              }]);
              return Script2;
            }(_inline2.default);
            Script.blotName = "script";
            Script.tagName = ["SUB", "SUP"];
            exports2.default = Script;
          },
          /* 70 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", {
              value: true
            });
            var _inline = __webpack_require__(6);
            var _inline2 = _interopRequireDefault(_inline);
            function _interopRequireDefault(obj) {
              return obj && obj.__esModule ? obj : { default: obj };
            }
            function _classCallCheck2(instance, Constructor) {
              if (!(instance instanceof Constructor)) {
                throw new TypeError("Cannot call a class as a function");
              }
            }
            function _possibleConstructorReturn(self2, call4) {
              if (!self2) {
                throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
              }
              return call4 && (typeof call4 === "object" || typeof call4 === "function") ? call4 : self2;
            }
            function _inherits(subClass, superClass) {
              if (typeof superClass !== "function" && superClass !== null) {
                throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
              }
              subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
              if (superClass)
                Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
            }
            var Strike = function(_Inline) {
              _inherits(Strike2, _Inline);
              function Strike2() {
                _classCallCheck2(this, Strike2);
                return _possibleConstructorReturn(this, (Strike2.__proto__ || Object.getPrototypeOf(Strike2)).apply(this, arguments));
              }
              return Strike2;
            }(_inline2.default);
            Strike.blotName = "strike";
            Strike.tagName = "S";
            exports2.default = Strike;
          },
          /* 71 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", {
              value: true
            });
            var _inline = __webpack_require__(6);
            var _inline2 = _interopRequireDefault(_inline);
            function _interopRequireDefault(obj) {
              return obj && obj.__esModule ? obj : { default: obj };
            }
            function _classCallCheck2(instance, Constructor) {
              if (!(instance instanceof Constructor)) {
                throw new TypeError("Cannot call a class as a function");
              }
            }
            function _possibleConstructorReturn(self2, call4) {
              if (!self2) {
                throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
              }
              return call4 && (typeof call4 === "object" || typeof call4 === "function") ? call4 : self2;
            }
            function _inherits(subClass, superClass) {
              if (typeof superClass !== "function" && superClass !== null) {
                throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
              }
              subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
              if (superClass)
                Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
            }
            var Underline = function(_Inline) {
              _inherits(Underline2, _Inline);
              function Underline2() {
                _classCallCheck2(this, Underline2);
                return _possibleConstructorReturn(this, (Underline2.__proto__ || Object.getPrototypeOf(Underline2)).apply(this, arguments));
              }
              return Underline2;
            }(_inline2.default);
            Underline.blotName = "underline";
            Underline.tagName = "U";
            exports2.default = Underline;
          },
          /* 72 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", {
              value: true
            });
            var _createClass = function() {
              function defineProperties(target, props) {
                for (var i3 = 0; i3 < props.length; i3++) {
                  var descriptor = props[i3];
                  descriptor.enumerable = descriptor.enumerable || false;
                  descriptor.configurable = true;
                  if ("value" in descriptor)
                    descriptor.writable = true;
                  Object.defineProperty(target, descriptor.key, descriptor);
                }
              }
              return function(Constructor, protoProps, staticProps) {
                if (protoProps)
                  defineProperties(Constructor.prototype, protoProps);
                if (staticProps)
                  defineProperties(Constructor, staticProps);
                return Constructor;
              };
            }();
            var _get = function get(object, property, receiver) {
              if (object === null)
                object = Function.prototype;
              var desc = Object.getOwnPropertyDescriptor(object, property);
              if (desc === void 0) {
                var parent = Object.getPrototypeOf(object);
                if (parent === null) {
                  return void 0;
                } else {
                  return get(parent, property, receiver);
                }
              } else if ("value" in desc) {
                return desc.value;
              } else {
                var getter = desc.get;
                if (getter === void 0) {
                  return void 0;
                }
                return getter.call(receiver);
              }
            };
            var _parchment = __webpack_require__(0);
            var _parchment2 = _interopRequireDefault(_parchment);
            var _link = __webpack_require__(27);
            function _interopRequireDefault(obj) {
              return obj && obj.__esModule ? obj : { default: obj };
            }
            function _classCallCheck2(instance, Constructor) {
              if (!(instance instanceof Constructor)) {
                throw new TypeError("Cannot call a class as a function");
              }
            }
            function _possibleConstructorReturn(self2, call4) {
              if (!self2) {
                throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
              }
              return call4 && (typeof call4 === "object" || typeof call4 === "function") ? call4 : self2;
            }
            function _inherits(subClass, superClass) {
              if (typeof superClass !== "function" && superClass !== null) {
                throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
              }
              subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
              if (superClass)
                Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
            }
            var ATTRIBUTES = ["alt", "height", "width"];
            var Image3 = function(_Parchment$Embed) {
              _inherits(Image4, _Parchment$Embed);
              function Image4() {
                _classCallCheck2(this, Image4);
                return _possibleConstructorReturn(this, (Image4.__proto__ || Object.getPrototypeOf(Image4)).apply(this, arguments));
              }
              _createClass(Image4, [{
                key: "format",
                value: function format(name, value) {
                  if (ATTRIBUTES.indexOf(name) > -1) {
                    if (value) {
                      this.domNode.setAttribute(name, value);
                    } else {
                      this.domNode.removeAttribute(name);
                    }
                  } else {
                    _get(Image4.prototype.__proto__ || Object.getPrototypeOf(Image4.prototype), "format", this).call(this, name, value);
                  }
                }
              }], [{
                key: "create",
                value: function create2(value) {
                  var node3 = _get(Image4.__proto__ || Object.getPrototypeOf(Image4), "create", this).call(this, value);
                  if (typeof value === "string") {
                    node3.setAttribute("src", this.sanitize(value));
                  }
                  return node3;
                }
              }, {
                key: "formats",
                value: function formats(domNode) {
                  return ATTRIBUTES.reduce(function(formats2, attribute) {
                    if (domNode.hasAttribute(attribute)) {
                      formats2[attribute] = domNode.getAttribute(attribute);
                    }
                    return formats2;
                  }, {});
                }
              }, {
                key: "match",
                value: function match(url) {
                  return /\.(jpe?g|gif|png)$/.test(url) || /^data:image\/.+;base64/.test(url);
                }
              }, {
                key: "sanitize",
                value: function sanitize(url) {
                  return (0, _link.sanitize)(url, ["http", "https", "data"]) ? url : "//:0";
                }
              }, {
                key: "value",
                value: function value(domNode) {
                  return domNode.getAttribute("src");
                }
              }]);
              return Image4;
            }(_parchment2.default.Embed);
            Image3.blotName = "image";
            Image3.tagName = "IMG";
            exports2.default = Image3;
          },
          /* 73 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", {
              value: true
            });
            var _createClass = function() {
              function defineProperties(target, props) {
                for (var i3 = 0; i3 < props.length; i3++) {
                  var descriptor = props[i3];
                  descriptor.enumerable = descriptor.enumerable || false;
                  descriptor.configurable = true;
                  if ("value" in descriptor)
                    descriptor.writable = true;
                  Object.defineProperty(target, descriptor.key, descriptor);
                }
              }
              return function(Constructor, protoProps, staticProps) {
                if (protoProps)
                  defineProperties(Constructor.prototype, protoProps);
                if (staticProps)
                  defineProperties(Constructor, staticProps);
                return Constructor;
              };
            }();
            var _get = function get(object, property, receiver) {
              if (object === null)
                object = Function.prototype;
              var desc = Object.getOwnPropertyDescriptor(object, property);
              if (desc === void 0) {
                var parent = Object.getPrototypeOf(object);
                if (parent === null) {
                  return void 0;
                } else {
                  return get(parent, property, receiver);
                }
              } else if ("value" in desc) {
                return desc.value;
              } else {
                var getter = desc.get;
                if (getter === void 0) {
                  return void 0;
                }
                return getter.call(receiver);
              }
            };
            var _block = __webpack_require__(4);
            var _link = __webpack_require__(27);
            var _link2 = _interopRequireDefault(_link);
            function _interopRequireDefault(obj) {
              return obj && obj.__esModule ? obj : { default: obj };
            }
            function _classCallCheck2(instance, Constructor) {
              if (!(instance instanceof Constructor)) {
                throw new TypeError("Cannot call a class as a function");
              }
            }
            function _possibleConstructorReturn(self2, call4) {
              if (!self2) {
                throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
              }
              return call4 && (typeof call4 === "object" || typeof call4 === "function") ? call4 : self2;
            }
            function _inherits(subClass, superClass) {
              if (typeof superClass !== "function" && superClass !== null) {
                throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
              }
              subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
              if (superClass)
                Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
            }
            var ATTRIBUTES = ["height", "width"];
            var Video = function(_BlockEmbed) {
              _inherits(Video2, _BlockEmbed);
              function Video2() {
                _classCallCheck2(this, Video2);
                return _possibleConstructorReturn(this, (Video2.__proto__ || Object.getPrototypeOf(Video2)).apply(this, arguments));
              }
              _createClass(Video2, [{
                key: "format",
                value: function format(name, value) {
                  if (ATTRIBUTES.indexOf(name) > -1) {
                    if (value) {
                      this.domNode.setAttribute(name, value);
                    } else {
                      this.domNode.removeAttribute(name);
                    }
                  } else {
                    _get(Video2.prototype.__proto__ || Object.getPrototypeOf(Video2.prototype), "format", this).call(this, name, value);
                  }
                }
              }], [{
                key: "create",
                value: function create2(value) {
                  var node3 = _get(Video2.__proto__ || Object.getPrototypeOf(Video2), "create", this).call(this, value);
                  node3.setAttribute("frameborder", "0");
                  node3.setAttribute("allowfullscreen", true);
                  node3.setAttribute("src", this.sanitize(value));
                  return node3;
                }
              }, {
                key: "formats",
                value: function formats(domNode) {
                  return ATTRIBUTES.reduce(function(formats2, attribute) {
                    if (domNode.hasAttribute(attribute)) {
                      formats2[attribute] = domNode.getAttribute(attribute);
                    }
                    return formats2;
                  }, {});
                }
              }, {
                key: "sanitize",
                value: function sanitize(url) {
                  return _link2.default.sanitize(url);
                }
              }, {
                key: "value",
                value: function value(domNode) {
                  return domNode.getAttribute("src");
                }
              }]);
              return Video2;
            }(_block.BlockEmbed);
            Video.blotName = "video";
            Video.className = "ql-video";
            Video.tagName = "IFRAME";
            exports2.default = Video;
          },
          /* 74 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", {
              value: true
            });
            exports2.default = exports2.FormulaBlot = void 0;
            var _createClass = function() {
              function defineProperties(target, props) {
                for (var i3 = 0; i3 < props.length; i3++) {
                  var descriptor = props[i3];
                  descriptor.enumerable = descriptor.enumerable || false;
                  descriptor.configurable = true;
                  if ("value" in descriptor)
                    descriptor.writable = true;
                  Object.defineProperty(target, descriptor.key, descriptor);
                }
              }
              return function(Constructor, protoProps, staticProps) {
                if (protoProps)
                  defineProperties(Constructor.prototype, protoProps);
                if (staticProps)
                  defineProperties(Constructor, staticProps);
                return Constructor;
              };
            }();
            var _get = function get(object, property, receiver) {
              if (object === null)
                object = Function.prototype;
              var desc = Object.getOwnPropertyDescriptor(object, property);
              if (desc === void 0) {
                var parent = Object.getPrototypeOf(object);
                if (parent === null) {
                  return void 0;
                } else {
                  return get(parent, property, receiver);
                }
              } else if ("value" in desc) {
                return desc.value;
              } else {
                var getter = desc.get;
                if (getter === void 0) {
                  return void 0;
                }
                return getter.call(receiver);
              }
            };
            var _embed = __webpack_require__(35);
            var _embed2 = _interopRequireDefault(_embed);
            var _quill = __webpack_require__(5);
            var _quill2 = _interopRequireDefault(_quill);
            var _module = __webpack_require__(9);
            var _module2 = _interopRequireDefault(_module);
            function _interopRequireDefault(obj) {
              return obj && obj.__esModule ? obj : { default: obj };
            }
            function _classCallCheck2(instance, Constructor) {
              if (!(instance instanceof Constructor)) {
                throw new TypeError("Cannot call a class as a function");
              }
            }
            function _possibleConstructorReturn(self2, call4) {
              if (!self2) {
                throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
              }
              return call4 && (typeof call4 === "object" || typeof call4 === "function") ? call4 : self2;
            }
            function _inherits(subClass, superClass) {
              if (typeof superClass !== "function" && superClass !== null) {
                throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
              }
              subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
              if (superClass)
                Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
            }
            var FormulaBlot = function(_Embed) {
              _inherits(FormulaBlot2, _Embed);
              function FormulaBlot2() {
                _classCallCheck2(this, FormulaBlot2);
                return _possibleConstructorReturn(this, (FormulaBlot2.__proto__ || Object.getPrototypeOf(FormulaBlot2)).apply(this, arguments));
              }
              _createClass(FormulaBlot2, null, [{
                key: "create",
                value: function create2(value) {
                  var node3 = _get(FormulaBlot2.__proto__ || Object.getPrototypeOf(FormulaBlot2), "create", this).call(this, value);
                  if (typeof value === "string") {
                    window.katex.render(value, node3, {
                      throwOnError: false,
                      errorColor: "#f00"
                    });
                    node3.setAttribute("data-value", value);
                  }
                  return node3;
                }
              }, {
                key: "value",
                value: function value(domNode) {
                  return domNode.getAttribute("data-value");
                }
              }]);
              return FormulaBlot2;
            }(_embed2.default);
            FormulaBlot.blotName = "formula";
            FormulaBlot.className = "ql-formula";
            FormulaBlot.tagName = "SPAN";
            var Formula = function(_Module) {
              _inherits(Formula2, _Module);
              _createClass(Formula2, null, [{
                key: "register",
                value: function register2() {
                  _quill2.default.register(FormulaBlot, true);
                }
              }]);
              function Formula2() {
                _classCallCheck2(this, Formula2);
                var _this2 = _possibleConstructorReturn(this, (Formula2.__proto__ || Object.getPrototypeOf(Formula2)).call(this));
                if (window.katex == null) {
                  throw new Error("Formula module requires KaTeX.");
                }
                return _this2;
              }
              return Formula2;
            }(_module2.default);
            exports2.FormulaBlot = FormulaBlot;
            exports2.default = Formula;
          },
          /* 75 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", {
              value: true
            });
            exports2.default = exports2.CodeToken = exports2.CodeBlock = void 0;
            var _createClass = function() {
              function defineProperties(target, props) {
                for (var i3 = 0; i3 < props.length; i3++) {
                  var descriptor = props[i3];
                  descriptor.enumerable = descriptor.enumerable || false;
                  descriptor.configurable = true;
                  if ("value" in descriptor)
                    descriptor.writable = true;
                  Object.defineProperty(target, descriptor.key, descriptor);
                }
              }
              return function(Constructor, protoProps, staticProps) {
                if (protoProps)
                  defineProperties(Constructor.prototype, protoProps);
                if (staticProps)
                  defineProperties(Constructor, staticProps);
                return Constructor;
              };
            }();
            var _get = function get(object, property, receiver) {
              if (object === null)
                object = Function.prototype;
              var desc = Object.getOwnPropertyDescriptor(object, property);
              if (desc === void 0) {
                var parent = Object.getPrototypeOf(object);
                if (parent === null) {
                  return void 0;
                } else {
                  return get(parent, property, receiver);
                }
              } else if ("value" in desc) {
                return desc.value;
              } else {
                var getter = desc.get;
                if (getter === void 0) {
                  return void 0;
                }
                return getter.call(receiver);
              }
            };
            var _parchment = __webpack_require__(0);
            var _parchment2 = _interopRequireDefault(_parchment);
            var _quill = __webpack_require__(5);
            var _quill2 = _interopRequireDefault(_quill);
            var _module = __webpack_require__(9);
            var _module2 = _interopRequireDefault(_module);
            var _code = __webpack_require__(13);
            var _code2 = _interopRequireDefault(_code);
            function _interopRequireDefault(obj) {
              return obj && obj.__esModule ? obj : { default: obj };
            }
            function _classCallCheck2(instance, Constructor) {
              if (!(instance instanceof Constructor)) {
                throw new TypeError("Cannot call a class as a function");
              }
            }
            function _possibleConstructorReturn(self2, call4) {
              if (!self2) {
                throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
              }
              return call4 && (typeof call4 === "object" || typeof call4 === "function") ? call4 : self2;
            }
            function _inherits(subClass, superClass) {
              if (typeof superClass !== "function" && superClass !== null) {
                throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
              }
              subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
              if (superClass)
                Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
            }
            var SyntaxCodeBlock = function(_CodeBlock) {
              _inherits(SyntaxCodeBlock2, _CodeBlock);
              function SyntaxCodeBlock2() {
                _classCallCheck2(this, SyntaxCodeBlock2);
                return _possibleConstructorReturn(this, (SyntaxCodeBlock2.__proto__ || Object.getPrototypeOf(SyntaxCodeBlock2)).apply(this, arguments));
              }
              _createClass(SyntaxCodeBlock2, [{
                key: "replaceWith",
                value: function replaceWith(block) {
                  this.domNode.textContent = this.domNode.textContent;
                  this.attach();
                  _get(SyntaxCodeBlock2.prototype.__proto__ || Object.getPrototypeOf(SyntaxCodeBlock2.prototype), "replaceWith", this).call(this, block);
                }
              }, {
                key: "highlight",
                value: function highlight(_highlight) {
                  var text3 = this.domNode.textContent;
                  if (this.cachedText !== text3) {
                    if (text3.trim().length > 0 || this.cachedText == null) {
                      this.domNode.innerHTML = _highlight(text3);
                      this.domNode.normalize();
                      this.attach();
                    }
                    this.cachedText = text3;
                  }
                }
              }]);
              return SyntaxCodeBlock2;
            }(_code2.default);
            SyntaxCodeBlock.className = "ql-syntax";
            var CodeToken = new _parchment2.default.Attributor.Class("token", "hljs", {
              scope: _parchment2.default.Scope.INLINE
            });
            var Syntax = function(_Module) {
              _inherits(Syntax2, _Module);
              _createClass(Syntax2, null, [{
                key: "register",
                value: function register2() {
                  _quill2.default.register(CodeToken, true);
                  _quill2.default.register(SyntaxCodeBlock, true);
                }
              }]);
              function Syntax2(quill, options) {
                _classCallCheck2(this, Syntax2);
                var _this2 = _possibleConstructorReturn(this, (Syntax2.__proto__ || Object.getPrototypeOf(Syntax2)).call(this, quill, options));
                if (typeof _this2.options.highlight !== "function") {
                  throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");
                }
                var timer = null;
                _this2.quill.on(_quill2.default.events.SCROLL_OPTIMIZE, function() {
                  clearTimeout(timer);
                  timer = setTimeout(function() {
                    _this2.highlight();
                    timer = null;
                  }, _this2.options.interval);
                });
                _this2.highlight();
                return _this2;
              }
              _createClass(Syntax2, [{
                key: "highlight",
                value: function highlight() {
                  var _this3 = this;
                  if (this.quill.selection.composing)
                    return;
                  this.quill.update(_quill2.default.sources.USER);
                  var range = this.quill.getSelection();
                  this.quill.scroll.descendants(SyntaxCodeBlock).forEach(function(code) {
                    code.highlight(_this3.options.highlight);
                  });
                  this.quill.update(_quill2.default.sources.SILENT);
                  if (range != null) {
                    this.quill.setSelection(range, _quill2.default.sources.SILENT);
                  }
                }
              }]);
              return Syntax2;
            }(_module2.default);
            Syntax.DEFAULTS = {
              highlight: function() {
                if (window.hljs == null)
                  return null;
                return function(text3) {
                  var result = window.hljs.highlightAuto(text3);
                  return result.value;
                };
              }(),
              interval: 1e3
            };
            exports2.CodeBlock = SyntaxCodeBlock;
            exports2.CodeToken = CodeToken;
            exports2.default = Syntax;
          },
          /* 76 */
          /***/
          function(module2, exports2) {
            module2.exports = '<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=13 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=9 y1=4 y2=4></line> </svg>';
          },
          /* 77 */
          /***/
          function(module2, exports2) {
            module2.exports = '<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=14 x2=4 y1=14 y2=14></line> <line class=ql-stroke x1=12 x2=6 y1=4 y2=4></line> </svg>';
          },
          /* 78 */
          /***/
          function(module2, exports2) {
            module2.exports = '<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=5 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=9 y1=4 y2=4></line> </svg>';
          },
          /* 79 */
          /***/
          function(module2, exports2) {
            module2.exports = '<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=3 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=3 y1=4 y2=4></line> </svg>';
          },
          /* 80 */
          /***/
          function(module2, exports2) {
            module2.exports = '<svg viewbox="0 0 18 18"> <g class="ql-fill ql-color-label"> <polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"></polygon> <rect height=1 width=1 x=4 y=4></rect> <polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"></polygon> <rect height=1 width=1 x=2 y=6></rect> <rect height=1 width=1 x=3 y=5></rect> <rect height=1 width=1 x=4 y=7></rect> <polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"></polygon> <rect height=1 width=1 x=2 y=12></rect> <rect height=1 width=1 x=2 y=9></rect> <rect height=1 width=1 x=2 y=15></rect> <polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"></polygon> <rect height=1 width=1 x=3 y=8></rect> <path d=M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z></path> <path d=M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z></path> <path d=M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z></path> <rect height=1 width=1 x=12 y=2></rect> <rect height=1 width=1 x=11 y=3></rect> <path d=M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z></path> <rect height=1 width=1 x=2 y=3></rect> <rect height=1 width=1 x=6 y=2></rect> <rect height=1 width=1 x=3 y=2></rect> <rect height=1 width=1 x=5 y=3></rect> <rect height=1 width=1 x=9 y=2></rect> <rect height=1 width=1 x=15 y=14></rect> <polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"></polygon> <rect height=1 width=1 x=13 y=7></rect> <rect height=1 width=1 x=15 y=5></rect> <rect height=1 width=1 x=14 y=6></rect> <rect height=1 width=1 x=15 y=8></rect> <rect height=1 width=1 x=14 y=9></rect> <path d=M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z></path> <rect height=1 width=1 x=14 y=3></rect> <polygon points="12 6.868 12 6 11.62 6 12 6.868"></polygon> <rect height=1 width=1 x=15 y=2></rect> <rect height=1 width=1 x=12 y=5></rect> <rect height=1 width=1 x=13 y=4></rect> <polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"></polygon> <rect height=1 width=1 x=9 y=14></rect> <rect height=1 width=1 x=8 y=15></rect> <path d=M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z></path> <rect height=1 width=1 x=5 y=15></rect> <path d=M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z></path> <rect height=1 width=1 x=11 y=15></rect> <path d=M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z></path> <rect height=1 width=1 x=14 y=15></rect> <rect height=1 width=1 x=15 y=11></rect> </g> <polyline class=ql-stroke points="5.5 13 9 5 12.5 13"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=11 y2=11></line> </svg>';
          },
          /* 81 */
          /***/
          function(module2, exports2) {
            module2.exports = '<svg viewbox="0 0 18 18"> <rect class="ql-fill ql-stroke" height=3 width=3 x=4 y=5></rect> <rect class="ql-fill ql-stroke" height=3 width=3 x=11 y=5></rect> <path class="ql-even ql-fill ql-stroke" d=M7,8c0,4.031-3,5-3,5></path> <path class="ql-even ql-fill ql-stroke" d=M14,8c0,4.031-3,5-3,5></path> </svg>';
          },
          /* 82 */
          /***/
          function(module2, exports2) {
            module2.exports = '<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z></path> <path class=ql-stroke d=M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z></path> </svg>';
          },
          /* 83 */
          /***/
          function(module2, exports2) {
            module2.exports = '<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=5 x2=13 y1=3 y2=3></line> <line class=ql-stroke x1=6 x2=9.35 y1=12 y2=3></line> <line class=ql-stroke x1=11 x2=15 y1=11 y2=15></line> <line class=ql-stroke x1=15 x2=11 y1=11 y2=15></line> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=7 x=2 y=14></rect> </svg>';
          },
          /* 84 */
          /***/
          function(module2, exports2) {
            module2.exports = '<svg viewbox="0 0 18 18"> <line class="ql-color-label ql-stroke ql-transparent" x1=3 x2=15 y1=15 y2=15></line> <polyline class=ql-stroke points="5.5 11 9 3 12.5 11"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=9 y2=9></line> </svg>';
          },
          /* 85 */
          /***/
          function(module2, exports2) {
            module2.exports = '<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"></polygon> <line class="ql-stroke ql-fill" x1=15 x2=11 y1=4 y2=4></line> <path class=ql-fill d=M11,3a3,3,0,0,0,0,6h1V3H11Z></path> <rect class=ql-fill height=11 width=1 x=11 y=4></rect> <rect class=ql-fill height=11 width=1 x=13 y=4></rect> </svg>';
          },
          /* 86 */
          /***/
          function(module2, exports2) {
            module2.exports = '<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"></polygon> <line class="ql-stroke ql-fill" x1=9 x2=5 y1=4 y2=4></line> <path class=ql-fill d=M5,3A3,3,0,0,0,5,9H6V3H5Z></path> <rect class=ql-fill height=11 width=1 x=5 y=4></rect> <rect class=ql-fill height=11 width=1 x=7 y=4></rect> </svg>';
          },
          /* 87 */
          /***/
          function(module2, exports2) {
            module2.exports = '<svg viewbox="0 0 18 18"> <path class=ql-fill d=M14,16H4a1,1,0,0,1,0-2H14A1,1,0,0,1,14,16Z /> <path class=ql-fill d=M14,4H4A1,1,0,0,1,4,2H14A1,1,0,0,1,14,4Z /> <rect class=ql-fill x=3 y=6 width=12 height=6 rx=1 ry=1 /> </svg>';
          },
          /* 88 */
          /***/
          function(module2, exports2) {
            module2.exports = '<svg viewbox="0 0 18 18"> <path class=ql-fill d=M13,16H5a1,1,0,0,1,0-2h8A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H5A1,1,0,0,1,5,2h8A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=2 y=6 width=14 height=6 rx=1 ry=1 /> </svg>';
          },
          /* 89 */
          /***/
          function(module2, exports2) {
            module2.exports = '<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15,8H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,8Z /> <path class=ql-fill d=M15,12H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,12Z /> <path class=ql-fill d=M15,16H5a1,1,0,0,1,0-2H15A1,1,0,0,1,15,16Z /> <path class=ql-fill d=M15,4H5A1,1,0,0,1,5,2H15A1,1,0,0,1,15,4Z /> <rect class=ql-fill x=2 y=6 width=8 height=6 rx=1 ry=1 /> </svg>';
          },
          /* 90 */
          /***/
          function(module2, exports2) {
            module2.exports = '<svg viewbox="0 0 18 18"> <path class=ql-fill d=M5,8H3A1,1,0,0,1,3,6H5A1,1,0,0,1,5,8Z /> <path class=ql-fill d=M5,12H3a1,1,0,0,1,0-2H5A1,1,0,0,1,5,12Z /> <path class=ql-fill d=M13,16H3a1,1,0,0,1,0-2H13A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H3A1,1,0,0,1,3,2H13A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=8 y=6 width=8 height=6 rx=1 ry=1 transform="translate(24 18) rotate(-180)"/> </svg>';
          },
          /* 91 */
          /***/
          function(module2, exports2) {
            module2.exports = '<svg viewbox="0 0 18 18"> <path class=ql-fill d=M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z></path> <rect class=ql-fill height=1.6 rx=0.8 ry=0.8 width=5 x=5.15 y=6.2></rect> <path class=ql-fill d=M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z></path> </svg>';
          },
          /* 92 */
          /***/
          function(module2, exports2) {
            module2.exports = '<svg viewBox="0 0 18 18"> <path class=ql-fill d=M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z /> </svg>';
          },
          /* 93 */
          /***/
          function(module2, exports2) {
            module2.exports = '<svg viewBox="0 0 18 18"> <path class=ql-fill d=M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z /> </svg>';
          },
          /* 94 */
          /***/
          function(module2, exports2) {
            module2.exports = '<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=13 y1=4 y2=4></line> <line class=ql-stroke x1=5 x2=11 y1=14 y2=14></line> <line class=ql-stroke x1=8 x2=10 y1=14 y2=4></line> </svg>';
          },
          /* 95 */
          /***/
          function(module2, exports2) {
            module2.exports = '<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=10 width=12 x=3 y=4></rect> <circle class=ql-fill cx=6 cy=7 r=1></circle> <polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"></polyline> </svg>';
          },
          /* 96 */
          /***/
          function(module2, exports2) {
            module2.exports = '<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"></polyline> </svg>';
          },
          /* 97 */
          /***/
          function(module2, exports2) {
            module2.exports = '<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="5 7 5 11 3 9 5 7"></polyline> </svg>';
          },
          /* 98 */
          /***/
          function(module2, exports2) {
            module2.exports = '<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=11 y1=7 y2=11></line> <path class="ql-even ql-stroke" d=M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z></path> <path class="ql-even ql-stroke" d=M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z></path> </svg>';
          },
          /* 99 */
          /***/
          function(module2, exports2) {
            module2.exports = '<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=7 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=7 x2=15 y1=14 y2=14></line> <line class="ql-stroke ql-thin" x1=2.5 x2=4.5 y1=5.5 y2=5.5></line> <path class=ql-fill d=M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z></path> <path class="ql-stroke ql-thin" d=M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156></path> <path class="ql-stroke ql-thin" d=M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109></path> </svg>';
          },
          /* 100 */
          /***/
          function(module2, exports2) {
            module2.exports = '<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=6 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=6 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=6 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=3 y1=4 y2=4></line> <line class=ql-stroke x1=3 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=3 y1=14 y2=14></line> </svg>';
          },
          /* 101 */
          /***/
          function(module2, exports2) {
            module2.exports = '<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=9 x2=15 y1=4 y2=4></line> <polyline class=ql-stroke points="3 4 4 5 6 3"></polyline> <line class=ql-stroke x1=9 x2=15 y1=14 y2=14></line> <polyline class=ql-stroke points="3 14 4 15 6 13"></polyline> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="3 9 4 10 6 8"></polyline> </svg>';
          },
          /* 102 */
          /***/
          function(module2, exports2) {
            module2.exports = '<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z /> <path class=ql-fill d=M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z /> </svg>';
          },
          /* 103 */
          /***/
          function(module2, exports2) {
            module2.exports = '<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z /> <path class=ql-fill d=M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z /> </svg>';
          },
          /* 104 */
          /***/
          function(module2, exports2) {
            module2.exports = '<svg viewbox="0 0 18 18"> <line class="ql-stroke ql-thin" x1=15.5 x2=2.5 y1=8.5 y2=9.5></line> <path class=ql-fill d=M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z></path> <path class=ql-fill d=M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z></path> </svg>';
          },
          /* 105 */
          /***/
          function(module2, exports2) {
            module2.exports = '<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3></path> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=12 x=3 y=15></rect> </svg>';
          },
          /* 106 */
          /***/
          function(module2, exports2) {
            module2.exports = '<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=12 width=12 x=3 y=3></rect> <rect class=ql-fill height=12 width=1 x=5 y=3></rect> <rect class=ql-fill height=12 width=1 x=12 y=3></rect> <rect class=ql-fill height=2 width=8 x=5 y=8></rect> <rect class=ql-fill height=1 width=3 x=3 y=5></rect> <rect class=ql-fill height=1 width=3 x=3 y=7></rect> <rect class=ql-fill height=1 width=3 x=3 y=10></rect> <rect class=ql-fill height=1 width=3 x=3 y=12></rect> <rect class=ql-fill height=1 width=3 x=12 y=5></rect> <rect class=ql-fill height=1 width=3 x=12 y=7></rect> <rect class=ql-fill height=1 width=3 x=12 y=10></rect> <rect class=ql-fill height=1 width=3 x=12 y=12></rect> </svg>';
          },
          /* 107 */
          /***/
          function(module2, exports2) {
            module2.exports = '<svg viewbox="0 0 18 18"> <polygon class=ql-stroke points="7 11 9 13 11 11 7 11"></polygon> <polygon class=ql-stroke points="7 7 9 5 11 7 7 7"></polygon> </svg>';
          },
          /* 108 */
          /***/
          function(module2, exports2, __webpack_require__) {
            "use strict";
            Object.defineProperty(exports2, "__esModule", {
              value: true
            });
            exports2.default = exports2.BubbleTooltip = void 0;
            var _get = function get(object, property, receiver) {
              if (object === null)
                object = Function.prototype;
              var desc = Object.getOwnPropertyDescriptor(object, property);
              if (desc === void 0) {
                var parent = Object.getPrototypeOf(object);
                if (parent === null) {
                  return void 0;
                } else {
                  return get(parent, property, receiver);
                }
              } else if ("value" in desc) {
                return desc.value;
              } else {
                var getter = desc.get;
                if (getter === void 0) {
                  return void 0;
                }
                return getter.call(receiver);
              }
            };
            var _createClass = function() {
              function defineProperties(target, props) {
                for (var i3 = 0; i3 < props.length; i3++) {
                  var descriptor = props[i3];
                  descriptor.enumerable = descriptor.enumerable || false;
                  descriptor.configurable = true;
                  if ("value" in descriptor)
                    descriptor.writable = true;
                  Object.defineProperty(target, descriptor.key, descriptor);
                }
              }
              return function(Constructor, protoProps, staticProps) {
                if (protoProps)
                  defineProperties(Constructor.prototype, protoProps);
                if (staticProps)
                  defineProperties(Constructor, staticProps);
                return Constructor;
              };
            }();
            var _extend = __webpack_require__(3);
            var _extend2 = _interopRequireDefault(_extend);
            var _emitter = __webpack_require__(8);
            var _emitter2 = _interopRequireDefault(_emitter);
            var _base = __webpack_require__(43);
            var _base2 = _interopRequireDefault(_base);
            var _selection = __webpack_require__(15);
            var _icons = __webpack_require__(41);
            var _icons2 = _interopRequireDefault(_icons);
            function _interopRequireDefault(obj) {
              return obj && obj.__esModule ? obj : { default: obj };
            }
            function _classCallCheck2(instance, Constructor) {
              if (!(instance instanceof Constructor)) {
                throw new TypeError("Cannot call a class as a function");
              }
            }
            function _possibleConstructorReturn(self2, call4) {
              if (!self2) {
                throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
              }
              return call4 && (typeof call4 === "object" || typeof call4 === "function") ? call4 : self2;
            }
            function _inherits(subClass, superClass) {
              if (typeof superClass !== "function" && superClass !== null) {
                throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
              }
              subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
              if (superClass)
                Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
            }
            var TOOLBAR_CONFIG = [["bold", "italic", "link"], [{ header: 1 }, { header: 2 }, "blockquote"]];
            var BubbleTheme = function(_BaseTheme) {
              _inherits(BubbleTheme2, _BaseTheme);
              function BubbleTheme2(quill, options) {
                _classCallCheck2(this, BubbleTheme2);
                if (options.modules.toolbar != null && options.modules.toolbar.container == null) {
                  options.modules.toolbar.container = TOOLBAR_CONFIG;
                }
                var _this = _possibleConstructorReturn(this, (BubbleTheme2.__proto__ || Object.getPrototypeOf(BubbleTheme2)).call(this, quill, options));
                _this.quill.container.classList.add("ql-bubble");
                return _this;
              }
              _createClass(BubbleTheme2, [{
                key: "extendToolbar",
                value: function extendToolbar(toolbar) {
                  this.tooltip = new BubbleTooltip(this.quill, this.options.bounds);
                  this.tooltip.root.appendChild(toolbar.container);
                  this.buildButtons([].slice.call(toolbar.container.querySelectorAll("button")), _icons2.default);
                  this.buildPickers([].slice.call(toolbar.container.querySelectorAll("select")), _icons2.default);
                }
              }]);
              return BubbleTheme2;
            }(_base2.default);
            BubbleTheme.DEFAULTS = (0, _extend2.default)(true, {}, _base2.default.DEFAULTS, {
              modules: {
                toolbar: {
                  handlers: {
                    link: function link(value) {
                      if (!value) {
                        this.quill.format("link", false);
                      } else {
                        this.quill.theme.tooltip.edit();
                      }
                    }
                  }
                }
              }
            });
            var BubbleTooltip = function(_BaseTooltip) {
              _inherits(BubbleTooltip2, _BaseTooltip);
              function BubbleTooltip2(quill, bounds) {
                _classCallCheck2(this, BubbleTooltip2);
                var _this2 = _possibleConstructorReturn(this, (BubbleTooltip2.__proto__ || Object.getPrototypeOf(BubbleTooltip2)).call(this, quill, bounds));
                _this2.quill.on(_emitter2.default.events.EDITOR_CHANGE, function(type, range, oldRange, source) {
                  if (type !== _emitter2.default.events.SELECTION_CHANGE)
                    return;
                  if (range != null && range.length > 0 && source === _emitter2.default.sources.USER) {
                    _this2.show();
                    _this2.root.style.left = "0px";
                    _this2.root.style.width = "";
                    _this2.root.style.width = _this2.root.offsetWidth + "px";
                    var lines = _this2.quill.getLines(range.index, range.length);
                    if (lines.length === 1) {
                      _this2.position(_this2.quill.getBounds(range));
                    } else {
                      var lastLine = lines[lines.length - 1];
                      var index3 = _this2.quill.getIndex(lastLine);
                      var length2 = Math.min(lastLine.length() - 1, range.index + range.length - index3);
                      var _bounds = _this2.quill.getBounds(new _selection.Range(index3, length2));
                      _this2.position(_bounds);
                    }
                  } else if (document.activeElement !== _this2.textbox && _this2.quill.hasFocus()) {
                    _this2.hide();
                  }
                });
                return _this2;
              }
              _createClass(BubbleTooltip2, [{
                key: "listen",
                value: function listen() {
                  var _this3 = this;
                  _get(BubbleTooltip2.prototype.__proto__ || Object.getPrototypeOf(BubbleTooltip2.prototype), "listen", this).call(this);
                  this.root.querySelector(".ql-close").addEventListener("click", function() {
                    _this3.root.classList.remove("ql-editing");
                  });
                  this.quill.on(_emitter2.default.events.SCROLL_OPTIMIZE, function() {
                    setTimeout(function() {
                      if (_this3.root.classList.contains("ql-hidden"))
                        return;
                      var range = _this3.quill.getSelection();
                      if (range != null) {
                        _this3.position(_this3.quill.getBounds(range));
                      }
                    }, 1);
                  });
                }
              }, {
                key: "cancel",
                value: function cancel() {
                  this.show();
                }
              }, {
                key: "position",
                value: function position3(reference2) {
                  var shift = _get(BubbleTooltip2.prototype.__proto__ || Object.getPrototypeOf(BubbleTooltip2.prototype), "position", this).call(this, reference2);
                  var arrow = this.root.querySelector(".ql-tooltip-arrow");
                  arrow.style.marginLeft = "";
                  if (shift === 0)
                    return shift;
                  arrow.style.marginLeft = -1 * shift - arrow.offsetWidth / 2 + "px";
                }
              }]);
              return BubbleTooltip2;
            }(_base.BaseTooltip);
            BubbleTooltip.TEMPLATE = ['<span class="ql-tooltip-arrow"></span>', '<div class="ql-tooltip-editor">', '<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">', '<a class="ql-close"></a>', "</div>"].join("");
            exports2.BubbleTooltip = BubbleTooltip;
            exports2.default = BubbleTheme;
          },
          /* 109 */
          /***/
          function(module2, exports2, __webpack_require__) {
            module2.exports = __webpack_require__(63);
          }
          /******/
        ])["default"]
      );
    });
  }
});

// ../simple-mind-map/node_modules/jszip/dist/jszip.min.js
var require_jszip_min = __commonJS({
  "../simple-mind-map/node_modules/jszip/dist/jszip.min.js"(exports, module) {
    !function(e2) {
      if ("object" == typeof exports && "undefined" != typeof module)
        module.exports = e2();
      else if ("function" == typeof define && define.amd)
        define([], e2);
      else {
        ("undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : this).JSZip = e2();
      }
    }(function() {
      return function s3(a3, o3, h3) {
        function u3(r2, e3) {
          if (!o3[r2]) {
            if (!a3[r2]) {
              var t3 = "function" == typeof __require && __require;
              if (!e3 && t3)
                return t3(r2, true);
              if (l3)
                return l3(r2, true);
              var n3 = new Error("Cannot find module '" + r2 + "'");
              throw n3.code = "MODULE_NOT_FOUND", n3;
            }
            var i3 = o3[r2] = { exports: {} };
            a3[r2][0].call(i3.exports, function(e4) {
              var t4 = a3[r2][1][e4];
              return u3(t4 || e4);
            }, i3, i3.exports, s3, a3, o3, h3);
          }
          return o3[r2].exports;
        }
        for (var l3 = "function" == typeof __require && __require, e2 = 0; e2 < h3.length; e2++)
          u3(h3[e2]);
        return u3;
      }({ 1: [function(e2, t3, r2) {
        "use strict";
        var d2 = e2("./utils"), c4 = e2("./support"), p3 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
        r2.encode = function(e3) {
          for (var t4, r3, n3, i3, s3, a3, o3, h3 = [], u3 = 0, l3 = e3.length, f3 = l3, c5 = "string" !== d2.getTypeOf(e3); u3 < e3.length; )
            f3 = l3 - u3, n3 = c5 ? (t4 = e3[u3++], r3 = u3 < l3 ? e3[u3++] : 0, u3 < l3 ? e3[u3++] : 0) : (t4 = e3.charCodeAt(u3++), r3 = u3 < l3 ? e3.charCodeAt(u3++) : 0, u3 < l3 ? e3.charCodeAt(u3++) : 0), i3 = t4 >> 2, s3 = (3 & t4) << 4 | r3 >> 4, a3 = 1 < f3 ? (15 & r3) << 2 | n3 >> 6 : 64, o3 = 2 < f3 ? 63 & n3 : 64, h3.push(p3.charAt(i3) + p3.charAt(s3) + p3.charAt(a3) + p3.charAt(o3));
          return h3.join("");
        }, r2.decode = function(e3) {
          var t4, r3, n3, i3, s3, a3, o3 = 0, h3 = 0, u3 = "data:";
          if (e3.substr(0, u3.length) === u3)
            throw new Error("Invalid base64 input, it looks like a data url.");
          var l3, f3 = 3 * (e3 = e3.replace(/[^A-Za-z0-9+/=]/g, "")).length / 4;
          if (e3.charAt(e3.length - 1) === p3.charAt(64) && f3--, e3.charAt(e3.length - 2) === p3.charAt(64) && f3--, f3 % 1 != 0)
            throw new Error("Invalid base64 input, bad content length.");
          for (l3 = c4.uint8array ? new Uint8Array(0 | f3) : new Array(0 | f3); o3 < e3.length; )
            t4 = p3.indexOf(e3.charAt(o3++)) << 2 | (i3 = p3.indexOf(e3.charAt(o3++))) >> 4, r3 = (15 & i3) << 4 | (s3 = p3.indexOf(e3.charAt(o3++))) >> 2, n3 = (3 & s3) << 6 | (a3 = p3.indexOf(e3.charAt(o3++))), l3[h3++] = t4, 64 !== s3 && (l3[h3++] = r3), 64 !== a3 && (l3[h3++] = n3);
          return l3;
        };
      }, { "./support": 30, "./utils": 32 }], 2: [function(e2, t3, r2) {
        "use strict";
        var n3 = e2("./external"), i3 = e2("./stream/DataWorker"), s3 = e2("./stream/Crc32Probe"), a3 = e2("./stream/DataLengthProbe");
        function o3(e3, t4, r3, n4, i4) {
          this.compressedSize = e3, this.uncompressedSize = t4, this.crc32 = r3, this.compression = n4, this.compressedContent = i4;
        }
        o3.prototype = { getContentWorker: function() {
          var e3 = new i3(n3.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new a3("data_length")), t4 = this;
          return e3.on("end", function() {
            if (this.streamInfo.data_length !== t4.uncompressedSize)
              throw new Error("Bug : uncompressed data size mismatch");
          }), e3;
        }, getCompressedWorker: function() {
          return new i3(n3.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize", this.compressedSize).withStreamInfo("uncompressedSize", this.uncompressedSize).withStreamInfo("crc32", this.crc32).withStreamInfo("compression", this.compression);
        } }, o3.createWorkerFrom = function(e3, t4, r3) {
          return e3.pipe(new s3()).pipe(new a3("uncompressedSize")).pipe(t4.compressWorker(r3)).pipe(new a3("compressedSize")).withStreamInfo("compression", t4);
        }, t3.exports = o3;
      }, { "./external": 6, "./stream/Crc32Probe": 25, "./stream/DataLengthProbe": 26, "./stream/DataWorker": 27 }], 3: [function(e2, t3, r2) {
        "use strict";
        var n3 = e2("./stream/GenericWorker");
        r2.STORE = { magic: "\0\0", compressWorker: function() {
          return new n3("STORE compression");
        }, uncompressWorker: function() {
          return new n3("STORE decompression");
        } }, r2.DEFLATE = e2("./flate");
      }, { "./flate": 7, "./stream/GenericWorker": 28 }], 4: [function(e2, t3, r2) {
        "use strict";
        var n3 = e2("./utils");
        var o3 = function() {
          for (var e3, t4 = [], r3 = 0; r3 < 256; r3++) {
            e3 = r3;
            for (var n4 = 0; n4 < 8; n4++)
              e3 = 1 & e3 ? 3988292384 ^ e3 >>> 1 : e3 >>> 1;
            t4[r3] = e3;
          }
          return t4;
        }();
        t3.exports = function(e3, t4) {
          return void 0 !== e3 && e3.length ? "string" !== n3.getTypeOf(e3) ? function(e4, t5, r3, n4) {
            var i3 = o3, s3 = n4 + r3;
            e4 ^= -1;
            for (var a3 = n4; a3 < s3; a3++)
              e4 = e4 >>> 8 ^ i3[255 & (e4 ^ t5[a3])];
            return -1 ^ e4;
          }(0 | t4, e3, e3.length, 0) : function(e4, t5, r3, n4) {
            var i3 = o3, s3 = n4 + r3;
            e4 ^= -1;
            for (var a3 = n4; a3 < s3; a3++)
              e4 = e4 >>> 8 ^ i3[255 & (e4 ^ t5.charCodeAt(a3))];
            return -1 ^ e4;
          }(0 | t4, e3, e3.length, 0) : 0;
        };
      }, { "./utils": 32 }], 5: [function(e2, t3, r2) {
        "use strict";
        r2.base64 = false, r2.binary = false, r2.dir = false, r2.createFolders = true, r2.date = null, r2.compression = null, r2.compressionOptions = null, r2.comment = null, r2.unixPermissions = null, r2.dosPermissions = null;
      }, {}], 6: [function(e2, t3, r2) {
        "use strict";
        var n3 = null;
        n3 = "undefined" != typeof Promise ? Promise : e2("lie"), t3.exports = { Promise: n3 };
      }, { lie: 37 }], 7: [function(e2, t3, r2) {
        "use strict";
        var n3 = "undefined" != typeof Uint8Array && "undefined" != typeof Uint16Array && "undefined" != typeof Uint32Array, i3 = e2("pako"), s3 = e2("./utils"), a3 = e2("./stream/GenericWorker"), o3 = n3 ? "uint8array" : "array";
        function h3(e3, t4) {
          a3.call(this, "FlateWorker/" + e3), this._pako = null, this._pakoAction = e3, this._pakoOptions = t4, this.meta = {};
        }
        r2.magic = "\b\0", s3.inherits(h3, a3), h3.prototype.processChunk = function(e3) {
          this.meta = e3.meta, null === this._pako && this._createPako(), this._pako.push(s3.transformTo(o3, e3.data), false);
        }, h3.prototype.flush = function() {
          a3.prototype.flush.call(this), null === this._pako && this._createPako(), this._pako.push([], true);
        }, h3.prototype.cleanUp = function() {
          a3.prototype.cleanUp.call(this), this._pako = null;
        }, h3.prototype._createPako = function() {
          this._pako = new i3[this._pakoAction]({ raw: true, level: this._pakoOptions.level || -1 });
          var t4 = this;
          this._pako.onData = function(e3) {
            t4.push({ data: e3, meta: t4.meta });
          };
        }, r2.compressWorker = function(e3) {
          return new h3("Deflate", e3);
        }, r2.uncompressWorker = function() {
          return new h3("Inflate", {});
        };
      }, { "./stream/GenericWorker": 28, "./utils": 32, pako: 38 }], 8: [function(e2, t3, r2) {
        "use strict";
        function A3(e3, t4) {
          var r3, n4 = "";
          for (r3 = 0; r3 < t4; r3++)
            n4 += String.fromCharCode(255 & e3), e3 >>>= 8;
          return n4;
        }
        function n3(e3, t4, r3, n4, i4, s4) {
          var a3, o3, h3 = e3.file, u3 = e3.compression, l3 = s4 !== O3.utf8encode, f3 = I2.transformTo("string", s4(h3.name)), c4 = I2.transformTo("string", O3.utf8encode(h3.name)), d2 = h3.comment, p3 = I2.transformTo("string", s4(d2)), m4 = I2.transformTo("string", O3.utf8encode(d2)), _3 = c4.length !== h3.name.length, g2 = m4.length !== d2.length, b2 = "", v3 = "", y4 = "", w2 = h3.dir, k2 = h3.date, x3 = { crc32: 0, compressedSize: 0, uncompressedSize: 0 };
          t4 && !r3 || (x3.crc32 = e3.crc32, x3.compressedSize = e3.compressedSize, x3.uncompressedSize = e3.uncompressedSize);
          var S2 = 0;
          t4 && (S2 |= 8), l3 || !_3 && !g2 || (S2 |= 2048);
          var z2 = 0, C2 = 0;
          w2 && (z2 |= 16), "UNIX" === i4 ? (C2 = 798, z2 |= function(e4, t5) {
            var r4 = e4;
            return e4 || (r4 = t5 ? 16893 : 33204), (65535 & r4) << 16;
          }(h3.unixPermissions, w2)) : (C2 = 20, z2 |= function(e4) {
            return 63 & (e4 || 0);
          }(h3.dosPermissions)), a3 = k2.getUTCHours(), a3 <<= 6, a3 |= k2.getUTCMinutes(), a3 <<= 5, a3 |= k2.getUTCSeconds() / 2, o3 = k2.getUTCFullYear() - 1980, o3 <<= 4, o3 |= k2.getUTCMonth() + 1, o3 <<= 5, o3 |= k2.getUTCDate(), _3 && (v3 = A3(1, 1) + A3(B2(f3), 4) + c4, b2 += "up" + A3(v3.length, 2) + v3), g2 && (y4 = A3(1, 1) + A3(B2(p3), 4) + m4, b2 += "uc" + A3(y4.length, 2) + y4);
          var E2 = "";
          return E2 += "\n\0", E2 += A3(S2, 2), E2 += u3.magic, E2 += A3(a3, 2), E2 += A3(o3, 2), E2 += A3(x3.crc32, 4), E2 += A3(x3.compressedSize, 4), E2 += A3(x3.uncompressedSize, 4), E2 += A3(f3.length, 2), E2 += A3(b2.length, 2), { fileRecord: R2.LOCAL_FILE_HEADER + E2 + f3 + b2, dirRecord: R2.CENTRAL_FILE_HEADER + A3(C2, 2) + E2 + A3(p3.length, 2) + "\0\0\0\0" + A3(z2, 4) + A3(n4, 4) + f3 + b2 + p3 };
        }
        var I2 = e2("../utils"), i3 = e2("../stream/GenericWorker"), O3 = e2("../utf8"), B2 = e2("../crc32"), R2 = e2("../signature");
        function s3(e3, t4, r3, n4) {
          i3.call(this, "ZipFileWorker"), this.bytesWritten = 0, this.zipComment = t4, this.zipPlatform = r3, this.encodeFileName = n4, this.streamFiles = e3, this.accumulate = false, this.contentBuffer = [], this.dirRecords = [], this.currentSourceOffset = 0, this.entriesCount = 0, this.currentFile = null, this._sources = [];
        }
        I2.inherits(s3, i3), s3.prototype.push = function(e3) {
          var t4 = e3.meta.percent || 0, r3 = this.entriesCount, n4 = this._sources.length;
          this.accumulate ? this.contentBuffer.push(e3) : (this.bytesWritten += e3.data.length, i3.prototype.push.call(this, { data: e3.data, meta: { currentFile: this.currentFile, percent: r3 ? (t4 + 100 * (r3 - n4 - 1)) / r3 : 100 } }));
        }, s3.prototype.openedSource = function(e3) {
          this.currentSourceOffset = this.bytesWritten, this.currentFile = e3.file.name;
          var t4 = this.streamFiles && !e3.file.dir;
          if (t4) {
            var r3 = n3(e3, t4, false, this.currentSourceOffset, this.zipPlatform, this.encodeFileName);
            this.push({ data: r3.fileRecord, meta: { percent: 0 } });
          } else
            this.accumulate = true;
        }, s3.prototype.closedSource = function(e3) {
          this.accumulate = false;
          var t4 = this.streamFiles && !e3.file.dir, r3 = n3(e3, t4, true, this.currentSourceOffset, this.zipPlatform, this.encodeFileName);
          if (this.dirRecords.push(r3.dirRecord), t4)
            this.push({ data: function(e4) {
              return R2.DATA_DESCRIPTOR + A3(e4.crc32, 4) + A3(e4.compressedSize, 4) + A3(e4.uncompressedSize, 4);
            }(e3), meta: { percent: 100 } });
          else
            for (this.push({ data: r3.fileRecord, meta: { percent: 0 } }); this.contentBuffer.length; )
              this.push(this.contentBuffer.shift());
          this.currentFile = null;
        }, s3.prototype.flush = function() {
          for (var e3 = this.bytesWritten, t4 = 0; t4 < this.dirRecords.length; t4++)
            this.push({ data: this.dirRecords[t4], meta: { percent: 100 } });
          var r3 = this.bytesWritten - e3, n4 = function(e4, t5, r4, n5, i4) {
            var s4 = I2.transformTo("string", i4(n5));
            return R2.CENTRAL_DIRECTORY_END + "\0\0\0\0" + A3(e4, 2) + A3(e4, 2) + A3(t5, 4) + A3(r4, 4) + A3(s4.length, 2) + s4;
          }(this.dirRecords.length, r3, e3, this.zipComment, this.encodeFileName);
          this.push({ data: n4, meta: { percent: 100 } });
        }, s3.prototype.prepareNextSource = function() {
          this.previous = this._sources.shift(), this.openedSource(this.previous.streamInfo), this.isPaused ? this.previous.pause() : this.previous.resume();
        }, s3.prototype.registerPrevious = function(e3) {
          this._sources.push(e3);
          var t4 = this;
          return e3.on("data", function(e4) {
            t4.processChunk(e4);
          }), e3.on("end", function() {
            t4.closedSource(t4.previous.streamInfo), t4._sources.length ? t4.prepareNextSource() : t4.end();
          }), e3.on("error", function(e4) {
            t4.error(e4);
          }), this;
        }, s3.prototype.resume = function() {
          return !!i3.prototype.resume.call(this) && (!this.previous && this._sources.length ? (this.prepareNextSource(), true) : this.previous || this._sources.length || this.generatedError ? void 0 : (this.end(), true));
        }, s3.prototype.error = function(e3) {
          var t4 = this._sources;
          if (!i3.prototype.error.call(this, e3))
            return false;
          for (var r3 = 0; r3 < t4.length; r3++)
            try {
              t4[r3].error(e3);
            } catch (e4) {
            }
          return true;
        }, s3.prototype.lock = function() {
          i3.prototype.lock.call(this);
          for (var e3 = this._sources, t4 = 0; t4 < e3.length; t4++)
            e3[t4].lock();
        }, t3.exports = s3;
      }, { "../crc32": 4, "../signature": 23, "../stream/GenericWorker": 28, "../utf8": 31, "../utils": 32 }], 9: [function(e2, t3, r2) {
        "use strict";
        var u3 = e2("../compressions"), n3 = e2("./ZipFileWorker");
        r2.generateWorker = function(e3, a3, t4) {
          var o3 = new n3(a3.streamFiles, t4, a3.platform, a3.encodeFileName), h3 = 0;
          try {
            e3.forEach(function(e4, t5) {
              h3++;
              var r3 = function(e5, t6) {
                var r4 = e5 || t6, n5 = u3[r4];
                if (!n5)
                  throw new Error(r4 + " is not a valid compression method !");
                return n5;
              }(t5.options.compression, a3.compression), n4 = t5.options.compressionOptions || a3.compressionOptions || {}, i3 = t5.dir, s3 = t5.date;
              t5._compressWorker(r3, n4).withStreamInfo("file", { name: e4, dir: i3, date: s3, comment: t5.comment || "", unixPermissions: t5.unixPermissions, dosPermissions: t5.dosPermissions }).pipe(o3);
            }), o3.entriesCount = h3;
          } catch (e4) {
            o3.error(e4);
          }
          return o3;
        };
      }, { "../compressions": 3, "./ZipFileWorker": 8 }], 10: [function(e2, t3, r2) {
        "use strict";
        function n3() {
          if (!(this instanceof n3))
            return new n3();
          if (arguments.length)
            throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");
          this.files = /* @__PURE__ */ Object.create(null), this.comment = null, this.root = "", this.clone = function() {
            var e3 = new n3();
            for (var t4 in this)
              "function" != typeof this[t4] && (e3[t4] = this[t4]);
            return e3;
          };
        }
        (n3.prototype = e2("./object")).loadAsync = e2("./load"), n3.support = e2("./support"), n3.defaults = e2("./defaults"), n3.version = "3.10.1", n3.loadAsync = function(e3, t4) {
          return new n3().loadAsync(e3, t4);
        }, n3.external = e2("./external"), t3.exports = n3;
      }, { "./defaults": 5, "./external": 6, "./load": 11, "./object": 15, "./support": 30 }], 11: [function(e2, t3, r2) {
        "use strict";
        var u3 = e2("./utils"), i3 = e2("./external"), n3 = e2("./utf8"), s3 = e2("./zipEntries"), a3 = e2("./stream/Crc32Probe"), l3 = e2("./nodejsUtils");
        function f3(n4) {
          return new i3.Promise(function(e3, t4) {
            var r3 = n4.decompressed.getContentWorker().pipe(new a3());
            r3.on("error", function(e4) {
              t4(e4);
            }).on("end", function() {
              r3.streamInfo.crc32 !== n4.decompressed.crc32 ? t4(new Error("Corrupted zip : CRC32 mismatch")) : e3();
            }).resume();
          });
        }
        t3.exports = function(e3, o3) {
          var h3 = this;
          return o3 = u3.extend(o3 || {}, { base64: false, checkCRC32: false, optimizedBinaryString: false, createFolders: false, decodeFileName: n3.utf8decode }), l3.isNode && l3.isStream(e3) ? i3.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")) : u3.prepareContent("the loaded zip file", e3, true, o3.optimizedBinaryString, o3.base64).then(function(e4) {
            var t4 = new s3(o3);
            return t4.load(e4), t4;
          }).then(function(e4) {
            var t4 = [i3.Promise.resolve(e4)], r3 = e4.files;
            if (o3.checkCRC32)
              for (var n4 = 0; n4 < r3.length; n4++)
                t4.push(f3(r3[n4]));
            return i3.Promise.all(t4);
          }).then(function(e4) {
            for (var t4 = e4.shift(), r3 = t4.files, n4 = 0; n4 < r3.length; n4++) {
              var i4 = r3[n4], s4 = i4.fileNameStr, a4 = u3.resolve(i4.fileNameStr);
              h3.file(a4, i4.decompressed, { binary: true, optimizedBinaryString: true, date: i4.date, dir: i4.dir, comment: i4.fileCommentStr.length ? i4.fileCommentStr : null, unixPermissions: i4.unixPermissions, dosPermissions: i4.dosPermissions, createFolders: o3.createFolders }), i4.dir || (h3.file(a4).unsafeOriginalName = s4);
            }
            return t4.zipComment.length && (h3.comment = t4.zipComment), h3;
          });
        };
      }, { "./external": 6, "./nodejsUtils": 14, "./stream/Crc32Probe": 25, "./utf8": 31, "./utils": 32, "./zipEntries": 33 }], 12: [function(e2, t3, r2) {
        "use strict";
        var n3 = e2("../utils"), i3 = e2("../stream/GenericWorker");
        function s3(e3, t4) {
          i3.call(this, "Nodejs stream input adapter for " + e3), this._upstreamEnded = false, this._bindStream(t4);
        }
        n3.inherits(s3, i3), s3.prototype._bindStream = function(e3) {
          var t4 = this;
          (this._stream = e3).pause(), e3.on("data", function(e4) {
            t4.push({ data: e4, meta: { percent: 0 } });
          }).on("error", function(e4) {
            t4.isPaused ? this.generatedError = e4 : t4.error(e4);
          }).on("end", function() {
            t4.isPaused ? t4._upstreamEnded = true : t4.end();
          });
        }, s3.prototype.pause = function() {
          return !!i3.prototype.pause.call(this) && (this._stream.pause(), true);
        }, s3.prototype.resume = function() {
          return !!i3.prototype.resume.call(this) && (this._upstreamEnded ? this.end() : this._stream.resume(), true);
        }, t3.exports = s3;
      }, { "../stream/GenericWorker": 28, "../utils": 32 }], 13: [function(e2, t3, r2) {
        "use strict";
        var i3 = e2("readable-stream").Readable;
        function n3(e3, t4, r3) {
          i3.call(this, t4), this._helper = e3;
          var n4 = this;
          e3.on("data", function(e4, t5) {
            n4.push(e4) || n4._helper.pause(), r3 && r3(t5);
          }).on("error", function(e4) {
            n4.emit("error", e4);
          }).on("end", function() {
            n4.push(null);
          });
        }
        e2("../utils").inherits(n3, i3), n3.prototype._read = function() {
          this._helper.resume();
        }, t3.exports = n3;
      }, { "../utils": 32, "readable-stream": 16 }], 14: [function(e2, t3, r2) {
        "use strict";
        t3.exports = { isNode: "undefined" != typeof Buffer, newBufferFrom: function(e3, t4) {
          if (Buffer.from && Buffer.from !== Uint8Array.from)
            return Buffer.from(e3, t4);
          if ("number" == typeof e3)
            throw new Error('The "data" argument must not be a number');
          return new Buffer(e3, t4);
        }, allocBuffer: function(e3) {
          if (Buffer.alloc)
            return Buffer.alloc(e3);
          var t4 = new Buffer(e3);
          return t4.fill(0), t4;
        }, isBuffer: function(e3) {
          return Buffer.isBuffer(e3);
        }, isStream: function(e3) {
          return e3 && "function" == typeof e3.on && "function" == typeof e3.pause && "function" == typeof e3.resume;
        } };
      }, {}], 15: [function(e2, t3, r2) {
        "use strict";
        function s3(e3, t4, r3) {
          var n4, i4 = u3.getTypeOf(t4), s4 = u3.extend(r3 || {}, f3);
          s4.date = s4.date || /* @__PURE__ */ new Date(), null !== s4.compression && (s4.compression = s4.compression.toUpperCase()), "string" == typeof s4.unixPermissions && (s4.unixPermissions = parseInt(s4.unixPermissions, 8)), s4.unixPermissions && 16384 & s4.unixPermissions && (s4.dir = true), s4.dosPermissions && 16 & s4.dosPermissions && (s4.dir = true), s4.dir && (e3 = g2(e3)), s4.createFolders && (n4 = _3(e3)) && b2.call(this, n4, true);
          var a4 = "string" === i4 && false === s4.binary && false === s4.base64;
          r3 && void 0 !== r3.binary || (s4.binary = !a4), (t4 instanceof c4 && 0 === t4.uncompressedSize || s4.dir || !t4 || 0 === t4.length) && (s4.base64 = false, s4.binary = true, t4 = "", s4.compression = "STORE", i4 = "string");
          var o4 = null;
          o4 = t4 instanceof c4 || t4 instanceof l3 ? t4 : p3.isNode && p3.isStream(t4) ? new m4(e3, t4) : u3.prepareContent(e3, t4, s4.binary, s4.optimizedBinaryString, s4.base64);
          var h4 = new d2(e3, o4, s4);
          this.files[e3] = h4;
        }
        var i3 = e2("./utf8"), u3 = e2("./utils"), l3 = e2("./stream/GenericWorker"), a3 = e2("./stream/StreamHelper"), f3 = e2("./defaults"), c4 = e2("./compressedObject"), d2 = e2("./zipObject"), o3 = e2("./generate"), p3 = e2("./nodejsUtils"), m4 = e2("./nodejs/NodejsStreamInputAdapter"), _3 = function(e3) {
          "/" === e3.slice(-1) && (e3 = e3.substring(0, e3.length - 1));
          var t4 = e3.lastIndexOf("/");
          return 0 < t4 ? e3.substring(0, t4) : "";
        }, g2 = function(e3) {
          return "/" !== e3.slice(-1) && (e3 += "/"), e3;
        }, b2 = function(e3, t4) {
          return t4 = void 0 !== t4 ? t4 : f3.createFolders, e3 = g2(e3), this.files[e3] || s3.call(this, e3, null, { dir: true, createFolders: t4 }), this.files[e3];
        };
        function h3(e3) {
          return "[object RegExp]" === Object.prototype.toString.call(e3);
        }
        var n3 = { load: function() {
          throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.");
        }, forEach: function(e3) {
          var t4, r3, n4;
          for (t4 in this.files)
            n4 = this.files[t4], (r3 = t4.slice(this.root.length, t4.length)) && t4.slice(0, this.root.length) === this.root && e3(r3, n4);
        }, filter: function(r3) {
          var n4 = [];
          return this.forEach(function(e3, t4) {
            r3(e3, t4) && n4.push(t4);
          }), n4;
        }, file: function(e3, t4, r3) {
          if (1 !== arguments.length)
            return e3 = this.root + e3, s3.call(this, e3, t4, r3), this;
          if (h3(e3)) {
            var n4 = e3;
            return this.filter(function(e4, t5) {
              return !t5.dir && n4.test(e4);
            });
          }
          var i4 = this.files[this.root + e3];
          return i4 && !i4.dir ? i4 : null;
        }, folder: function(r3) {
          if (!r3)
            return this;
          if (h3(r3))
            return this.filter(function(e4, t5) {
              return t5.dir && r3.test(e4);
            });
          var e3 = this.root + r3, t4 = b2.call(this, e3), n4 = this.clone();
          return n4.root = t4.name, n4;
        }, remove: function(r3) {
          r3 = this.root + r3;
          var e3 = this.files[r3];
          if (e3 || ("/" !== r3.slice(-1) && (r3 += "/"), e3 = this.files[r3]), e3 && !e3.dir)
            delete this.files[r3];
          else
            for (var t4 = this.filter(function(e4, t5) {
              return t5.name.slice(0, r3.length) === r3;
            }), n4 = 0; n4 < t4.length; n4++)
              delete this.files[t4[n4].name];
          return this;
        }, generate: function() {
          throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.");
        }, generateInternalStream: function(e3) {
          var t4, r3 = {};
          try {
            if ((r3 = u3.extend(e3 || {}, { streamFiles: false, compression: "STORE", compressionOptions: null, type: "", platform: "DOS", comment: null, mimeType: "application/zip", encodeFileName: i3.utf8encode })).type = r3.type.toLowerCase(), r3.compression = r3.compression.toUpperCase(), "binarystring" === r3.type && (r3.type = "string"), !r3.type)
              throw new Error("No output type specified.");
            u3.checkSupport(r3.type), "darwin" !== r3.platform && "freebsd" !== r3.platform && "linux" !== r3.platform && "sunos" !== r3.platform || (r3.platform = "UNIX"), "win32" === r3.platform && (r3.platform = "DOS");
            var n4 = r3.comment || this.comment || "";
            t4 = o3.generateWorker(this, r3, n4);
          } catch (e4) {
            (t4 = new l3("error")).error(e4);
          }
          return new a3(t4, r3.type || "string", r3.mimeType);
        }, generateAsync: function(e3, t4) {
          return this.generateInternalStream(e3).accumulate(t4);
        }, generateNodeStream: function(e3, t4) {
          return (e3 = e3 || {}).type || (e3.type = "nodebuffer"), this.generateInternalStream(e3).toNodejsStream(t4);
        } };
        t3.exports = n3;
      }, { "./compressedObject": 2, "./defaults": 5, "./generate": 9, "./nodejs/NodejsStreamInputAdapter": 12, "./nodejsUtils": 14, "./stream/GenericWorker": 28, "./stream/StreamHelper": 29, "./utf8": 31, "./utils": 32, "./zipObject": 35 }], 16: [function(e2, t3, r2) {
        "use strict";
        t3.exports = e2("stream");
      }, { stream: void 0 }], 17: [function(e2, t3, r2) {
        "use strict";
        var n3 = e2("./DataReader");
        function i3(e3) {
          n3.call(this, e3);
          for (var t4 = 0; t4 < this.data.length; t4++)
            e3[t4] = 255 & e3[t4];
        }
        e2("../utils").inherits(i3, n3), i3.prototype.byteAt = function(e3) {
          return this.data[this.zero + e3];
        }, i3.prototype.lastIndexOfSignature = function(e3) {
          for (var t4 = e3.charCodeAt(0), r3 = e3.charCodeAt(1), n4 = e3.charCodeAt(2), i4 = e3.charCodeAt(3), s3 = this.length - 4; 0 <= s3; --s3)
            if (this.data[s3] === t4 && this.data[s3 + 1] === r3 && this.data[s3 + 2] === n4 && this.data[s3 + 3] === i4)
              return s3 - this.zero;
          return -1;
        }, i3.prototype.readAndCheckSignature = function(e3) {
          var t4 = e3.charCodeAt(0), r3 = e3.charCodeAt(1), n4 = e3.charCodeAt(2), i4 = e3.charCodeAt(3), s3 = this.readData(4);
          return t4 === s3[0] && r3 === s3[1] && n4 === s3[2] && i4 === s3[3];
        }, i3.prototype.readData = function(e3) {
          if (this.checkOffset(e3), 0 === e3)
            return [];
          var t4 = this.data.slice(this.zero + this.index, this.zero + this.index + e3);
          return this.index += e3, t4;
        }, t3.exports = i3;
      }, { "../utils": 32, "./DataReader": 18 }], 18: [function(e2, t3, r2) {
        "use strict";
        var n3 = e2("../utils");
        function i3(e3) {
          this.data = e3, this.length = e3.length, this.index = 0, this.zero = 0;
        }
        i3.prototype = { checkOffset: function(e3) {
          this.checkIndex(this.index + e3);
        }, checkIndex: function(e3) {
          if (this.length < this.zero + e3 || e3 < 0)
            throw new Error("End of data reached (data length = " + this.length + ", asked index = " + e3 + "). Corrupted zip ?");
        }, setIndex: function(e3) {
          this.checkIndex(e3), this.index = e3;
        }, skip: function(e3) {
          this.setIndex(this.index + e3);
        }, byteAt: function() {
        }, readInt: function(e3) {
          var t4, r3 = 0;
          for (this.checkOffset(e3), t4 = this.index + e3 - 1; t4 >= this.index; t4--)
            r3 = (r3 << 8) + this.byteAt(t4);
          return this.index += e3, r3;
        }, readString: function(e3) {
          return n3.transformTo("string", this.readData(e3));
        }, readData: function() {
        }, lastIndexOfSignature: function() {
        }, readAndCheckSignature: function() {
        }, readDate: function() {
          var e3 = this.readInt(4);
          return new Date(Date.UTC(1980 + (e3 >> 25 & 127), (e3 >> 21 & 15) - 1, e3 >> 16 & 31, e3 >> 11 & 31, e3 >> 5 & 63, (31 & e3) << 1));
        } }, t3.exports = i3;
      }, { "../utils": 32 }], 19: [function(e2, t3, r2) {
        "use strict";
        var n3 = e2("./Uint8ArrayReader");
        function i3(e3) {
          n3.call(this, e3);
        }
        e2("../utils").inherits(i3, n3), i3.prototype.readData = function(e3) {
          this.checkOffset(e3);
          var t4 = this.data.slice(this.zero + this.index, this.zero + this.index + e3);
          return this.index += e3, t4;
        }, t3.exports = i3;
      }, { "../utils": 32, "./Uint8ArrayReader": 21 }], 20: [function(e2, t3, r2) {
        "use strict";
        var n3 = e2("./DataReader");
        function i3(e3) {
          n3.call(this, e3);
        }
        e2("../utils").inherits(i3, n3), i3.prototype.byteAt = function(e3) {
          return this.data.charCodeAt(this.zero + e3);
        }, i3.prototype.lastIndexOfSignature = function(e3) {
          return this.data.lastIndexOf(e3) - this.zero;
        }, i3.prototype.readAndCheckSignature = function(e3) {
          return e3 === this.readData(4);
        }, i3.prototype.readData = function(e3) {
          this.checkOffset(e3);
          var t4 = this.data.slice(this.zero + this.index, this.zero + this.index + e3);
          return this.index += e3, t4;
        }, t3.exports = i3;
      }, { "../utils": 32, "./DataReader": 18 }], 21: [function(e2, t3, r2) {
        "use strict";
        var n3 = e2("./ArrayReader");
        function i3(e3) {
          n3.call(this, e3);
        }
        e2("../utils").inherits(i3, n3), i3.prototype.readData = function(e3) {
          if (this.checkOffset(e3), 0 === e3)
            return new Uint8Array(0);
          var t4 = this.data.subarray(this.zero + this.index, this.zero + this.index + e3);
          return this.index += e3, t4;
        }, t3.exports = i3;
      }, { "../utils": 32, "./ArrayReader": 17 }], 22: [function(e2, t3, r2) {
        "use strict";
        var n3 = e2("../utils"), i3 = e2("../support"), s3 = e2("./ArrayReader"), a3 = e2("./StringReader"), o3 = e2("./NodeBufferReader"), h3 = e2("./Uint8ArrayReader");
        t3.exports = function(e3) {
          var t4 = n3.getTypeOf(e3);
          return n3.checkSupport(t4), "string" !== t4 || i3.uint8array ? "nodebuffer" === t4 ? new o3(e3) : i3.uint8array ? new h3(n3.transformTo("uint8array", e3)) : new s3(n3.transformTo("array", e3)) : new a3(e3);
        };
      }, { "../support": 30, "../utils": 32, "./ArrayReader": 17, "./NodeBufferReader": 19, "./StringReader": 20, "./Uint8ArrayReader": 21 }], 23: [function(e2, t3, r2) {
        "use strict";
        r2.LOCAL_FILE_HEADER = "PK", r2.CENTRAL_FILE_HEADER = "PK", r2.CENTRAL_DIRECTORY_END = "PK", r2.ZIP64_CENTRAL_DIRECTORY_LOCATOR = "PK\x07", r2.ZIP64_CENTRAL_DIRECTORY_END = "PK", r2.DATA_DESCRIPTOR = "PK\x07\b";
      }, {}], 24: [function(e2, t3, r2) {
        "use strict";
        var n3 = e2("./GenericWorker"), i3 = e2("../utils");
        function s3(e3) {
          n3.call(this, "ConvertWorker to " + e3), this.destType = e3;
        }
        i3.inherits(s3, n3), s3.prototype.processChunk = function(e3) {
          this.push({ data: i3.transformTo(this.destType, e3.data), meta: e3.meta });
        }, t3.exports = s3;
      }, { "../utils": 32, "./GenericWorker": 28 }], 25: [function(e2, t3, r2) {
        "use strict";
        var n3 = e2("./GenericWorker"), i3 = e2("../crc32");
        function s3() {
          n3.call(this, "Crc32Probe"), this.withStreamInfo("crc32", 0);
        }
        e2("../utils").inherits(s3, n3), s3.prototype.processChunk = function(e3) {
          this.streamInfo.crc32 = i3(e3.data, this.streamInfo.crc32 || 0), this.push(e3);
        }, t3.exports = s3;
      }, { "../crc32": 4, "../utils": 32, "./GenericWorker": 28 }], 26: [function(e2, t3, r2) {
        "use strict";
        var n3 = e2("../utils"), i3 = e2("./GenericWorker");
        function s3(e3) {
          i3.call(this, "DataLengthProbe for " + e3), this.propName = e3, this.withStreamInfo(e3, 0);
        }
        n3.inherits(s3, i3), s3.prototype.processChunk = function(e3) {
          if (e3) {
            var t4 = this.streamInfo[this.propName] || 0;
            this.streamInfo[this.propName] = t4 + e3.data.length;
          }
          i3.prototype.processChunk.call(this, e3);
        }, t3.exports = s3;
      }, { "../utils": 32, "./GenericWorker": 28 }], 27: [function(e2, t3, r2) {
        "use strict";
        var n3 = e2("../utils"), i3 = e2("./GenericWorker");
        function s3(e3) {
          i3.call(this, "DataWorker");
          var t4 = this;
          this.dataIsReady = false, this.index = 0, this.max = 0, this.data = null, this.type = "", this._tickScheduled = false, e3.then(function(e4) {
            t4.dataIsReady = true, t4.data = e4, t4.max = e4 && e4.length || 0, t4.type = n3.getTypeOf(e4), t4.isPaused || t4._tickAndRepeat();
          }, function(e4) {
            t4.error(e4);
          });
        }
        n3.inherits(s3, i3), s3.prototype.cleanUp = function() {
          i3.prototype.cleanUp.call(this), this.data = null;
        }, s3.prototype.resume = function() {
          return !!i3.prototype.resume.call(this) && (!this._tickScheduled && this.dataIsReady && (this._tickScheduled = true, n3.delay(this._tickAndRepeat, [], this)), true);
        }, s3.prototype._tickAndRepeat = function() {
          this._tickScheduled = false, this.isPaused || this.isFinished || (this._tick(), this.isFinished || (n3.delay(this._tickAndRepeat, [], this), this._tickScheduled = true));
        }, s3.prototype._tick = function() {
          if (this.isPaused || this.isFinished)
            return false;
          var e3 = null, t4 = Math.min(this.max, this.index + 16384);
          if (this.index >= this.max)
            return this.end();
          switch (this.type) {
            case "string":
              e3 = this.data.substring(this.index, t4);
              break;
            case "uint8array":
              e3 = this.data.subarray(this.index, t4);
              break;
            case "array":
            case "nodebuffer":
              e3 = this.data.slice(this.index, t4);
          }
          return this.index = t4, this.push({ data: e3, meta: { percent: this.max ? this.index / this.max * 100 : 0 } });
        }, t3.exports = s3;
      }, { "../utils": 32, "./GenericWorker": 28 }], 28: [function(e2, t3, r2) {
        "use strict";
        function n3(e3) {
          this.name = e3 || "default", this.streamInfo = {}, this.generatedError = null, this.extraStreamInfo = {}, this.isPaused = true, this.isFinished = false, this.isLocked = false, this._listeners = { data: [], end: [], error: [] }, this.previous = null;
        }
        n3.prototype = { push: function(e3) {
          this.emit("data", e3);
        }, end: function() {
          if (this.isFinished)
            return false;
          this.flush();
          try {
            this.emit("end"), this.cleanUp(), this.isFinished = true;
          } catch (e3) {
            this.emit("error", e3);
          }
          return true;
        }, error: function(e3) {
          return !this.isFinished && (this.isPaused ? this.generatedError = e3 : (this.isFinished = true, this.emit("error", e3), this.previous && this.previous.error(e3), this.cleanUp()), true);
        }, on: function(e3, t4) {
          return this._listeners[e3].push(t4), this;
        }, cleanUp: function() {
          this.streamInfo = this.generatedError = this.extraStreamInfo = null, this._listeners = [];
        }, emit: function(e3, t4) {
          if (this._listeners[e3])
            for (var r3 = 0; r3 < this._listeners[e3].length; r3++)
              this._listeners[e3][r3].call(this, t4);
        }, pipe: function(e3) {
          return e3.registerPrevious(this);
        }, registerPrevious: function(e3) {
          if (this.isLocked)
            throw new Error("The stream '" + this + "' has already been used.");
          this.streamInfo = e3.streamInfo, this.mergeStreamInfo(), this.previous = e3;
          var t4 = this;
          return e3.on("data", function(e4) {
            t4.processChunk(e4);
          }), e3.on("end", function() {
            t4.end();
          }), e3.on("error", function(e4) {
            t4.error(e4);
          }), this;
        }, pause: function() {
          return !this.isPaused && !this.isFinished && (this.isPaused = true, this.previous && this.previous.pause(), true);
        }, resume: function() {
          if (!this.isPaused || this.isFinished)
            return false;
          var e3 = this.isPaused = false;
          return this.generatedError && (this.error(this.generatedError), e3 = true), this.previous && this.previous.resume(), !e3;
        }, flush: function() {
        }, processChunk: function(e3) {
          this.push(e3);
        }, withStreamInfo: function(e3, t4) {
          return this.extraStreamInfo[e3] = t4, this.mergeStreamInfo(), this;
        }, mergeStreamInfo: function() {
          for (var e3 in this.extraStreamInfo)
            Object.prototype.hasOwnProperty.call(this.extraStreamInfo, e3) && (this.streamInfo[e3] = this.extraStreamInfo[e3]);
        }, lock: function() {
          if (this.isLocked)
            throw new Error("The stream '" + this + "' has already been used.");
          this.isLocked = true, this.previous && this.previous.lock();
        }, toString: function() {
          var e3 = "Worker " + this.name;
          return this.previous ? this.previous + " -> " + e3 : e3;
        } }, t3.exports = n3;
      }, {}], 29: [function(e2, t3, r2) {
        "use strict";
        var h3 = e2("../utils"), i3 = e2("./ConvertWorker"), s3 = e2("./GenericWorker"), u3 = e2("../base64"), n3 = e2("../support"), a3 = e2("../external"), o3 = null;
        if (n3.nodestream)
          try {
            o3 = e2("../nodejs/NodejsStreamOutputAdapter");
          } catch (e3) {
          }
        function l3(e3, o4) {
          return new a3.Promise(function(t4, r3) {
            var n4 = [], i4 = e3._internalType, s4 = e3._outputType, a4 = e3._mimeType;
            e3.on("data", function(e4, t5) {
              n4.push(e4), o4 && o4(t5);
            }).on("error", function(e4) {
              n4 = [], r3(e4);
            }).on("end", function() {
              try {
                var e4 = function(e5, t5, r4) {
                  switch (e5) {
                    case "blob":
                      return h3.newBlob(h3.transformTo("arraybuffer", t5), r4);
                    case "base64":
                      return u3.encode(t5);
                    default:
                      return h3.transformTo(e5, t5);
                  }
                }(s4, function(e5, t5) {
                  var r4, n5 = 0, i5 = null, s5 = 0;
                  for (r4 = 0; r4 < t5.length; r4++)
                    s5 += t5[r4].length;
                  switch (e5) {
                    case "string":
                      return t5.join("");
                    case "array":
                      return Array.prototype.concat.apply([], t5);
                    case "uint8array":
                      for (i5 = new Uint8Array(s5), r4 = 0; r4 < t5.length; r4++)
                        i5.set(t5[r4], n5), n5 += t5[r4].length;
                      return i5;
                    case "nodebuffer":
                      return Buffer.concat(t5);
                    default:
                      throw new Error("concat : unsupported type '" + e5 + "'");
                  }
                }(i4, n4), a4);
                t4(e4);
              } catch (e5) {
                r3(e5);
              }
              n4 = [];
            }).resume();
          });
        }
        function f3(e3, t4, r3) {
          var n4 = t4;
          switch (t4) {
            case "blob":
            case "arraybuffer":
              n4 = "uint8array";
              break;
            case "base64":
              n4 = "string";
          }
          try {
            this._internalType = n4, this._outputType = t4, this._mimeType = r3, h3.checkSupport(n4), this._worker = e3.pipe(new i3(n4)), e3.lock();
          } catch (e4) {
            this._worker = new s3("error"), this._worker.error(e4);
          }
        }
        f3.prototype = { accumulate: function(e3) {
          return l3(this, e3);
        }, on: function(e3, t4) {
          var r3 = this;
          return "data" === e3 ? this._worker.on(e3, function(e4) {
            t4.call(r3, e4.data, e4.meta);
          }) : this._worker.on(e3, function() {
            h3.delay(t4, arguments, r3);
          }), this;
        }, resume: function() {
          return h3.delay(this._worker.resume, [], this._worker), this;
        }, pause: function() {
          return this._worker.pause(), this;
        }, toNodejsStream: function(e3) {
          if (h3.checkSupport("nodestream"), "nodebuffer" !== this._outputType)
            throw new Error(this._outputType + " is not supported by this method");
          return new o3(this, { objectMode: "nodebuffer" !== this._outputType }, e3);
        } }, t3.exports = f3;
      }, { "../base64": 1, "../external": 6, "../nodejs/NodejsStreamOutputAdapter": 13, "../support": 30, "../utils": 32, "./ConvertWorker": 24, "./GenericWorker": 28 }], 30: [function(e2, t3, r2) {
        "use strict";
        if (r2.base64 = true, r2.array = true, r2.string = true, r2.arraybuffer = "undefined" != typeof ArrayBuffer && "undefined" != typeof Uint8Array, r2.nodebuffer = "undefined" != typeof Buffer, r2.uint8array = "undefined" != typeof Uint8Array, "undefined" == typeof ArrayBuffer)
          r2.blob = false;
        else {
          var n3 = new ArrayBuffer(0);
          try {
            r2.blob = 0 === new Blob([n3], { type: "application/zip" }).size;
          } catch (e3) {
            try {
              var i3 = new (self.BlobBuilder || self.WebKitBlobBuilder || self.MozBlobBuilder || self.MSBlobBuilder)();
              i3.append(n3), r2.blob = 0 === i3.getBlob("application/zip").size;
            } catch (e4) {
              r2.blob = false;
            }
          }
        }
        try {
          r2.nodestream = !!e2("readable-stream").Readable;
        } catch (e3) {
          r2.nodestream = false;
        }
      }, { "readable-stream": 16 }], 31: [function(e2, t3, s3) {
        "use strict";
        for (var o3 = e2("./utils"), h3 = e2("./support"), r2 = e2("./nodejsUtils"), n3 = e2("./stream/GenericWorker"), u3 = new Array(256), i3 = 0; i3 < 256; i3++)
          u3[i3] = 252 <= i3 ? 6 : 248 <= i3 ? 5 : 240 <= i3 ? 4 : 224 <= i3 ? 3 : 192 <= i3 ? 2 : 1;
        u3[254] = u3[254] = 1;
        function a3() {
          n3.call(this, "utf-8 decode"), this.leftOver = null;
        }
        function l3() {
          n3.call(this, "utf-8 encode");
        }
        s3.utf8encode = function(e3) {
          return h3.nodebuffer ? r2.newBufferFrom(e3, "utf-8") : function(e4) {
            var t4, r3, n4, i4, s4, a4 = e4.length, o4 = 0;
            for (i4 = 0; i4 < a4; i4++)
              55296 == (64512 & (r3 = e4.charCodeAt(i4))) && i4 + 1 < a4 && 56320 == (64512 & (n4 = e4.charCodeAt(i4 + 1))) && (r3 = 65536 + (r3 - 55296 << 10) + (n4 - 56320), i4++), o4 += r3 < 128 ? 1 : r3 < 2048 ? 2 : r3 < 65536 ? 3 : 4;
            for (t4 = h3.uint8array ? new Uint8Array(o4) : new Array(o4), i4 = s4 = 0; s4 < o4; i4++)
              55296 == (64512 & (r3 = e4.charCodeAt(i4))) && i4 + 1 < a4 && 56320 == (64512 & (n4 = e4.charCodeAt(i4 + 1))) && (r3 = 65536 + (r3 - 55296 << 10) + (n4 - 56320), i4++), r3 < 128 ? t4[s4++] = r3 : (r3 < 2048 ? t4[s4++] = 192 | r3 >>> 6 : (r3 < 65536 ? t4[s4++] = 224 | r3 >>> 12 : (t4[s4++] = 240 | r3 >>> 18, t4[s4++] = 128 | r3 >>> 12 & 63), t4[s4++] = 128 | r3 >>> 6 & 63), t4[s4++] = 128 | 63 & r3);
            return t4;
          }(e3);
        }, s3.utf8decode = function(e3) {
          return h3.nodebuffer ? o3.transformTo("nodebuffer", e3).toString("utf-8") : function(e4) {
            var t4, r3, n4, i4, s4 = e4.length, a4 = new Array(2 * s4);
            for (t4 = r3 = 0; t4 < s4; )
              if ((n4 = e4[t4++]) < 128)
                a4[r3++] = n4;
              else if (4 < (i4 = u3[n4]))
                a4[r3++] = 65533, t4 += i4 - 1;
              else {
                for (n4 &= 2 === i4 ? 31 : 3 === i4 ? 15 : 7; 1 < i4 && t4 < s4; )
                  n4 = n4 << 6 | 63 & e4[t4++], i4--;
                1 < i4 ? a4[r3++] = 65533 : n4 < 65536 ? a4[r3++] = n4 : (n4 -= 65536, a4[r3++] = 55296 | n4 >> 10 & 1023, a4[r3++] = 56320 | 1023 & n4);
              }
            return a4.length !== r3 && (a4.subarray ? a4 = a4.subarray(0, r3) : a4.length = r3), o3.applyFromCharCode(a4);
          }(e3 = o3.transformTo(h3.uint8array ? "uint8array" : "array", e3));
        }, o3.inherits(a3, n3), a3.prototype.processChunk = function(e3) {
          var t4 = o3.transformTo(h3.uint8array ? "uint8array" : "array", e3.data);
          if (this.leftOver && this.leftOver.length) {
            if (h3.uint8array) {
              var r3 = t4;
              (t4 = new Uint8Array(r3.length + this.leftOver.length)).set(this.leftOver, 0), t4.set(r3, this.leftOver.length);
            } else
              t4 = this.leftOver.concat(t4);
            this.leftOver = null;
          }
          var n4 = function(e4, t5) {
            var r4;
            for ((t5 = t5 || e4.length) > e4.length && (t5 = e4.length), r4 = t5 - 1; 0 <= r4 && 128 == (192 & e4[r4]); )
              r4--;
            return r4 < 0 ? t5 : 0 === r4 ? t5 : r4 + u3[e4[r4]] > t5 ? r4 : t5;
          }(t4), i4 = t4;
          n4 !== t4.length && (h3.uint8array ? (i4 = t4.subarray(0, n4), this.leftOver = t4.subarray(n4, t4.length)) : (i4 = t4.slice(0, n4), this.leftOver = t4.slice(n4, t4.length))), this.push({ data: s3.utf8decode(i4), meta: e3.meta });
        }, a3.prototype.flush = function() {
          this.leftOver && this.leftOver.length && (this.push({ data: s3.utf8decode(this.leftOver), meta: {} }), this.leftOver = null);
        }, s3.Utf8DecodeWorker = a3, o3.inherits(l3, n3), l3.prototype.processChunk = function(e3) {
          this.push({ data: s3.utf8encode(e3.data), meta: e3.meta });
        }, s3.Utf8EncodeWorker = l3;
      }, { "./nodejsUtils": 14, "./stream/GenericWorker": 28, "./support": 30, "./utils": 32 }], 32: [function(e2, t3, a3) {
        "use strict";
        var o3 = e2("./support"), h3 = e2("./base64"), r2 = e2("./nodejsUtils"), u3 = e2("./external");
        function n3(e3) {
          return e3;
        }
        function l3(e3, t4) {
          for (var r3 = 0; r3 < e3.length; ++r3)
            t4[r3] = 255 & e3.charCodeAt(r3);
          return t4;
        }
        e2("setimmediate"), a3.newBlob = function(t4, r3) {
          a3.checkSupport("blob");
          try {
            return new Blob([t4], { type: r3 });
          } catch (e3) {
            try {
              var n4 = new (self.BlobBuilder || self.WebKitBlobBuilder || self.MozBlobBuilder || self.MSBlobBuilder)();
              return n4.append(t4), n4.getBlob(r3);
            } catch (e4) {
              throw new Error("Bug : can't construct the Blob.");
            }
          }
        };
        var i3 = { stringifyByChunk: function(e3, t4, r3) {
          var n4 = [], i4 = 0, s4 = e3.length;
          if (s4 <= r3)
            return String.fromCharCode.apply(null, e3);
          for (; i4 < s4; )
            "array" === t4 || "nodebuffer" === t4 ? n4.push(String.fromCharCode.apply(null, e3.slice(i4, Math.min(i4 + r3, s4)))) : n4.push(String.fromCharCode.apply(null, e3.subarray(i4, Math.min(i4 + r3, s4)))), i4 += r3;
          return n4.join("");
        }, stringifyByChar: function(e3) {
          for (var t4 = "", r3 = 0; r3 < e3.length; r3++)
            t4 += String.fromCharCode(e3[r3]);
          return t4;
        }, applyCanBeUsed: { uint8array: function() {
          try {
            return o3.uint8array && 1 === String.fromCharCode.apply(null, new Uint8Array(1)).length;
          } catch (e3) {
            return false;
          }
        }(), nodebuffer: function() {
          try {
            return o3.nodebuffer && 1 === String.fromCharCode.apply(null, r2.allocBuffer(1)).length;
          } catch (e3) {
            return false;
          }
        }() } };
        function s3(e3) {
          var t4 = 65536, r3 = a3.getTypeOf(e3), n4 = true;
          if ("uint8array" === r3 ? n4 = i3.applyCanBeUsed.uint8array : "nodebuffer" === r3 && (n4 = i3.applyCanBeUsed.nodebuffer), n4)
            for (; 1 < t4; )
              try {
                return i3.stringifyByChunk(e3, r3, t4);
              } catch (e4) {
                t4 = Math.floor(t4 / 2);
              }
          return i3.stringifyByChar(e3);
        }
        function f3(e3, t4) {
          for (var r3 = 0; r3 < e3.length; r3++)
            t4[r3] = e3[r3];
          return t4;
        }
        a3.applyFromCharCode = s3;
        var c4 = {};
        c4.string = { string: n3, array: function(e3) {
          return l3(e3, new Array(e3.length));
        }, arraybuffer: function(e3) {
          return c4.string.uint8array(e3).buffer;
        }, uint8array: function(e3) {
          return l3(e3, new Uint8Array(e3.length));
        }, nodebuffer: function(e3) {
          return l3(e3, r2.allocBuffer(e3.length));
        } }, c4.array = { string: s3, array: n3, arraybuffer: function(e3) {
          return new Uint8Array(e3).buffer;
        }, uint8array: function(e3) {
          return new Uint8Array(e3);
        }, nodebuffer: function(e3) {
          return r2.newBufferFrom(e3);
        } }, c4.arraybuffer = { string: function(e3) {
          return s3(new Uint8Array(e3));
        }, array: function(e3) {
          return f3(new Uint8Array(e3), new Array(e3.byteLength));
        }, arraybuffer: n3, uint8array: function(e3) {
          return new Uint8Array(e3);
        }, nodebuffer: function(e3) {
          return r2.newBufferFrom(new Uint8Array(e3));
        } }, c4.uint8array = { string: s3, array: function(e3) {
          return f3(e3, new Array(e3.length));
        }, arraybuffer: function(e3) {
          return e3.buffer;
        }, uint8array: n3, nodebuffer: function(e3) {
          return r2.newBufferFrom(e3);
        } }, c4.nodebuffer = { string: s3, array: function(e3) {
          return f3(e3, new Array(e3.length));
        }, arraybuffer: function(e3) {
          return c4.nodebuffer.uint8array(e3).buffer;
        }, uint8array: function(e3) {
          return f3(e3, new Uint8Array(e3.length));
        }, nodebuffer: n3 }, a3.transformTo = function(e3, t4) {
          if (t4 = t4 || "", !e3)
            return t4;
          a3.checkSupport(e3);
          var r3 = a3.getTypeOf(t4);
          return c4[r3][e3](t4);
        }, a3.resolve = function(e3) {
          for (var t4 = e3.split("/"), r3 = [], n4 = 0; n4 < t4.length; n4++) {
            var i4 = t4[n4];
            "." === i4 || "" === i4 && 0 !== n4 && n4 !== t4.length - 1 || (".." === i4 ? r3.pop() : r3.push(i4));
          }
          return r3.join("/");
        }, a3.getTypeOf = function(e3) {
          return "string" == typeof e3 ? "string" : "[object Array]" === Object.prototype.toString.call(e3) ? "array" : o3.nodebuffer && r2.isBuffer(e3) ? "nodebuffer" : o3.uint8array && e3 instanceof Uint8Array ? "uint8array" : o3.arraybuffer && e3 instanceof ArrayBuffer ? "arraybuffer" : void 0;
        }, a3.checkSupport = function(e3) {
          if (!o3[e3.toLowerCase()])
            throw new Error(e3 + " is not supported by this platform");
        }, a3.MAX_VALUE_16BITS = 65535, a3.MAX_VALUE_32BITS = -1, a3.pretty = function(e3) {
          var t4, r3, n4 = "";
          for (r3 = 0; r3 < (e3 || "").length; r3++)
            n4 += "\\x" + ((t4 = e3.charCodeAt(r3)) < 16 ? "0" : "") + t4.toString(16).toUpperCase();
          return n4;
        }, a3.delay = function(e3, t4, r3) {
          setImmediate(function() {
            e3.apply(r3 || null, t4 || []);
          });
        }, a3.inherits = function(e3, t4) {
          function r3() {
          }
          r3.prototype = t4.prototype, e3.prototype = new r3();
        }, a3.extend = function() {
          var e3, t4, r3 = {};
          for (e3 = 0; e3 < arguments.length; e3++)
            for (t4 in arguments[e3])
              Object.prototype.hasOwnProperty.call(arguments[e3], t4) && void 0 === r3[t4] && (r3[t4] = arguments[e3][t4]);
          return r3;
        }, a3.prepareContent = function(r3, e3, n4, i4, s4) {
          return u3.Promise.resolve(e3).then(function(n5) {
            return o3.blob && (n5 instanceof Blob || -1 !== ["[object File]", "[object Blob]"].indexOf(Object.prototype.toString.call(n5))) && "undefined" != typeof FileReader ? new u3.Promise(function(t4, r4) {
              var e4 = new FileReader();
              e4.onload = function(e5) {
                t4(e5.target.result);
              }, e4.onerror = function(e5) {
                r4(e5.target.error);
              }, e4.readAsArrayBuffer(n5);
            }) : n5;
          }).then(function(e4) {
            var t4 = a3.getTypeOf(e4);
            return t4 ? ("arraybuffer" === t4 ? e4 = a3.transformTo("uint8array", e4) : "string" === t4 && (s4 ? e4 = h3.decode(e4) : n4 && true !== i4 && (e4 = function(e5) {
              return l3(e5, o3.uint8array ? new Uint8Array(e5.length) : new Array(e5.length));
            }(e4))), e4) : u3.Promise.reject(new Error("Can't read the data of '" + r3 + "'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"));
          });
        };
      }, { "./base64": 1, "./external": 6, "./nodejsUtils": 14, "./support": 30, setimmediate: 54 }], 33: [function(e2, t3, r2) {
        "use strict";
        var n3 = e2("./reader/readerFor"), i3 = e2("./utils"), s3 = e2("./signature"), a3 = e2("./zipEntry"), o3 = e2("./support");
        function h3(e3) {
          this.files = [], this.loadOptions = e3;
        }
        h3.prototype = { checkSignature: function(e3) {
          if (!this.reader.readAndCheckSignature(e3)) {
            this.reader.index -= 4;
            var t4 = this.reader.readString(4);
            throw new Error("Corrupted zip or bug: unexpected signature (" + i3.pretty(t4) + ", expected " + i3.pretty(e3) + ")");
          }
        }, isSignature: function(e3, t4) {
          var r3 = this.reader.index;
          this.reader.setIndex(e3);
          var n4 = this.reader.readString(4) === t4;
          return this.reader.setIndex(r3), n4;
        }, readBlockEndOfCentral: function() {
          this.diskNumber = this.reader.readInt(2), this.diskWithCentralDirStart = this.reader.readInt(2), this.centralDirRecordsOnThisDisk = this.reader.readInt(2), this.centralDirRecords = this.reader.readInt(2), this.centralDirSize = this.reader.readInt(4), this.centralDirOffset = this.reader.readInt(4), this.zipCommentLength = this.reader.readInt(2);
          var e3 = this.reader.readData(this.zipCommentLength), t4 = o3.uint8array ? "uint8array" : "array", r3 = i3.transformTo(t4, e3);
          this.zipComment = this.loadOptions.decodeFileName(r3);
        }, readBlockZip64EndOfCentral: function() {
          this.zip64EndOfCentralSize = this.reader.readInt(8), this.reader.skip(4), this.diskNumber = this.reader.readInt(4), this.diskWithCentralDirStart = this.reader.readInt(4), this.centralDirRecordsOnThisDisk = this.reader.readInt(8), this.centralDirRecords = this.reader.readInt(8), this.centralDirSize = this.reader.readInt(8), this.centralDirOffset = this.reader.readInt(8), this.zip64ExtensibleData = {};
          for (var e3, t4, r3, n4 = this.zip64EndOfCentralSize - 44; 0 < n4; )
            e3 = this.reader.readInt(2), t4 = this.reader.readInt(4), r3 = this.reader.readData(t4), this.zip64ExtensibleData[e3] = { id: e3, length: t4, value: r3 };
        }, readBlockZip64EndOfCentralLocator: function() {
          if (this.diskWithZip64CentralDirStart = this.reader.readInt(4), this.relativeOffsetEndOfZip64CentralDir = this.reader.readInt(8), this.disksCount = this.reader.readInt(4), 1 < this.disksCount)
            throw new Error("Multi-volumes zip are not supported");
        }, readLocalFiles: function() {
          var e3, t4;
          for (e3 = 0; e3 < this.files.length; e3++)
            t4 = this.files[e3], this.reader.setIndex(t4.localHeaderOffset), this.checkSignature(s3.LOCAL_FILE_HEADER), t4.readLocalPart(this.reader), t4.handleUTF8(), t4.processAttributes();
        }, readCentralDir: function() {
          var e3;
          for (this.reader.setIndex(this.centralDirOffset); this.reader.readAndCheckSignature(s3.CENTRAL_FILE_HEADER); )
            (e3 = new a3({ zip64: this.zip64 }, this.loadOptions)).readCentralPart(this.reader), this.files.push(e3);
          if (this.centralDirRecords !== this.files.length && 0 !== this.centralDirRecords && 0 === this.files.length)
            throw new Error("Corrupted zip or bug: expected " + this.centralDirRecords + " records in central dir, got " + this.files.length);
        }, readEndOfCentral: function() {
          var e3 = this.reader.lastIndexOfSignature(s3.CENTRAL_DIRECTORY_END);
          if (e3 < 0)
            throw !this.isSignature(0, s3.LOCAL_FILE_HEADER) ? new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html") : new Error("Corrupted zip: can't find end of central directory");
          this.reader.setIndex(e3);
          var t4 = e3;
          if (this.checkSignature(s3.CENTRAL_DIRECTORY_END), this.readBlockEndOfCentral(), this.diskNumber === i3.MAX_VALUE_16BITS || this.diskWithCentralDirStart === i3.MAX_VALUE_16BITS || this.centralDirRecordsOnThisDisk === i3.MAX_VALUE_16BITS || this.centralDirRecords === i3.MAX_VALUE_16BITS || this.centralDirSize === i3.MAX_VALUE_32BITS || this.centralDirOffset === i3.MAX_VALUE_32BITS) {
            if (this.zip64 = true, (e3 = this.reader.lastIndexOfSignature(s3.ZIP64_CENTRAL_DIRECTORY_LOCATOR)) < 0)
              throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");
            if (this.reader.setIndex(e3), this.checkSignature(s3.ZIP64_CENTRAL_DIRECTORY_LOCATOR), this.readBlockZip64EndOfCentralLocator(), !this.isSignature(this.relativeOffsetEndOfZip64CentralDir, s3.ZIP64_CENTRAL_DIRECTORY_END) && (this.relativeOffsetEndOfZip64CentralDir = this.reader.lastIndexOfSignature(s3.ZIP64_CENTRAL_DIRECTORY_END), this.relativeOffsetEndOfZip64CentralDir < 0))
              throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");
            this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir), this.checkSignature(s3.ZIP64_CENTRAL_DIRECTORY_END), this.readBlockZip64EndOfCentral();
          }
          var r3 = this.centralDirOffset + this.centralDirSize;
          this.zip64 && (r3 += 20, r3 += 12 + this.zip64EndOfCentralSize);
          var n4 = t4 - r3;
          if (0 < n4)
            this.isSignature(t4, s3.CENTRAL_FILE_HEADER) || (this.reader.zero = n4);
          else if (n4 < 0)
            throw new Error("Corrupted zip: missing " + Math.abs(n4) + " bytes.");
        }, prepareReader: function(e3) {
          this.reader = n3(e3);
        }, load: function(e3) {
          this.prepareReader(e3), this.readEndOfCentral(), this.readCentralDir(), this.readLocalFiles();
        } }, t3.exports = h3;
      }, { "./reader/readerFor": 22, "./signature": 23, "./support": 30, "./utils": 32, "./zipEntry": 34 }], 34: [function(e2, t3, r2) {
        "use strict";
        var n3 = e2("./reader/readerFor"), s3 = e2("./utils"), i3 = e2("./compressedObject"), a3 = e2("./crc32"), o3 = e2("./utf8"), h3 = e2("./compressions"), u3 = e2("./support");
        function l3(e3, t4) {
          this.options = e3, this.loadOptions = t4;
        }
        l3.prototype = { isEncrypted: function() {
          return 1 == (1 & this.bitFlag);
        }, useUTF8: function() {
          return 2048 == (2048 & this.bitFlag);
        }, readLocalPart: function(e3) {
          var t4, r3;
          if (e3.skip(22), this.fileNameLength = e3.readInt(2), r3 = e3.readInt(2), this.fileName = e3.readData(this.fileNameLength), e3.skip(r3), -1 === this.compressedSize || -1 === this.uncompressedSize)
            throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");
          if (null === (t4 = function(e4) {
            for (var t5 in h3)
              if (Object.prototype.hasOwnProperty.call(h3, t5) && h3[t5].magic === e4)
                return h3[t5];
            return null;
          }(this.compressionMethod)))
            throw new Error("Corrupted zip : compression " + s3.pretty(this.compressionMethod) + " unknown (inner file : " + s3.transformTo("string", this.fileName) + ")");
          this.decompressed = new i3(this.compressedSize, this.uncompressedSize, this.crc32, t4, e3.readData(this.compressedSize));
        }, readCentralPart: function(e3) {
          this.versionMadeBy = e3.readInt(2), e3.skip(2), this.bitFlag = e3.readInt(2), this.compressionMethod = e3.readString(2), this.date = e3.readDate(), this.crc32 = e3.readInt(4), this.compressedSize = e3.readInt(4), this.uncompressedSize = e3.readInt(4);
          var t4 = e3.readInt(2);
          if (this.extraFieldsLength = e3.readInt(2), this.fileCommentLength = e3.readInt(2), this.diskNumberStart = e3.readInt(2), this.internalFileAttributes = e3.readInt(2), this.externalFileAttributes = e3.readInt(4), this.localHeaderOffset = e3.readInt(4), this.isEncrypted())
            throw new Error("Encrypted zip are not supported");
          e3.skip(t4), this.readExtraFields(e3), this.parseZIP64ExtraField(e3), this.fileComment = e3.readData(this.fileCommentLength);
        }, processAttributes: function() {
          this.unixPermissions = null, this.dosPermissions = null;
          var e3 = this.versionMadeBy >> 8;
          this.dir = !!(16 & this.externalFileAttributes), 0 == e3 && (this.dosPermissions = 63 & this.externalFileAttributes), 3 == e3 && (this.unixPermissions = this.externalFileAttributes >> 16 & 65535), this.dir || "/" !== this.fileNameStr.slice(-1) || (this.dir = true);
        }, parseZIP64ExtraField: function() {
          if (this.extraFields[1]) {
            var e3 = n3(this.extraFields[1].value);
            this.uncompressedSize === s3.MAX_VALUE_32BITS && (this.uncompressedSize = e3.readInt(8)), this.compressedSize === s3.MAX_VALUE_32BITS && (this.compressedSize = e3.readInt(8)), this.localHeaderOffset === s3.MAX_VALUE_32BITS && (this.localHeaderOffset = e3.readInt(8)), this.diskNumberStart === s3.MAX_VALUE_32BITS && (this.diskNumberStart = e3.readInt(4));
          }
        }, readExtraFields: function(e3) {
          var t4, r3, n4, i4 = e3.index + this.extraFieldsLength;
          for (this.extraFields || (this.extraFields = {}); e3.index + 4 < i4; )
            t4 = e3.readInt(2), r3 = e3.readInt(2), n4 = e3.readData(r3), this.extraFields[t4] = { id: t4, length: r3, value: n4 };
          e3.setIndex(i4);
        }, handleUTF8: function() {
          var e3 = u3.uint8array ? "uint8array" : "array";
          if (this.useUTF8())
            this.fileNameStr = o3.utf8decode(this.fileName), this.fileCommentStr = o3.utf8decode(this.fileComment);
          else {
            var t4 = this.findExtraFieldUnicodePath();
            if (null !== t4)
              this.fileNameStr = t4;
            else {
              var r3 = s3.transformTo(e3, this.fileName);
              this.fileNameStr = this.loadOptions.decodeFileName(r3);
            }
            var n4 = this.findExtraFieldUnicodeComment();
            if (null !== n4)
              this.fileCommentStr = n4;
            else {
              var i4 = s3.transformTo(e3, this.fileComment);
              this.fileCommentStr = this.loadOptions.decodeFileName(i4);
            }
          }
        }, findExtraFieldUnicodePath: function() {
          var e3 = this.extraFields[28789];
          if (e3) {
            var t4 = n3(e3.value);
            return 1 !== t4.readInt(1) ? null : a3(this.fileName) !== t4.readInt(4) ? null : o3.utf8decode(t4.readData(e3.length - 5));
          }
          return null;
        }, findExtraFieldUnicodeComment: function() {
          var e3 = this.extraFields[25461];
          if (e3) {
            var t4 = n3(e3.value);
            return 1 !== t4.readInt(1) ? null : a3(this.fileComment) !== t4.readInt(4) ? null : o3.utf8decode(t4.readData(e3.length - 5));
          }
          return null;
        } }, t3.exports = l3;
      }, { "./compressedObject": 2, "./compressions": 3, "./crc32": 4, "./reader/readerFor": 22, "./support": 30, "./utf8": 31, "./utils": 32 }], 35: [function(e2, t3, r2) {
        "use strict";
        function n3(e3, t4, r3) {
          this.name = e3, this.dir = r3.dir, this.date = r3.date, this.comment = r3.comment, this.unixPermissions = r3.unixPermissions, this.dosPermissions = r3.dosPermissions, this._data = t4, this._dataBinary = r3.binary, this.options = { compression: r3.compression, compressionOptions: r3.compressionOptions };
        }
        var s3 = e2("./stream/StreamHelper"), i3 = e2("./stream/DataWorker"), a3 = e2("./utf8"), o3 = e2("./compressedObject"), h3 = e2("./stream/GenericWorker");
        n3.prototype = { internalStream: function(e3) {
          var t4 = null, r3 = "string";
          try {
            if (!e3)
              throw new Error("No output type specified.");
            var n4 = "string" === (r3 = e3.toLowerCase()) || "text" === r3;
            "binarystring" !== r3 && "text" !== r3 || (r3 = "string"), t4 = this._decompressWorker();
            var i4 = !this._dataBinary;
            i4 && !n4 && (t4 = t4.pipe(new a3.Utf8EncodeWorker())), !i4 && n4 && (t4 = t4.pipe(new a3.Utf8DecodeWorker()));
          } catch (e4) {
            (t4 = new h3("error")).error(e4);
          }
          return new s3(t4, r3, "");
        }, async: function(e3, t4) {
          return this.internalStream(e3).accumulate(t4);
        }, nodeStream: function(e3, t4) {
          return this.internalStream(e3 || "nodebuffer").toNodejsStream(t4);
        }, _compressWorker: function(e3, t4) {
          if (this._data instanceof o3 && this._data.compression.magic === e3.magic)
            return this._data.getCompressedWorker();
          var r3 = this._decompressWorker();
          return this._dataBinary || (r3 = r3.pipe(new a3.Utf8EncodeWorker())), o3.createWorkerFrom(r3, e3, t4);
        }, _decompressWorker: function() {
          return this._data instanceof o3 ? this._data.getContentWorker() : this._data instanceof h3 ? this._data : new i3(this._data);
        } };
        for (var u3 = ["asText", "asBinary", "asNodeBuffer", "asUint8Array", "asArrayBuffer"], l3 = function() {
          throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.");
        }, f3 = 0; f3 < u3.length; f3++)
          n3.prototype[u3[f3]] = l3;
        t3.exports = n3;
      }, { "./compressedObject": 2, "./stream/DataWorker": 27, "./stream/GenericWorker": 28, "./stream/StreamHelper": 29, "./utf8": 31 }], 36: [function(e2, l3, t3) {
        (function(t4) {
          "use strict";
          var r2, n3, e3 = t4.MutationObserver || t4.WebKitMutationObserver;
          if (e3) {
            var i3 = 0, s3 = new e3(u3), a3 = t4.document.createTextNode("");
            s3.observe(a3, { characterData: true }), r2 = function() {
              a3.data = i3 = ++i3 % 2;
            };
          } else if (t4.setImmediate || void 0 === t4.MessageChannel)
            r2 = "document" in t4 && "onreadystatechange" in t4.document.createElement("script") ? function() {
              var e4 = t4.document.createElement("script");
              e4.onreadystatechange = function() {
                u3(), e4.onreadystatechange = null, e4.parentNode.removeChild(e4), e4 = null;
              }, t4.document.documentElement.appendChild(e4);
            } : function() {
              setTimeout(u3, 0);
            };
          else {
            var o3 = new t4.MessageChannel();
            o3.port1.onmessage = u3, r2 = function() {
              o3.port2.postMessage(0);
            };
          }
          var h3 = [];
          function u3() {
            var e4, t5;
            n3 = true;
            for (var r3 = h3.length; r3; ) {
              for (t5 = h3, h3 = [], e4 = -1; ++e4 < r3; )
                t5[e4]();
              r3 = h3.length;
            }
            n3 = false;
          }
          l3.exports = function(e4) {
            1 !== h3.push(e4) || n3 || r2();
          };
        }).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {});
      }, {}], 37: [function(e2, t3, r2) {
        "use strict";
        var i3 = e2("immediate");
        function u3() {
        }
        var l3 = {}, s3 = ["REJECTED"], a3 = ["FULFILLED"], n3 = ["PENDING"];
        function o3(e3) {
          if ("function" != typeof e3)
            throw new TypeError("resolver must be a function");
          this.state = n3, this.queue = [], this.outcome = void 0, e3 !== u3 && d2(this, e3);
        }
        function h3(e3, t4, r3) {
          this.promise = e3, "function" == typeof t4 && (this.onFulfilled = t4, this.callFulfilled = this.otherCallFulfilled), "function" == typeof r3 && (this.onRejected = r3, this.callRejected = this.otherCallRejected);
        }
        function f3(t4, r3, n4) {
          i3(function() {
            var e3;
            try {
              e3 = r3(n4);
            } catch (e4) {
              return l3.reject(t4, e4);
            }
            e3 === t4 ? l3.reject(t4, new TypeError("Cannot resolve promise with itself")) : l3.resolve(t4, e3);
          });
        }
        function c4(e3) {
          var t4 = e3 && e3.then;
          if (e3 && ("object" == typeof e3 || "function" == typeof e3) && "function" == typeof t4)
            return function() {
              t4.apply(e3, arguments);
            };
        }
        function d2(t4, e3) {
          var r3 = false;
          function n4(e4) {
            r3 || (r3 = true, l3.reject(t4, e4));
          }
          function i4(e4) {
            r3 || (r3 = true, l3.resolve(t4, e4));
          }
          var s4 = p3(function() {
            e3(i4, n4);
          });
          "error" === s4.status && n4(s4.value);
        }
        function p3(e3, t4) {
          var r3 = {};
          try {
            r3.value = e3(t4), r3.status = "success";
          } catch (e4) {
            r3.status = "error", r3.value = e4;
          }
          return r3;
        }
        (t3.exports = o3).prototype.finally = function(t4) {
          if ("function" != typeof t4)
            return this;
          var r3 = this.constructor;
          return this.then(function(e3) {
            return r3.resolve(t4()).then(function() {
              return e3;
            });
          }, function(e3) {
            return r3.resolve(t4()).then(function() {
              throw e3;
            });
          });
        }, o3.prototype.catch = function(e3) {
          return this.then(null, e3);
        }, o3.prototype.then = function(e3, t4) {
          if ("function" != typeof e3 && this.state === a3 || "function" != typeof t4 && this.state === s3)
            return this;
          var r3 = new this.constructor(u3);
          this.state !== n3 ? f3(r3, this.state === a3 ? e3 : t4, this.outcome) : this.queue.push(new h3(r3, e3, t4));
          return r3;
        }, h3.prototype.callFulfilled = function(e3) {
          l3.resolve(this.promise, e3);
        }, h3.prototype.otherCallFulfilled = function(e3) {
          f3(this.promise, this.onFulfilled, e3);
        }, h3.prototype.callRejected = function(e3) {
          l3.reject(this.promise, e3);
        }, h3.prototype.otherCallRejected = function(e3) {
          f3(this.promise, this.onRejected, e3);
        }, l3.resolve = function(e3, t4) {
          var r3 = p3(c4, t4);
          if ("error" === r3.status)
            return l3.reject(e3, r3.value);
          var n4 = r3.value;
          if (n4)
            d2(e3, n4);
          else {
            e3.state = a3, e3.outcome = t4;
            for (var i4 = -1, s4 = e3.queue.length; ++i4 < s4; )
              e3.queue[i4].callFulfilled(t4);
          }
          return e3;
        }, l3.reject = function(e3, t4) {
          e3.state = s3, e3.outcome = t4;
          for (var r3 = -1, n4 = e3.queue.length; ++r3 < n4; )
            e3.queue[r3].callRejected(t4);
          return e3;
        }, o3.resolve = function(e3) {
          if (e3 instanceof this)
            return e3;
          return l3.resolve(new this(u3), e3);
        }, o3.reject = function(e3) {
          var t4 = new this(u3);
          return l3.reject(t4, e3);
        }, o3.all = function(e3) {
          var r3 = this;
          if ("[object Array]" !== Object.prototype.toString.call(e3))
            return this.reject(new TypeError("must be an array"));
          var n4 = e3.length, i4 = false;
          if (!n4)
            return this.resolve([]);
          var s4 = new Array(n4), a4 = 0, t4 = -1, o4 = new this(u3);
          for (; ++t4 < n4; )
            h4(e3[t4], t4);
          return o4;
          function h4(e4, t5) {
            r3.resolve(e4).then(function(e5) {
              s4[t5] = e5, ++a4 !== n4 || i4 || (i4 = true, l3.resolve(o4, s4));
            }, function(e5) {
              i4 || (i4 = true, l3.reject(o4, e5));
            });
          }
        }, o3.race = function(e3) {
          var t4 = this;
          if ("[object Array]" !== Object.prototype.toString.call(e3))
            return this.reject(new TypeError("must be an array"));
          var r3 = e3.length, n4 = false;
          if (!r3)
            return this.resolve([]);
          var i4 = -1, s4 = new this(u3);
          for (; ++i4 < r3; )
            a4 = e3[i4], t4.resolve(a4).then(function(e4) {
              n4 || (n4 = true, l3.resolve(s4, e4));
            }, function(e4) {
              n4 || (n4 = true, l3.reject(s4, e4));
            });
          var a4;
          return s4;
        };
      }, { immediate: 36 }], 38: [function(e2, t3, r2) {
        "use strict";
        var n3 = {};
        (0, e2("./lib/utils/common").assign)(n3, e2("./lib/deflate"), e2("./lib/inflate"), e2("./lib/zlib/constants")), t3.exports = n3;
      }, { "./lib/deflate": 39, "./lib/inflate": 40, "./lib/utils/common": 41, "./lib/zlib/constants": 44 }], 39: [function(e2, t3, r2) {
        "use strict";
        var a3 = e2("./zlib/deflate"), o3 = e2("./utils/common"), h3 = e2("./utils/strings"), i3 = e2("./zlib/messages"), s3 = e2("./zlib/zstream"), u3 = Object.prototype.toString, l3 = 0, f3 = -1, c4 = 0, d2 = 8;
        function p3(e3) {
          if (!(this instanceof p3))
            return new p3(e3);
          this.options = o3.assign({ level: f3, method: d2, chunkSize: 16384, windowBits: 15, memLevel: 8, strategy: c4, to: "" }, e3 || {});
          var t4 = this.options;
          t4.raw && 0 < t4.windowBits ? t4.windowBits = -t4.windowBits : t4.gzip && 0 < t4.windowBits && t4.windowBits < 16 && (t4.windowBits += 16), this.err = 0, this.msg = "", this.ended = false, this.chunks = [], this.strm = new s3(), this.strm.avail_out = 0;
          var r3 = a3.deflateInit2(this.strm, t4.level, t4.method, t4.windowBits, t4.memLevel, t4.strategy);
          if (r3 !== l3)
            throw new Error(i3[r3]);
          if (t4.header && a3.deflateSetHeader(this.strm, t4.header), t4.dictionary) {
            var n4;
            if (n4 = "string" == typeof t4.dictionary ? h3.string2buf(t4.dictionary) : "[object ArrayBuffer]" === u3.call(t4.dictionary) ? new Uint8Array(t4.dictionary) : t4.dictionary, (r3 = a3.deflateSetDictionary(this.strm, n4)) !== l3)
              throw new Error(i3[r3]);
            this._dict_set = true;
          }
        }
        function n3(e3, t4) {
          var r3 = new p3(t4);
          if (r3.push(e3, true), r3.err)
            throw r3.msg || i3[r3.err];
          return r3.result;
        }
        p3.prototype.push = function(e3, t4) {
          var r3, n4, i4 = this.strm, s4 = this.options.chunkSize;
          if (this.ended)
            return false;
          n4 = t4 === ~~t4 ? t4 : true === t4 ? 4 : 0, "string" == typeof e3 ? i4.input = h3.string2buf(e3) : "[object ArrayBuffer]" === u3.call(e3) ? i4.input = new Uint8Array(e3) : i4.input = e3, i4.next_in = 0, i4.avail_in = i4.input.length;
          do {
            if (0 === i4.avail_out && (i4.output = new o3.Buf8(s4), i4.next_out = 0, i4.avail_out = s4), 1 !== (r3 = a3.deflate(i4, n4)) && r3 !== l3)
              return this.onEnd(r3), !(this.ended = true);
            0 !== i4.avail_out && (0 !== i4.avail_in || 4 !== n4 && 2 !== n4) || ("string" === this.options.to ? this.onData(h3.buf2binstring(o3.shrinkBuf(i4.output, i4.next_out))) : this.onData(o3.shrinkBuf(i4.output, i4.next_out)));
          } while ((0 < i4.avail_in || 0 === i4.avail_out) && 1 !== r3);
          return 4 === n4 ? (r3 = a3.deflateEnd(this.strm), this.onEnd(r3), this.ended = true, r3 === l3) : 2 !== n4 || (this.onEnd(l3), !(i4.avail_out = 0));
        }, p3.prototype.onData = function(e3) {
          this.chunks.push(e3);
        }, p3.prototype.onEnd = function(e3) {
          e3 === l3 && ("string" === this.options.to ? this.result = this.chunks.join("") : this.result = o3.flattenChunks(this.chunks)), this.chunks = [], this.err = e3, this.msg = this.strm.msg;
        }, r2.Deflate = p3, r2.deflate = n3, r2.deflateRaw = function(e3, t4) {
          return (t4 = t4 || {}).raw = true, n3(e3, t4);
        }, r2.gzip = function(e3, t4) {
          return (t4 = t4 || {}).gzip = true, n3(e3, t4);
        };
      }, { "./utils/common": 41, "./utils/strings": 42, "./zlib/deflate": 46, "./zlib/messages": 51, "./zlib/zstream": 53 }], 40: [function(e2, t3, r2) {
        "use strict";
        var c4 = e2("./zlib/inflate"), d2 = e2("./utils/common"), p3 = e2("./utils/strings"), m4 = e2("./zlib/constants"), n3 = e2("./zlib/messages"), i3 = e2("./zlib/zstream"), s3 = e2("./zlib/gzheader"), _3 = Object.prototype.toString;
        function a3(e3) {
          if (!(this instanceof a3))
            return new a3(e3);
          this.options = d2.assign({ chunkSize: 16384, windowBits: 0, to: "" }, e3 || {});
          var t4 = this.options;
          t4.raw && 0 <= t4.windowBits && t4.windowBits < 16 && (t4.windowBits = -t4.windowBits, 0 === t4.windowBits && (t4.windowBits = -15)), !(0 <= t4.windowBits && t4.windowBits < 16) || e3 && e3.windowBits || (t4.windowBits += 32), 15 < t4.windowBits && t4.windowBits < 48 && 0 == (15 & t4.windowBits) && (t4.windowBits |= 15), this.err = 0, this.msg = "", this.ended = false, this.chunks = [], this.strm = new i3(), this.strm.avail_out = 0;
          var r3 = c4.inflateInit2(this.strm, t4.windowBits);
          if (r3 !== m4.Z_OK)
            throw new Error(n3[r3]);
          this.header = new s3(), c4.inflateGetHeader(this.strm, this.header);
        }
        function o3(e3, t4) {
          var r3 = new a3(t4);
          if (r3.push(e3, true), r3.err)
            throw r3.msg || n3[r3.err];
          return r3.result;
        }
        a3.prototype.push = function(e3, t4) {
          var r3, n4, i4, s4, a4, o4, h3 = this.strm, u3 = this.options.chunkSize, l3 = this.options.dictionary, f3 = false;
          if (this.ended)
            return false;
          n4 = t4 === ~~t4 ? t4 : true === t4 ? m4.Z_FINISH : m4.Z_NO_FLUSH, "string" == typeof e3 ? h3.input = p3.binstring2buf(e3) : "[object ArrayBuffer]" === _3.call(e3) ? h3.input = new Uint8Array(e3) : h3.input = e3, h3.next_in = 0, h3.avail_in = h3.input.length;
          do {
            if (0 === h3.avail_out && (h3.output = new d2.Buf8(u3), h3.next_out = 0, h3.avail_out = u3), (r3 = c4.inflate(h3, m4.Z_NO_FLUSH)) === m4.Z_NEED_DICT && l3 && (o4 = "string" == typeof l3 ? p3.string2buf(l3) : "[object ArrayBuffer]" === _3.call(l3) ? new Uint8Array(l3) : l3, r3 = c4.inflateSetDictionary(this.strm, o4)), r3 === m4.Z_BUF_ERROR && true === f3 && (r3 = m4.Z_OK, f3 = false), r3 !== m4.Z_STREAM_END && r3 !== m4.Z_OK)
              return this.onEnd(r3), !(this.ended = true);
            h3.next_out && (0 !== h3.avail_out && r3 !== m4.Z_STREAM_END && (0 !== h3.avail_in || n4 !== m4.Z_FINISH && n4 !== m4.Z_SYNC_FLUSH) || ("string" === this.options.to ? (i4 = p3.utf8border(h3.output, h3.next_out), s4 = h3.next_out - i4, a4 = p3.buf2string(h3.output, i4), h3.next_out = s4, h3.avail_out = u3 - s4, s4 && d2.arraySet(h3.output, h3.output, i4, s4, 0), this.onData(a4)) : this.onData(d2.shrinkBuf(h3.output, h3.next_out)))), 0 === h3.avail_in && 0 === h3.avail_out && (f3 = true);
          } while ((0 < h3.avail_in || 0 === h3.avail_out) && r3 !== m4.Z_STREAM_END);
          return r3 === m4.Z_STREAM_END && (n4 = m4.Z_FINISH), n4 === m4.Z_FINISH ? (r3 = c4.inflateEnd(this.strm), this.onEnd(r3), this.ended = true, r3 === m4.Z_OK) : n4 !== m4.Z_SYNC_FLUSH || (this.onEnd(m4.Z_OK), !(h3.avail_out = 0));
        }, a3.prototype.onData = function(e3) {
          this.chunks.push(e3);
        }, a3.prototype.onEnd = function(e3) {
          e3 === m4.Z_OK && ("string" === this.options.to ? this.result = this.chunks.join("") : this.result = d2.flattenChunks(this.chunks)), this.chunks = [], this.err = e3, this.msg = this.strm.msg;
        }, r2.Inflate = a3, r2.inflate = o3, r2.inflateRaw = function(e3, t4) {
          return (t4 = t4 || {}).raw = true, o3(e3, t4);
        }, r2.ungzip = o3;
      }, { "./utils/common": 41, "./utils/strings": 42, "./zlib/constants": 44, "./zlib/gzheader": 47, "./zlib/inflate": 49, "./zlib/messages": 51, "./zlib/zstream": 53 }], 41: [function(e2, t3, r2) {
        "use strict";
        var n3 = "undefined" != typeof Uint8Array && "undefined" != typeof Uint16Array && "undefined" != typeof Int32Array;
        r2.assign = function(e3) {
          for (var t4 = Array.prototype.slice.call(arguments, 1); t4.length; ) {
            var r3 = t4.shift();
            if (r3) {
              if ("object" != typeof r3)
                throw new TypeError(r3 + "must be non-object");
              for (var n4 in r3)
                r3.hasOwnProperty(n4) && (e3[n4] = r3[n4]);
            }
          }
          return e3;
        }, r2.shrinkBuf = function(e3, t4) {
          return e3.length === t4 ? e3 : e3.subarray ? e3.subarray(0, t4) : (e3.length = t4, e3);
        };
        var i3 = { arraySet: function(e3, t4, r3, n4, i4) {
          if (t4.subarray && e3.subarray)
            e3.set(t4.subarray(r3, r3 + n4), i4);
          else
            for (var s4 = 0; s4 < n4; s4++)
              e3[i4 + s4] = t4[r3 + s4];
        }, flattenChunks: function(e3) {
          var t4, r3, n4, i4, s4, a3;
          for (t4 = n4 = 0, r3 = e3.length; t4 < r3; t4++)
            n4 += e3[t4].length;
          for (a3 = new Uint8Array(n4), t4 = i4 = 0, r3 = e3.length; t4 < r3; t4++)
            s4 = e3[t4], a3.set(s4, i4), i4 += s4.length;
          return a3;
        } }, s3 = { arraySet: function(e3, t4, r3, n4, i4) {
          for (var s4 = 0; s4 < n4; s4++)
            e3[i4 + s4] = t4[r3 + s4];
        }, flattenChunks: function(e3) {
          return [].concat.apply([], e3);
        } };
        r2.setTyped = function(e3) {
          e3 ? (r2.Buf8 = Uint8Array, r2.Buf16 = Uint16Array, r2.Buf32 = Int32Array, r2.assign(r2, i3)) : (r2.Buf8 = Array, r2.Buf16 = Array, r2.Buf32 = Array, r2.assign(r2, s3));
        }, r2.setTyped(n3);
      }, {}], 42: [function(e2, t3, r2) {
        "use strict";
        var h3 = e2("./common"), i3 = true, s3 = true;
        try {
          String.fromCharCode.apply(null, [0]);
        } catch (e3) {
          i3 = false;
        }
        try {
          String.fromCharCode.apply(null, new Uint8Array(1));
        } catch (e3) {
          s3 = false;
        }
        for (var u3 = new h3.Buf8(256), n3 = 0; n3 < 256; n3++)
          u3[n3] = 252 <= n3 ? 6 : 248 <= n3 ? 5 : 240 <= n3 ? 4 : 224 <= n3 ? 3 : 192 <= n3 ? 2 : 1;
        function l3(e3, t4) {
          if (t4 < 65537 && (e3.subarray && s3 || !e3.subarray && i3))
            return String.fromCharCode.apply(null, h3.shrinkBuf(e3, t4));
          for (var r3 = "", n4 = 0; n4 < t4; n4++)
            r3 += String.fromCharCode(e3[n4]);
          return r3;
        }
        u3[254] = u3[254] = 1, r2.string2buf = function(e3) {
          var t4, r3, n4, i4, s4, a3 = e3.length, o3 = 0;
          for (i4 = 0; i4 < a3; i4++)
            55296 == (64512 & (r3 = e3.charCodeAt(i4))) && i4 + 1 < a3 && 56320 == (64512 & (n4 = e3.charCodeAt(i4 + 1))) && (r3 = 65536 + (r3 - 55296 << 10) + (n4 - 56320), i4++), o3 += r3 < 128 ? 1 : r3 < 2048 ? 2 : r3 < 65536 ? 3 : 4;
          for (t4 = new h3.Buf8(o3), i4 = s4 = 0; s4 < o3; i4++)
            55296 == (64512 & (r3 = e3.charCodeAt(i4))) && i4 + 1 < a3 && 56320 == (64512 & (n4 = e3.charCodeAt(i4 + 1))) && (r3 = 65536 + (r3 - 55296 << 10) + (n4 - 56320), i4++), r3 < 128 ? t4[s4++] = r3 : (r3 < 2048 ? t4[s4++] = 192 | r3 >>> 6 : (r3 < 65536 ? t4[s4++] = 224 | r3 >>> 12 : (t4[s4++] = 240 | r3 >>> 18, t4[s4++] = 128 | r3 >>> 12 & 63), t4[s4++] = 128 | r3 >>> 6 & 63), t4[s4++] = 128 | 63 & r3);
          return t4;
        }, r2.buf2binstring = function(e3) {
          return l3(e3, e3.length);
        }, r2.binstring2buf = function(e3) {
          for (var t4 = new h3.Buf8(e3.length), r3 = 0, n4 = t4.length; r3 < n4; r3++)
            t4[r3] = e3.charCodeAt(r3);
          return t4;
        }, r2.buf2string = function(e3, t4) {
          var r3, n4, i4, s4, a3 = t4 || e3.length, o3 = new Array(2 * a3);
          for (r3 = n4 = 0; r3 < a3; )
            if ((i4 = e3[r3++]) < 128)
              o3[n4++] = i4;
            else if (4 < (s4 = u3[i4]))
              o3[n4++] = 65533, r3 += s4 - 1;
            else {
              for (i4 &= 2 === s4 ? 31 : 3 === s4 ? 15 : 7; 1 < s4 && r3 < a3; )
                i4 = i4 << 6 | 63 & e3[r3++], s4--;
              1 < s4 ? o3[n4++] = 65533 : i4 < 65536 ? o3[n4++] = i4 : (i4 -= 65536, o3[n4++] = 55296 | i4 >> 10 & 1023, o3[n4++] = 56320 | 1023 & i4);
            }
          return l3(o3, n4);
        }, r2.utf8border = function(e3, t4) {
          var r3;
          for ((t4 = t4 || e3.length) > e3.length && (t4 = e3.length), r3 = t4 - 1; 0 <= r3 && 128 == (192 & e3[r3]); )
            r3--;
          return r3 < 0 ? t4 : 0 === r3 ? t4 : r3 + u3[e3[r3]] > t4 ? r3 : t4;
        };
      }, { "./common": 41 }], 43: [function(e2, t3, r2) {
        "use strict";
        t3.exports = function(e3, t4, r3, n3) {
          for (var i3 = 65535 & e3 | 0, s3 = e3 >>> 16 & 65535 | 0, a3 = 0; 0 !== r3; ) {
            for (r3 -= a3 = 2e3 < r3 ? 2e3 : r3; s3 = s3 + (i3 = i3 + t4[n3++] | 0) | 0, --a3; )
              ;
            i3 %= 65521, s3 %= 65521;
          }
          return i3 | s3 << 16 | 0;
        };
      }, {}], 44: [function(e2, t3, r2) {
        "use strict";
        t3.exports = { Z_NO_FLUSH: 0, Z_PARTIAL_FLUSH: 1, Z_SYNC_FLUSH: 2, Z_FULL_FLUSH: 3, Z_FINISH: 4, Z_BLOCK: 5, Z_TREES: 6, Z_OK: 0, Z_STREAM_END: 1, Z_NEED_DICT: 2, Z_ERRNO: -1, Z_STREAM_ERROR: -2, Z_DATA_ERROR: -3, Z_BUF_ERROR: -5, Z_NO_COMPRESSION: 0, Z_BEST_SPEED: 1, Z_BEST_COMPRESSION: 9, Z_DEFAULT_COMPRESSION: -1, Z_FILTERED: 1, Z_HUFFMAN_ONLY: 2, Z_RLE: 3, Z_FIXED: 4, Z_DEFAULT_STRATEGY: 0, Z_BINARY: 0, Z_TEXT: 1, Z_UNKNOWN: 2, Z_DEFLATED: 8 };
      }, {}], 45: [function(e2, t3, r2) {
        "use strict";
        var o3 = function() {
          for (var e3, t4 = [], r3 = 0; r3 < 256; r3++) {
            e3 = r3;
            for (var n3 = 0; n3 < 8; n3++)
              e3 = 1 & e3 ? 3988292384 ^ e3 >>> 1 : e3 >>> 1;
            t4[r3] = e3;
          }
          return t4;
        }();
        t3.exports = function(e3, t4, r3, n3) {
          var i3 = o3, s3 = n3 + r3;
          e3 ^= -1;
          for (var a3 = n3; a3 < s3; a3++)
            e3 = e3 >>> 8 ^ i3[255 & (e3 ^ t4[a3])];
          return -1 ^ e3;
        };
      }, {}], 46: [function(e2, t3, r2) {
        "use strict";
        var h3, c4 = e2("../utils/common"), u3 = e2("./trees"), d2 = e2("./adler32"), p3 = e2("./crc32"), n3 = e2("./messages"), l3 = 0, f3 = 4, m4 = 0, _3 = -2, g2 = -1, b2 = 4, i3 = 2, v3 = 8, y4 = 9, s3 = 286, a3 = 30, o3 = 19, w2 = 2 * s3 + 1, k2 = 15, x3 = 3, S2 = 258, z2 = S2 + x3 + 1, C2 = 42, E2 = 113, A3 = 1, I2 = 2, O3 = 3, B2 = 4;
        function R2(e3, t4) {
          return e3.msg = n3[t4], t4;
        }
        function T3(e3) {
          return (e3 << 1) - (4 < e3 ? 9 : 0);
        }
        function D2(e3) {
          for (var t4 = e3.length; 0 <= --t4; )
            e3[t4] = 0;
        }
        function F2(e3) {
          var t4 = e3.state, r3 = t4.pending;
          r3 > e3.avail_out && (r3 = e3.avail_out), 0 !== r3 && (c4.arraySet(e3.output, t4.pending_buf, t4.pending_out, r3, e3.next_out), e3.next_out += r3, t4.pending_out += r3, e3.total_out += r3, e3.avail_out -= r3, t4.pending -= r3, 0 === t4.pending && (t4.pending_out = 0));
        }
        function N3(e3, t4) {
          u3._tr_flush_block(e3, 0 <= e3.block_start ? e3.block_start : -1, e3.strstart - e3.block_start, t4), e3.block_start = e3.strstart, F2(e3.strm);
        }
        function U2(e3, t4) {
          e3.pending_buf[e3.pending++] = t4;
        }
        function P2(e3, t4) {
          e3.pending_buf[e3.pending++] = t4 >>> 8 & 255, e3.pending_buf[e3.pending++] = 255 & t4;
        }
        function L2(e3, t4) {
          var r3, n4, i4 = e3.max_chain_length, s4 = e3.strstart, a4 = e3.prev_length, o4 = e3.nice_match, h4 = e3.strstart > e3.w_size - z2 ? e3.strstart - (e3.w_size - z2) : 0, u4 = e3.window, l4 = e3.w_mask, f4 = e3.prev, c5 = e3.strstart + S2, d3 = u4[s4 + a4 - 1], p4 = u4[s4 + a4];
          e3.prev_length >= e3.good_match && (i4 >>= 2), o4 > e3.lookahead && (o4 = e3.lookahead);
          do {
            if (u4[(r3 = t4) + a4] === p4 && u4[r3 + a4 - 1] === d3 && u4[r3] === u4[s4] && u4[++r3] === u4[s4 + 1]) {
              s4 += 2, r3++;
              do {
              } while (u4[++s4] === u4[++r3] && u4[++s4] === u4[++r3] && u4[++s4] === u4[++r3] && u4[++s4] === u4[++r3] && u4[++s4] === u4[++r3] && u4[++s4] === u4[++r3] && u4[++s4] === u4[++r3] && u4[++s4] === u4[++r3] && s4 < c5);
              if (n4 = S2 - (c5 - s4), s4 = c5 - S2, a4 < n4) {
                if (e3.match_start = t4, o4 <= (a4 = n4))
                  break;
                d3 = u4[s4 + a4 - 1], p4 = u4[s4 + a4];
              }
            }
          } while ((t4 = f4[t4 & l4]) > h4 && 0 != --i4);
          return a4 <= e3.lookahead ? a4 : e3.lookahead;
        }
        function j2(e3) {
          var t4, r3, n4, i4, s4, a4, o4, h4, u4, l4, f4 = e3.w_size;
          do {
            if (i4 = e3.window_size - e3.lookahead - e3.strstart, e3.strstart >= f4 + (f4 - z2)) {
              for (c4.arraySet(e3.window, e3.window, f4, f4, 0), e3.match_start -= f4, e3.strstart -= f4, e3.block_start -= f4, t4 = r3 = e3.hash_size; n4 = e3.head[--t4], e3.head[t4] = f4 <= n4 ? n4 - f4 : 0, --r3; )
                ;
              for (t4 = r3 = f4; n4 = e3.prev[--t4], e3.prev[t4] = f4 <= n4 ? n4 - f4 : 0, --r3; )
                ;
              i4 += f4;
            }
            if (0 === e3.strm.avail_in)
              break;
            if (a4 = e3.strm, o4 = e3.window, h4 = e3.strstart + e3.lookahead, u4 = i4, l4 = void 0, l4 = a4.avail_in, u4 < l4 && (l4 = u4), r3 = 0 === l4 ? 0 : (a4.avail_in -= l4, c4.arraySet(o4, a4.input, a4.next_in, l4, h4), 1 === a4.state.wrap ? a4.adler = d2(a4.adler, o4, l4, h4) : 2 === a4.state.wrap && (a4.adler = p3(a4.adler, o4, l4, h4)), a4.next_in += l4, a4.total_in += l4, l4), e3.lookahead += r3, e3.lookahead + e3.insert >= x3)
              for (s4 = e3.strstart - e3.insert, e3.ins_h = e3.window[s4], e3.ins_h = (e3.ins_h << e3.hash_shift ^ e3.window[s4 + 1]) & e3.hash_mask; e3.insert && (e3.ins_h = (e3.ins_h << e3.hash_shift ^ e3.window[s4 + x3 - 1]) & e3.hash_mask, e3.prev[s4 & e3.w_mask] = e3.head[e3.ins_h], e3.head[e3.ins_h] = s4, s4++, e3.insert--, !(e3.lookahead + e3.insert < x3)); )
                ;
          } while (e3.lookahead < z2 && 0 !== e3.strm.avail_in);
        }
        function Z2(e3, t4) {
          for (var r3, n4; ; ) {
            if (e3.lookahead < z2) {
              if (j2(e3), e3.lookahead < z2 && t4 === l3)
                return A3;
              if (0 === e3.lookahead)
                break;
            }
            if (r3 = 0, e3.lookahead >= x3 && (e3.ins_h = (e3.ins_h << e3.hash_shift ^ e3.window[e3.strstart + x3 - 1]) & e3.hash_mask, r3 = e3.prev[e3.strstart & e3.w_mask] = e3.head[e3.ins_h], e3.head[e3.ins_h] = e3.strstart), 0 !== r3 && e3.strstart - r3 <= e3.w_size - z2 && (e3.match_length = L2(e3, r3)), e3.match_length >= x3)
              if (n4 = u3._tr_tally(e3, e3.strstart - e3.match_start, e3.match_length - x3), e3.lookahead -= e3.match_length, e3.match_length <= e3.max_lazy_match && e3.lookahead >= x3) {
                for (e3.match_length--; e3.strstart++, e3.ins_h = (e3.ins_h << e3.hash_shift ^ e3.window[e3.strstart + x3 - 1]) & e3.hash_mask, r3 = e3.prev[e3.strstart & e3.w_mask] = e3.head[e3.ins_h], e3.head[e3.ins_h] = e3.strstart, 0 != --e3.match_length; )
                  ;
                e3.strstart++;
              } else
                e3.strstart += e3.match_length, e3.match_length = 0, e3.ins_h = e3.window[e3.strstart], e3.ins_h = (e3.ins_h << e3.hash_shift ^ e3.window[e3.strstart + 1]) & e3.hash_mask;
            else
              n4 = u3._tr_tally(e3, 0, e3.window[e3.strstart]), e3.lookahead--, e3.strstart++;
            if (n4 && (N3(e3, false), 0 === e3.strm.avail_out))
              return A3;
          }
          return e3.insert = e3.strstart < x3 - 1 ? e3.strstart : x3 - 1, t4 === f3 ? (N3(e3, true), 0 === e3.strm.avail_out ? O3 : B2) : e3.last_lit && (N3(e3, false), 0 === e3.strm.avail_out) ? A3 : I2;
        }
        function W2(e3, t4) {
          for (var r3, n4, i4; ; ) {
            if (e3.lookahead < z2) {
              if (j2(e3), e3.lookahead < z2 && t4 === l3)
                return A3;
              if (0 === e3.lookahead)
                break;
            }
            if (r3 = 0, e3.lookahead >= x3 && (e3.ins_h = (e3.ins_h << e3.hash_shift ^ e3.window[e3.strstart + x3 - 1]) & e3.hash_mask, r3 = e3.prev[e3.strstart & e3.w_mask] = e3.head[e3.ins_h], e3.head[e3.ins_h] = e3.strstart), e3.prev_length = e3.match_length, e3.prev_match = e3.match_start, e3.match_length = x3 - 1, 0 !== r3 && e3.prev_length < e3.max_lazy_match && e3.strstart - r3 <= e3.w_size - z2 && (e3.match_length = L2(e3, r3), e3.match_length <= 5 && (1 === e3.strategy || e3.match_length === x3 && 4096 < e3.strstart - e3.match_start) && (e3.match_length = x3 - 1)), e3.prev_length >= x3 && e3.match_length <= e3.prev_length) {
              for (i4 = e3.strstart + e3.lookahead - x3, n4 = u3._tr_tally(e3, e3.strstart - 1 - e3.prev_match, e3.prev_length - x3), e3.lookahead -= e3.prev_length - 1, e3.prev_length -= 2; ++e3.strstart <= i4 && (e3.ins_h = (e3.ins_h << e3.hash_shift ^ e3.window[e3.strstart + x3 - 1]) & e3.hash_mask, r3 = e3.prev[e3.strstart & e3.w_mask] = e3.head[e3.ins_h], e3.head[e3.ins_h] = e3.strstart), 0 != --e3.prev_length; )
                ;
              if (e3.match_available = 0, e3.match_length = x3 - 1, e3.strstart++, n4 && (N3(e3, false), 0 === e3.strm.avail_out))
                return A3;
            } else if (e3.match_available) {
              if ((n4 = u3._tr_tally(e3, 0, e3.window[e3.strstart - 1])) && N3(e3, false), e3.strstart++, e3.lookahead--, 0 === e3.strm.avail_out)
                return A3;
            } else
              e3.match_available = 1, e3.strstart++, e3.lookahead--;
          }
          return e3.match_available && (n4 = u3._tr_tally(e3, 0, e3.window[e3.strstart - 1]), e3.match_available = 0), e3.insert = e3.strstart < x3 - 1 ? e3.strstart : x3 - 1, t4 === f3 ? (N3(e3, true), 0 === e3.strm.avail_out ? O3 : B2) : e3.last_lit && (N3(e3, false), 0 === e3.strm.avail_out) ? A3 : I2;
        }
        function M2(e3, t4, r3, n4, i4) {
          this.good_length = e3, this.max_lazy = t4, this.nice_length = r3, this.max_chain = n4, this.func = i4;
        }
        function H2() {
          this.strm = null, this.status = 0, this.pending_buf = null, this.pending_buf_size = 0, this.pending_out = 0, this.pending = 0, this.wrap = 0, this.gzhead = null, this.gzindex = 0, this.method = v3, this.last_flush = -1, this.w_size = 0, this.w_bits = 0, this.w_mask = 0, this.window = null, this.window_size = 0, this.prev = null, this.head = null, this.ins_h = 0, this.hash_size = 0, this.hash_bits = 0, this.hash_mask = 0, this.hash_shift = 0, this.block_start = 0, this.match_length = 0, this.prev_match = 0, this.match_available = 0, this.strstart = 0, this.match_start = 0, this.lookahead = 0, this.prev_length = 0, this.max_chain_length = 0, this.max_lazy_match = 0, this.level = 0, this.strategy = 0, this.good_match = 0, this.nice_match = 0, this.dyn_ltree = new c4.Buf16(2 * w2), this.dyn_dtree = new c4.Buf16(2 * (2 * a3 + 1)), this.bl_tree = new c4.Buf16(2 * (2 * o3 + 1)), D2(this.dyn_ltree), D2(this.dyn_dtree), D2(this.bl_tree), this.l_desc = null, this.d_desc = null, this.bl_desc = null, this.bl_count = new c4.Buf16(k2 + 1), this.heap = new c4.Buf16(2 * s3 + 1), D2(this.heap), this.heap_len = 0, this.heap_max = 0, this.depth = new c4.Buf16(2 * s3 + 1), D2(this.depth), this.l_buf = 0, this.lit_bufsize = 0, this.last_lit = 0, this.d_buf = 0, this.opt_len = 0, this.static_len = 0, this.matches = 0, this.insert = 0, this.bi_buf = 0, this.bi_valid = 0;
        }
        function G3(e3) {
          var t4;
          return e3 && e3.state ? (e3.total_in = e3.total_out = 0, e3.data_type = i3, (t4 = e3.state).pending = 0, t4.pending_out = 0, t4.wrap < 0 && (t4.wrap = -t4.wrap), t4.status = t4.wrap ? C2 : E2, e3.adler = 2 === t4.wrap ? 0 : 1, t4.last_flush = l3, u3._tr_init(t4), m4) : R2(e3, _3);
        }
        function K2(e3) {
          var t4 = G3(e3);
          return t4 === m4 && function(e4) {
            e4.window_size = 2 * e4.w_size, D2(e4.head), e4.max_lazy_match = h3[e4.level].max_lazy, e4.good_match = h3[e4.level].good_length, e4.nice_match = h3[e4.level].nice_length, e4.max_chain_length = h3[e4.level].max_chain, e4.strstart = 0, e4.block_start = 0, e4.lookahead = 0, e4.insert = 0, e4.match_length = e4.prev_length = x3 - 1, e4.match_available = 0, e4.ins_h = 0;
          }(e3.state), t4;
        }
        function Y2(e3, t4, r3, n4, i4, s4) {
          if (!e3)
            return _3;
          var a4 = 1;
          if (t4 === g2 && (t4 = 6), n4 < 0 ? (a4 = 0, n4 = -n4) : 15 < n4 && (a4 = 2, n4 -= 16), i4 < 1 || y4 < i4 || r3 !== v3 || n4 < 8 || 15 < n4 || t4 < 0 || 9 < t4 || s4 < 0 || b2 < s4)
            return R2(e3, _3);
          8 === n4 && (n4 = 9);
          var o4 = new H2();
          return (e3.state = o4).strm = e3, o4.wrap = a4, o4.gzhead = null, o4.w_bits = n4, o4.w_size = 1 << o4.w_bits, o4.w_mask = o4.w_size - 1, o4.hash_bits = i4 + 7, o4.hash_size = 1 << o4.hash_bits, o4.hash_mask = o4.hash_size - 1, o4.hash_shift = ~~((o4.hash_bits + x3 - 1) / x3), o4.window = new c4.Buf8(2 * o4.w_size), o4.head = new c4.Buf16(o4.hash_size), o4.prev = new c4.Buf16(o4.w_size), o4.lit_bufsize = 1 << i4 + 6, o4.pending_buf_size = 4 * o4.lit_bufsize, o4.pending_buf = new c4.Buf8(o4.pending_buf_size), o4.d_buf = 1 * o4.lit_bufsize, o4.l_buf = 3 * o4.lit_bufsize, o4.level = t4, o4.strategy = s4, o4.method = r3, K2(e3);
        }
        h3 = [new M2(0, 0, 0, 0, function(e3, t4) {
          var r3 = 65535;
          for (r3 > e3.pending_buf_size - 5 && (r3 = e3.pending_buf_size - 5); ; ) {
            if (e3.lookahead <= 1) {
              if (j2(e3), 0 === e3.lookahead && t4 === l3)
                return A3;
              if (0 === e3.lookahead)
                break;
            }
            e3.strstart += e3.lookahead, e3.lookahead = 0;
            var n4 = e3.block_start + r3;
            if ((0 === e3.strstart || e3.strstart >= n4) && (e3.lookahead = e3.strstart - n4, e3.strstart = n4, N3(e3, false), 0 === e3.strm.avail_out))
              return A3;
            if (e3.strstart - e3.block_start >= e3.w_size - z2 && (N3(e3, false), 0 === e3.strm.avail_out))
              return A3;
          }
          return e3.insert = 0, t4 === f3 ? (N3(e3, true), 0 === e3.strm.avail_out ? O3 : B2) : (e3.strstart > e3.block_start && (N3(e3, false), e3.strm.avail_out), A3);
        }), new M2(4, 4, 8, 4, Z2), new M2(4, 5, 16, 8, Z2), new M2(4, 6, 32, 32, Z2), new M2(4, 4, 16, 16, W2), new M2(8, 16, 32, 32, W2), new M2(8, 16, 128, 128, W2), new M2(8, 32, 128, 256, W2), new M2(32, 128, 258, 1024, W2), new M2(32, 258, 258, 4096, W2)], r2.deflateInit = function(e3, t4) {
          return Y2(e3, t4, v3, 15, 8, 0);
        }, r2.deflateInit2 = Y2, r2.deflateReset = K2, r2.deflateResetKeep = G3, r2.deflateSetHeader = function(e3, t4) {
          return e3 && e3.state ? 2 !== e3.state.wrap ? _3 : (e3.state.gzhead = t4, m4) : _3;
        }, r2.deflate = function(e3, t4) {
          var r3, n4, i4, s4;
          if (!e3 || !e3.state || 5 < t4 || t4 < 0)
            return e3 ? R2(e3, _3) : _3;
          if (n4 = e3.state, !e3.output || !e3.input && 0 !== e3.avail_in || 666 === n4.status && t4 !== f3)
            return R2(e3, 0 === e3.avail_out ? -5 : _3);
          if (n4.strm = e3, r3 = n4.last_flush, n4.last_flush = t4, n4.status === C2)
            if (2 === n4.wrap)
              e3.adler = 0, U2(n4, 31), U2(n4, 139), U2(n4, 8), n4.gzhead ? (U2(n4, (n4.gzhead.text ? 1 : 0) + (n4.gzhead.hcrc ? 2 : 0) + (n4.gzhead.extra ? 4 : 0) + (n4.gzhead.name ? 8 : 0) + (n4.gzhead.comment ? 16 : 0)), U2(n4, 255 & n4.gzhead.time), U2(n4, n4.gzhead.time >> 8 & 255), U2(n4, n4.gzhead.time >> 16 & 255), U2(n4, n4.gzhead.time >> 24 & 255), U2(n4, 9 === n4.level ? 2 : 2 <= n4.strategy || n4.level < 2 ? 4 : 0), U2(n4, 255 & n4.gzhead.os), n4.gzhead.extra && n4.gzhead.extra.length && (U2(n4, 255 & n4.gzhead.extra.length), U2(n4, n4.gzhead.extra.length >> 8 & 255)), n4.gzhead.hcrc && (e3.adler = p3(e3.adler, n4.pending_buf, n4.pending, 0)), n4.gzindex = 0, n4.status = 69) : (U2(n4, 0), U2(n4, 0), U2(n4, 0), U2(n4, 0), U2(n4, 0), U2(n4, 9 === n4.level ? 2 : 2 <= n4.strategy || n4.level < 2 ? 4 : 0), U2(n4, 3), n4.status = E2);
            else {
              var a4 = v3 + (n4.w_bits - 8 << 4) << 8;
              a4 |= (2 <= n4.strategy || n4.level < 2 ? 0 : n4.level < 6 ? 1 : 6 === n4.level ? 2 : 3) << 6, 0 !== n4.strstart && (a4 |= 32), a4 += 31 - a4 % 31, n4.status = E2, P2(n4, a4), 0 !== n4.strstart && (P2(n4, e3.adler >>> 16), P2(n4, 65535 & e3.adler)), e3.adler = 1;
            }
          if (69 === n4.status)
            if (n4.gzhead.extra) {
              for (i4 = n4.pending; n4.gzindex < (65535 & n4.gzhead.extra.length) && (n4.pending !== n4.pending_buf_size || (n4.gzhead.hcrc && n4.pending > i4 && (e3.adler = p3(e3.adler, n4.pending_buf, n4.pending - i4, i4)), F2(e3), i4 = n4.pending, n4.pending !== n4.pending_buf_size)); )
                U2(n4, 255 & n4.gzhead.extra[n4.gzindex]), n4.gzindex++;
              n4.gzhead.hcrc && n4.pending > i4 && (e3.adler = p3(e3.adler, n4.pending_buf, n4.pending - i4, i4)), n4.gzindex === n4.gzhead.extra.length && (n4.gzindex = 0, n4.status = 73);
            } else
              n4.status = 73;
          if (73 === n4.status)
            if (n4.gzhead.name) {
              i4 = n4.pending;
              do {
                if (n4.pending === n4.pending_buf_size && (n4.gzhead.hcrc && n4.pending > i4 && (e3.adler = p3(e3.adler, n4.pending_buf, n4.pending - i4, i4)), F2(e3), i4 = n4.pending, n4.pending === n4.pending_buf_size)) {
                  s4 = 1;
                  break;
                }
                s4 = n4.gzindex < n4.gzhead.name.length ? 255 & n4.gzhead.name.charCodeAt(n4.gzindex++) : 0, U2(n4, s4);
              } while (0 !== s4);
              n4.gzhead.hcrc && n4.pending > i4 && (e3.adler = p3(e3.adler, n4.pending_buf, n4.pending - i4, i4)), 0 === s4 && (n4.gzindex = 0, n4.status = 91);
            } else
              n4.status = 91;
          if (91 === n4.status)
            if (n4.gzhead.comment) {
              i4 = n4.pending;
              do {
                if (n4.pending === n4.pending_buf_size && (n4.gzhead.hcrc && n4.pending > i4 && (e3.adler = p3(e3.adler, n4.pending_buf, n4.pending - i4, i4)), F2(e3), i4 = n4.pending, n4.pending === n4.pending_buf_size)) {
                  s4 = 1;
                  break;
                }
                s4 = n4.gzindex < n4.gzhead.comment.length ? 255 & n4.gzhead.comment.charCodeAt(n4.gzindex++) : 0, U2(n4, s4);
              } while (0 !== s4);
              n4.gzhead.hcrc && n4.pending > i4 && (e3.adler = p3(e3.adler, n4.pending_buf, n4.pending - i4, i4)), 0 === s4 && (n4.status = 103);
            } else
              n4.status = 103;
          if (103 === n4.status && (n4.gzhead.hcrc ? (n4.pending + 2 > n4.pending_buf_size && F2(e3), n4.pending + 2 <= n4.pending_buf_size && (U2(n4, 255 & e3.adler), U2(n4, e3.adler >> 8 & 255), e3.adler = 0, n4.status = E2)) : n4.status = E2), 0 !== n4.pending) {
            if (F2(e3), 0 === e3.avail_out)
              return n4.last_flush = -1, m4;
          } else if (0 === e3.avail_in && T3(t4) <= T3(r3) && t4 !== f3)
            return R2(e3, -5);
          if (666 === n4.status && 0 !== e3.avail_in)
            return R2(e3, -5);
          if (0 !== e3.avail_in || 0 !== n4.lookahead || t4 !== l3 && 666 !== n4.status) {
            var o4 = 2 === n4.strategy ? function(e4, t5) {
              for (var r4; ; ) {
                if (0 === e4.lookahead && (j2(e4), 0 === e4.lookahead)) {
                  if (t5 === l3)
                    return A3;
                  break;
                }
                if (e4.match_length = 0, r4 = u3._tr_tally(e4, 0, e4.window[e4.strstart]), e4.lookahead--, e4.strstart++, r4 && (N3(e4, false), 0 === e4.strm.avail_out))
                  return A3;
              }
              return e4.insert = 0, t5 === f3 ? (N3(e4, true), 0 === e4.strm.avail_out ? O3 : B2) : e4.last_lit && (N3(e4, false), 0 === e4.strm.avail_out) ? A3 : I2;
            }(n4, t4) : 3 === n4.strategy ? function(e4, t5) {
              for (var r4, n5, i5, s5, a5 = e4.window; ; ) {
                if (e4.lookahead <= S2) {
                  if (j2(e4), e4.lookahead <= S2 && t5 === l3)
                    return A3;
                  if (0 === e4.lookahead)
                    break;
                }
                if (e4.match_length = 0, e4.lookahead >= x3 && 0 < e4.strstart && (n5 = a5[i5 = e4.strstart - 1]) === a5[++i5] && n5 === a5[++i5] && n5 === a5[++i5]) {
                  s5 = e4.strstart + S2;
                  do {
                  } while (n5 === a5[++i5] && n5 === a5[++i5] && n5 === a5[++i5] && n5 === a5[++i5] && n5 === a5[++i5] && n5 === a5[++i5] && n5 === a5[++i5] && n5 === a5[++i5] && i5 < s5);
                  e4.match_length = S2 - (s5 - i5), e4.match_length > e4.lookahead && (e4.match_length = e4.lookahead);
                }
                if (e4.match_length >= x3 ? (r4 = u3._tr_tally(e4, 1, e4.match_length - x3), e4.lookahead -= e4.match_length, e4.strstart += e4.match_length, e4.match_length = 0) : (r4 = u3._tr_tally(e4, 0, e4.window[e4.strstart]), e4.lookahead--, e4.strstart++), r4 && (N3(e4, false), 0 === e4.strm.avail_out))
                  return A3;
              }
              return e4.insert = 0, t5 === f3 ? (N3(e4, true), 0 === e4.strm.avail_out ? O3 : B2) : e4.last_lit && (N3(e4, false), 0 === e4.strm.avail_out) ? A3 : I2;
            }(n4, t4) : h3[n4.level].func(n4, t4);
            if (o4 !== O3 && o4 !== B2 || (n4.status = 666), o4 === A3 || o4 === O3)
              return 0 === e3.avail_out && (n4.last_flush = -1), m4;
            if (o4 === I2 && (1 === t4 ? u3._tr_align(n4) : 5 !== t4 && (u3._tr_stored_block(n4, 0, 0, false), 3 === t4 && (D2(n4.head), 0 === n4.lookahead && (n4.strstart = 0, n4.block_start = 0, n4.insert = 0))), F2(e3), 0 === e3.avail_out))
              return n4.last_flush = -1, m4;
          }
          return t4 !== f3 ? m4 : n4.wrap <= 0 ? 1 : (2 === n4.wrap ? (U2(n4, 255 & e3.adler), U2(n4, e3.adler >> 8 & 255), U2(n4, e3.adler >> 16 & 255), U2(n4, e3.adler >> 24 & 255), U2(n4, 255 & e3.total_in), U2(n4, e3.total_in >> 8 & 255), U2(n4, e3.total_in >> 16 & 255), U2(n4, e3.total_in >> 24 & 255)) : (P2(n4, e3.adler >>> 16), P2(n4, 65535 & e3.adler)), F2(e3), 0 < n4.wrap && (n4.wrap = -n4.wrap), 0 !== n4.pending ? m4 : 1);
        }, r2.deflateEnd = function(e3) {
          var t4;
          return e3 && e3.state ? (t4 = e3.state.status) !== C2 && 69 !== t4 && 73 !== t4 && 91 !== t4 && 103 !== t4 && t4 !== E2 && 666 !== t4 ? R2(e3, _3) : (e3.state = null, t4 === E2 ? R2(e3, -3) : m4) : _3;
        }, r2.deflateSetDictionary = function(e3, t4) {
          var r3, n4, i4, s4, a4, o4, h4, u4, l4 = t4.length;
          if (!e3 || !e3.state)
            return _3;
          if (2 === (s4 = (r3 = e3.state).wrap) || 1 === s4 && r3.status !== C2 || r3.lookahead)
            return _3;
          for (1 === s4 && (e3.adler = d2(e3.adler, t4, l4, 0)), r3.wrap = 0, l4 >= r3.w_size && (0 === s4 && (D2(r3.head), r3.strstart = 0, r3.block_start = 0, r3.insert = 0), u4 = new c4.Buf8(r3.w_size), c4.arraySet(u4, t4, l4 - r3.w_size, r3.w_size, 0), t4 = u4, l4 = r3.w_size), a4 = e3.avail_in, o4 = e3.next_in, h4 = e3.input, e3.avail_in = l4, e3.next_in = 0, e3.input = t4, j2(r3); r3.lookahead >= x3; ) {
            for (n4 = r3.strstart, i4 = r3.lookahead - (x3 - 1); r3.ins_h = (r3.ins_h << r3.hash_shift ^ r3.window[n4 + x3 - 1]) & r3.hash_mask, r3.prev[n4 & r3.w_mask] = r3.head[r3.ins_h], r3.head[r3.ins_h] = n4, n4++, --i4; )
              ;
            r3.strstart = n4, r3.lookahead = x3 - 1, j2(r3);
          }
          return r3.strstart += r3.lookahead, r3.block_start = r3.strstart, r3.insert = r3.lookahead, r3.lookahead = 0, r3.match_length = r3.prev_length = x3 - 1, r3.match_available = 0, e3.next_in = o4, e3.input = h4, e3.avail_in = a4, r3.wrap = s4, m4;
        }, r2.deflateInfo = "pako deflate (from Nodeca project)";
      }, { "../utils/common": 41, "./adler32": 43, "./crc32": 45, "./messages": 51, "./trees": 52 }], 47: [function(e2, t3, r2) {
        "use strict";
        t3.exports = function() {
          this.text = 0, this.time = 0, this.xflags = 0, this.os = 0, this.extra = null, this.extra_len = 0, this.name = "", this.comment = "", this.hcrc = 0, this.done = false;
        };
      }, {}], 48: [function(e2, t3, r2) {
        "use strict";
        t3.exports = function(e3, t4) {
          var r3, n3, i3, s3, a3, o3, h3, u3, l3, f3, c4, d2, p3, m4, _3, g2, b2, v3, y4, w2, k2, x3, S2, z2, C2;
          r3 = e3.state, n3 = e3.next_in, z2 = e3.input, i3 = n3 + (e3.avail_in - 5), s3 = e3.next_out, C2 = e3.output, a3 = s3 - (t4 - e3.avail_out), o3 = s3 + (e3.avail_out - 257), h3 = r3.dmax, u3 = r3.wsize, l3 = r3.whave, f3 = r3.wnext, c4 = r3.window, d2 = r3.hold, p3 = r3.bits, m4 = r3.lencode, _3 = r3.distcode, g2 = (1 << r3.lenbits) - 1, b2 = (1 << r3.distbits) - 1;
          e:
            do {
              p3 < 15 && (d2 += z2[n3++] << p3, p3 += 8, d2 += z2[n3++] << p3, p3 += 8), v3 = m4[d2 & g2];
              t:
                for (; ; ) {
                  if (d2 >>>= y4 = v3 >>> 24, p3 -= y4, 0 === (y4 = v3 >>> 16 & 255))
                    C2[s3++] = 65535 & v3;
                  else {
                    if (!(16 & y4)) {
                      if (0 == (64 & y4)) {
                        v3 = m4[(65535 & v3) + (d2 & (1 << y4) - 1)];
                        continue t;
                      }
                      if (32 & y4) {
                        r3.mode = 12;
                        break e;
                      }
                      e3.msg = "invalid literal/length code", r3.mode = 30;
                      break e;
                    }
                    w2 = 65535 & v3, (y4 &= 15) && (p3 < y4 && (d2 += z2[n3++] << p3, p3 += 8), w2 += d2 & (1 << y4) - 1, d2 >>>= y4, p3 -= y4), p3 < 15 && (d2 += z2[n3++] << p3, p3 += 8, d2 += z2[n3++] << p3, p3 += 8), v3 = _3[d2 & b2];
                    r:
                      for (; ; ) {
                        if (d2 >>>= y4 = v3 >>> 24, p3 -= y4, !(16 & (y4 = v3 >>> 16 & 255))) {
                          if (0 == (64 & y4)) {
                            v3 = _3[(65535 & v3) + (d2 & (1 << y4) - 1)];
                            continue r;
                          }
                          e3.msg = "invalid distance code", r3.mode = 30;
                          break e;
                        }
                        if (k2 = 65535 & v3, p3 < (y4 &= 15) && (d2 += z2[n3++] << p3, (p3 += 8) < y4 && (d2 += z2[n3++] << p3, p3 += 8)), h3 < (k2 += d2 & (1 << y4) - 1)) {
                          e3.msg = "invalid distance too far back", r3.mode = 30;
                          break e;
                        }
                        if (d2 >>>= y4, p3 -= y4, (y4 = s3 - a3) < k2) {
                          if (l3 < (y4 = k2 - y4) && r3.sane) {
                            e3.msg = "invalid distance too far back", r3.mode = 30;
                            break e;
                          }
                          if (S2 = c4, (x3 = 0) === f3) {
                            if (x3 += u3 - y4, y4 < w2) {
                              for (w2 -= y4; C2[s3++] = c4[x3++], --y4; )
                                ;
                              x3 = s3 - k2, S2 = C2;
                            }
                          } else if (f3 < y4) {
                            if (x3 += u3 + f3 - y4, (y4 -= f3) < w2) {
                              for (w2 -= y4; C2[s3++] = c4[x3++], --y4; )
                                ;
                              if (x3 = 0, f3 < w2) {
                                for (w2 -= y4 = f3; C2[s3++] = c4[x3++], --y4; )
                                  ;
                                x3 = s3 - k2, S2 = C2;
                              }
                            }
                          } else if (x3 += f3 - y4, y4 < w2) {
                            for (w2 -= y4; C2[s3++] = c4[x3++], --y4; )
                              ;
                            x3 = s3 - k2, S2 = C2;
                          }
                          for (; 2 < w2; )
                            C2[s3++] = S2[x3++], C2[s3++] = S2[x3++], C2[s3++] = S2[x3++], w2 -= 3;
                          w2 && (C2[s3++] = S2[x3++], 1 < w2 && (C2[s3++] = S2[x3++]));
                        } else {
                          for (x3 = s3 - k2; C2[s3++] = C2[x3++], C2[s3++] = C2[x3++], C2[s3++] = C2[x3++], 2 < (w2 -= 3); )
                            ;
                          w2 && (C2[s3++] = C2[x3++], 1 < w2 && (C2[s3++] = C2[x3++]));
                        }
                        break;
                      }
                  }
                  break;
                }
            } while (n3 < i3 && s3 < o3);
          n3 -= w2 = p3 >> 3, d2 &= (1 << (p3 -= w2 << 3)) - 1, e3.next_in = n3, e3.next_out = s3, e3.avail_in = n3 < i3 ? i3 - n3 + 5 : 5 - (n3 - i3), e3.avail_out = s3 < o3 ? o3 - s3 + 257 : 257 - (s3 - o3), r3.hold = d2, r3.bits = p3;
        };
      }, {}], 49: [function(e2, t3, r2) {
        "use strict";
        var I2 = e2("../utils/common"), O3 = e2("./adler32"), B2 = e2("./crc32"), R2 = e2("./inffast"), T3 = e2("./inftrees"), D2 = 1, F2 = 2, N3 = 0, U2 = -2, P2 = 1, n3 = 852, i3 = 592;
        function L2(e3) {
          return (e3 >>> 24 & 255) + (e3 >>> 8 & 65280) + ((65280 & e3) << 8) + ((255 & e3) << 24);
        }
        function s3() {
          this.mode = 0, this.last = false, this.wrap = 0, this.havedict = false, this.flags = 0, this.dmax = 0, this.check = 0, this.total = 0, this.head = null, this.wbits = 0, this.wsize = 0, this.whave = 0, this.wnext = 0, this.window = null, this.hold = 0, this.bits = 0, this.length = 0, this.offset = 0, this.extra = 0, this.lencode = null, this.distcode = null, this.lenbits = 0, this.distbits = 0, this.ncode = 0, this.nlen = 0, this.ndist = 0, this.have = 0, this.next = null, this.lens = new I2.Buf16(320), this.work = new I2.Buf16(288), this.lendyn = null, this.distdyn = null, this.sane = 0, this.back = 0, this.was = 0;
        }
        function a3(e3) {
          var t4;
          return e3 && e3.state ? (t4 = e3.state, e3.total_in = e3.total_out = t4.total = 0, e3.msg = "", t4.wrap && (e3.adler = 1 & t4.wrap), t4.mode = P2, t4.last = 0, t4.havedict = 0, t4.dmax = 32768, t4.head = null, t4.hold = 0, t4.bits = 0, t4.lencode = t4.lendyn = new I2.Buf32(n3), t4.distcode = t4.distdyn = new I2.Buf32(i3), t4.sane = 1, t4.back = -1, N3) : U2;
        }
        function o3(e3) {
          var t4;
          return e3 && e3.state ? ((t4 = e3.state).wsize = 0, t4.whave = 0, t4.wnext = 0, a3(e3)) : U2;
        }
        function h3(e3, t4) {
          var r3, n4;
          return e3 && e3.state ? (n4 = e3.state, t4 < 0 ? (r3 = 0, t4 = -t4) : (r3 = 1 + (t4 >> 4), t4 < 48 && (t4 &= 15)), t4 && (t4 < 8 || 15 < t4) ? U2 : (null !== n4.window && n4.wbits !== t4 && (n4.window = null), n4.wrap = r3, n4.wbits = t4, o3(e3))) : U2;
        }
        function u3(e3, t4) {
          var r3, n4;
          return e3 ? (n4 = new s3(), (e3.state = n4).window = null, (r3 = h3(e3, t4)) !== N3 && (e3.state = null), r3) : U2;
        }
        var l3, f3, c4 = true;
        function j2(e3) {
          if (c4) {
            var t4;
            for (l3 = new I2.Buf32(512), f3 = new I2.Buf32(32), t4 = 0; t4 < 144; )
              e3.lens[t4++] = 8;
            for (; t4 < 256; )
              e3.lens[t4++] = 9;
            for (; t4 < 280; )
              e3.lens[t4++] = 7;
            for (; t4 < 288; )
              e3.lens[t4++] = 8;
            for (T3(D2, e3.lens, 0, 288, l3, 0, e3.work, { bits: 9 }), t4 = 0; t4 < 32; )
              e3.lens[t4++] = 5;
            T3(F2, e3.lens, 0, 32, f3, 0, e3.work, { bits: 5 }), c4 = false;
          }
          e3.lencode = l3, e3.lenbits = 9, e3.distcode = f3, e3.distbits = 5;
        }
        function Z2(e3, t4, r3, n4) {
          var i4, s4 = e3.state;
          return null === s4.window && (s4.wsize = 1 << s4.wbits, s4.wnext = 0, s4.whave = 0, s4.window = new I2.Buf8(s4.wsize)), n4 >= s4.wsize ? (I2.arraySet(s4.window, t4, r3 - s4.wsize, s4.wsize, 0), s4.wnext = 0, s4.whave = s4.wsize) : (n4 < (i4 = s4.wsize - s4.wnext) && (i4 = n4), I2.arraySet(s4.window, t4, r3 - n4, i4, s4.wnext), (n4 -= i4) ? (I2.arraySet(s4.window, t4, r3 - n4, n4, 0), s4.wnext = n4, s4.whave = s4.wsize) : (s4.wnext += i4, s4.wnext === s4.wsize && (s4.wnext = 0), s4.whave < s4.wsize && (s4.whave += i4))), 0;
        }
        r2.inflateReset = o3, r2.inflateReset2 = h3, r2.inflateResetKeep = a3, r2.inflateInit = function(e3) {
          return u3(e3, 15);
        }, r2.inflateInit2 = u3, r2.inflate = function(e3, t4) {
          var r3, n4, i4, s4, a4, o4, h4, u4, l4, f4, c5, d2, p3, m4, _3, g2, b2, v3, y4, w2, k2, x3, S2, z2, C2 = 0, E2 = new I2.Buf8(4), A3 = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];
          if (!e3 || !e3.state || !e3.output || !e3.input && 0 !== e3.avail_in)
            return U2;
          12 === (r3 = e3.state).mode && (r3.mode = 13), a4 = e3.next_out, i4 = e3.output, h4 = e3.avail_out, s4 = e3.next_in, n4 = e3.input, o4 = e3.avail_in, u4 = r3.hold, l4 = r3.bits, f4 = o4, c5 = h4, x3 = N3;
          e:
            for (; ; )
              switch (r3.mode) {
                case P2:
                  if (0 === r3.wrap) {
                    r3.mode = 13;
                    break;
                  }
                  for (; l4 < 16; ) {
                    if (0 === o4)
                      break e;
                    o4--, u4 += n4[s4++] << l4, l4 += 8;
                  }
                  if (2 & r3.wrap && 35615 === u4) {
                    E2[r3.check = 0] = 255 & u4, E2[1] = u4 >>> 8 & 255, r3.check = B2(r3.check, E2, 2, 0), l4 = u4 = 0, r3.mode = 2;
                    break;
                  }
                  if (r3.flags = 0, r3.head && (r3.head.done = false), !(1 & r3.wrap) || (((255 & u4) << 8) + (u4 >> 8)) % 31) {
                    e3.msg = "incorrect header check", r3.mode = 30;
                    break;
                  }
                  if (8 != (15 & u4)) {
                    e3.msg = "unknown compression method", r3.mode = 30;
                    break;
                  }
                  if (l4 -= 4, k2 = 8 + (15 & (u4 >>>= 4)), 0 === r3.wbits)
                    r3.wbits = k2;
                  else if (k2 > r3.wbits) {
                    e3.msg = "invalid window size", r3.mode = 30;
                    break;
                  }
                  r3.dmax = 1 << k2, e3.adler = r3.check = 1, r3.mode = 512 & u4 ? 10 : 12, l4 = u4 = 0;
                  break;
                case 2:
                  for (; l4 < 16; ) {
                    if (0 === o4)
                      break e;
                    o4--, u4 += n4[s4++] << l4, l4 += 8;
                  }
                  if (r3.flags = u4, 8 != (255 & r3.flags)) {
                    e3.msg = "unknown compression method", r3.mode = 30;
                    break;
                  }
                  if (57344 & r3.flags) {
                    e3.msg = "unknown header flags set", r3.mode = 30;
                    break;
                  }
                  r3.head && (r3.head.text = u4 >> 8 & 1), 512 & r3.flags && (E2[0] = 255 & u4, E2[1] = u4 >>> 8 & 255, r3.check = B2(r3.check, E2, 2, 0)), l4 = u4 = 0, r3.mode = 3;
                case 3:
                  for (; l4 < 32; ) {
                    if (0 === o4)
                      break e;
                    o4--, u4 += n4[s4++] << l4, l4 += 8;
                  }
                  r3.head && (r3.head.time = u4), 512 & r3.flags && (E2[0] = 255 & u4, E2[1] = u4 >>> 8 & 255, E2[2] = u4 >>> 16 & 255, E2[3] = u4 >>> 24 & 255, r3.check = B2(r3.check, E2, 4, 0)), l4 = u4 = 0, r3.mode = 4;
                case 4:
                  for (; l4 < 16; ) {
                    if (0 === o4)
                      break e;
                    o4--, u4 += n4[s4++] << l4, l4 += 8;
                  }
                  r3.head && (r3.head.xflags = 255 & u4, r3.head.os = u4 >> 8), 512 & r3.flags && (E2[0] = 255 & u4, E2[1] = u4 >>> 8 & 255, r3.check = B2(r3.check, E2, 2, 0)), l4 = u4 = 0, r3.mode = 5;
                case 5:
                  if (1024 & r3.flags) {
                    for (; l4 < 16; ) {
                      if (0 === o4)
                        break e;
                      o4--, u4 += n4[s4++] << l4, l4 += 8;
                    }
                    r3.length = u4, r3.head && (r3.head.extra_len = u4), 512 & r3.flags && (E2[0] = 255 & u4, E2[1] = u4 >>> 8 & 255, r3.check = B2(r3.check, E2, 2, 0)), l4 = u4 = 0;
                  } else
                    r3.head && (r3.head.extra = null);
                  r3.mode = 6;
                case 6:
                  if (1024 & r3.flags && (o4 < (d2 = r3.length) && (d2 = o4), d2 && (r3.head && (k2 = r3.head.extra_len - r3.length, r3.head.extra || (r3.head.extra = new Array(r3.head.extra_len)), I2.arraySet(r3.head.extra, n4, s4, d2, k2)), 512 & r3.flags && (r3.check = B2(r3.check, n4, d2, s4)), o4 -= d2, s4 += d2, r3.length -= d2), r3.length))
                    break e;
                  r3.length = 0, r3.mode = 7;
                case 7:
                  if (2048 & r3.flags) {
                    if (0 === o4)
                      break e;
                    for (d2 = 0; k2 = n4[s4 + d2++], r3.head && k2 && r3.length < 65536 && (r3.head.name += String.fromCharCode(k2)), k2 && d2 < o4; )
                      ;
                    if (512 & r3.flags && (r3.check = B2(r3.check, n4, d2, s4)), o4 -= d2, s4 += d2, k2)
                      break e;
                  } else
                    r3.head && (r3.head.name = null);
                  r3.length = 0, r3.mode = 8;
                case 8:
                  if (4096 & r3.flags) {
                    if (0 === o4)
                      break e;
                    for (d2 = 0; k2 = n4[s4 + d2++], r3.head && k2 && r3.length < 65536 && (r3.head.comment += String.fromCharCode(k2)), k2 && d2 < o4; )
                      ;
                    if (512 & r3.flags && (r3.check = B2(r3.check, n4, d2, s4)), o4 -= d2, s4 += d2, k2)
                      break e;
                  } else
                    r3.head && (r3.head.comment = null);
                  r3.mode = 9;
                case 9:
                  if (512 & r3.flags) {
                    for (; l4 < 16; ) {
                      if (0 === o4)
                        break e;
                      o4--, u4 += n4[s4++] << l4, l4 += 8;
                    }
                    if (u4 !== (65535 & r3.check)) {
                      e3.msg = "header crc mismatch", r3.mode = 30;
                      break;
                    }
                    l4 = u4 = 0;
                  }
                  r3.head && (r3.head.hcrc = r3.flags >> 9 & 1, r3.head.done = true), e3.adler = r3.check = 0, r3.mode = 12;
                  break;
                case 10:
                  for (; l4 < 32; ) {
                    if (0 === o4)
                      break e;
                    o4--, u4 += n4[s4++] << l4, l4 += 8;
                  }
                  e3.adler = r3.check = L2(u4), l4 = u4 = 0, r3.mode = 11;
                case 11:
                  if (0 === r3.havedict)
                    return e3.next_out = a4, e3.avail_out = h4, e3.next_in = s4, e3.avail_in = o4, r3.hold = u4, r3.bits = l4, 2;
                  e3.adler = r3.check = 1, r3.mode = 12;
                case 12:
                  if (5 === t4 || 6 === t4)
                    break e;
                case 13:
                  if (r3.last) {
                    u4 >>>= 7 & l4, l4 -= 7 & l4, r3.mode = 27;
                    break;
                  }
                  for (; l4 < 3; ) {
                    if (0 === o4)
                      break e;
                    o4--, u4 += n4[s4++] << l4, l4 += 8;
                  }
                  switch (r3.last = 1 & u4, l4 -= 1, 3 & (u4 >>>= 1)) {
                    case 0:
                      r3.mode = 14;
                      break;
                    case 1:
                      if (j2(r3), r3.mode = 20, 6 !== t4)
                        break;
                      u4 >>>= 2, l4 -= 2;
                      break e;
                    case 2:
                      r3.mode = 17;
                      break;
                    case 3:
                      e3.msg = "invalid block type", r3.mode = 30;
                  }
                  u4 >>>= 2, l4 -= 2;
                  break;
                case 14:
                  for (u4 >>>= 7 & l4, l4 -= 7 & l4; l4 < 32; ) {
                    if (0 === o4)
                      break e;
                    o4--, u4 += n4[s4++] << l4, l4 += 8;
                  }
                  if ((65535 & u4) != (u4 >>> 16 ^ 65535)) {
                    e3.msg = "invalid stored block lengths", r3.mode = 30;
                    break;
                  }
                  if (r3.length = 65535 & u4, l4 = u4 = 0, r3.mode = 15, 6 === t4)
                    break e;
                case 15:
                  r3.mode = 16;
                case 16:
                  if (d2 = r3.length) {
                    if (o4 < d2 && (d2 = o4), h4 < d2 && (d2 = h4), 0 === d2)
                      break e;
                    I2.arraySet(i4, n4, s4, d2, a4), o4 -= d2, s4 += d2, h4 -= d2, a4 += d2, r3.length -= d2;
                    break;
                  }
                  r3.mode = 12;
                  break;
                case 17:
                  for (; l4 < 14; ) {
                    if (0 === o4)
                      break e;
                    o4--, u4 += n4[s4++] << l4, l4 += 8;
                  }
                  if (r3.nlen = 257 + (31 & u4), u4 >>>= 5, l4 -= 5, r3.ndist = 1 + (31 & u4), u4 >>>= 5, l4 -= 5, r3.ncode = 4 + (15 & u4), u4 >>>= 4, l4 -= 4, 286 < r3.nlen || 30 < r3.ndist) {
                    e3.msg = "too many length or distance symbols", r3.mode = 30;
                    break;
                  }
                  r3.have = 0, r3.mode = 18;
                case 18:
                  for (; r3.have < r3.ncode; ) {
                    for (; l4 < 3; ) {
                      if (0 === o4)
                        break e;
                      o4--, u4 += n4[s4++] << l4, l4 += 8;
                    }
                    r3.lens[A3[r3.have++]] = 7 & u4, u4 >>>= 3, l4 -= 3;
                  }
                  for (; r3.have < 19; )
                    r3.lens[A3[r3.have++]] = 0;
                  if (r3.lencode = r3.lendyn, r3.lenbits = 7, S2 = { bits: r3.lenbits }, x3 = T3(0, r3.lens, 0, 19, r3.lencode, 0, r3.work, S2), r3.lenbits = S2.bits, x3) {
                    e3.msg = "invalid code lengths set", r3.mode = 30;
                    break;
                  }
                  r3.have = 0, r3.mode = 19;
                case 19:
                  for (; r3.have < r3.nlen + r3.ndist; ) {
                    for (; g2 = (C2 = r3.lencode[u4 & (1 << r3.lenbits) - 1]) >>> 16 & 255, b2 = 65535 & C2, !((_3 = C2 >>> 24) <= l4); ) {
                      if (0 === o4)
                        break e;
                      o4--, u4 += n4[s4++] << l4, l4 += 8;
                    }
                    if (b2 < 16)
                      u4 >>>= _3, l4 -= _3, r3.lens[r3.have++] = b2;
                    else {
                      if (16 === b2) {
                        for (z2 = _3 + 2; l4 < z2; ) {
                          if (0 === o4)
                            break e;
                          o4--, u4 += n4[s4++] << l4, l4 += 8;
                        }
                        if (u4 >>>= _3, l4 -= _3, 0 === r3.have) {
                          e3.msg = "invalid bit length repeat", r3.mode = 30;
                          break;
                        }
                        k2 = r3.lens[r3.have - 1], d2 = 3 + (3 & u4), u4 >>>= 2, l4 -= 2;
                      } else if (17 === b2) {
                        for (z2 = _3 + 3; l4 < z2; ) {
                          if (0 === o4)
                            break e;
                          o4--, u4 += n4[s4++] << l4, l4 += 8;
                        }
                        l4 -= _3, k2 = 0, d2 = 3 + (7 & (u4 >>>= _3)), u4 >>>= 3, l4 -= 3;
                      } else {
                        for (z2 = _3 + 7; l4 < z2; ) {
                          if (0 === o4)
                            break e;
                          o4--, u4 += n4[s4++] << l4, l4 += 8;
                        }
                        l4 -= _3, k2 = 0, d2 = 11 + (127 & (u4 >>>= _3)), u4 >>>= 7, l4 -= 7;
                      }
                      if (r3.have + d2 > r3.nlen + r3.ndist) {
                        e3.msg = "invalid bit length repeat", r3.mode = 30;
                        break;
                      }
                      for (; d2--; )
                        r3.lens[r3.have++] = k2;
                    }
                  }
                  if (30 === r3.mode)
                    break;
                  if (0 === r3.lens[256]) {
                    e3.msg = "invalid code -- missing end-of-block", r3.mode = 30;
                    break;
                  }
                  if (r3.lenbits = 9, S2 = { bits: r3.lenbits }, x3 = T3(D2, r3.lens, 0, r3.nlen, r3.lencode, 0, r3.work, S2), r3.lenbits = S2.bits, x3) {
                    e3.msg = "invalid literal/lengths set", r3.mode = 30;
                    break;
                  }
                  if (r3.distbits = 6, r3.distcode = r3.distdyn, S2 = { bits: r3.distbits }, x3 = T3(F2, r3.lens, r3.nlen, r3.ndist, r3.distcode, 0, r3.work, S2), r3.distbits = S2.bits, x3) {
                    e3.msg = "invalid distances set", r3.mode = 30;
                    break;
                  }
                  if (r3.mode = 20, 6 === t4)
                    break e;
                case 20:
                  r3.mode = 21;
                case 21:
                  if (6 <= o4 && 258 <= h4) {
                    e3.next_out = a4, e3.avail_out = h4, e3.next_in = s4, e3.avail_in = o4, r3.hold = u4, r3.bits = l4, R2(e3, c5), a4 = e3.next_out, i4 = e3.output, h4 = e3.avail_out, s4 = e3.next_in, n4 = e3.input, o4 = e3.avail_in, u4 = r3.hold, l4 = r3.bits, 12 === r3.mode && (r3.back = -1);
                    break;
                  }
                  for (r3.back = 0; g2 = (C2 = r3.lencode[u4 & (1 << r3.lenbits) - 1]) >>> 16 & 255, b2 = 65535 & C2, !((_3 = C2 >>> 24) <= l4); ) {
                    if (0 === o4)
                      break e;
                    o4--, u4 += n4[s4++] << l4, l4 += 8;
                  }
                  if (g2 && 0 == (240 & g2)) {
                    for (v3 = _3, y4 = g2, w2 = b2; g2 = (C2 = r3.lencode[w2 + ((u4 & (1 << v3 + y4) - 1) >> v3)]) >>> 16 & 255, b2 = 65535 & C2, !(v3 + (_3 = C2 >>> 24) <= l4); ) {
                      if (0 === o4)
                        break e;
                      o4--, u4 += n4[s4++] << l4, l4 += 8;
                    }
                    u4 >>>= v3, l4 -= v3, r3.back += v3;
                  }
                  if (u4 >>>= _3, l4 -= _3, r3.back += _3, r3.length = b2, 0 === g2) {
                    r3.mode = 26;
                    break;
                  }
                  if (32 & g2) {
                    r3.back = -1, r3.mode = 12;
                    break;
                  }
                  if (64 & g2) {
                    e3.msg = "invalid literal/length code", r3.mode = 30;
                    break;
                  }
                  r3.extra = 15 & g2, r3.mode = 22;
                case 22:
                  if (r3.extra) {
                    for (z2 = r3.extra; l4 < z2; ) {
                      if (0 === o4)
                        break e;
                      o4--, u4 += n4[s4++] << l4, l4 += 8;
                    }
                    r3.length += u4 & (1 << r3.extra) - 1, u4 >>>= r3.extra, l4 -= r3.extra, r3.back += r3.extra;
                  }
                  r3.was = r3.length, r3.mode = 23;
                case 23:
                  for (; g2 = (C2 = r3.distcode[u4 & (1 << r3.distbits) - 1]) >>> 16 & 255, b2 = 65535 & C2, !((_3 = C2 >>> 24) <= l4); ) {
                    if (0 === o4)
                      break e;
                    o4--, u4 += n4[s4++] << l4, l4 += 8;
                  }
                  if (0 == (240 & g2)) {
                    for (v3 = _3, y4 = g2, w2 = b2; g2 = (C2 = r3.distcode[w2 + ((u4 & (1 << v3 + y4) - 1) >> v3)]) >>> 16 & 255, b2 = 65535 & C2, !(v3 + (_3 = C2 >>> 24) <= l4); ) {
                      if (0 === o4)
                        break e;
                      o4--, u4 += n4[s4++] << l4, l4 += 8;
                    }
                    u4 >>>= v3, l4 -= v3, r3.back += v3;
                  }
                  if (u4 >>>= _3, l4 -= _3, r3.back += _3, 64 & g2) {
                    e3.msg = "invalid distance code", r3.mode = 30;
                    break;
                  }
                  r3.offset = b2, r3.extra = 15 & g2, r3.mode = 24;
                case 24:
                  if (r3.extra) {
                    for (z2 = r3.extra; l4 < z2; ) {
                      if (0 === o4)
                        break e;
                      o4--, u4 += n4[s4++] << l4, l4 += 8;
                    }
                    r3.offset += u4 & (1 << r3.extra) - 1, u4 >>>= r3.extra, l4 -= r3.extra, r3.back += r3.extra;
                  }
                  if (r3.offset > r3.dmax) {
                    e3.msg = "invalid distance too far back", r3.mode = 30;
                    break;
                  }
                  r3.mode = 25;
                case 25:
                  if (0 === h4)
                    break e;
                  if (d2 = c5 - h4, r3.offset > d2) {
                    if ((d2 = r3.offset - d2) > r3.whave && r3.sane) {
                      e3.msg = "invalid distance too far back", r3.mode = 30;
                      break;
                    }
                    p3 = d2 > r3.wnext ? (d2 -= r3.wnext, r3.wsize - d2) : r3.wnext - d2, d2 > r3.length && (d2 = r3.length), m4 = r3.window;
                  } else
                    m4 = i4, p3 = a4 - r3.offset, d2 = r3.length;
                  for (h4 < d2 && (d2 = h4), h4 -= d2, r3.length -= d2; i4[a4++] = m4[p3++], --d2; )
                    ;
                  0 === r3.length && (r3.mode = 21);
                  break;
                case 26:
                  if (0 === h4)
                    break e;
                  i4[a4++] = r3.length, h4--, r3.mode = 21;
                  break;
                case 27:
                  if (r3.wrap) {
                    for (; l4 < 32; ) {
                      if (0 === o4)
                        break e;
                      o4--, u4 |= n4[s4++] << l4, l4 += 8;
                    }
                    if (c5 -= h4, e3.total_out += c5, r3.total += c5, c5 && (e3.adler = r3.check = r3.flags ? B2(r3.check, i4, c5, a4 - c5) : O3(r3.check, i4, c5, a4 - c5)), c5 = h4, (r3.flags ? u4 : L2(u4)) !== r3.check) {
                      e3.msg = "incorrect data check", r3.mode = 30;
                      break;
                    }
                    l4 = u4 = 0;
                  }
                  r3.mode = 28;
                case 28:
                  if (r3.wrap && r3.flags) {
                    for (; l4 < 32; ) {
                      if (0 === o4)
                        break e;
                      o4--, u4 += n4[s4++] << l4, l4 += 8;
                    }
                    if (u4 !== (4294967295 & r3.total)) {
                      e3.msg = "incorrect length check", r3.mode = 30;
                      break;
                    }
                    l4 = u4 = 0;
                  }
                  r3.mode = 29;
                case 29:
                  x3 = 1;
                  break e;
                case 30:
                  x3 = -3;
                  break e;
                case 31:
                  return -4;
                case 32:
                default:
                  return U2;
              }
          return e3.next_out = a4, e3.avail_out = h4, e3.next_in = s4, e3.avail_in = o4, r3.hold = u4, r3.bits = l4, (r3.wsize || c5 !== e3.avail_out && r3.mode < 30 && (r3.mode < 27 || 4 !== t4)) && Z2(e3, e3.output, e3.next_out, c5 - e3.avail_out) ? (r3.mode = 31, -4) : (f4 -= e3.avail_in, c5 -= e3.avail_out, e3.total_in += f4, e3.total_out += c5, r3.total += c5, r3.wrap && c5 && (e3.adler = r3.check = r3.flags ? B2(r3.check, i4, c5, e3.next_out - c5) : O3(r3.check, i4, c5, e3.next_out - c5)), e3.data_type = r3.bits + (r3.last ? 64 : 0) + (12 === r3.mode ? 128 : 0) + (20 === r3.mode || 15 === r3.mode ? 256 : 0), (0 == f4 && 0 === c5 || 4 === t4) && x3 === N3 && (x3 = -5), x3);
        }, r2.inflateEnd = function(e3) {
          if (!e3 || !e3.state)
            return U2;
          var t4 = e3.state;
          return t4.window && (t4.window = null), e3.state = null, N3;
        }, r2.inflateGetHeader = function(e3, t4) {
          var r3;
          return e3 && e3.state ? 0 == (2 & (r3 = e3.state).wrap) ? U2 : ((r3.head = t4).done = false, N3) : U2;
        }, r2.inflateSetDictionary = function(e3, t4) {
          var r3, n4 = t4.length;
          return e3 && e3.state ? 0 !== (r3 = e3.state).wrap && 11 !== r3.mode ? U2 : 11 === r3.mode && O3(1, t4, n4, 0) !== r3.check ? -3 : Z2(e3, t4, n4, n4) ? (r3.mode = 31, -4) : (r3.havedict = 1, N3) : U2;
        }, r2.inflateInfo = "pako inflate (from Nodeca project)";
      }, { "../utils/common": 41, "./adler32": 43, "./crc32": 45, "./inffast": 48, "./inftrees": 50 }], 50: [function(e2, t3, r2) {
        "use strict";
        var D2 = e2("../utils/common"), F2 = [3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0], N3 = [16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78], U2 = [1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577, 0, 0], P2 = [16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 64, 64];
        t3.exports = function(e3, t4, r3, n3, i3, s3, a3, o3) {
          var h3, u3, l3, f3, c4, d2, p3, m4, _3, g2 = o3.bits, b2 = 0, v3 = 0, y4 = 0, w2 = 0, k2 = 0, x3 = 0, S2 = 0, z2 = 0, C2 = 0, E2 = 0, A3 = null, I2 = 0, O3 = new D2.Buf16(16), B2 = new D2.Buf16(16), R2 = null, T3 = 0;
          for (b2 = 0; b2 <= 15; b2++)
            O3[b2] = 0;
          for (v3 = 0; v3 < n3; v3++)
            O3[t4[r3 + v3]]++;
          for (k2 = g2, w2 = 15; 1 <= w2 && 0 === O3[w2]; w2--)
            ;
          if (w2 < k2 && (k2 = w2), 0 === w2)
            return i3[s3++] = 20971520, i3[s3++] = 20971520, o3.bits = 1, 0;
          for (y4 = 1; y4 < w2 && 0 === O3[y4]; y4++)
            ;
          for (k2 < y4 && (k2 = y4), b2 = z2 = 1; b2 <= 15; b2++)
            if (z2 <<= 1, (z2 -= O3[b2]) < 0)
              return -1;
          if (0 < z2 && (0 === e3 || 1 !== w2))
            return -1;
          for (B2[1] = 0, b2 = 1; b2 < 15; b2++)
            B2[b2 + 1] = B2[b2] + O3[b2];
          for (v3 = 0; v3 < n3; v3++)
            0 !== t4[r3 + v3] && (a3[B2[t4[r3 + v3]]++] = v3);
          if (d2 = 0 === e3 ? (A3 = R2 = a3, 19) : 1 === e3 ? (A3 = F2, I2 -= 257, R2 = N3, T3 -= 257, 256) : (A3 = U2, R2 = P2, -1), b2 = y4, c4 = s3, S2 = v3 = E2 = 0, l3 = -1, f3 = (C2 = 1 << (x3 = k2)) - 1, 1 === e3 && 852 < C2 || 2 === e3 && 592 < C2)
            return 1;
          for (; ; ) {
            for (p3 = b2 - S2, _3 = a3[v3] < d2 ? (m4 = 0, a3[v3]) : a3[v3] > d2 ? (m4 = R2[T3 + a3[v3]], A3[I2 + a3[v3]]) : (m4 = 96, 0), h3 = 1 << b2 - S2, y4 = u3 = 1 << x3; i3[c4 + (E2 >> S2) + (u3 -= h3)] = p3 << 24 | m4 << 16 | _3 | 0, 0 !== u3; )
              ;
            for (h3 = 1 << b2 - 1; E2 & h3; )
              h3 >>= 1;
            if (0 !== h3 ? (E2 &= h3 - 1, E2 += h3) : E2 = 0, v3++, 0 == --O3[b2]) {
              if (b2 === w2)
                break;
              b2 = t4[r3 + a3[v3]];
            }
            if (k2 < b2 && (E2 & f3) !== l3) {
              for (0 === S2 && (S2 = k2), c4 += y4, z2 = 1 << (x3 = b2 - S2); x3 + S2 < w2 && !((z2 -= O3[x3 + S2]) <= 0); )
                x3++, z2 <<= 1;
              if (C2 += 1 << x3, 1 === e3 && 852 < C2 || 2 === e3 && 592 < C2)
                return 1;
              i3[l3 = E2 & f3] = k2 << 24 | x3 << 16 | c4 - s3 | 0;
            }
          }
          return 0 !== E2 && (i3[c4 + E2] = b2 - S2 << 24 | 64 << 16 | 0), o3.bits = k2, 0;
        };
      }, { "../utils/common": 41 }], 51: [function(e2, t3, r2) {
        "use strict";
        t3.exports = { 2: "need dictionary", 1: "stream end", 0: "", "-1": "file error", "-2": "stream error", "-3": "data error", "-4": "insufficient memory", "-5": "buffer error", "-6": "incompatible version" };
      }, {}], 52: [function(e2, t3, r2) {
        "use strict";
        var i3 = e2("../utils/common"), o3 = 0, h3 = 1;
        function n3(e3) {
          for (var t4 = e3.length; 0 <= --t4; )
            e3[t4] = 0;
        }
        var s3 = 0, a3 = 29, u3 = 256, l3 = u3 + 1 + a3, f3 = 30, c4 = 19, _3 = 2 * l3 + 1, g2 = 15, d2 = 16, p3 = 7, m4 = 256, b2 = 16, v3 = 17, y4 = 18, w2 = [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], k2 = [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], x3 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7], S2 = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15], z2 = new Array(2 * (l3 + 2));
        n3(z2);
        var C2 = new Array(2 * f3);
        n3(C2);
        var E2 = new Array(512);
        n3(E2);
        var A3 = new Array(256);
        n3(A3);
        var I2 = new Array(a3);
        n3(I2);
        var O3, B2, R2, T3 = new Array(f3);
        function D2(e3, t4, r3, n4, i4) {
          this.static_tree = e3, this.extra_bits = t4, this.extra_base = r3, this.elems = n4, this.max_length = i4, this.has_stree = e3 && e3.length;
        }
        function F2(e3, t4) {
          this.dyn_tree = e3, this.max_code = 0, this.stat_desc = t4;
        }
        function N3(e3) {
          return e3 < 256 ? E2[e3] : E2[256 + (e3 >>> 7)];
        }
        function U2(e3, t4) {
          e3.pending_buf[e3.pending++] = 255 & t4, e3.pending_buf[e3.pending++] = t4 >>> 8 & 255;
        }
        function P2(e3, t4, r3) {
          e3.bi_valid > d2 - r3 ? (e3.bi_buf |= t4 << e3.bi_valid & 65535, U2(e3, e3.bi_buf), e3.bi_buf = t4 >> d2 - e3.bi_valid, e3.bi_valid += r3 - d2) : (e3.bi_buf |= t4 << e3.bi_valid & 65535, e3.bi_valid += r3);
        }
        function L2(e3, t4, r3) {
          P2(e3, r3[2 * t4], r3[2 * t4 + 1]);
        }
        function j2(e3, t4) {
          for (var r3 = 0; r3 |= 1 & e3, e3 >>>= 1, r3 <<= 1, 0 < --t4; )
            ;
          return r3 >>> 1;
        }
        function Z2(e3, t4, r3) {
          var n4, i4, s4 = new Array(g2 + 1), a4 = 0;
          for (n4 = 1; n4 <= g2; n4++)
            s4[n4] = a4 = a4 + r3[n4 - 1] << 1;
          for (i4 = 0; i4 <= t4; i4++) {
            var o4 = e3[2 * i4 + 1];
            0 !== o4 && (e3[2 * i4] = j2(s4[o4]++, o4));
          }
        }
        function W2(e3) {
          var t4;
          for (t4 = 0; t4 < l3; t4++)
            e3.dyn_ltree[2 * t4] = 0;
          for (t4 = 0; t4 < f3; t4++)
            e3.dyn_dtree[2 * t4] = 0;
          for (t4 = 0; t4 < c4; t4++)
            e3.bl_tree[2 * t4] = 0;
          e3.dyn_ltree[2 * m4] = 1, e3.opt_len = e3.static_len = 0, e3.last_lit = e3.matches = 0;
        }
        function M2(e3) {
          8 < e3.bi_valid ? U2(e3, e3.bi_buf) : 0 < e3.bi_valid && (e3.pending_buf[e3.pending++] = e3.bi_buf), e3.bi_buf = 0, e3.bi_valid = 0;
        }
        function H2(e3, t4, r3, n4) {
          var i4 = 2 * t4, s4 = 2 * r3;
          return e3[i4] < e3[s4] || e3[i4] === e3[s4] && n4[t4] <= n4[r3];
        }
        function G3(e3, t4, r3) {
          for (var n4 = e3.heap[r3], i4 = r3 << 1; i4 <= e3.heap_len && (i4 < e3.heap_len && H2(t4, e3.heap[i4 + 1], e3.heap[i4], e3.depth) && i4++, !H2(t4, n4, e3.heap[i4], e3.depth)); )
            e3.heap[r3] = e3.heap[i4], r3 = i4, i4 <<= 1;
          e3.heap[r3] = n4;
        }
        function K2(e3, t4, r3) {
          var n4, i4, s4, a4, o4 = 0;
          if (0 !== e3.last_lit)
            for (; n4 = e3.pending_buf[e3.d_buf + 2 * o4] << 8 | e3.pending_buf[e3.d_buf + 2 * o4 + 1], i4 = e3.pending_buf[e3.l_buf + o4], o4++, 0 === n4 ? L2(e3, i4, t4) : (L2(e3, (s4 = A3[i4]) + u3 + 1, t4), 0 !== (a4 = w2[s4]) && P2(e3, i4 -= I2[s4], a4), L2(e3, s4 = N3(--n4), r3), 0 !== (a4 = k2[s4]) && P2(e3, n4 -= T3[s4], a4)), o4 < e3.last_lit; )
              ;
          L2(e3, m4, t4);
        }
        function Y2(e3, t4) {
          var r3, n4, i4, s4 = t4.dyn_tree, a4 = t4.stat_desc.static_tree, o4 = t4.stat_desc.has_stree, h4 = t4.stat_desc.elems, u4 = -1;
          for (e3.heap_len = 0, e3.heap_max = _3, r3 = 0; r3 < h4; r3++)
            0 !== s4[2 * r3] ? (e3.heap[++e3.heap_len] = u4 = r3, e3.depth[r3] = 0) : s4[2 * r3 + 1] = 0;
          for (; e3.heap_len < 2; )
            s4[2 * (i4 = e3.heap[++e3.heap_len] = u4 < 2 ? ++u4 : 0)] = 1, e3.depth[i4] = 0, e3.opt_len--, o4 && (e3.static_len -= a4[2 * i4 + 1]);
          for (t4.max_code = u4, r3 = e3.heap_len >> 1; 1 <= r3; r3--)
            G3(e3, s4, r3);
          for (i4 = h4; r3 = e3.heap[1], e3.heap[1] = e3.heap[e3.heap_len--], G3(e3, s4, 1), n4 = e3.heap[1], e3.heap[--e3.heap_max] = r3, e3.heap[--e3.heap_max] = n4, s4[2 * i4] = s4[2 * r3] + s4[2 * n4], e3.depth[i4] = (e3.depth[r3] >= e3.depth[n4] ? e3.depth[r3] : e3.depth[n4]) + 1, s4[2 * r3 + 1] = s4[2 * n4 + 1] = i4, e3.heap[1] = i4++, G3(e3, s4, 1), 2 <= e3.heap_len; )
            ;
          e3.heap[--e3.heap_max] = e3.heap[1], function(e4, t5) {
            var r4, n5, i5, s5, a5, o5, h5 = t5.dyn_tree, u5 = t5.max_code, l4 = t5.stat_desc.static_tree, f4 = t5.stat_desc.has_stree, c5 = t5.stat_desc.extra_bits, d3 = t5.stat_desc.extra_base, p4 = t5.stat_desc.max_length, m5 = 0;
            for (s5 = 0; s5 <= g2; s5++)
              e4.bl_count[s5] = 0;
            for (h5[2 * e4.heap[e4.heap_max] + 1] = 0, r4 = e4.heap_max + 1; r4 < _3; r4++)
              p4 < (s5 = h5[2 * h5[2 * (n5 = e4.heap[r4]) + 1] + 1] + 1) && (s5 = p4, m5++), h5[2 * n5 + 1] = s5, u5 < n5 || (e4.bl_count[s5]++, a5 = 0, d3 <= n5 && (a5 = c5[n5 - d3]), o5 = h5[2 * n5], e4.opt_len += o5 * (s5 + a5), f4 && (e4.static_len += o5 * (l4[2 * n5 + 1] + a5)));
            if (0 !== m5) {
              do {
                for (s5 = p4 - 1; 0 === e4.bl_count[s5]; )
                  s5--;
                e4.bl_count[s5]--, e4.bl_count[s5 + 1] += 2, e4.bl_count[p4]--, m5 -= 2;
              } while (0 < m5);
              for (s5 = p4; 0 !== s5; s5--)
                for (n5 = e4.bl_count[s5]; 0 !== n5; )
                  u5 < (i5 = e4.heap[--r4]) || (h5[2 * i5 + 1] !== s5 && (e4.opt_len += (s5 - h5[2 * i5 + 1]) * h5[2 * i5], h5[2 * i5 + 1] = s5), n5--);
            }
          }(e3, t4), Z2(s4, u4, e3.bl_count);
        }
        function X2(e3, t4, r3) {
          var n4, i4, s4 = -1, a4 = t4[1], o4 = 0, h4 = 7, u4 = 4;
          for (0 === a4 && (h4 = 138, u4 = 3), t4[2 * (r3 + 1) + 1] = 65535, n4 = 0; n4 <= r3; n4++)
            i4 = a4, a4 = t4[2 * (n4 + 1) + 1], ++o4 < h4 && i4 === a4 || (o4 < u4 ? e3.bl_tree[2 * i4] += o4 : 0 !== i4 ? (i4 !== s4 && e3.bl_tree[2 * i4]++, e3.bl_tree[2 * b2]++) : o4 <= 10 ? e3.bl_tree[2 * v3]++ : e3.bl_tree[2 * y4]++, s4 = i4, u4 = (o4 = 0) === a4 ? (h4 = 138, 3) : i4 === a4 ? (h4 = 6, 3) : (h4 = 7, 4));
        }
        function V2(e3, t4, r3) {
          var n4, i4, s4 = -1, a4 = t4[1], o4 = 0, h4 = 7, u4 = 4;
          for (0 === a4 && (h4 = 138, u4 = 3), n4 = 0; n4 <= r3; n4++)
            if (i4 = a4, a4 = t4[2 * (n4 + 1) + 1], !(++o4 < h4 && i4 === a4)) {
              if (o4 < u4)
                for (; L2(e3, i4, e3.bl_tree), 0 != --o4; )
                  ;
              else
                0 !== i4 ? (i4 !== s4 && (L2(e3, i4, e3.bl_tree), o4--), L2(e3, b2, e3.bl_tree), P2(e3, o4 - 3, 2)) : o4 <= 10 ? (L2(e3, v3, e3.bl_tree), P2(e3, o4 - 3, 3)) : (L2(e3, y4, e3.bl_tree), P2(e3, o4 - 11, 7));
              s4 = i4, u4 = (o4 = 0) === a4 ? (h4 = 138, 3) : i4 === a4 ? (h4 = 6, 3) : (h4 = 7, 4);
            }
        }
        n3(T3);
        var q2 = false;
        function J2(e3, t4, r3, n4) {
          P2(e3, (s3 << 1) + (n4 ? 1 : 0), 3), function(e4, t5, r4, n5) {
            M2(e4), n5 && (U2(e4, r4), U2(e4, ~r4)), i3.arraySet(e4.pending_buf, e4.window, t5, r4, e4.pending), e4.pending += r4;
          }(e3, t4, r3, true);
        }
        r2._tr_init = function(e3) {
          q2 || (function() {
            var e4, t4, r3, n4, i4, s4 = new Array(g2 + 1);
            for (n4 = r3 = 0; n4 < a3 - 1; n4++)
              for (I2[n4] = r3, e4 = 0; e4 < 1 << w2[n4]; e4++)
                A3[r3++] = n4;
            for (A3[r3 - 1] = n4, n4 = i4 = 0; n4 < 16; n4++)
              for (T3[n4] = i4, e4 = 0; e4 < 1 << k2[n4]; e4++)
                E2[i4++] = n4;
            for (i4 >>= 7; n4 < f3; n4++)
              for (T3[n4] = i4 << 7, e4 = 0; e4 < 1 << k2[n4] - 7; e4++)
                E2[256 + i4++] = n4;
            for (t4 = 0; t4 <= g2; t4++)
              s4[t4] = 0;
            for (e4 = 0; e4 <= 143; )
              z2[2 * e4 + 1] = 8, e4++, s4[8]++;
            for (; e4 <= 255; )
              z2[2 * e4 + 1] = 9, e4++, s4[9]++;
            for (; e4 <= 279; )
              z2[2 * e4 + 1] = 7, e4++, s4[7]++;
            for (; e4 <= 287; )
              z2[2 * e4 + 1] = 8, e4++, s4[8]++;
            for (Z2(z2, l3 + 1, s4), e4 = 0; e4 < f3; e4++)
              C2[2 * e4 + 1] = 5, C2[2 * e4] = j2(e4, 5);
            O3 = new D2(z2, w2, u3 + 1, l3, g2), B2 = new D2(C2, k2, 0, f3, g2), R2 = new D2(new Array(0), x3, 0, c4, p3);
          }(), q2 = true), e3.l_desc = new F2(e3.dyn_ltree, O3), e3.d_desc = new F2(e3.dyn_dtree, B2), e3.bl_desc = new F2(e3.bl_tree, R2), e3.bi_buf = 0, e3.bi_valid = 0, W2(e3);
        }, r2._tr_stored_block = J2, r2._tr_flush_block = function(e3, t4, r3, n4) {
          var i4, s4, a4 = 0;
          0 < e3.level ? (2 === e3.strm.data_type && (e3.strm.data_type = function(e4) {
            var t5, r4 = 4093624447;
            for (t5 = 0; t5 <= 31; t5++, r4 >>>= 1)
              if (1 & r4 && 0 !== e4.dyn_ltree[2 * t5])
                return o3;
            if (0 !== e4.dyn_ltree[18] || 0 !== e4.dyn_ltree[20] || 0 !== e4.dyn_ltree[26])
              return h3;
            for (t5 = 32; t5 < u3; t5++)
              if (0 !== e4.dyn_ltree[2 * t5])
                return h3;
            return o3;
          }(e3)), Y2(e3, e3.l_desc), Y2(e3, e3.d_desc), a4 = function(e4) {
            var t5;
            for (X2(e4, e4.dyn_ltree, e4.l_desc.max_code), X2(e4, e4.dyn_dtree, e4.d_desc.max_code), Y2(e4, e4.bl_desc), t5 = c4 - 1; 3 <= t5 && 0 === e4.bl_tree[2 * S2[t5] + 1]; t5--)
              ;
            return e4.opt_len += 3 * (t5 + 1) + 5 + 5 + 4, t5;
          }(e3), i4 = e3.opt_len + 3 + 7 >>> 3, (s4 = e3.static_len + 3 + 7 >>> 3) <= i4 && (i4 = s4)) : i4 = s4 = r3 + 5, r3 + 4 <= i4 && -1 !== t4 ? J2(e3, t4, r3, n4) : 4 === e3.strategy || s4 === i4 ? (P2(e3, 2 + (n4 ? 1 : 0), 3), K2(e3, z2, C2)) : (P2(e3, 4 + (n4 ? 1 : 0), 3), function(e4, t5, r4, n5) {
            var i5;
            for (P2(e4, t5 - 257, 5), P2(e4, r4 - 1, 5), P2(e4, n5 - 4, 4), i5 = 0; i5 < n5; i5++)
              P2(e4, e4.bl_tree[2 * S2[i5] + 1], 3);
            V2(e4, e4.dyn_ltree, t5 - 1), V2(e4, e4.dyn_dtree, r4 - 1);
          }(e3, e3.l_desc.max_code + 1, e3.d_desc.max_code + 1, a4 + 1), K2(e3, e3.dyn_ltree, e3.dyn_dtree)), W2(e3), n4 && M2(e3);
        }, r2._tr_tally = function(e3, t4, r3) {
          return e3.pending_buf[e3.d_buf + 2 * e3.last_lit] = t4 >>> 8 & 255, e3.pending_buf[e3.d_buf + 2 * e3.last_lit + 1] = 255 & t4, e3.pending_buf[e3.l_buf + e3.last_lit] = 255 & r3, e3.last_lit++, 0 === t4 ? e3.dyn_ltree[2 * r3]++ : (e3.matches++, t4--, e3.dyn_ltree[2 * (A3[r3] + u3 + 1)]++, e3.dyn_dtree[2 * N3(t4)]++), e3.last_lit === e3.lit_bufsize - 1;
        }, r2._tr_align = function(e3) {
          P2(e3, 2, 3), L2(e3, m4, z2), function(e4) {
            16 === e4.bi_valid ? (U2(e4, e4.bi_buf), e4.bi_buf = 0, e4.bi_valid = 0) : 8 <= e4.bi_valid && (e4.pending_buf[e4.pending++] = 255 & e4.bi_buf, e4.bi_buf >>= 8, e4.bi_valid -= 8);
          }(e3);
        };
      }, { "../utils/common": 41 }], 53: [function(e2, t3, r2) {
        "use strict";
        t3.exports = function() {
          this.input = null, this.next_in = 0, this.avail_in = 0, this.total_in = 0, this.output = null, this.next_out = 0, this.avail_out = 0, this.total_out = 0, this.msg = "", this.state = null, this.data_type = 2, this.adler = 0;
        };
      }, {}], 54: [function(e2, t3, r2) {
        (function(e3) {
          !function(r3, n3) {
            "use strict";
            if (!r3.setImmediate) {
              var i3, s3, t4, a3, o3 = 1, h3 = {}, u3 = false, l3 = r3.document, e4 = Object.getPrototypeOf && Object.getPrototypeOf(r3);
              e4 = e4 && e4.setTimeout ? e4 : r3, i3 = "[object process]" === {}.toString.call(r3.process) ? function(e5) {
                process.nextTick(function() {
                  c4(e5);
                });
              } : function() {
                if (r3.postMessage && !r3.importScripts) {
                  var e5 = true, t5 = r3.onmessage;
                  return r3.onmessage = function() {
                    e5 = false;
                  }, r3.postMessage("", "*"), r3.onmessage = t5, e5;
                }
              }() ? (a3 = "setImmediate$" + Math.random() + "$", r3.addEventListener ? r3.addEventListener("message", d2, false) : r3.attachEvent("onmessage", d2), function(e5) {
                r3.postMessage(a3 + e5, "*");
              }) : r3.MessageChannel ? ((t4 = new MessageChannel()).port1.onmessage = function(e5) {
                c4(e5.data);
              }, function(e5) {
                t4.port2.postMessage(e5);
              }) : l3 && "onreadystatechange" in l3.createElement("script") ? (s3 = l3.documentElement, function(e5) {
                var t5 = l3.createElement("script");
                t5.onreadystatechange = function() {
                  c4(e5), t5.onreadystatechange = null, s3.removeChild(t5), t5 = null;
                }, s3.appendChild(t5);
              }) : function(e5) {
                setTimeout(c4, 0, e5);
              }, e4.setImmediate = function(e5) {
                "function" != typeof e5 && (e5 = new Function("" + e5));
                for (var t5 = new Array(arguments.length - 1), r4 = 0; r4 < t5.length; r4++)
                  t5[r4] = arguments[r4 + 1];
                var n4 = { callback: e5, args: t5 };
                return h3[o3] = n4, i3(o3), o3++;
              }, e4.clearImmediate = f3;
            }
            function f3(e5) {
              delete h3[e5];
            }
            function c4(e5) {
              if (u3)
                setTimeout(c4, 0, e5);
              else {
                var t5 = h3[e5];
                if (t5) {
                  u3 = true;
                  try {
                    !function(e6) {
                      var t6 = e6.callback, r4 = e6.args;
                      switch (r4.length) {
                        case 0:
                          t6();
                          break;
                        case 1:
                          t6(r4[0]);
                          break;
                        case 2:
                          t6(r4[0], r4[1]);
                          break;
                        case 3:
                          t6(r4[0], r4[1], r4[2]);
                          break;
                        default:
                          t6.apply(n3, r4);
                      }
                    }(t5);
                  } finally {
                    f3(e5), u3 = false;
                  }
                }
              }
            }
            function d2(e5) {
              e5.source === r3 && "string" == typeof e5.data && 0 === e5.data.indexOf(a3) && c4(+e5.data.slice(a3.length));
            }
          }("undefined" == typeof self ? void 0 === e3 ? this : e3 : self);
        }).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {});
      }, {}] }, {}, [10])(10);
    });
  }
});

// ../simple-mind-map/node_modules/safe-buffer/index.js
var require_safe_buffer = __commonJS({
  "../simple-mind-map/node_modules/safe-buffer/index.js"(exports, module) {
    var buffer = __require("buffer");
    var Buffer2 = buffer.Buffer;
    function copyProps(src, dst) {
      for (var key in src) {
        dst[key] = src[key];
      }
    }
    if (Buffer2.from && Buffer2.alloc && Buffer2.allocUnsafe && Buffer2.allocUnsafeSlow) {
      module.exports = buffer;
    } else {
      copyProps(buffer, exports);
      exports.Buffer = SafeBuffer;
    }
    function SafeBuffer(arg, encodingOrOffset, length2) {
      return Buffer2(arg, encodingOrOffset, length2);
    }
    copyProps(Buffer2, SafeBuffer);
    SafeBuffer.from = function(arg, encodingOrOffset, length2) {
      if (typeof arg === "number") {
        throw new TypeError("Argument must not be a number");
      }
      return Buffer2(arg, encodingOrOffset, length2);
    };
    SafeBuffer.alloc = function(size2, fill, encoding) {
      if (typeof size2 !== "number") {
        throw new TypeError("Argument must be a number");
      }
      var buf = Buffer2(size2);
      if (fill !== void 0) {
        if (typeof encoding === "string") {
          buf.fill(fill, encoding);
        } else {
          buf.fill(fill);
        }
      } else {
        buf.fill(0);
      }
      return buf;
    };
    SafeBuffer.allocUnsafe = function(size2) {
      if (typeof size2 !== "number") {
        throw new TypeError("Argument must be a number");
      }
      return Buffer2(size2);
    };
    SafeBuffer.allocUnsafeSlow = function(size2) {
      if (typeof size2 !== "number") {
        throw new TypeError("Argument must be a number");
      }
      return buffer.SlowBuffer(size2);
    };
  }
});

// ../simple-mind-map/node_modules/string_decoder/lib/string_decoder.js
var require_string_decoder = __commonJS({
  "../simple-mind-map/node_modules/string_decoder/lib/string_decoder.js"(exports) {
    "use strict";
    var Buffer2 = require_safe_buffer().Buffer;
    var isEncoding = Buffer2.isEncoding || function(encoding) {
      encoding = "" + encoding;
      switch (encoding && encoding.toLowerCase()) {
        case "hex":
        case "utf8":
        case "utf-8":
        case "ascii":
        case "binary":
        case "base64":
        case "ucs2":
        case "ucs-2":
        case "utf16le":
        case "utf-16le":
        case "raw":
          return true;
        default:
          return false;
      }
    };
    function _normalizeEncoding(enc) {
      if (!enc)
        return "utf8";
      var retried;
      while (true) {
        switch (enc) {
          case "utf8":
          case "utf-8":
            return "utf8";
          case "ucs2":
          case "ucs-2":
          case "utf16le":
          case "utf-16le":
            return "utf16le";
          case "latin1":
          case "binary":
            return "latin1";
          case "base64":
          case "ascii":
          case "hex":
            return enc;
          default:
            if (retried)
              return;
            enc = ("" + enc).toLowerCase();
            retried = true;
        }
      }
    }
    function normalizeEncoding(enc) {
      var nenc = _normalizeEncoding(enc);
      if (typeof nenc !== "string" && (Buffer2.isEncoding === isEncoding || !isEncoding(enc)))
        throw new Error("Unknown encoding: " + enc);
      return nenc || enc;
    }
    exports.StringDecoder = StringDecoder;
    function StringDecoder(encoding) {
      this.encoding = normalizeEncoding(encoding);
      var nb;
      switch (this.encoding) {
        case "utf16le":
          this.text = utf16Text;
          this.end = utf16End;
          nb = 4;
          break;
        case "utf8":
          this.fillLast = utf8FillLast;
          nb = 4;
          break;
        case "base64":
          this.text = base64Text;
          this.end = base64End;
          nb = 3;
          break;
        default:
          this.write = simpleWrite;
          this.end = simpleEnd;
          return;
      }
      this.lastNeed = 0;
      this.lastTotal = 0;
      this.lastChar = Buffer2.allocUnsafe(nb);
    }
    StringDecoder.prototype.write = function(buf) {
      if (buf.length === 0)
        return "";
      var r2;
      var i3;
      if (this.lastNeed) {
        r2 = this.fillLast(buf);
        if (r2 === void 0)
          return "";
        i3 = this.lastNeed;
        this.lastNeed = 0;
      } else {
        i3 = 0;
      }
      if (i3 < buf.length)
        return r2 ? r2 + this.text(buf, i3) : this.text(buf, i3);
      return r2 || "";
    };
    StringDecoder.prototype.end = utf8End;
    StringDecoder.prototype.text = utf8Text;
    StringDecoder.prototype.fillLast = function(buf) {
      if (this.lastNeed <= buf.length) {
        buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
        return this.lastChar.toString(this.encoding, 0, this.lastTotal);
      }
      buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
      this.lastNeed -= buf.length;
    };
    function utf8CheckByte(byte) {
      if (byte <= 127)
        return 0;
      else if (byte >> 5 === 6)
        return 2;
      else if (byte >> 4 === 14)
        return 3;
      else if (byte >> 3 === 30)
        return 4;
      return byte >> 6 === 2 ? -1 : -2;
    }
    function utf8CheckIncomplete(self2, buf, i3) {
      var j2 = buf.length - 1;
      if (j2 < i3)
        return 0;
      var nb = utf8CheckByte(buf[j2]);
      if (nb >= 0) {
        if (nb > 0)
          self2.lastNeed = nb - 1;
        return nb;
      }
      if (--j2 < i3 || nb === -2)
        return 0;
      nb = utf8CheckByte(buf[j2]);
      if (nb >= 0) {
        if (nb > 0)
          self2.lastNeed = nb - 2;
        return nb;
      }
      if (--j2 < i3 || nb === -2)
        return 0;
      nb = utf8CheckByte(buf[j2]);
      if (nb >= 0) {
        if (nb > 0) {
          if (nb === 2)
            nb = 0;
          else
            self2.lastNeed = nb - 3;
        }
        return nb;
      }
      return 0;
    }
    function utf8CheckExtraBytes(self2, buf, p3) {
      if ((buf[0] & 192) !== 128) {
        self2.lastNeed = 0;
        return "\uFFFD";
      }
      if (self2.lastNeed > 1 && buf.length > 1) {
        if ((buf[1] & 192) !== 128) {
          self2.lastNeed = 1;
          return "\uFFFD";
        }
        if (self2.lastNeed > 2 && buf.length > 2) {
          if ((buf[2] & 192) !== 128) {
            self2.lastNeed = 2;
            return "\uFFFD";
          }
        }
      }
    }
    function utf8FillLast(buf) {
      var p3 = this.lastTotal - this.lastNeed;
      var r2 = utf8CheckExtraBytes(this, buf, p3);
      if (r2 !== void 0)
        return r2;
      if (this.lastNeed <= buf.length) {
        buf.copy(this.lastChar, p3, 0, this.lastNeed);
        return this.lastChar.toString(this.encoding, 0, this.lastTotal);
      }
      buf.copy(this.lastChar, p3, 0, buf.length);
      this.lastNeed -= buf.length;
    }
    function utf8Text(buf, i3) {
      var total = utf8CheckIncomplete(this, buf, i3);
      if (!this.lastNeed)
        return buf.toString("utf8", i3);
      this.lastTotal = total;
      var end = buf.length - (total - this.lastNeed);
      buf.copy(this.lastChar, 0, end);
      return buf.toString("utf8", i3, end);
    }
    function utf8End(buf) {
      var r2 = buf && buf.length ? this.write(buf) : "";
      if (this.lastNeed)
        return r2 + "\uFFFD";
      return r2;
    }
    function utf16Text(buf, i3) {
      if ((buf.length - i3) % 2 === 0) {
        var r2 = buf.toString("utf16le", i3);
        if (r2) {
          var c4 = r2.charCodeAt(r2.length - 1);
          if (c4 >= 55296 && c4 <= 56319) {
            this.lastNeed = 2;
            this.lastTotal = 4;
            this.lastChar[0] = buf[buf.length - 2];
            this.lastChar[1] = buf[buf.length - 1];
            return r2.slice(0, -1);
          }
        }
        return r2;
      }
      this.lastNeed = 1;
      this.lastTotal = 2;
      this.lastChar[0] = buf[buf.length - 1];
      return buf.toString("utf16le", i3, buf.length - 1);
    }
    function utf16End(buf) {
      var r2 = buf && buf.length ? this.write(buf) : "";
      if (this.lastNeed) {
        var end = this.lastTotal - this.lastNeed;
        return r2 + this.lastChar.toString("utf16le", 0, end);
      }
      return r2;
    }
    function base64Text(buf, i3) {
      var n3 = (buf.length - i3) % 3;
      if (n3 === 0)
        return buf.toString("base64", i3);
      this.lastNeed = 3 - n3;
      this.lastTotal = 3;
      if (n3 === 1) {
        this.lastChar[0] = buf[buf.length - 1];
      } else {
        this.lastChar[0] = buf[buf.length - 2];
        this.lastChar[1] = buf[buf.length - 1];
      }
      return buf.toString("base64", i3, buf.length - n3);
    }
    function base64End(buf) {
      var r2 = buf && buf.length ? this.write(buf) : "";
      if (this.lastNeed)
        return r2 + this.lastChar.toString("base64", 0, 3 - this.lastNeed);
      return r2;
    }
    function simpleWrite(buf) {
      return buf.toString(this.encoding);
    }
    function simpleEnd(buf) {
      return buf && buf.length ? this.write(buf) : "";
    }
  }
});

// ../simple-mind-map/node_modules/sax/lib/sax.js
var require_sax = __commonJS({
  "../simple-mind-map/node_modules/sax/lib/sax.js"(exports) {
    (function(sax) {
      sax.parser = function(strict, opt) {
        return new SAXParser(strict, opt);
      };
      sax.SAXParser = SAXParser;
      sax.SAXStream = SAXStream;
      sax.createStream = createStream;
      sax.MAX_BUFFER_LENGTH = 64 * 1024;
      var buffers = [
        "comment",
        "sgmlDecl",
        "textNode",
        "tagName",
        "doctype",
        "procInstName",
        "procInstBody",
        "entity",
        "attribName",
        "attribValue",
        "cdata",
        "script"
      ];
      sax.EVENTS = [
        "text",
        "processinginstruction",
        "sgmldeclaration",
        "doctype",
        "comment",
        "opentagstart",
        "attribute",
        "opentag",
        "closetag",
        "opencdata",
        "cdata",
        "closecdata",
        "error",
        "end",
        "ready",
        "script",
        "opennamespace",
        "closenamespace"
      ];
      function SAXParser(strict, opt) {
        if (!(this instanceof SAXParser)) {
          return new SAXParser(strict, opt);
        }
        var parser2 = this;
        clearBuffers(parser2);
        parser2.q = parser2.c = "";
        parser2.bufferCheckPosition = sax.MAX_BUFFER_LENGTH;
        parser2.opt = opt || {};
        parser2.opt.lowercase = parser2.opt.lowercase || parser2.opt.lowercasetags;
        parser2.looseCase = parser2.opt.lowercase ? "toLowerCase" : "toUpperCase";
        parser2.tags = [];
        parser2.closed = parser2.closedRoot = parser2.sawRoot = false;
        parser2.tag = parser2.error = null;
        parser2.strict = !!strict;
        parser2.noscript = !!(strict || parser2.opt.noscript);
        parser2.state = S2.BEGIN;
        parser2.strictEntities = parser2.opt.strictEntities;
        parser2.ENTITIES = parser2.strictEntities ? Object.create(sax.XML_ENTITIES) : Object.create(sax.ENTITIES);
        parser2.attribList = [];
        if (parser2.opt.xmlns) {
          parser2.ns = Object.create(rootNS);
        }
        parser2.trackPosition = parser2.opt.position !== false;
        if (parser2.trackPosition) {
          parser2.position = parser2.line = parser2.column = 0;
        }
        emit(parser2, "onready");
      }
      if (!Object.create) {
        Object.create = function(o3) {
          function F2() {
          }
          F2.prototype = o3;
          var newf = new F2();
          return newf;
        };
      }
      if (!Object.keys) {
        Object.keys = function(o3) {
          var a3 = [];
          for (var i3 in o3)
            if (o3.hasOwnProperty(i3))
              a3.push(i3);
          return a3;
        };
      }
      function checkBufferLength(parser2) {
        var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10);
        var maxActual = 0;
        for (var i3 = 0, l3 = buffers.length; i3 < l3; i3++) {
          var len = parser2[buffers[i3]].length;
          if (len > maxAllowed) {
            switch (buffers[i3]) {
              case "textNode":
                closeText(parser2);
                break;
              case "cdata":
                emitNode(parser2, "oncdata", parser2.cdata);
                parser2.cdata = "";
                break;
              case "script":
                emitNode(parser2, "onscript", parser2.script);
                parser2.script = "";
                break;
              default:
                error(parser2, "Max buffer length exceeded: " + buffers[i3]);
            }
          }
          maxActual = Math.max(maxActual, len);
        }
        var m4 = sax.MAX_BUFFER_LENGTH - maxActual;
        parser2.bufferCheckPosition = m4 + parser2.position;
      }
      function clearBuffers(parser2) {
        for (var i3 = 0, l3 = buffers.length; i3 < l3; i3++) {
          parser2[buffers[i3]] = "";
        }
      }
      function flushBuffers(parser2) {
        closeText(parser2);
        if (parser2.cdata !== "") {
          emitNode(parser2, "oncdata", parser2.cdata);
          parser2.cdata = "";
        }
        if (parser2.script !== "") {
          emitNode(parser2, "onscript", parser2.script);
          parser2.script = "";
        }
      }
      SAXParser.prototype = {
        end: function() {
          end(this);
        },
        write,
        resume: function() {
          this.error = null;
          return this;
        },
        close: function() {
          return this.write(null);
        },
        flush: function() {
          flushBuffers(this);
        }
      };
      var Stream;
      try {
        Stream = __require("stream").Stream;
      } catch (ex) {
        Stream = function() {
        };
      }
      var streamWraps = sax.EVENTS.filter(function(ev) {
        return ev !== "error" && ev !== "end";
      });
      function createStream(strict, opt) {
        return new SAXStream(strict, opt);
      }
      function SAXStream(strict, opt) {
        if (!(this instanceof SAXStream)) {
          return new SAXStream(strict, opt);
        }
        Stream.apply(this);
        this._parser = new SAXParser(strict, opt);
        this.writable = true;
        this.readable = true;
        var me2 = this;
        this._parser.onend = function() {
          me2.emit("end");
        };
        this._parser.onerror = function(er) {
          me2.emit("error", er);
          me2._parser.error = null;
        };
        this._decoder = null;
        streamWraps.forEach(function(ev) {
          Object.defineProperty(me2, "on" + ev, {
            get: function() {
              return me2._parser["on" + ev];
            },
            set: function(h3) {
              if (!h3) {
                me2.removeAllListeners(ev);
                me2._parser["on" + ev] = h3;
                return h3;
              }
              me2.on(ev, h3);
            },
            enumerable: true,
            configurable: false
          });
        });
      }
      SAXStream.prototype = Object.create(Stream.prototype, {
        constructor: {
          value: SAXStream
        }
      });
      SAXStream.prototype.write = function(data2) {
        if (typeof Buffer === "function" && typeof Buffer.isBuffer === "function" && Buffer.isBuffer(data2)) {
          if (!this._decoder) {
            var SD = require_string_decoder().StringDecoder;
            this._decoder = new SD("utf8");
          }
          data2 = this._decoder.write(data2);
        }
        this._parser.write(data2.toString());
        this.emit("data", data2);
        return true;
      };
      SAXStream.prototype.end = function(chunk) {
        if (chunk && chunk.length) {
          this.write(chunk);
        }
        this._parser.end();
        return true;
      };
      SAXStream.prototype.on = function(ev, handler) {
        var me2 = this;
        if (!me2._parser["on" + ev] && streamWraps.indexOf(ev) !== -1) {
          me2._parser["on" + ev] = function() {
            var args = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments);
            args.splice(0, 0, ev);
            me2.emit.apply(me2, args);
          };
        }
        return Stream.prototype.on.call(me2, ev, handler);
      };
      var CDATA = "[CDATA[";
      var DOCTYPE = "DOCTYPE";
      var XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace";
      var XMLNS_NAMESPACE = "http://www.w3.org/2000/xmlns/";
      var rootNS = { xml: XML_NAMESPACE, xmlns: XMLNS_NAMESPACE };
      var nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;
      var nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;
      var entityStart = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;
      var entityBody = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;
      function isWhitespace(c4) {
        return c4 === " " || c4 === "\n" || c4 === "\r" || c4 === "	";
      }
      function isQuote(c4) {
        return c4 === '"' || c4 === "'";
      }
      function isAttribEnd(c4) {
        return c4 === ">" || isWhitespace(c4);
      }
      function isMatch(regex, c4) {
        return regex.test(c4);
      }
      function notMatch(regex, c4) {
        return !isMatch(regex, c4);
      }
      var S2 = 0;
      sax.STATE = {
        BEGIN: S2++,
        // leading byte order mark or whitespace
        BEGIN_WHITESPACE: S2++,
        // leading whitespace
        TEXT: S2++,
        // general stuff
        TEXT_ENTITY: S2++,
        // &amp and such.
        OPEN_WAKA: S2++,
        // <
        SGML_DECL: S2++,
        // <!BLARG
        SGML_DECL_QUOTED: S2++,
        // <!BLARG foo "bar
        DOCTYPE: S2++,
        // <!DOCTYPE
        DOCTYPE_QUOTED: S2++,
        // <!DOCTYPE "//blah
        DOCTYPE_DTD: S2++,
        // <!DOCTYPE "//blah" [ ...
        DOCTYPE_DTD_QUOTED: S2++,
        // <!DOCTYPE "//blah" [ "foo
        COMMENT_STARTING: S2++,
        // <!-
        COMMENT: S2++,
        // <!--
        COMMENT_ENDING: S2++,
        // <!-- blah -
        COMMENT_ENDED: S2++,
        // <!-- blah --
        CDATA: S2++,
        // <![CDATA[ something
        CDATA_ENDING: S2++,
        // ]
        CDATA_ENDING_2: S2++,
        // ]]
        PROC_INST: S2++,
        // <?hi
        PROC_INST_BODY: S2++,
        // <?hi there
        PROC_INST_ENDING: S2++,
        // <?hi "there" ?
        OPEN_TAG: S2++,
        // <strong
        OPEN_TAG_SLASH: S2++,
        // <strong /
        ATTRIB: S2++,
        // <a
        ATTRIB_NAME: S2++,
        // <a foo
        ATTRIB_NAME_SAW_WHITE: S2++,
        // <a foo _
        ATTRIB_VALUE: S2++,
        // <a foo=
        ATTRIB_VALUE_QUOTED: S2++,
        // <a foo="bar
        ATTRIB_VALUE_CLOSED: S2++,
        // <a foo="bar"
        ATTRIB_VALUE_UNQUOTED: S2++,
        // <a foo=bar
        ATTRIB_VALUE_ENTITY_Q: S2++,
        // <foo bar="&quot;"
        ATTRIB_VALUE_ENTITY_U: S2++,
        // <foo bar=&quot
        CLOSE_TAG: S2++,
        // </a
        CLOSE_TAG_SAW_WHITE: S2++,
        // </a   >
        SCRIPT: S2++,
        // <script> ...
        SCRIPT_ENDING: S2++
        // <script> ... <
      };
      sax.XML_ENTITIES = {
        "amp": "&",
        "gt": ">",
        "lt": "<",
        "quot": '"',
        "apos": "'"
      };
      sax.ENTITIES = {
        "amp": "&",
        "gt": ">",
        "lt": "<",
        "quot": '"',
        "apos": "'",
        "AElig": 198,
        "Aacute": 193,
        "Acirc": 194,
        "Agrave": 192,
        "Aring": 197,
        "Atilde": 195,
        "Auml": 196,
        "Ccedil": 199,
        "ETH": 208,
        "Eacute": 201,
        "Ecirc": 202,
        "Egrave": 200,
        "Euml": 203,
        "Iacute": 205,
        "Icirc": 206,
        "Igrave": 204,
        "Iuml": 207,
        "Ntilde": 209,
        "Oacute": 211,
        "Ocirc": 212,
        "Ograve": 210,
        "Oslash": 216,
        "Otilde": 213,
        "Ouml": 214,
        "THORN": 222,
        "Uacute": 218,
        "Ucirc": 219,
        "Ugrave": 217,
        "Uuml": 220,
        "Yacute": 221,
        "aacute": 225,
        "acirc": 226,
        "aelig": 230,
        "agrave": 224,
        "aring": 229,
        "atilde": 227,
        "auml": 228,
        "ccedil": 231,
        "eacute": 233,
        "ecirc": 234,
        "egrave": 232,
        "eth": 240,
        "euml": 235,
        "iacute": 237,
        "icirc": 238,
        "igrave": 236,
        "iuml": 239,
        "ntilde": 241,
        "oacute": 243,
        "ocirc": 244,
        "ograve": 242,
        "oslash": 248,
        "otilde": 245,
        "ouml": 246,
        "szlig": 223,
        "thorn": 254,
        "uacute": 250,
        "ucirc": 251,
        "ugrave": 249,
        "uuml": 252,
        "yacute": 253,
        "yuml": 255,
        "copy": 169,
        "reg": 174,
        "nbsp": 160,
        "iexcl": 161,
        "cent": 162,
        "pound": 163,
        "curren": 164,
        "yen": 165,
        "brvbar": 166,
        "sect": 167,
        "uml": 168,
        "ordf": 170,
        "laquo": 171,
        "not": 172,
        "shy": 173,
        "macr": 175,
        "deg": 176,
        "plusmn": 177,
        "sup1": 185,
        "sup2": 178,
        "sup3": 179,
        "acute": 180,
        "micro": 181,
        "para": 182,
        "middot": 183,
        "cedil": 184,
        "ordm": 186,
        "raquo": 187,
        "frac14": 188,
        "frac12": 189,
        "frac34": 190,
        "iquest": 191,
        "times": 215,
        "divide": 247,
        "OElig": 338,
        "oelig": 339,
        "Scaron": 352,
        "scaron": 353,
        "Yuml": 376,
        "fnof": 402,
        "circ": 710,
        "tilde": 732,
        "Alpha": 913,
        "Beta": 914,
        "Gamma": 915,
        "Delta": 916,
        "Epsilon": 917,
        "Zeta": 918,
        "Eta": 919,
        "Theta": 920,
        "Iota": 921,
        "Kappa": 922,
        "Lambda": 923,
        "Mu": 924,
        "Nu": 925,
        "Xi": 926,
        "Omicron": 927,
        "Pi": 928,
        "Rho": 929,
        "Sigma": 931,
        "Tau": 932,
        "Upsilon": 933,
        "Phi": 934,
        "Chi": 935,
        "Psi": 936,
        "Omega": 937,
        "alpha": 945,
        "beta": 946,
        "gamma": 947,
        "delta": 948,
        "epsilon": 949,
        "zeta": 950,
        "eta": 951,
        "theta": 952,
        "iota": 953,
        "kappa": 954,
        "lambda": 955,
        "mu": 956,
        "nu": 957,
        "xi": 958,
        "omicron": 959,
        "pi": 960,
        "rho": 961,
        "sigmaf": 962,
        "sigma": 963,
        "tau": 964,
        "upsilon": 965,
        "phi": 966,
        "chi": 967,
        "psi": 968,
        "omega": 969,
        "thetasym": 977,
        "upsih": 978,
        "piv": 982,
        "ensp": 8194,
        "emsp": 8195,
        "thinsp": 8201,
        "zwnj": 8204,
        "zwj": 8205,
        "lrm": 8206,
        "rlm": 8207,
        "ndash": 8211,
        "mdash": 8212,
        "lsquo": 8216,
        "rsquo": 8217,
        "sbquo": 8218,
        "ldquo": 8220,
        "rdquo": 8221,
        "bdquo": 8222,
        "dagger": 8224,
        "Dagger": 8225,
        "bull": 8226,
        "hellip": 8230,
        "permil": 8240,
        "prime": 8242,
        "Prime": 8243,
        "lsaquo": 8249,
        "rsaquo": 8250,
        "oline": 8254,
        "frasl": 8260,
        "euro": 8364,
        "image": 8465,
        "weierp": 8472,
        "real": 8476,
        "trade": 8482,
        "alefsym": 8501,
        "larr": 8592,
        "uarr": 8593,
        "rarr": 8594,
        "darr": 8595,
        "harr": 8596,
        "crarr": 8629,
        "lArr": 8656,
        "uArr": 8657,
        "rArr": 8658,
        "dArr": 8659,
        "hArr": 8660,
        "forall": 8704,
        "part": 8706,
        "exist": 8707,
        "empty": 8709,
        "nabla": 8711,
        "isin": 8712,
        "notin": 8713,
        "ni": 8715,
        "prod": 8719,
        "sum": 8721,
        "minus": 8722,
        "lowast": 8727,
        "radic": 8730,
        "prop": 8733,
        "infin": 8734,
        "ang": 8736,
        "and": 8743,
        "or": 8744,
        "cap": 8745,
        "cup": 8746,
        "int": 8747,
        "there4": 8756,
        "sim": 8764,
        "cong": 8773,
        "asymp": 8776,
        "ne": 8800,
        "equiv": 8801,
        "le": 8804,
        "ge": 8805,
        "sub": 8834,
        "sup": 8835,
        "nsub": 8836,
        "sube": 8838,
        "supe": 8839,
        "oplus": 8853,
        "otimes": 8855,
        "perp": 8869,
        "sdot": 8901,
        "lceil": 8968,
        "rceil": 8969,
        "lfloor": 8970,
        "rfloor": 8971,
        "lang": 9001,
        "rang": 9002,
        "loz": 9674,
        "spades": 9824,
        "clubs": 9827,
        "hearts": 9829,
        "diams": 9830
      };
      Object.keys(sax.ENTITIES).forEach(function(key) {
        var e2 = sax.ENTITIES[key];
        var s4 = typeof e2 === "number" ? String.fromCharCode(e2) : e2;
        sax.ENTITIES[key] = s4;
      });
      for (var s3 in sax.STATE) {
        sax.STATE[sax.STATE[s3]] = s3;
      }
      S2 = sax.STATE;
      function emit(parser2, event, data2) {
        parser2[event] && parser2[event](data2);
      }
      function emitNode(parser2, nodeType, data2) {
        if (parser2.textNode)
          closeText(parser2);
        emit(parser2, nodeType, data2);
      }
      function closeText(parser2) {
        parser2.textNode = textopts(parser2.opt, parser2.textNode);
        if (parser2.textNode)
          emit(parser2, "ontext", parser2.textNode);
        parser2.textNode = "";
      }
      function textopts(opt, text3) {
        if (opt.trim)
          text3 = text3.trim();
        if (opt.normalize)
          text3 = text3.replace(/\s+/g, " ");
        return text3;
      }
      function error(parser2, er) {
        closeText(parser2);
        if (parser2.trackPosition) {
          er += "\nLine: " + parser2.line + "\nColumn: " + parser2.column + "\nChar: " + parser2.c;
        }
        er = new Error(er);
        parser2.error = er;
        emit(parser2, "onerror", er);
        return parser2;
      }
      function end(parser2) {
        if (parser2.sawRoot && !parser2.closedRoot)
          strictFail(parser2, "Unclosed root tag");
        if (parser2.state !== S2.BEGIN && parser2.state !== S2.BEGIN_WHITESPACE && parser2.state !== S2.TEXT) {
          error(parser2, "Unexpected end");
        }
        closeText(parser2);
        parser2.c = "";
        parser2.closed = true;
        emit(parser2, "onend");
        SAXParser.call(parser2, parser2.strict, parser2.opt);
        return parser2;
      }
      function strictFail(parser2, message) {
        if (typeof parser2 !== "object" || !(parser2 instanceof SAXParser)) {
          throw new Error("bad call to strictFail");
        }
        if (parser2.strict) {
          error(parser2, message);
        }
      }
      function newTag(parser2) {
        if (!parser2.strict)
          parser2.tagName = parser2.tagName[parser2.looseCase]();
        var parent = parser2.tags[parser2.tags.length - 1] || parser2;
        var tag = parser2.tag = { name: parser2.tagName, attributes: {} };
        if (parser2.opt.xmlns) {
          tag.ns = parent.ns;
        }
        parser2.attribList.length = 0;
        emitNode(parser2, "onopentagstart", tag);
      }
      function qname(name, attribute) {
        var i3 = name.indexOf(":");
        var qualName = i3 < 0 ? ["", name] : name.split(":");
        var prefix = qualName[0];
        var local = qualName[1];
        if (attribute && name === "xmlns") {
          prefix = "xmlns";
          local = "";
        }
        return { prefix, local };
      }
      function attrib(parser2) {
        if (!parser2.strict) {
          parser2.attribName = parser2.attribName[parser2.looseCase]();
        }
        if (parser2.attribList.indexOf(parser2.attribName) !== -1 || parser2.tag.attributes.hasOwnProperty(parser2.attribName)) {
          parser2.attribName = parser2.attribValue = "";
          return;
        }
        if (parser2.opt.xmlns) {
          var qn = qname(parser2.attribName, true);
          var prefix = qn.prefix;
          var local = qn.local;
          if (prefix === "xmlns") {
            if (local === "xml" && parser2.attribValue !== XML_NAMESPACE) {
              strictFail(
                parser2,
                "xml: prefix must be bound to " + XML_NAMESPACE + "\nActual: " + parser2.attribValue
              );
            } else if (local === "xmlns" && parser2.attribValue !== XMLNS_NAMESPACE) {
              strictFail(
                parser2,
                "xmlns: prefix must be bound to " + XMLNS_NAMESPACE + "\nActual: " + parser2.attribValue
              );
            } else {
              var tag = parser2.tag;
              var parent = parser2.tags[parser2.tags.length - 1] || parser2;
              if (tag.ns === parent.ns) {
                tag.ns = Object.create(parent.ns);
              }
              tag.ns[local] = parser2.attribValue;
            }
          }
          parser2.attribList.push([parser2.attribName, parser2.attribValue]);
        } else {
          parser2.tag.attributes[parser2.attribName] = parser2.attribValue;
          emitNode(parser2, "onattribute", {
            name: parser2.attribName,
            value: parser2.attribValue
          });
        }
        parser2.attribName = parser2.attribValue = "";
      }
      function openTag(parser2, selfClosing) {
        if (parser2.opt.xmlns) {
          var tag = parser2.tag;
          var qn = qname(parser2.tagName);
          tag.prefix = qn.prefix;
          tag.local = qn.local;
          tag.uri = tag.ns[qn.prefix] || "";
          if (tag.prefix && !tag.uri) {
            strictFail(parser2, "Unbound namespace prefix: " + JSON.stringify(parser2.tagName));
            tag.uri = qn.prefix;
          }
          var parent = parser2.tags[parser2.tags.length - 1] || parser2;
          if (tag.ns && parent.ns !== tag.ns) {
            Object.keys(tag.ns).forEach(function(p3) {
              emitNode(parser2, "onopennamespace", {
                prefix: p3,
                uri: tag.ns[p3]
              });
            });
          }
          for (var i3 = 0, l3 = parser2.attribList.length; i3 < l3; i3++) {
            var nv = parser2.attribList[i3];
            var name = nv[0];
            var value = nv[1];
            var qualName = qname(name, true);
            var prefix = qualName.prefix;
            var local = qualName.local;
            var uri = prefix === "" ? "" : tag.ns[prefix] || "";
            var a3 = {
              name,
              value,
              prefix,
              local,
              uri
            };
            if (prefix && prefix !== "xmlns" && !uri) {
              strictFail(parser2, "Unbound namespace prefix: " + JSON.stringify(prefix));
              a3.uri = prefix;
            }
            parser2.tag.attributes[name] = a3;
            emitNode(parser2, "onattribute", a3);
          }
          parser2.attribList.length = 0;
        }
        parser2.tag.isSelfClosing = !!selfClosing;
        parser2.sawRoot = true;
        parser2.tags.push(parser2.tag);
        emitNode(parser2, "onopentag", parser2.tag);
        if (!selfClosing) {
          if (!parser2.noscript && parser2.tagName.toLowerCase() === "script") {
            parser2.state = S2.SCRIPT;
          } else {
            parser2.state = S2.TEXT;
          }
          parser2.tag = null;
          parser2.tagName = "";
        }
        parser2.attribName = parser2.attribValue = "";
        parser2.attribList.length = 0;
      }
      function closeTag(parser2) {
        if (!parser2.tagName) {
          strictFail(parser2, "Weird empty close tag.");
          parser2.textNode += "</>";
          parser2.state = S2.TEXT;
          return;
        }
        if (parser2.script) {
          if (parser2.tagName !== "script") {
            parser2.script += "</" + parser2.tagName + ">";
            parser2.tagName = "";
            parser2.state = S2.SCRIPT;
            return;
          }
          emitNode(parser2, "onscript", parser2.script);
          parser2.script = "";
        }
        var t3 = parser2.tags.length;
        var tagName = parser2.tagName;
        if (!parser2.strict) {
          tagName = tagName[parser2.looseCase]();
        }
        var closeTo = tagName;
        while (t3--) {
          var close2 = parser2.tags[t3];
          if (close2.name !== closeTo) {
            strictFail(parser2, "Unexpected close tag");
          } else {
            break;
          }
        }
        if (t3 < 0) {
          strictFail(parser2, "Unmatched closing tag: " + parser2.tagName);
          parser2.textNode += "</" + parser2.tagName + ">";
          parser2.state = S2.TEXT;
          return;
        }
        parser2.tagName = tagName;
        var s4 = parser2.tags.length;
        while (s4-- > t3) {
          var tag = parser2.tag = parser2.tags.pop();
          parser2.tagName = parser2.tag.name;
          emitNode(parser2, "onclosetag", parser2.tagName);
          var x3 = {};
          for (var i3 in tag.ns) {
            x3[i3] = tag.ns[i3];
          }
          var parent = parser2.tags[parser2.tags.length - 1] || parser2;
          if (parser2.opt.xmlns && tag.ns !== parent.ns) {
            Object.keys(tag.ns).forEach(function(p3) {
              var n3 = tag.ns[p3];
              emitNode(parser2, "onclosenamespace", { prefix: p3, uri: n3 });
            });
          }
        }
        if (t3 === 0)
          parser2.closedRoot = true;
        parser2.tagName = parser2.attribValue = parser2.attribName = "";
        parser2.attribList.length = 0;
        parser2.state = S2.TEXT;
      }
      function parseEntity(parser2) {
        var entity = parser2.entity;
        var entityLC = entity.toLowerCase();
        var num;
        var numStr = "";
        if (parser2.ENTITIES[entity]) {
          return parser2.ENTITIES[entity];
        }
        if (parser2.ENTITIES[entityLC]) {
          return parser2.ENTITIES[entityLC];
        }
        entity = entityLC;
        if (entity.charAt(0) === "#") {
          if (entity.charAt(1) === "x") {
            entity = entity.slice(2);
            num = parseInt(entity, 16);
            numStr = num.toString(16);
          } else {
            entity = entity.slice(1);
            num = parseInt(entity, 10);
            numStr = num.toString(10);
          }
        }
        entity = entity.replace(/^0+/, "");
        if (isNaN(num) || numStr.toLowerCase() !== entity) {
          strictFail(parser2, "Invalid character entity");
          return "&" + parser2.entity + ";";
        }
        return String.fromCodePoint(num);
      }
      function beginWhiteSpace(parser2, c4) {
        if (c4 === "<") {
          parser2.state = S2.OPEN_WAKA;
          parser2.startTagPosition = parser2.position;
        } else if (!isWhitespace(c4)) {
          strictFail(parser2, "Non-whitespace before first tag.");
          parser2.textNode = c4;
          parser2.state = S2.TEXT;
        }
      }
      function charAt(chunk, i3) {
        var result = "";
        if (i3 < chunk.length) {
          result = chunk.charAt(i3);
        }
        return result;
      }
      function write(chunk) {
        var parser2 = this;
        if (this.error) {
          throw this.error;
        }
        if (parser2.closed) {
          return error(
            parser2,
            "Cannot write after close. Assign an onready handler."
          );
        }
        if (chunk === null) {
          return end(parser2);
        }
        if (typeof chunk === "object") {
          chunk = chunk.toString();
        }
        var i3 = 0;
        var c4 = "";
        while (true) {
          c4 = charAt(chunk, i3++);
          parser2.c = c4;
          if (!c4) {
            break;
          }
          if (parser2.trackPosition) {
            parser2.position++;
            if (c4 === "\n") {
              parser2.line++;
              parser2.column = 0;
            } else {
              parser2.column++;
            }
          }
          switch (parser2.state) {
            case S2.BEGIN:
              parser2.state = S2.BEGIN_WHITESPACE;
              if (c4 === "\uFEFF") {
                continue;
              }
              beginWhiteSpace(parser2, c4);
              continue;
            case S2.BEGIN_WHITESPACE:
              beginWhiteSpace(parser2, c4);
              continue;
            case S2.TEXT:
              if (parser2.sawRoot && !parser2.closedRoot) {
                var starti = i3 - 1;
                while (c4 && c4 !== "<" && c4 !== "&") {
                  c4 = charAt(chunk, i3++);
                  if (c4 && parser2.trackPosition) {
                    parser2.position++;
                    if (c4 === "\n") {
                      parser2.line++;
                      parser2.column = 0;
                    } else {
                      parser2.column++;
                    }
                  }
                }
                parser2.textNode += chunk.substring(starti, i3 - 1);
              }
              if (c4 === "<" && !(parser2.sawRoot && parser2.closedRoot && !parser2.strict)) {
                parser2.state = S2.OPEN_WAKA;
                parser2.startTagPosition = parser2.position;
              } else {
                if (!isWhitespace(c4) && (!parser2.sawRoot || parser2.closedRoot)) {
                  strictFail(parser2, "Text data outside of root node.");
                }
                if (c4 === "&") {
                  parser2.state = S2.TEXT_ENTITY;
                } else {
                  parser2.textNode += c4;
                }
              }
              continue;
            case S2.SCRIPT:
              if (c4 === "<") {
                parser2.state = S2.SCRIPT_ENDING;
              } else {
                parser2.script += c4;
              }
              continue;
            case S2.SCRIPT_ENDING:
              if (c4 === "/") {
                parser2.state = S2.CLOSE_TAG;
              } else {
                parser2.script += "<" + c4;
                parser2.state = S2.SCRIPT;
              }
              continue;
            case S2.OPEN_WAKA:
              if (c4 === "!") {
                parser2.state = S2.SGML_DECL;
                parser2.sgmlDecl = "";
              } else if (isWhitespace(c4)) {
              } else if (isMatch(nameStart, c4)) {
                parser2.state = S2.OPEN_TAG;
                parser2.tagName = c4;
              } else if (c4 === "/") {
                parser2.state = S2.CLOSE_TAG;
                parser2.tagName = "";
              } else if (c4 === "?") {
                parser2.state = S2.PROC_INST;
                parser2.procInstName = parser2.procInstBody = "";
              } else {
                strictFail(parser2, "Unencoded <");
                if (parser2.startTagPosition + 1 < parser2.position) {
                  var pad = parser2.position - parser2.startTagPosition;
                  c4 = new Array(pad).join(" ") + c4;
                }
                parser2.textNode += "<" + c4;
                parser2.state = S2.TEXT;
              }
              continue;
            case S2.SGML_DECL:
              if ((parser2.sgmlDecl + c4).toUpperCase() === CDATA) {
                emitNode(parser2, "onopencdata");
                parser2.state = S2.CDATA;
                parser2.sgmlDecl = "";
                parser2.cdata = "";
              } else if (parser2.sgmlDecl + c4 === "--") {
                parser2.state = S2.COMMENT;
                parser2.comment = "";
                parser2.sgmlDecl = "";
              } else if ((parser2.sgmlDecl + c4).toUpperCase() === DOCTYPE) {
                parser2.state = S2.DOCTYPE;
                if (parser2.doctype || parser2.sawRoot) {
                  strictFail(
                    parser2,
                    "Inappropriately located doctype declaration"
                  );
                }
                parser2.doctype = "";
                parser2.sgmlDecl = "";
              } else if (c4 === ">") {
                emitNode(parser2, "onsgmldeclaration", parser2.sgmlDecl);
                parser2.sgmlDecl = "";
                parser2.state = S2.TEXT;
              } else if (isQuote(c4)) {
                parser2.state = S2.SGML_DECL_QUOTED;
                parser2.sgmlDecl += c4;
              } else {
                parser2.sgmlDecl += c4;
              }
              continue;
            case S2.SGML_DECL_QUOTED:
              if (c4 === parser2.q) {
                parser2.state = S2.SGML_DECL;
                parser2.q = "";
              }
              parser2.sgmlDecl += c4;
              continue;
            case S2.DOCTYPE:
              if (c4 === ">") {
                parser2.state = S2.TEXT;
                emitNode(parser2, "ondoctype", parser2.doctype);
                parser2.doctype = true;
              } else {
                parser2.doctype += c4;
                if (c4 === "[") {
                  parser2.state = S2.DOCTYPE_DTD;
                } else if (isQuote(c4)) {
                  parser2.state = S2.DOCTYPE_QUOTED;
                  parser2.q = c4;
                }
              }
              continue;
            case S2.DOCTYPE_QUOTED:
              parser2.doctype += c4;
              if (c4 === parser2.q) {
                parser2.q = "";
                parser2.state = S2.DOCTYPE;
              }
              continue;
            case S2.DOCTYPE_DTD:
              parser2.doctype += c4;
              if (c4 === "]") {
                parser2.state = S2.DOCTYPE;
              } else if (isQuote(c4)) {
                parser2.state = S2.DOCTYPE_DTD_QUOTED;
                parser2.q = c4;
              }
              continue;
            case S2.DOCTYPE_DTD_QUOTED:
              parser2.doctype += c4;
              if (c4 === parser2.q) {
                parser2.state = S2.DOCTYPE_DTD;
                parser2.q = "";
              }
              continue;
            case S2.COMMENT:
              if (c4 === "-") {
                parser2.state = S2.COMMENT_ENDING;
              } else {
                parser2.comment += c4;
              }
              continue;
            case S2.COMMENT_ENDING:
              if (c4 === "-") {
                parser2.state = S2.COMMENT_ENDED;
                parser2.comment = textopts(parser2.opt, parser2.comment);
                if (parser2.comment) {
                  emitNode(parser2, "oncomment", parser2.comment);
                }
                parser2.comment = "";
              } else {
                parser2.comment += "-" + c4;
                parser2.state = S2.COMMENT;
              }
              continue;
            case S2.COMMENT_ENDED:
              if (c4 !== ">") {
                strictFail(parser2, "Malformed comment");
                parser2.comment += "--" + c4;
                parser2.state = S2.COMMENT;
              } else {
                parser2.state = S2.TEXT;
              }
              continue;
            case S2.CDATA:
              if (c4 === "]") {
                parser2.state = S2.CDATA_ENDING;
              } else {
                parser2.cdata += c4;
              }
              continue;
            case S2.CDATA_ENDING:
              if (c4 === "]") {
                parser2.state = S2.CDATA_ENDING_2;
              } else {
                parser2.cdata += "]" + c4;
                parser2.state = S2.CDATA;
              }
              continue;
            case S2.CDATA_ENDING_2:
              if (c4 === ">") {
                if (parser2.cdata) {
                  emitNode(parser2, "oncdata", parser2.cdata);
                }
                emitNode(parser2, "onclosecdata");
                parser2.cdata = "";
                parser2.state = S2.TEXT;
              } else if (c4 === "]") {
                parser2.cdata += "]";
              } else {
                parser2.cdata += "]]" + c4;
                parser2.state = S2.CDATA;
              }
              continue;
            case S2.PROC_INST:
              if (c4 === "?") {
                parser2.state = S2.PROC_INST_ENDING;
              } else if (isWhitespace(c4)) {
                parser2.state = S2.PROC_INST_BODY;
              } else {
                parser2.procInstName += c4;
              }
              continue;
            case S2.PROC_INST_BODY:
              if (!parser2.procInstBody && isWhitespace(c4)) {
                continue;
              } else if (c4 === "?") {
                parser2.state = S2.PROC_INST_ENDING;
              } else {
                parser2.procInstBody += c4;
              }
              continue;
            case S2.PROC_INST_ENDING:
              if (c4 === ">") {
                emitNode(parser2, "onprocessinginstruction", {
                  name: parser2.procInstName,
                  body: parser2.procInstBody
                });
                parser2.procInstName = parser2.procInstBody = "";
                parser2.state = S2.TEXT;
              } else {
                parser2.procInstBody += "?" + c4;
                parser2.state = S2.PROC_INST_BODY;
              }
              continue;
            case S2.OPEN_TAG:
              if (isMatch(nameBody, c4)) {
                parser2.tagName += c4;
              } else {
                newTag(parser2);
                if (c4 === ">") {
                  openTag(parser2);
                } else if (c4 === "/") {
                  parser2.state = S2.OPEN_TAG_SLASH;
                } else {
                  if (!isWhitespace(c4)) {
                    strictFail(parser2, "Invalid character in tag name");
                  }
                  parser2.state = S2.ATTRIB;
                }
              }
              continue;
            case S2.OPEN_TAG_SLASH:
              if (c4 === ">") {
                openTag(parser2, true);
                closeTag(parser2);
              } else {
                strictFail(parser2, "Forward-slash in opening tag not followed by >");
                parser2.state = S2.ATTRIB;
              }
              continue;
            case S2.ATTRIB:
              if (isWhitespace(c4)) {
                continue;
              } else if (c4 === ">") {
                openTag(parser2);
              } else if (c4 === "/") {
                parser2.state = S2.OPEN_TAG_SLASH;
              } else if (isMatch(nameStart, c4)) {
                parser2.attribName = c4;
                parser2.attribValue = "";
                parser2.state = S2.ATTRIB_NAME;
              } else {
                strictFail(parser2, "Invalid attribute name");
              }
              continue;
            case S2.ATTRIB_NAME:
              if (c4 === "=") {
                parser2.state = S2.ATTRIB_VALUE;
              } else if (c4 === ">") {
                strictFail(parser2, "Attribute without value");
                parser2.attribValue = parser2.attribName;
                attrib(parser2);
                openTag(parser2);
              } else if (isWhitespace(c4)) {
                parser2.state = S2.ATTRIB_NAME_SAW_WHITE;
              } else if (isMatch(nameBody, c4)) {
                parser2.attribName += c4;
              } else {
                strictFail(parser2, "Invalid attribute name");
              }
              continue;
            case S2.ATTRIB_NAME_SAW_WHITE:
              if (c4 === "=") {
                parser2.state = S2.ATTRIB_VALUE;
              } else if (isWhitespace(c4)) {
                continue;
              } else {
                strictFail(parser2, "Attribute without value");
                parser2.tag.attributes[parser2.attribName] = "";
                parser2.attribValue = "";
                emitNode(parser2, "onattribute", {
                  name: parser2.attribName,
                  value: ""
                });
                parser2.attribName = "";
                if (c4 === ">") {
                  openTag(parser2);
                } else if (isMatch(nameStart, c4)) {
                  parser2.attribName = c4;
                  parser2.state = S2.ATTRIB_NAME;
                } else {
                  strictFail(parser2, "Invalid attribute name");
                  parser2.state = S2.ATTRIB;
                }
              }
              continue;
            case S2.ATTRIB_VALUE:
              if (isWhitespace(c4)) {
                continue;
              } else if (isQuote(c4)) {
                parser2.q = c4;
                parser2.state = S2.ATTRIB_VALUE_QUOTED;
              } else {
                strictFail(parser2, "Unquoted attribute value");
                parser2.state = S2.ATTRIB_VALUE_UNQUOTED;
                parser2.attribValue = c4;
              }
              continue;
            case S2.ATTRIB_VALUE_QUOTED:
              if (c4 !== parser2.q) {
                if (c4 === "&") {
                  parser2.state = S2.ATTRIB_VALUE_ENTITY_Q;
                } else {
                  parser2.attribValue += c4;
                }
                continue;
              }
              attrib(parser2);
              parser2.q = "";
              parser2.state = S2.ATTRIB_VALUE_CLOSED;
              continue;
            case S2.ATTRIB_VALUE_CLOSED:
              if (isWhitespace(c4)) {
                parser2.state = S2.ATTRIB;
              } else if (c4 === ">") {
                openTag(parser2);
              } else if (c4 === "/") {
                parser2.state = S2.OPEN_TAG_SLASH;
              } else if (isMatch(nameStart, c4)) {
                strictFail(parser2, "No whitespace between attributes");
                parser2.attribName = c4;
                parser2.attribValue = "";
                parser2.state = S2.ATTRIB_NAME;
              } else {
                strictFail(parser2, "Invalid attribute name");
              }
              continue;
            case S2.ATTRIB_VALUE_UNQUOTED:
              if (!isAttribEnd(c4)) {
                if (c4 === "&") {
                  parser2.state = S2.ATTRIB_VALUE_ENTITY_U;
                } else {
                  parser2.attribValue += c4;
                }
                continue;
              }
              attrib(parser2);
              if (c4 === ">") {
                openTag(parser2);
              } else {
                parser2.state = S2.ATTRIB;
              }
              continue;
            case S2.CLOSE_TAG:
              if (!parser2.tagName) {
                if (isWhitespace(c4)) {
                  continue;
                } else if (notMatch(nameStart, c4)) {
                  if (parser2.script) {
                    parser2.script += "</" + c4;
                    parser2.state = S2.SCRIPT;
                  } else {
                    strictFail(parser2, "Invalid tagname in closing tag.");
                  }
                } else {
                  parser2.tagName = c4;
                }
              } else if (c4 === ">") {
                closeTag(parser2);
              } else if (isMatch(nameBody, c4)) {
                parser2.tagName += c4;
              } else if (parser2.script) {
                parser2.script += "</" + parser2.tagName;
                parser2.tagName = "";
                parser2.state = S2.SCRIPT;
              } else {
                if (!isWhitespace(c4)) {
                  strictFail(parser2, "Invalid tagname in closing tag");
                }
                parser2.state = S2.CLOSE_TAG_SAW_WHITE;
              }
              continue;
            case S2.CLOSE_TAG_SAW_WHITE:
              if (isWhitespace(c4)) {
                continue;
              }
              if (c4 === ">") {
                closeTag(parser2);
              } else {
                strictFail(parser2, "Invalid characters in closing tag");
              }
              continue;
            case S2.TEXT_ENTITY:
            case S2.ATTRIB_VALUE_ENTITY_Q:
            case S2.ATTRIB_VALUE_ENTITY_U:
              var returnState;
              var buffer;
              switch (parser2.state) {
                case S2.TEXT_ENTITY:
                  returnState = S2.TEXT;
                  buffer = "textNode";
                  break;
                case S2.ATTRIB_VALUE_ENTITY_Q:
                  returnState = S2.ATTRIB_VALUE_QUOTED;
                  buffer = "attribValue";
                  break;
                case S2.ATTRIB_VALUE_ENTITY_U:
                  returnState = S2.ATTRIB_VALUE_UNQUOTED;
                  buffer = "attribValue";
                  break;
              }
              if (c4 === ";") {
                parser2[buffer] += parseEntity(parser2);
                parser2.entity = "";
                parser2.state = returnState;
              } else if (isMatch(parser2.entity.length ? entityBody : entityStart, c4)) {
                parser2.entity += c4;
              } else {
                strictFail(parser2, "Invalid character in entity name");
                parser2[buffer] += "&" + parser2.entity + c4;
                parser2.entity = "";
                parser2.state = returnState;
              }
              continue;
            default:
              throw new Error(parser2, "Unknown state: " + parser2.state);
          }
        }
        if (parser2.position >= parser2.bufferCheckPosition) {
          checkBufferLength(parser2);
        }
        return parser2;
      }
      if (!String.fromCodePoint) {
        (function() {
          var stringFromCharCode = String.fromCharCode;
          var floor = Math.floor;
          var fromCodePoint = function() {
            var MAX_SIZE = 16384;
            var codeUnits = [];
            var highSurrogate;
            var lowSurrogate;
            var index3 = -1;
            var length2 = arguments.length;
            if (!length2) {
              return "";
            }
            var result = "";
            while (++index3 < length2) {
              var codePoint = Number(arguments[index3]);
              if (!isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity`
              codePoint < 0 || // not a valid Unicode code point
              codePoint > 1114111 || // not a valid Unicode code point
              floor(codePoint) !== codePoint) {
                throw RangeError("Invalid code point: " + codePoint);
              }
              if (codePoint <= 65535) {
                codeUnits.push(codePoint);
              } else {
                codePoint -= 65536;
                highSurrogate = (codePoint >> 10) + 55296;
                lowSurrogate = codePoint % 1024 + 56320;
                codeUnits.push(highSurrogate, lowSurrogate);
              }
              if (index3 + 1 === length2 || codeUnits.length > MAX_SIZE) {
                result += stringFromCharCode.apply(null, codeUnits);
                codeUnits.length = 0;
              }
            }
            return result;
          };
          if (Object.defineProperty) {
            Object.defineProperty(String, "fromCodePoint", {
              value: fromCodePoint,
              configurable: true,
              writable: true
            });
          } else {
            String.fromCodePoint = fromCodePoint;
          }
        })();
      }
    })(typeof exports === "undefined" ? exports.sax = {} : exports);
  }
});

// ../simple-mind-map/node_modules/xml-js/lib/array-helper.js
var require_array_helper = __commonJS({
  "../simple-mind-map/node_modules/xml-js/lib/array-helper.js"(exports, module) {
    module.exports = {
      isArray: function(value) {
        if (Array.isArray) {
          return Array.isArray(value);
        }
        return Object.prototype.toString.call(value) === "[object Array]";
      }
    };
  }
});

// ../simple-mind-map/node_modules/xml-js/lib/options-helper.js
var require_options_helper = __commonJS({
  "../simple-mind-map/node_modules/xml-js/lib/options-helper.js"(exports, module) {
    var isArray2 = require_array_helper().isArray;
    module.exports = {
      copyOptions: function(options) {
        var key, copy = {};
        for (key in options) {
          if (options.hasOwnProperty(key)) {
            copy[key] = options[key];
          }
        }
        return copy;
      },
      ensureFlagExists: function(item, options) {
        if (!(item in options) || typeof options[item] !== "boolean") {
          options[item] = false;
        }
      },
      ensureSpacesExists: function(options) {
        if (!("spaces" in options) || typeof options.spaces !== "number" && typeof options.spaces !== "string") {
          options.spaces = 0;
        }
      },
      ensureAlwaysArrayExists: function(options) {
        if (!("alwaysArray" in options) || typeof options.alwaysArray !== "boolean" && !isArray2(options.alwaysArray)) {
          options.alwaysArray = false;
        }
      },
      ensureKeyExists: function(key, options) {
        if (!(key + "Key" in options) || typeof options[key + "Key"] !== "string") {
          options[key + "Key"] = options.compact ? "_" + key : key;
        }
      },
      checkFnExists: function(key, options) {
        return key + "Fn" in options;
      }
    };
  }
});

// ../simple-mind-map/node_modules/xml-js/lib/xml2js.js
var require_xml2js = __commonJS({
  "../simple-mind-map/node_modules/xml-js/lib/xml2js.js"(exports, module) {
    var sax = require_sax();
    var expat = { on: function() {
    }, parse: function() {
    } };
    var helper = require_options_helper();
    var isArray2 = require_array_helper().isArray;
    var options;
    var pureJsParser = true;
    var currentElement;
    function validateOptions(userOptions) {
      options = helper.copyOptions(userOptions);
      helper.ensureFlagExists("ignoreDeclaration", options);
      helper.ensureFlagExists("ignoreInstruction", options);
      helper.ensureFlagExists("ignoreAttributes", options);
      helper.ensureFlagExists("ignoreText", options);
      helper.ensureFlagExists("ignoreComment", options);
      helper.ensureFlagExists("ignoreCdata", options);
      helper.ensureFlagExists("ignoreDoctype", options);
      helper.ensureFlagExists("compact", options);
      helper.ensureFlagExists("alwaysChildren", options);
      helper.ensureFlagExists("addParent", options);
      helper.ensureFlagExists("trim", options);
      helper.ensureFlagExists("nativeType", options);
      helper.ensureFlagExists("nativeTypeAttributes", options);
      helper.ensureFlagExists("sanitize", options);
      helper.ensureFlagExists("instructionHasAttributes", options);
      helper.ensureFlagExists("captureSpacesBetweenElements", options);
      helper.ensureAlwaysArrayExists(options);
      helper.ensureKeyExists("declaration", options);
      helper.ensureKeyExists("instruction", options);
      helper.ensureKeyExists("attributes", options);
      helper.ensureKeyExists("text", options);
      helper.ensureKeyExists("comment", options);
      helper.ensureKeyExists("cdata", options);
      helper.ensureKeyExists("doctype", options);
      helper.ensureKeyExists("type", options);
      helper.ensureKeyExists("name", options);
      helper.ensureKeyExists("elements", options);
      helper.ensureKeyExists("parent", options);
      helper.checkFnExists("doctype", options);
      helper.checkFnExists("instruction", options);
      helper.checkFnExists("cdata", options);
      helper.checkFnExists("comment", options);
      helper.checkFnExists("text", options);
      helper.checkFnExists("instructionName", options);
      helper.checkFnExists("elementName", options);
      helper.checkFnExists("attributeName", options);
      helper.checkFnExists("attributeValue", options);
      helper.checkFnExists("attributes", options);
      return options;
    }
    function nativeType(value) {
      var nValue = Number(value);
      if (!isNaN(nValue)) {
        return nValue;
      }
      var bValue = value.toLowerCase();
      if (bValue === "true") {
        return true;
      } else if (bValue === "false") {
        return false;
      }
      return value;
    }
    function addField(type, value) {
      var key;
      if (options.compact) {
        if (!currentElement[options[type + "Key"]] && (isArray2(options.alwaysArray) ? options.alwaysArray.indexOf(options[type + "Key"]) !== -1 : options.alwaysArray)) {
          currentElement[options[type + "Key"]] = [];
        }
        if (currentElement[options[type + "Key"]] && !isArray2(currentElement[options[type + "Key"]])) {
          currentElement[options[type + "Key"]] = [currentElement[options[type + "Key"]]];
        }
        if (type + "Fn" in options && typeof value === "string") {
          value = options[type + "Fn"](value, currentElement);
        }
        if (type === "instruction" && ("instructionFn" in options || "instructionNameFn" in options)) {
          for (key in value) {
            if (value.hasOwnProperty(key)) {
              if ("instructionFn" in options) {
                value[key] = options.instructionFn(value[key], key, currentElement);
              } else {
                var temp = value[key];
                delete value[key];
                value[options.instructionNameFn(key, temp, currentElement)] = temp;
              }
            }
          }
        }
        if (isArray2(currentElement[options[type + "Key"]])) {
          currentElement[options[type + "Key"]].push(value);
        } else {
          currentElement[options[type + "Key"]] = value;
        }
      } else {
        if (!currentElement[options.elementsKey]) {
          currentElement[options.elementsKey] = [];
        }
        var element2 = {};
        element2[options.typeKey] = type;
        if (type === "instruction") {
          for (key in value) {
            if (value.hasOwnProperty(key)) {
              break;
            }
          }
          element2[options.nameKey] = "instructionNameFn" in options ? options.instructionNameFn(key, value, currentElement) : key;
          if (options.instructionHasAttributes) {
            element2[options.attributesKey] = value[key][options.attributesKey];
            if ("instructionFn" in options) {
              element2[options.attributesKey] = options.instructionFn(element2[options.attributesKey], key, currentElement);
            }
          } else {
            if ("instructionFn" in options) {
              value[key] = options.instructionFn(value[key], key, currentElement);
            }
            element2[options.instructionKey] = value[key];
          }
        } else {
          if (type + "Fn" in options) {
            value = options[type + "Fn"](value, currentElement);
          }
          element2[options[type + "Key"]] = value;
        }
        if (options.addParent) {
          element2[options.parentKey] = currentElement;
        }
        currentElement[options.elementsKey].push(element2);
      }
    }
    function manipulateAttributes(attributes) {
      if ("attributesFn" in options && attributes) {
        attributes = options.attributesFn(attributes, currentElement);
      }
      if ((options.trim || "attributeValueFn" in options || "attributeNameFn" in options || options.nativeTypeAttributes) && attributes) {
        var key;
        for (key in attributes) {
          if (attributes.hasOwnProperty(key)) {
            if (options.trim)
              attributes[key] = attributes[key].trim();
            if (options.nativeTypeAttributes) {
              attributes[key] = nativeType(attributes[key]);
            }
            if ("attributeValueFn" in options)
              attributes[key] = options.attributeValueFn(attributes[key], key, currentElement);
            if ("attributeNameFn" in options) {
              var temp = attributes[key];
              delete attributes[key];
              attributes[options.attributeNameFn(key, attributes[key], currentElement)] = temp;
            }
          }
        }
      }
      return attributes;
    }
    function onInstruction(instruction) {
      var attributes = {};
      if (instruction.body && (instruction.name.toLowerCase() === "xml" || options.instructionHasAttributes)) {
        var attrsRegExp = /([\w:-]+)\s*=\s*(?:"([^"]*)"|'([^']*)'|(\w+))\s*/g;
        var match;
        while ((match = attrsRegExp.exec(instruction.body)) !== null) {
          attributes[match[1]] = match[2] || match[3] || match[4];
        }
        attributes = manipulateAttributes(attributes);
      }
      if (instruction.name.toLowerCase() === "xml") {
        if (options.ignoreDeclaration) {
          return;
        }
        currentElement[options.declarationKey] = {};
        if (Object.keys(attributes).length) {
          currentElement[options.declarationKey][options.attributesKey] = attributes;
        }
        if (options.addParent) {
          currentElement[options.declarationKey][options.parentKey] = currentElement;
        }
      } else {
        if (options.ignoreInstruction) {
          return;
        }
        if (options.trim) {
          instruction.body = instruction.body.trim();
        }
        var value = {};
        if (options.instructionHasAttributes && Object.keys(attributes).length) {
          value[instruction.name] = {};
          value[instruction.name][options.attributesKey] = attributes;
        } else {
          value[instruction.name] = instruction.body;
        }
        addField("instruction", value);
      }
    }
    function onStartElement(name, attributes) {
      var element2;
      if (typeof name === "object") {
        attributes = name.attributes;
        name = name.name;
      }
      attributes = manipulateAttributes(attributes);
      if ("elementNameFn" in options) {
        name = options.elementNameFn(name, currentElement);
      }
      if (options.compact) {
        element2 = {};
        if (!options.ignoreAttributes && attributes && Object.keys(attributes).length) {
          element2[options.attributesKey] = {};
          var key;
          for (key in attributes) {
            if (attributes.hasOwnProperty(key)) {
              element2[options.attributesKey][key] = attributes[key];
            }
          }
        }
        if (!(name in currentElement) && (isArray2(options.alwaysArray) ? options.alwaysArray.indexOf(name) !== -1 : options.alwaysArray)) {
          currentElement[name] = [];
        }
        if (currentElement[name] && !isArray2(currentElement[name])) {
          currentElement[name] = [currentElement[name]];
        }
        if (isArray2(currentElement[name])) {
          currentElement[name].push(element2);
        } else {
          currentElement[name] = element2;
        }
      } else {
        if (!currentElement[options.elementsKey]) {
          currentElement[options.elementsKey] = [];
        }
        element2 = {};
        element2[options.typeKey] = "element";
        element2[options.nameKey] = name;
        if (!options.ignoreAttributes && attributes && Object.keys(attributes).length) {
          element2[options.attributesKey] = attributes;
        }
        if (options.alwaysChildren) {
          element2[options.elementsKey] = [];
        }
        currentElement[options.elementsKey].push(element2);
      }
      element2[options.parentKey] = currentElement;
      currentElement = element2;
    }
    function onText(text3) {
      if (options.ignoreText) {
        return;
      }
      if (!text3.trim() && !options.captureSpacesBetweenElements) {
        return;
      }
      if (options.trim) {
        text3 = text3.trim();
      }
      if (options.nativeType) {
        text3 = nativeType(text3);
      }
      if (options.sanitize) {
        text3 = text3.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
      }
      addField("text", text3);
    }
    function onComment(comment) {
      if (options.ignoreComment) {
        return;
      }
      if (options.trim) {
        comment = comment.trim();
      }
      addField("comment", comment);
    }
    function onEndElement(name) {
      var parentElement = currentElement[options.parentKey];
      if (!options.addParent) {
        delete currentElement[options.parentKey];
      }
      currentElement = parentElement;
    }
    function onCdata(cdata) {
      if (options.ignoreCdata) {
        return;
      }
      if (options.trim) {
        cdata = cdata.trim();
      }
      addField("cdata", cdata);
    }
    function onDoctype(doctype) {
      if (options.ignoreDoctype) {
        return;
      }
      doctype = doctype.replace(/^ /, "");
      if (options.trim) {
        doctype = doctype.trim();
      }
      addField("doctype", doctype);
    }
    function onError(error) {
      error.note = error;
    }
    module.exports = function(xml, userOptions) {
      var parser2 = pureJsParser ? sax.parser(true, {}) : parser2 = new expat.Parser("UTF-8");
      var result = {};
      currentElement = result;
      options = validateOptions(userOptions);
      if (pureJsParser) {
        parser2.opt = { strictEntities: true };
        parser2.onopentag = onStartElement;
        parser2.ontext = onText;
        parser2.oncomment = onComment;
        parser2.onclosetag = onEndElement;
        parser2.onerror = onError;
        parser2.oncdata = onCdata;
        parser2.ondoctype = onDoctype;
        parser2.onprocessinginstruction = onInstruction;
      } else {
        parser2.on("startElement", onStartElement);
        parser2.on("text", onText);
        parser2.on("comment", onComment);
        parser2.on("endElement", onEndElement);
        parser2.on("error", onError);
      }
      if (pureJsParser) {
        parser2.write(xml).close();
      } else {
        if (!parser2.parse(xml)) {
          throw new Error("XML parsing error: " + parser2.getError());
        }
      }
      if (result[options.elementsKey]) {
        var temp = result[options.elementsKey];
        delete result[options.elementsKey];
        result[options.elementsKey] = temp;
        delete result.text;
      }
      return result;
    };
  }
});

// ../simple-mind-map/node_modules/xml-js/lib/xml2json.js
var require_xml2json = __commonJS({
  "../simple-mind-map/node_modules/xml-js/lib/xml2json.js"(exports, module) {
    var helper = require_options_helper();
    var xml2js = require_xml2js();
    function validateOptions(userOptions) {
      var options = helper.copyOptions(userOptions);
      helper.ensureSpacesExists(options);
      return options;
    }
    module.exports = function(xml, userOptions) {
      var options, js, json, parentKey;
      options = validateOptions(userOptions);
      js = xml2js(xml, options);
      parentKey = "compact" in options && options.compact ? "_parent" : "parent";
      if ("addParent" in options && options.addParent) {
        json = JSON.stringify(js, function(k2, v3) {
          return k2 === parentKey ? "_" : v3;
        }, options.spaces);
      } else {
        json = JSON.stringify(js, null, options.spaces);
      }
      return json.replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
    };
  }
});

// ../simple-mind-map/node_modules/xml-js/lib/js2xml.js
var require_js2xml = __commonJS({
  "../simple-mind-map/node_modules/xml-js/lib/js2xml.js"(exports, module) {
    var helper = require_options_helper();
    var isArray2 = require_array_helper().isArray;
    var currentElement;
    var currentElementName;
    function validateOptions(userOptions) {
      var options = helper.copyOptions(userOptions);
      helper.ensureFlagExists("ignoreDeclaration", options);
      helper.ensureFlagExists("ignoreInstruction", options);
      helper.ensureFlagExists("ignoreAttributes", options);
      helper.ensureFlagExists("ignoreText", options);
      helper.ensureFlagExists("ignoreComment", options);
      helper.ensureFlagExists("ignoreCdata", options);
      helper.ensureFlagExists("ignoreDoctype", options);
      helper.ensureFlagExists("compact", options);
      helper.ensureFlagExists("indentText", options);
      helper.ensureFlagExists("indentCdata", options);
      helper.ensureFlagExists("indentAttributes", options);
      helper.ensureFlagExists("indentInstruction", options);
      helper.ensureFlagExists("fullTagEmptyElement", options);
      helper.ensureFlagExists("noQuotesForNativeAttributes", options);
      helper.ensureSpacesExists(options);
      if (typeof options.spaces === "number") {
        options.spaces = Array(options.spaces + 1).join(" ");
      }
      helper.ensureKeyExists("declaration", options);
      helper.ensureKeyExists("instruction", options);
      helper.ensureKeyExists("attributes", options);
      helper.ensureKeyExists("text", options);
      helper.ensureKeyExists("comment", options);
      helper.ensureKeyExists("cdata", options);
      helper.ensureKeyExists("doctype", options);
      helper.ensureKeyExists("type", options);
      helper.ensureKeyExists("name", options);
      helper.ensureKeyExists("elements", options);
      helper.checkFnExists("doctype", options);
      helper.checkFnExists("instruction", options);
      helper.checkFnExists("cdata", options);
      helper.checkFnExists("comment", options);
      helper.checkFnExists("text", options);
      helper.checkFnExists("instructionName", options);
      helper.checkFnExists("elementName", options);
      helper.checkFnExists("attributeName", options);
      helper.checkFnExists("attributeValue", options);
      helper.checkFnExists("attributes", options);
      helper.checkFnExists("fullTagEmptyElement", options);
      return options;
    }
    function writeIndentation(options, depth, firstLine) {
      return (!firstLine && options.spaces ? "\n" : "") + Array(depth + 1).join(options.spaces);
    }
    function writeAttributes(attributes, options, depth) {
      if (options.ignoreAttributes) {
        return "";
      }
      if ("attributesFn" in options) {
        attributes = options.attributesFn(attributes, currentElementName, currentElement);
      }
      var key, attr2, attrName, quote, result = [];
      for (key in attributes) {
        if (attributes.hasOwnProperty(key) && attributes[key] !== null && attributes[key] !== void 0) {
          quote = options.noQuotesForNativeAttributes && typeof attributes[key] !== "string" ? "" : '"';
          attr2 = "" + attributes[key];
          attr2 = attr2.replace(/"/g, "&quot;");
          attrName = "attributeNameFn" in options ? options.attributeNameFn(key, attr2, currentElementName, currentElement) : key;
          result.push(options.spaces && options.indentAttributes ? writeIndentation(options, depth + 1, false) : " ");
          result.push(attrName + "=" + quote + ("attributeValueFn" in options ? options.attributeValueFn(attr2, key, currentElementName, currentElement) : attr2) + quote);
        }
      }
      if (attributes && Object.keys(attributes).length && options.spaces && options.indentAttributes) {
        result.push(writeIndentation(options, depth, false));
      }
      return result.join("");
    }
    function writeDeclaration(declaration, options, depth) {
      currentElement = declaration;
      currentElementName = "xml";
      return options.ignoreDeclaration ? "" : "<?xml" + writeAttributes(declaration[options.attributesKey], options, depth) + "?>";
    }
    function writeInstruction(instruction, options, depth) {
      if (options.ignoreInstruction) {
        return "";
      }
      var key;
      for (key in instruction) {
        if (instruction.hasOwnProperty(key)) {
          break;
        }
      }
      var instructionName = "instructionNameFn" in options ? options.instructionNameFn(key, instruction[key], currentElementName, currentElement) : key;
      if (typeof instruction[key] === "object") {
        currentElement = instruction;
        currentElementName = instructionName;
        return "<?" + instructionName + writeAttributes(instruction[key][options.attributesKey], options, depth) + "?>";
      } else {
        var instructionValue = instruction[key] ? instruction[key] : "";
        if ("instructionFn" in options)
          instructionValue = options.instructionFn(instructionValue, key, currentElementName, currentElement);
        return "<?" + instructionName + (instructionValue ? " " + instructionValue : "") + "?>";
      }
    }
    function writeComment(comment, options) {
      return options.ignoreComment ? "" : "<!--" + ("commentFn" in options ? options.commentFn(comment, currentElementName, currentElement) : comment) + "-->";
    }
    function writeCdata(cdata, options) {
      return options.ignoreCdata ? "" : "<![CDATA[" + ("cdataFn" in options ? options.cdataFn(cdata, currentElementName, currentElement) : cdata.replace("]]>", "]]]]><![CDATA[>")) + "]]>";
    }
    function writeDoctype(doctype, options) {
      return options.ignoreDoctype ? "" : "<!DOCTYPE " + ("doctypeFn" in options ? options.doctypeFn(doctype, currentElementName, currentElement) : doctype) + ">";
    }
    function writeText(text3, options) {
      if (options.ignoreText)
        return "";
      text3 = "" + text3;
      text3 = text3.replace(/&amp;/g, "&");
      text3 = text3.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
      return "textFn" in options ? options.textFn(text3, currentElementName, currentElement) : text3;
    }
    function hasContent(element2, options) {
      var i3;
      if (element2.elements && element2.elements.length) {
        for (i3 = 0; i3 < element2.elements.length; ++i3) {
          switch (element2.elements[i3][options.typeKey]) {
            case "text":
              if (options.indentText) {
                return true;
              }
              break;
            case "cdata":
              if (options.indentCdata) {
                return true;
              }
              break;
            case "instruction":
              if (options.indentInstruction) {
                return true;
              }
              break;
            case "doctype":
            case "comment":
            case "element":
              return true;
            default:
              return true;
          }
        }
      }
      return false;
    }
    function writeElement(element2, options, depth) {
      currentElement = element2;
      currentElementName = element2.name;
      var xml = [], elementName = "elementNameFn" in options ? options.elementNameFn(element2.name, element2) : element2.name;
      xml.push("<" + elementName);
      if (element2[options.attributesKey]) {
        xml.push(writeAttributes(element2[options.attributesKey], options, depth));
      }
      var withClosingTag = element2[options.elementsKey] && element2[options.elementsKey].length || element2[options.attributesKey] && element2[options.attributesKey]["xml:space"] === "preserve";
      if (!withClosingTag) {
        if ("fullTagEmptyElementFn" in options) {
          withClosingTag = options.fullTagEmptyElementFn(element2.name, element2);
        } else {
          withClosingTag = options.fullTagEmptyElement;
        }
      }
      if (withClosingTag) {
        xml.push(">");
        if (element2[options.elementsKey] && element2[options.elementsKey].length) {
          xml.push(writeElements(element2[options.elementsKey], options, depth + 1));
          currentElement = element2;
          currentElementName = element2.name;
        }
        xml.push(options.spaces && hasContent(element2, options) ? "\n" + Array(depth + 1).join(options.spaces) : "");
        xml.push("</" + elementName + ">");
      } else {
        xml.push("/>");
      }
      return xml.join("");
    }
    function writeElements(elements3, options, depth, firstLine) {
      return elements3.reduce(function(xml, element2) {
        var indent = writeIndentation(options, depth, firstLine && !xml);
        switch (element2.type) {
          case "element":
            return xml + indent + writeElement(element2, options, depth);
          case "comment":
            return xml + indent + writeComment(element2[options.commentKey], options);
          case "doctype":
            return xml + indent + writeDoctype(element2[options.doctypeKey], options);
          case "cdata":
            return xml + (options.indentCdata ? indent : "") + writeCdata(element2[options.cdataKey], options);
          case "text":
            return xml + (options.indentText ? indent : "") + writeText(element2[options.textKey], options);
          case "instruction":
            var instruction = {};
            instruction[element2[options.nameKey]] = element2[options.attributesKey] ? element2 : element2[options.instructionKey];
            return xml + (options.indentInstruction ? indent : "") + writeInstruction(instruction, options, depth);
        }
      }, "");
    }
    function hasContentCompact(element2, options, anyContent) {
      var key;
      for (key in element2) {
        if (element2.hasOwnProperty(key)) {
          switch (key) {
            case options.parentKey:
            case options.attributesKey:
              break;
            case options.textKey:
              if (options.indentText || anyContent) {
                return true;
              }
              break;
            case options.cdataKey:
              if (options.indentCdata || anyContent) {
                return true;
              }
              break;
            case options.instructionKey:
              if (options.indentInstruction || anyContent) {
                return true;
              }
              break;
            case options.doctypeKey:
            case options.commentKey:
              return true;
            default:
              return true;
          }
        }
      }
      return false;
    }
    function writeElementCompact(element2, name, options, depth, indent) {
      currentElement = element2;
      currentElementName = name;
      var elementName = "elementNameFn" in options ? options.elementNameFn(name, element2) : name;
      if (typeof element2 === "undefined" || element2 === null || element2 === "") {
        return "fullTagEmptyElementFn" in options && options.fullTagEmptyElementFn(name, element2) || options.fullTagEmptyElement ? "<" + elementName + "></" + elementName + ">" : "<" + elementName + "/>";
      }
      var xml = [];
      if (name) {
        xml.push("<" + elementName);
        if (typeof element2 !== "object") {
          xml.push(">" + writeText(element2, options) + "</" + elementName + ">");
          return xml.join("");
        }
        if (element2[options.attributesKey]) {
          xml.push(writeAttributes(element2[options.attributesKey], options, depth));
        }
        var withClosingTag = hasContentCompact(element2, options, true) || element2[options.attributesKey] && element2[options.attributesKey]["xml:space"] === "preserve";
        if (!withClosingTag) {
          if ("fullTagEmptyElementFn" in options) {
            withClosingTag = options.fullTagEmptyElementFn(name, element2);
          } else {
            withClosingTag = options.fullTagEmptyElement;
          }
        }
        if (withClosingTag) {
          xml.push(">");
        } else {
          xml.push("/>");
          return xml.join("");
        }
      }
      xml.push(writeElementsCompact(element2, options, depth + 1, false));
      currentElement = element2;
      currentElementName = name;
      if (name) {
        xml.push((indent ? writeIndentation(options, depth, false) : "") + "</" + elementName + ">");
      }
      return xml.join("");
    }
    function writeElementsCompact(element2, options, depth, firstLine) {
      var i3, key, nodes, xml = [];
      for (key in element2) {
        if (element2.hasOwnProperty(key)) {
          nodes = isArray2(element2[key]) ? element2[key] : [element2[key]];
          for (i3 = 0; i3 < nodes.length; ++i3) {
            switch (key) {
              case options.declarationKey:
                xml.push(writeDeclaration(nodes[i3], options, depth));
                break;
              case options.instructionKey:
                xml.push((options.indentInstruction ? writeIndentation(options, depth, firstLine) : "") + writeInstruction(nodes[i3], options, depth));
                break;
              case options.attributesKey:
              case options.parentKey:
                break;
              case options.textKey:
                xml.push((options.indentText ? writeIndentation(options, depth, firstLine) : "") + writeText(nodes[i3], options));
                break;
              case options.cdataKey:
                xml.push((options.indentCdata ? writeIndentation(options, depth, firstLine) : "") + writeCdata(nodes[i3], options));
                break;
              case options.doctypeKey:
                xml.push(writeIndentation(options, depth, firstLine) + writeDoctype(nodes[i3], options));
                break;
              case options.commentKey:
                xml.push(writeIndentation(options, depth, firstLine) + writeComment(nodes[i3], options));
                break;
              default:
                xml.push(writeIndentation(options, depth, firstLine) + writeElementCompact(nodes[i3], key, options, depth, hasContentCompact(nodes[i3], options)));
            }
            firstLine = firstLine && !xml.length;
          }
        }
      }
      return xml.join("");
    }
    module.exports = function(js, options) {
      options = validateOptions(options);
      var xml = [];
      currentElement = js;
      currentElementName = "_root_";
      if (options.compact) {
        xml.push(writeElementsCompact(js, options, 0, true));
      } else {
        if (js[options.declarationKey]) {
          xml.push(writeDeclaration(js[options.declarationKey], options, 0));
        }
        if (js[options.elementsKey] && js[options.elementsKey].length) {
          xml.push(writeElements(js[options.elementsKey], options, 0, !xml.length));
        }
      }
      return xml.join("");
    };
  }
});

// ../simple-mind-map/node_modules/xml-js/lib/json2xml.js
var require_json2xml = __commonJS({
  "../simple-mind-map/node_modules/xml-js/lib/json2xml.js"(exports, module) {
    var js2xml = require_js2xml();
    module.exports = function(json, options) {
      if (json instanceof Buffer) {
        json = json.toString();
      }
      var js = null;
      if (typeof json === "string") {
        try {
          js = JSON.parse(json);
        } catch (e2) {
          throw new Error("The JSON structure is invalid");
        }
      } else {
        js = json;
      }
      return js2xml(js, options);
    };
  }
});

// ../simple-mind-map/node_modules/xml-js/lib/index.js
var require_lib = __commonJS({
  "../simple-mind-map/node_modules/xml-js/lib/index.js"(exports, module) {
    var xml2js = require_xml2js();
    var xml2json = require_xml2json();
    var js2xml = require_js2xml();
    var json2xml = require_json2xml();
    module.exports = {
      xml2js,
      xml2json,
      js2xml,
      json2xml
    };
  }
});

// ../simple-mind-map/src/constants/constant.js
var tagColorList = [
  {
    color: "rgb(77, 65, 0)",
    background: "rgb(255, 244, 179)"
  },
  {
    color: "rgb(0, 50, 77)",
    background: "rgb(179, 229, 255)"
  },
  {
    color: "rgb(77, 0, 73)",
    background: "rgb(255, 179, 251)"
  },
  {
    color: "rgb(57, 77, 0)",
    background: "rgb(236, 255, 179)"
  },
  {
    color: "rgb(0, 77, 47)",
    background: "rgb(179, 255, 226)"
  }
];
var CONSTANTS = {
  CHANGE_THEME: "changeTheme",
  SET_DATA: "setData",
  TRANSFORM_TO_NORMAL_NODE: "transformAllNodesToNormalNode",
  MODE: {
    READONLY: "readonly",
    EDIT: "edit"
  },
  LAYOUT: {
    LOGICAL_STRUCTURE: "logicalStructure",
    MIND_MAP: "mindMap",
    ORGANIZATION_STRUCTURE: "organizationStructure",
    CATALOG_ORGANIZATION: "catalogOrganization",
    TIMELINE: "timeline",
    TIMELINE2: "timeline2",
    FISHBONE: "fishbone"
  },
  DIR: {
    UP: "up",
    LEFT: "left",
    DOWN: "down",
    RIGHT: "right"
  },
  KEY_DIR: {
    LEFT: "Left",
    UP: "Up",
    RIGHT: "Right",
    DOWN: "Down"
  },
  SHAPE: {
    RECTANGLE: "rectangle",
    DIAMOND: "diamond",
    PARALLELOGRAM: "parallelogram",
    ROUNDED_RECTANGLE: "roundedRectangle",
    OCTAGONAL_RECTANGLE: "octagonalRectangle",
    OUTER_TRIANGULAR_RECTANGLE: "outerTriangularRectangle",
    INNER_TRIANGULAR_RECTANGLE: "innerTriangularRectangle",
    ELLIPSE: "ellipse",
    CIRCLE: "circle"
  },
  MOUSE_WHEEL_ACTION: {
    ZOOM: "zoom",
    MOVE: "move"
  },
  INIT_ROOT_NODE_POSITION: {
    LEFT: "left",
    TOP: "top",
    RIGHT: "right",
    BOTTOM: "bottom",
    CENTER: "center"
  },
  TIMELINE_DIR: {
    TOP: "top",
    BOTTOM: "bottom"
  }
};
var initRootNodePositionMap = {
  [CONSTANTS.INIT_ROOT_NODE_POSITION.LEFT]: 0,
  [CONSTANTS.INIT_ROOT_NODE_POSITION.TOP]: 0,
  [CONSTANTS.INIT_ROOT_NODE_POSITION.RIGHT]: 1,
  [CONSTANTS.INIT_ROOT_NODE_POSITION.BOTTOM]: 1,
  [CONSTANTS.INIT_ROOT_NODE_POSITION.CENTER]: 0.5
};
var layoutList = [
  {
    name: "\u903B\u8F91\u7ED3\u6784\u56FE",
    value: CONSTANTS.LAYOUT.LOGICAL_STRUCTURE
  },
  {
    name: "\u601D\u7EF4\u5BFC\u56FE",
    value: CONSTANTS.LAYOUT.MIND_MAP
  },
  {
    name: "\u7EC4\u7EC7\u7ED3\u6784\u56FE",
    value: CONSTANTS.LAYOUT.ORGANIZATION_STRUCTURE
  },
  {
    name: "\u76EE\u5F55\u7EC4\u7EC7\u56FE",
    value: CONSTANTS.LAYOUT.CATALOG_ORGANIZATION
  },
  {
    name: "\u65F6\u95F4\u8F74",
    value: CONSTANTS.LAYOUT.TIMELINE
  },
  {
    name: "\u65F6\u95F4\u8F742",
    value: CONSTANTS.LAYOUT.TIMELINE2
  },
  {
    name: "\u9C7C\u9AA8\u56FE",
    value: CONSTANTS.LAYOUT.FISHBONE
  }
];
var layoutValueList = [
  CONSTANTS.LAYOUT.LOGICAL_STRUCTURE,
  CONSTANTS.LAYOUT.MIND_MAP,
  CONSTANTS.LAYOUT.CATALOG_ORGANIZATION,
  CONSTANTS.LAYOUT.ORGANIZATION_STRUCTURE,
  CONSTANTS.LAYOUT.TIMELINE,
  CONSTANTS.LAYOUT.TIMELINE2,
  CONSTANTS.LAYOUT.FISHBONE
];

// ../simple-mind-map/src/core/view/View.js
var View = class {
  //  构造函数
  constructor(opt = {}) {
    this.opt = opt;
    this.mindMap = this.opt.mindMap;
    this.scale = 1;
    this.sx = 0;
    this.sy = 0;
    this.x = 0;
    this.y = 0;
    this.firstDrag = true;
    this.setTransformData(this.mindMap.opt.viewData);
    this.bind();
  }
  //  绑定
  bind() {
    this.mindMap.keyCommand.addShortcut("Control+=", () => {
      this.enlarge();
    });
    this.mindMap.keyCommand.addShortcut("Control+-", () => {
      this.narrow();
    });
    this.mindMap.keyCommand.addShortcut("Control+Enter", () => {
      this.reset();
    });
    this.mindMap.keyCommand.addShortcut("Control+i", () => {
      this.fit();
    });
    this.mindMap.svg.on("dblclick", () => {
      this.reset();
    });
    this.mindMap.event.on("mousedown", () => {
      this.sx = this.x;
      this.sy = this.y;
    });
    this.mindMap.event.on("drag", (e2, event) => {
      if (e2.ctrlKey) {
        return;
      }
      if (this.firstDrag) {
        this.firstDrag = false;
        if (this.mindMap.renderer.activeNodeList.length > 0) {
          this.mindMap.execCommand("CLEAR_ACTIVE_NODE");
        }
      }
      this.x = this.sx + event.mousemoveOffset.x;
      this.y = this.sy + event.mousemoveOffset.y;
      this.transform();
    });
    this.mindMap.event.on("mouseup", () => {
      this.firstDrag = true;
    });
    this.mindMap.event.on("mousewheel", (e2, dir) => {
      if (this.mindMap.opt.customHandleMousewheel && typeof this.mindMap.opt.customHandleMousewheel === "function") {
        return this.mindMap.opt.customHandleMousewheel(e2);
      }
      if (this.mindMap.opt.mousewheelAction === CONSTANTS.MOUSE_WHEEL_ACTION.ZOOM) {
        switch (dir) {
          case CONSTANTS.DIR.UP:
          case CONSTANTS.DIR.LEFT:
            this.narrow();
            break;
          case CONSTANTS.DIR.DOWN:
          case CONSTANTS.DIR.RIGHT:
            this.enlarge();
            break;
        }
      } else {
        switch (dir) {
          case CONSTANTS.DIR.DOWN:
            this.translateY(-this.mindMap.opt.mousewheelMoveStep);
            break;
          case CONSTANTS.DIR.UP:
            this.translateY(this.mindMap.opt.mousewheelMoveStep);
            break;
          case CONSTANTS.DIR.LEFT:
            this.translateX(-this.mindMap.opt.mousewheelMoveStep);
            break;
          case CONSTANTS.DIR.RIGHT:
            this.translateX(this.mindMap.opt.mousewheelMoveStep);
            break;
        }
      }
    });
  }
  //  获取当前变换状态数据
  getTransformData() {
    return {
      transform: this.mindMap.draw.transform(),
      state: {
        scale: this.scale,
        x: this.x,
        y: this.y,
        sx: this.sx,
        sy: this.sy
      }
    };
  }
  //  动态设置变换状态数据
  setTransformData(viewData) {
    if (viewData) {
      Object.keys(viewData.state).forEach((prop) => {
        this[prop] = viewData.state[prop];
      });
      this.mindMap.draw.transform({
        ...viewData.transform
      });
      this.mindMap.emit("view_data_change", this.getTransformData());
      this.mindMap.emit("scale", this.scale);
    }
  }
  //  平移x,y方向
  translateXY(x3, y4) {
    this.x += x3;
    this.y += y4;
    this.transform();
  }
  //  平移x方向
  translateX(step) {
    this.x += step;
    this.transform();
  }
  //  平移x方式到
  translateXTo(x3) {
    this.x = x3;
    this.transform();
  }
  //  平移y方向
  translateY(step) {
    this.y += step;
    this.transform();
  }
  //  平移y方向到
  translateYTo(y4) {
    this.y = y4;
    this.transform();
  }
  //   应用变换
  transform() {
    this.mindMap.draw.transform({
      scale: this.scale,
      // origin: 'center center',
      translate: [this.x, this.y]
    });
    this.mindMap.emit("view_data_change", this.getTransformData());
  }
  //  恢复
  reset() {
    let scaleChange = this.scale !== 1;
    this.scale = 1;
    this.x = 0;
    this.y = 0;
    this.transform();
    if (scaleChange) {
      this.mindMap.emit("scale", this.scale);
    }
  }
  //  缩小
  narrow() {
    if (this.scale - this.mindMap.opt.scaleRatio > 0.1) {
      this.scale -= this.mindMap.opt.scaleRatio;
    } else {
      this.scale = 0.1;
    }
    this.transform();
    this.mindMap.emit("scale", this.scale);
  }
  //  放大
  enlarge() {
    this.scale += this.mindMap.opt.scaleRatio;
    this.transform();
    this.mindMap.emit("scale", this.scale);
  }
  //  设置缩放
  setScale(scale) {
    this.scale = scale;
    this.transform();
    this.mindMap.emit("scale", this.scale);
  }
  // 适应画布大小
  fit() {
    let { fitPadding } = this.mindMap.opt;
    let draw = this.mindMap.draw;
    let origTransform = draw.transform();
    let rect = draw.rbox();
    let drawWidth = rect.width / origTransform.scaleX;
    let drawHeight = rect.height / origTransform.scaleY;
    let drawRatio = drawWidth / drawHeight;
    let { width: elWidth, height: elHeight } = this.mindMap.el.getBoundingClientRect();
    elWidth = elWidth - fitPadding * 2;
    elHeight = elHeight - fitPadding * 2;
    let elRatio = elWidth / elHeight;
    let newScale = 0;
    let flag = "";
    if (drawWidth <= elWidth && drawHeight <= elHeight) {
      newScale = 1;
      flag = 1;
    } else {
      let newWidth = 0;
      let newHeight = 0;
      if (drawRatio > elRatio) {
        newWidth = elWidth;
        newHeight = elWidth / drawRatio;
        flag = 2;
      } else {
        newHeight = elHeight;
        newWidth = elHeight * drawRatio;
        flag = 3;
      }
      newScale = newWidth / drawWidth;
    }
    this.setScale(newScale);
    let newRect = draw.rbox();
    let newX = 0;
    let newY = 0;
    if (flag === 1) {
      newX = -newRect.x + fitPadding + (elWidth - newRect.width) / 2;
      newY = -newRect.y + fitPadding + (elHeight - newRect.height) / 2;
    } else if (flag === 2) {
      newX = -newRect.x + fitPadding;
      newY = -newRect.y + fitPadding + (elHeight - newRect.height) / 2;
    } else if (flag === 3) {
      newX = -newRect.x + fitPadding + (elWidth - newRect.width) / 2;
      newY = -newRect.y + fitPadding;
    }
    this.translateXY(newX, newY);
  }
};
var View_default = View;

// ../simple-mind-map/src/core/event/Event.js
var import_eventemitter3 = __toESM(require_eventemitter3());
var Event2 = class extends import_eventemitter3.default {
  //  构造函数
  constructor(opt = {}) {
    super();
    this.opt = opt;
    this.mindMap = opt.mindMap;
    this.isLeftMousedown = false;
    this.isRightMousedown = false;
    this.mousedownPos = {
      x: 0,
      y: 0
    };
    this.mousemovePos = {
      x: 0,
      y: 0
    };
    this.mousemoveOffset = {
      x: 0,
      y: 0
    };
    this.bindFn();
    this.bind();
  }
  //  绑定函数上下文
  bindFn() {
    this.onBodyClick = this.onBodyClick.bind(this);
    this.onDrawClick = this.onDrawClick.bind(this);
    this.onMousedown = this.onMousedown.bind(this);
    this.onMousemove = this.onMousemove.bind(this);
    this.onMouseup = this.onMouseup.bind(this);
    this.onMousewheel = this.onMousewheel.bind(this);
    this.onContextmenu = this.onContextmenu.bind(this);
    this.onSvgMousedown = this.onSvgMousedown.bind(this);
    this.onKeyup = this.onKeyup.bind(this);
    this.onMouseenter = this.onMouseenter.bind(this);
    this.onMouseleave = this.onMouseleave.bind(this);
  }
  //  绑定事件
  bind() {
    document.body.addEventListener("click", this.onBodyClick);
    this.mindMap.svg.on("click", this.onDrawClick);
    this.mindMap.el.addEventListener("mousedown", this.onMousedown);
    this.mindMap.svg.on("mousedown", this.onSvgMousedown);
    window.addEventListener("mousemove", this.onMousemove);
    window.addEventListener("mouseup", this.onMouseup);
    this.mindMap.el.addEventListener("wheel", this.onMousewheel);
    this.mindMap.svg.on("contextmenu", this.onContextmenu);
    this.mindMap.svg.on("mouseenter", this.onMouseenter);
    this.mindMap.svg.on("mouseleave", this.onMouseleave);
    window.addEventListener("keyup", this.onKeyup);
  }
  //  解绑事件
  unbind() {
    document.body.removeEventListener("click", this.onBodyClick);
    this.mindMap.svg.off("click", this.onDrawClick);
    this.mindMap.el.removeEventListener("mousedown", this.onMousedown);
    window.removeEventListener("mousemove", this.onMousemove);
    window.removeEventListener("mouseup", this.onMouseup);
    this.mindMap.el.removeEventListener("wheel", this.onMousewheel);
    this.mindMap.svg.off("contextmenu", this.onContextmenu);
    this.mindMap.svg.off("mouseenter", this.onMouseenter);
    this.mindMap.svg.off("mouseleave", this.onMouseleave);
    window.removeEventListener("keyup", this.onKeyup);
  }
  //   画布的单击事件
  onDrawClick(e2) {
    this.emit("draw_click", e2);
  }
  // 页面的单击事件
  onBodyClick(e2) {
    this.emit("body_click", e2);
  }
  //   svg画布的鼠标按下事件
  onSvgMousedown(e2) {
    this.emit("svg_mousedown", e2);
  }
  //  鼠标按下事件
  onMousedown(e2) {
    if (e2.which === 1) {
      this.isLeftMousedown = true;
    } else if (e2.which === 3) {
      this.isRightMousedown = true;
    }
    this.mousedownPos.x = e2.clientX;
    this.mousedownPos.y = e2.clientY;
    this.emit("mousedown", e2, this);
  }
  //  鼠标移动事件
  onMousemove(e2) {
    let { useLeftKeySelectionRightKeyDrag } = this.mindMap.opt;
    this.mousemovePos.x = e2.clientX;
    this.mousemovePos.y = e2.clientY;
    this.mousemoveOffset.x = e2.clientX - this.mousedownPos.x;
    this.mousemoveOffset.y = e2.clientY - this.mousedownPos.y;
    this.emit("mousemove", e2, this);
    if (useLeftKeySelectionRightKeyDrag ? this.isRightMousedown : this.isLeftMousedown) {
      e2.preventDefault();
      this.emit("drag", e2, this);
    }
  }
  //  鼠标松开事件
  onMouseup(e2) {
    this.isLeftMousedown = false;
    this.isRightMousedown = false;
    this.emit("mouseup", e2, this);
  }
  //  鼠标滚动
  onMousewheel(e2) {
    e2.stopPropagation();
    e2.preventDefault();
    let dir;
    if (e2.ctrlKey) {
      if (e2.deltaY > 0)
        dir = CONSTANTS.DIR.UP;
      if (e2.deltaY < 0)
        dir = CONSTANTS.DIR.DOWN;
      if (e2.deltaX > 0)
        dir = CONSTANTS.DIR.LEFT;
      if (e2.deltaX < 0)
        dir = CONSTANTS.DIR.RIGHT;
    } else {
      if ((e2.wheelDeltaY || e2.detail) > 0)
        dir = CONSTANTS.DIR.UP;
      if ((e2.wheelDeltaY || e2.detail) < 0)
        dir = CONSTANTS.DIR.DOWN;
      if ((e2.wheelDeltaX || e2.detail) > 0)
        dir = CONSTANTS.DIR.LEFT;
      if ((e2.wheelDeltaX || e2.detail) < 0)
        dir = CONSTANTS.DIR.RIGHT;
    }
    this.emit("mousewheel", e2, dir, this);
  }
  //  鼠标右键菜单事件
  onContextmenu(e2) {
    e2.preventDefault();
    this.emit("contextmenu", e2);
  }
  //  按键松开事件
  onKeyup(e2) {
    this.emit("keyup", e2);
  }
  // 进入
  onMouseenter(e2) {
    this.emit("svg_mouseenter", e2);
  }
  // 离开
  onMouseleave(e2) {
    this.emit("svg_mouseleave", e2);
  }
};
var Event_default = Event2;

// ../simple-mind-map/src/core/render/Render.js
var import_deepmerge = __toESM(require_cjs());

// ../simple-mind-map/src/core/render/node/Style.js
var rootProp = ["paddingX", "paddingY"];
var backgroundStyleProps = ["backgroundColor", "backgroundImage", "backgroundRepeat", "backgroundPosition", "backgroundSize"];
var Style = class {
  //   设置背景样式
  static setBackgroundStyle(el2, themeConfig) {
    if (!Style.cacheStyle) {
      Style.cacheStyle = {};
      let style = window.getComputedStyle(el2);
      backgroundStyleProps.forEach((prop) => {
        Style.cacheStyle[prop] = style[prop];
      });
    }
    let { backgroundColor, backgroundImage, backgroundRepeat, backgroundPosition, backgroundSize } = themeConfig;
    el2.style.backgroundColor = backgroundColor;
    if (backgroundImage) {
      el2.style.backgroundImage = `url(${backgroundImage})`;
      el2.style.backgroundRepeat = backgroundRepeat;
      el2.style.backgroundPosition = backgroundPosition;
      el2.style.backgroundSize = backgroundSize;
    } else {
      el2.style.backgroundImage = "none";
    }
  }
  // 移除背景样式
  static removeBackgroundStyle(el2) {
    backgroundStyleProps.forEach((prop) => {
      el2.style[prop] = Style.cacheStyle[prop];
    });
    Style.cacheStyle = null;
  }
  //  构造函数
  constructor(ctx) {
    this.ctx = ctx;
  }
  //  合并样式
  merge(prop, root2, isActive) {
    let themeConfig = this.ctx.mindMap.themeConfig;
    let defaultConfig = themeConfig.node;
    if (root2 || rootProp.includes(prop)) {
      defaultConfig = themeConfig;
    } else if (this.ctx.isGeneralization) {
      defaultConfig = themeConfig.generalization;
    } else if (this.ctx.layerIndex === 0) {
      defaultConfig = themeConfig.root;
    } else if (this.ctx.layerIndex === 1) {
      defaultConfig = themeConfig.second;
    }
    if (isActive !== void 0 ? isActive : this.ctx.nodeData.data.isActive) {
      if (this.ctx.nodeData.data.activeStyle && this.ctx.nodeData.data.activeStyle[prop] !== void 0) {
        return this.ctx.nodeData.data.activeStyle[prop];
      } else if (defaultConfig.active && defaultConfig.active[prop]) {
        return defaultConfig.active[prop];
      }
    }
    return this.getSelfStyle(prop) !== void 0 ? this.getSelfStyle(prop) : defaultConfig[prop];
  }
  //  获取某个样式值
  getStyle(prop, root2, isActive) {
    return this.merge(prop, root2, isActive);
  }
  //  获取自身自定义样式
  getSelfStyle(prop) {
    return this.ctx.nodeData.data[prop];
  }
  //  矩形
  rect(node3) {
    this.shape(node3);
    node3.radius(this.merge("borderRadius"));
  }
  //   矩形外的其他形状
  shape(node3) {
    node3.fill({
      color: this.merge("fillColor")
    });
    node3.stroke({
      color: this.merge("borderColor"),
      width: this.merge("borderWidth"),
      dasharray: this.merge("borderDasharray")
    });
  }
  //  文字
  text(node3) {
    node3.fill({
      color: this.merge("color")
    }).css({
      "font-family": this.merge("fontFamily"),
      "font-size": this.merge("fontSize"),
      "font-weight": this.merge("fontWeight"),
      "font-style": this.merge("fontStyle"),
      "text-decoration": this.merge("textDecoration")
    });
  }
  // 生成内联样式
  createStyleText() {
    return `
      color: ${this.merge("color")};
      font-family: ${this.merge("fontFamily")};
      font-size: ${this.merge("fontSize") + "px"};
      font-weight: ${this.merge("fontWeight")};
      font-style: ${this.merge("fontStyle")};
      text-decoration: ${this.merge("textDecoration")}
    `;
  }
  // 获取文本样式
  getTextFontStyle() {
    return {
      italic: this.merge("fontStyle") === "italic",
      bold: this.merge("fontWeight"),
      fontSize: this.merge("fontSize"),
      fontFamily: this.merge("fontFamily")
    };
  }
  //  html文字节点
  domText(node3, fontSizeScale = 1, isMultiLine) {
    node3.style.fontFamily = this.merge("fontFamily");
    node3.style.fontSize = this.merge("fontSize") * fontSizeScale + "px";
    node3.style.fontWeight = this.merge("fontWeight") || "normal";
    node3.style.lineHeight = !isMultiLine ? "normal" : this.merge("lineHeight");
    node3.style.fontStyle = this.merge("fontStyle");
  }
  //  标签文字
  tagText(node3, index3) {
    node3.fill({
      color: tagColorList[index3].color
    }).css({
      "font-size": "12px"
    });
  }
  //  标签矩形
  tagRect(node3, index3) {
    node3.fill({
      color: tagColorList[index3].background
    });
  }
  //  内置图标
  iconNode(node3) {
    node3.attr({
      fill: this.merge("color")
    });
  }
  //  连线
  line(node3, { width: width2, color, dasharray } = {}) {
    node3.stroke({ width: width2, color, dasharray }).fill({ color: "none" });
  }
  //  概要连线
  generalizationLine(node3) {
    node3.stroke({
      width: this.merge("generalizationLineWidth", true),
      color: this.merge("generalizationLineColor", true)
    }).fill({ color: "none" });
  }
  //  展开收起按钮
  iconBtn(node3, node22, fillNode) {
    let { color, fill } = this.ctx.mindMap.opt.expandBtnStyle || {
      color: "#808080",
      fill: "#fff"
    };
    node3.fill({ color });
    node22.fill({ color });
    fillNode.fill({ color: fill });
  }
};
Style.cacheStyle = null;
var Style_default = Style;

// ../simple-mind-map/node_modules/@svgdotjs/svg.js/dist/svg.esm.js
var methods$1 = {};
var names = [];
function registerMethods(name, m4) {
  if (Array.isArray(name)) {
    for (const _name of name) {
      registerMethods(_name, m4);
    }
    return;
  }
  if (typeof name === "object") {
    for (const _name in name) {
      registerMethods(_name, name[_name]);
    }
    return;
  }
  addMethodNames(Object.getOwnPropertyNames(m4));
  methods$1[name] = Object.assign(methods$1[name] || {}, m4);
}
function getMethodsFor(name) {
  return methods$1[name] || {};
}
function getMethodNames() {
  return [...new Set(names)];
}
function addMethodNames(_names) {
  names.push(..._names);
}
function map(array2, block) {
  let i3;
  const il = array2.length;
  const result = [];
  for (i3 = 0; i3 < il; i3++) {
    result.push(block(array2[i3]));
  }
  return result;
}
function filter(array2, block) {
  let i3;
  const il = array2.length;
  const result = [];
  for (i3 = 0; i3 < il; i3++) {
    if (block(array2[i3])) {
      result.push(array2[i3]);
    }
  }
  return result;
}
function radians(d2) {
  return d2 % 360 * Math.PI / 180;
}
function camelCase(s3) {
  return s3.toLowerCase().replace(/-(.)/g, function(m4, g2) {
    return g2.toUpperCase();
  });
}
function unCamelCase(s3) {
  return s3.replace(/([A-Z])/g, function(m4, g2) {
    return "-" + g2.toLowerCase();
  });
}
function capitalize(s3) {
  return s3.charAt(0).toUpperCase() + s3.slice(1);
}
function proportionalSize(element2, width2, height2, box) {
  if (width2 == null || height2 == null) {
    box = box || element2.bbox();
    if (width2 == null) {
      width2 = box.width / box.height * height2;
    } else if (height2 == null) {
      height2 = box.height / box.width * width2;
    }
  }
  return {
    width: width2,
    height: height2
  };
}
function getOrigin(o3, element2) {
  const origin = o3.origin;
  let ox = o3.ox != null ? o3.ox : o3.originX != null ? o3.originX : "center";
  let oy = o3.oy != null ? o3.oy : o3.originY != null ? o3.originY : "center";
  if (origin != null) {
    [ox, oy] = Array.isArray(origin) ? origin : typeof origin === "object" ? [origin.x, origin.y] : [origin, origin];
  }
  const condX = typeof ox === "string";
  const condY = typeof oy === "string";
  if (condX || condY) {
    const {
      height: height2,
      width: width2,
      x: x3,
      y: y4
    } = element2.bbox();
    if (condX) {
      ox = ox.includes("left") ? x3 : ox.includes("right") ? x3 + width2 : x3 + width2 / 2;
    }
    if (condY) {
      oy = oy.includes("top") ? y4 : oy.includes("bottom") ? y4 + height2 : y4 + height2 / 2;
    }
  }
  return [ox, oy];
}
var svg = "http://www.w3.org/2000/svg";
var html = "http://www.w3.org/1999/xhtml";
var xmlns = "http://www.w3.org/2000/xmlns/";
var xlink = "http://www.w3.org/1999/xlink";
var svgjs = "http://svgjs.dev/svgjs";
var globals = {
  window: typeof window === "undefined" ? null : window,
  document: typeof document === "undefined" ? null : document
};
var Base = class {
  // constructor (node/*, {extensions = []} */) {
  //   // this.tags = []
  //   //
  //   // for (let extension of extensions) {
  //   //   extension.setup.call(this, node)
  //   //   this.tags.push(extension.name)
  //   // }
  // }
};
var elements = {};
var root = "___SYMBOL___ROOT___";
function create(name, ns = svg) {
  return globals.document.createElementNS(ns, name);
}
function makeInstance(element2, isHTML = false) {
  if (element2 instanceof Base)
    return element2;
  if (typeof element2 === "object") {
    return adopter(element2);
  }
  if (element2 == null) {
    return new elements[root]();
  }
  if (typeof element2 === "string" && element2.charAt(0) !== "<") {
    return adopter(globals.document.querySelector(element2));
  }
  const wrapper = isHTML ? globals.document.createElement("div") : create("svg");
  wrapper.innerHTML = element2;
  element2 = adopter(wrapper.firstChild);
  wrapper.removeChild(wrapper.firstChild);
  return element2;
}
function nodeOrNew(name, node3) {
  return node3 && node3.ownerDocument && node3 instanceof node3.ownerDocument.defaultView.Node ? node3 : create(name);
}
function adopt(node3) {
  if (!node3)
    return null;
  if (node3.instance instanceof Base)
    return node3.instance;
  if (node3.nodeName === "#document-fragment") {
    return new elements.Fragment(node3);
  }
  let className = capitalize(node3.nodeName || "Dom");
  if (className === "LinearGradient" || className === "RadialGradient") {
    className = "Gradient";
  } else if (!elements[className]) {
    className = "Dom";
  }
  return new elements[className](node3);
}
var adopter = adopt;
function register(element2, name = element2.name, asRoot = false) {
  elements[name] = element2;
  if (asRoot)
    elements[root] = element2;
  addMethodNames(Object.getOwnPropertyNames(element2.prototype));
  return element2;
}
function getClass(name) {
  return elements[name];
}
var did = 1e3;
function eid(name) {
  return "Svgjs" + capitalize(name) + did++;
}
function assignNewId(node3) {
  for (let i3 = node3.children.length - 1; i3 >= 0; i3--) {
    assignNewId(node3.children[i3]);
  }
  if (node3.id) {
    node3.id = eid(node3.nodeName);
    return node3;
  }
  return node3;
}
function extend(modules, methods2) {
  let key, i3;
  modules = Array.isArray(modules) ? modules : [modules];
  for (i3 = modules.length - 1; i3 >= 0; i3--) {
    for (key in methods2) {
      modules[i3].prototype[key] = methods2[key];
    }
  }
}
function wrapWithAttrCheck(fn) {
  return function(...args) {
    const o3 = args[args.length - 1];
    if (o3 && o3.constructor === Object && !(o3 instanceof Array)) {
      return fn.apply(this, args.slice(0, -1)).attr(o3);
    } else {
      return fn.apply(this, args);
    }
  };
}
function siblings() {
  return this.parent().children();
}
function position() {
  return this.parent().index(this);
}
function next() {
  return this.siblings()[this.position() + 1];
}
function prev() {
  return this.siblings()[this.position() - 1];
}
function forward() {
  const i3 = this.position();
  const p3 = this.parent();
  p3.add(this.remove(), i3 + 1);
  return this;
}
function backward() {
  const i3 = this.position();
  const p3 = this.parent();
  p3.add(this.remove(), i3 ? i3 - 1 : 0);
  return this;
}
function front() {
  const p3 = this.parent();
  p3.add(this.remove());
  return this;
}
function back() {
  const p3 = this.parent();
  p3.add(this.remove(), 0);
  return this;
}
function before(element2) {
  element2 = makeInstance(element2);
  element2.remove();
  const i3 = this.position();
  this.parent().add(element2, i3);
  return this;
}
function after(element2) {
  element2 = makeInstance(element2);
  element2.remove();
  const i3 = this.position();
  this.parent().add(element2, i3 + 1);
  return this;
}
function insertBefore(element2) {
  element2 = makeInstance(element2);
  element2.before(this);
  return this;
}
function insertAfter(element2) {
  element2 = makeInstance(element2);
  element2.after(this);
  return this;
}
registerMethods("Dom", {
  siblings,
  position,
  next,
  prev,
  forward,
  backward,
  front,
  back,
  before,
  after,
  insertBefore,
  insertAfter
});
var numberAndUnit = /^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i;
var hex = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i;
var rgb = /rgb\((\d+),(\d+),(\d+)\)/;
var reference = /(#[a-z_][a-z0-9\-_]*)/i;
var transforms = /\)\s*,?\s*/;
var whitespace = /\s/g;
var isHex = /^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i;
var isRgb = /^rgb\(/;
var isBlank = /^(\s+)?$/;
var isNumber = /^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;
var isImage = /\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i;
var delimiter = /[\s,]+/;
var isPathLetter = /[MLHVCSQTAZ]/i;
function classes() {
  const attr2 = this.attr("class");
  return attr2 == null ? [] : attr2.trim().split(delimiter);
}
function hasClass(name) {
  return this.classes().indexOf(name) !== -1;
}
function addClass(name) {
  if (!this.hasClass(name)) {
    const array2 = this.classes();
    array2.push(name);
    this.attr("class", array2.join(" "));
  }
  return this;
}
function removeClass(name) {
  if (this.hasClass(name)) {
    this.attr("class", this.classes().filter(function(c4) {
      return c4 !== name;
    }).join(" "));
  }
  return this;
}
function toggleClass(name) {
  return this.hasClass(name) ? this.removeClass(name) : this.addClass(name);
}
registerMethods("Dom", {
  classes,
  hasClass,
  addClass,
  removeClass,
  toggleClass
});
function css(style, val) {
  const ret = {};
  if (arguments.length === 0) {
    this.node.style.cssText.split(/\s*;\s*/).filter(function(el2) {
      return !!el2.length;
    }).forEach(function(el2) {
      const t3 = el2.split(/\s*:\s*/);
      ret[t3[0]] = t3[1];
    });
    return ret;
  }
  if (arguments.length < 2) {
    if (Array.isArray(style)) {
      for (const name of style) {
        const cased = camelCase(name);
        ret[name] = this.node.style[cased];
      }
      return ret;
    }
    if (typeof style === "string") {
      return this.node.style[camelCase(style)];
    }
    if (typeof style === "object") {
      for (const name in style) {
        this.node.style[camelCase(name)] = style[name] == null || isBlank.test(style[name]) ? "" : style[name];
      }
    }
  }
  if (arguments.length === 2) {
    this.node.style[camelCase(style)] = val == null || isBlank.test(val) ? "" : val;
  }
  return this;
}
function show() {
  return this.css("display", "");
}
function hide() {
  return this.css("display", "none");
}
function visible() {
  return this.css("display") !== "none";
}
registerMethods("Dom", {
  css,
  show,
  hide,
  visible
});
function data(a3, v3, r2) {
  if (a3 == null) {
    return this.data(map(filter(this.node.attributes, (el2) => el2.nodeName.indexOf("data-") === 0), (el2) => el2.nodeName.slice(5)));
  } else if (a3 instanceof Array) {
    const data2 = {};
    for (const key of a3) {
      data2[key] = this.data(key);
    }
    return data2;
  } else if (typeof a3 === "object") {
    for (v3 in a3) {
      this.data(v3, a3[v3]);
    }
  } else if (arguments.length < 2) {
    try {
      return JSON.parse(this.attr("data-" + a3));
    } catch (e2) {
      return this.attr("data-" + a3);
    }
  } else {
    this.attr("data-" + a3, v3 === null ? null : r2 === true || typeof v3 === "string" || typeof v3 === "number" ? v3 : JSON.stringify(v3));
  }
  return this;
}
registerMethods("Dom", {
  data
});
function remember(k2, v3) {
  if (typeof arguments[0] === "object") {
    for (const key in k2) {
      this.remember(key, k2[key]);
    }
  } else if (arguments.length === 1) {
    return this.memory()[k2];
  } else {
    this.memory()[k2] = v3;
  }
  return this;
}
function forget() {
  if (arguments.length === 0) {
    this._memory = {};
  } else {
    for (let i3 = arguments.length - 1; i3 >= 0; i3--) {
      delete this.memory()[arguments[i3]];
    }
  }
  return this;
}
function memory() {
  return this._memory = this._memory || {};
}
registerMethods("Dom", {
  remember,
  forget,
  memory
});
function sixDigitHex(hex2) {
  return hex2.length === 4 ? ["#", hex2.substring(1, 2), hex2.substring(1, 2), hex2.substring(2, 3), hex2.substring(2, 3), hex2.substring(3, 4), hex2.substring(3, 4)].join("") : hex2;
}
function componentHex(component) {
  const integer = Math.round(component);
  const bounded = Math.max(0, Math.min(255, integer));
  const hex2 = bounded.toString(16);
  return hex2.length === 1 ? "0" + hex2 : hex2;
}
function is(object, space) {
  for (let i3 = space.length; i3--; ) {
    if (object[space[i3]] == null) {
      return false;
    }
  }
  return true;
}
function getParameters(a3, b2) {
  const params = is(a3, "rgb") ? {
    _a: a3.r,
    _b: a3.g,
    _c: a3.b,
    _d: 0,
    space: "rgb"
  } : is(a3, "xyz") ? {
    _a: a3.x,
    _b: a3.y,
    _c: a3.z,
    _d: 0,
    space: "xyz"
  } : is(a3, "hsl") ? {
    _a: a3.h,
    _b: a3.s,
    _c: a3.l,
    _d: 0,
    space: "hsl"
  } : is(a3, "lab") ? {
    _a: a3.l,
    _b: a3.a,
    _c: a3.b,
    _d: 0,
    space: "lab"
  } : is(a3, "lch") ? {
    _a: a3.l,
    _b: a3.c,
    _c: a3.h,
    _d: 0,
    space: "lch"
  } : is(a3, "cmyk") ? {
    _a: a3.c,
    _b: a3.m,
    _c: a3.y,
    _d: a3.k,
    space: "cmyk"
  } : {
    _a: 0,
    _b: 0,
    _c: 0,
    space: "rgb"
  };
  params.space = b2 || params.space;
  return params;
}
function cieSpace(space) {
  if (space === "lab" || space === "xyz" || space === "lch") {
    return true;
  } else {
    return false;
  }
}
function hueToRgb(p3, q2, t3) {
  if (t3 < 0)
    t3 += 1;
  if (t3 > 1)
    t3 -= 1;
  if (t3 < 1 / 6)
    return p3 + (q2 - p3) * 6 * t3;
  if (t3 < 1 / 2)
    return q2;
  if (t3 < 2 / 3)
    return p3 + (q2 - p3) * (2 / 3 - t3) * 6;
  return p3;
}
var Color = class {
  constructor(...inputs) {
    this.init(...inputs);
  }
  // Test if given value is a color
  static isColor(color) {
    return color && (color instanceof Color || this.isRgb(color) || this.test(color));
  }
  // Test if given value is an rgb object
  static isRgb(color) {
    return color && typeof color.r === "number" && typeof color.g === "number" && typeof color.b === "number";
  }
  /*
  Generating random colors
  */
  static random(mode = "vibrant", t3, u3) {
    const {
      random,
      round,
      sin,
      PI: pi
    } = Math;
    if (mode === "vibrant") {
      const l3 = (81 - 57) * random() + 57;
      const c4 = (83 - 45) * random() + 45;
      const h3 = 360 * random();
      const color = new Color(l3, c4, h3, "lch");
      return color;
    } else if (mode === "sine") {
      t3 = t3 == null ? random() : t3;
      const r2 = round(80 * sin(2 * pi * t3 / 0.5 + 0.01) + 150);
      const g2 = round(50 * sin(2 * pi * t3 / 0.5 + 4.6) + 200);
      const b2 = round(100 * sin(2 * pi * t3 / 0.5 + 2.3) + 150);
      const color = new Color(r2, g2, b2);
      return color;
    } else if (mode === "pastel") {
      const l3 = (94 - 86) * random() + 86;
      const c4 = (26 - 9) * random() + 9;
      const h3 = 360 * random();
      const color = new Color(l3, c4, h3, "lch");
      return color;
    } else if (mode === "dark") {
      const l3 = 10 + 10 * random();
      const c4 = (125 - 75) * random() + 86;
      const h3 = 360 * random();
      const color = new Color(l3, c4, h3, "lch");
      return color;
    } else if (mode === "rgb") {
      const r2 = 255 * random();
      const g2 = 255 * random();
      const b2 = 255 * random();
      const color = new Color(r2, g2, b2);
      return color;
    } else if (mode === "lab") {
      const l3 = 100 * random();
      const a3 = 256 * random() - 128;
      const b2 = 256 * random() - 128;
      const color = new Color(l3, a3, b2, "lab");
      return color;
    } else if (mode === "grey") {
      const grey = 255 * random();
      const color = new Color(grey, grey, grey);
      return color;
    } else {
      throw new Error("Unsupported random color mode");
    }
  }
  // Test if given value is a color string
  static test(color) {
    return typeof color === "string" && (isHex.test(color) || isRgb.test(color));
  }
  cmyk() {
    const {
      _a: _a2,
      _b: _b2,
      _c
    } = this.rgb();
    const [r2, g2, b2] = [_a2, _b2, _c].map((v3) => v3 / 255);
    const k2 = Math.min(1 - r2, 1 - g2, 1 - b2);
    if (k2 === 1) {
      return new Color(0, 0, 0, 1, "cmyk");
    }
    const c4 = (1 - r2 - k2) / (1 - k2);
    const m4 = (1 - g2 - k2) / (1 - k2);
    const y4 = (1 - b2 - k2) / (1 - k2);
    const color = new Color(c4, m4, y4, k2, "cmyk");
    return color;
  }
  hsl() {
    const {
      _a: _a2,
      _b: _b2,
      _c
    } = this.rgb();
    const [r2, g2, b2] = [_a2, _b2, _c].map((v3) => v3 / 255);
    const max3 = Math.max(r2, g2, b2);
    const min5 = Math.min(r2, g2, b2);
    const l3 = (max3 + min5) / 2;
    const isGrey = max3 === min5;
    const delta = max3 - min5;
    const s3 = isGrey ? 0 : l3 > 0.5 ? delta / (2 - max3 - min5) : delta / (max3 + min5);
    const h3 = isGrey ? 0 : max3 === r2 ? ((g2 - b2) / delta + (g2 < b2 ? 6 : 0)) / 6 : max3 === g2 ? ((b2 - r2) / delta + 2) / 6 : max3 === b2 ? ((r2 - g2) / delta + 4) / 6 : 0;
    const color = new Color(360 * h3, 100 * s3, 100 * l3, "hsl");
    return color;
  }
  init(a3 = 0, b2 = 0, c4 = 0, d2 = 0, space = "rgb") {
    a3 = !a3 ? 0 : a3;
    if (this.space) {
      for (const component in this.space) {
        delete this[this.space[component]];
      }
    }
    if (typeof a3 === "number") {
      space = typeof d2 === "string" ? d2 : space;
      d2 = typeof d2 === "string" ? 0 : d2;
      Object.assign(this, {
        _a: a3,
        _b: b2,
        _c: c4,
        _d: d2,
        space
      });
    } else if (a3 instanceof Array) {
      this.space = b2 || (typeof a3[3] === "string" ? a3[3] : a3[4]) || "rgb";
      Object.assign(this, {
        _a: a3[0],
        _b: a3[1],
        _c: a3[2],
        _d: a3[3] || 0
      });
    } else if (a3 instanceof Object) {
      const values = getParameters(a3, b2);
      Object.assign(this, values);
    } else if (typeof a3 === "string") {
      if (isRgb.test(a3)) {
        const noWhitespace = a3.replace(whitespace, "");
        const [_a3, _b3, _c2] = rgb.exec(noWhitespace).slice(1, 4).map((v3) => parseInt(v3));
        Object.assign(this, {
          _a: _a3,
          _b: _b3,
          _c: _c2,
          _d: 0,
          space: "rgb"
        });
      } else if (isHex.test(a3)) {
        const hexParse = (v3) => parseInt(v3, 16);
        const [, _a3, _b3, _c2] = hex.exec(sixDigitHex(a3)).map(hexParse);
        Object.assign(this, {
          _a: _a3,
          _b: _b3,
          _c: _c2,
          _d: 0,
          space: "rgb"
        });
      } else
        throw Error("Unsupported string format, can't construct Color");
    }
    const {
      _a: _a2,
      _b: _b2,
      _c,
      _d
    } = this;
    const components = this.space === "rgb" ? {
      r: _a2,
      g: _b2,
      b: _c
    } : this.space === "xyz" ? {
      x: _a2,
      y: _b2,
      z: _c
    } : this.space === "hsl" ? {
      h: _a2,
      s: _b2,
      l: _c
    } : this.space === "lab" ? {
      l: _a2,
      a: _b2,
      b: _c
    } : this.space === "lch" ? {
      l: _a2,
      c: _b2,
      h: _c
    } : this.space === "cmyk" ? {
      c: _a2,
      m: _b2,
      y: _c,
      k: _d
    } : {};
    Object.assign(this, components);
  }
  lab() {
    const {
      x: x3,
      y: y4,
      z: z2
    } = this.xyz();
    const l3 = 116 * y4 - 16;
    const a3 = 500 * (x3 - y4);
    const b2 = 200 * (y4 - z2);
    const color = new Color(l3, a3, b2, "lab");
    return color;
  }
  lch() {
    const {
      l: l3,
      a: a3,
      b: b2
    } = this.lab();
    const c4 = Math.sqrt(a3 ** 2 + b2 ** 2);
    let h3 = 180 * Math.atan2(b2, a3) / Math.PI;
    if (h3 < 0) {
      h3 *= -1;
      h3 = 360 - h3;
    }
    const color = new Color(l3, c4, h3, "lch");
    return color;
  }
  /*
  Conversion Methods
  */
  rgb() {
    if (this.space === "rgb") {
      return this;
    } else if (cieSpace(this.space)) {
      let {
        x: x3,
        y: y4,
        z: z2
      } = this;
      if (this.space === "lab" || this.space === "lch") {
        let {
          l: l3,
          a: a3,
          b: b3
        } = this;
        if (this.space === "lch") {
          const {
            c: c4,
            h: h3
          } = this;
          const dToR = Math.PI / 180;
          a3 = c4 * Math.cos(dToR * h3);
          b3 = c4 * Math.sin(dToR * h3);
        }
        const yL = (l3 + 16) / 116;
        const xL = a3 / 500 + yL;
        const zL = yL - b3 / 200;
        const ct2 = 16 / 116;
        const mx = 8856e-6;
        const nm = 7.787;
        x3 = 0.95047 * (xL ** 3 > mx ? xL ** 3 : (xL - ct2) / nm);
        y4 = 1 * (yL ** 3 > mx ? yL ** 3 : (yL - ct2) / nm);
        z2 = 1.08883 * (zL ** 3 > mx ? zL ** 3 : (zL - ct2) / nm);
      }
      const rU = x3 * 3.2406 + y4 * -1.5372 + z2 * -0.4986;
      const gU = x3 * -0.9689 + y4 * 1.8758 + z2 * 0.0415;
      const bU = x3 * 0.0557 + y4 * -0.204 + z2 * 1.057;
      const pow = Math.pow;
      const bd = 31308e-7;
      const r2 = rU > bd ? 1.055 * pow(rU, 1 / 2.4) - 0.055 : 12.92 * rU;
      const g2 = gU > bd ? 1.055 * pow(gU, 1 / 2.4) - 0.055 : 12.92 * gU;
      const b2 = bU > bd ? 1.055 * pow(bU, 1 / 2.4) - 0.055 : 12.92 * bU;
      const color = new Color(255 * r2, 255 * g2, 255 * b2);
      return color;
    } else if (this.space === "hsl") {
      let {
        h: h3,
        s: s3,
        l: l3
      } = this;
      h3 /= 360;
      s3 /= 100;
      l3 /= 100;
      if (s3 === 0) {
        l3 *= 255;
        const color2 = new Color(l3, l3, l3);
        return color2;
      }
      const q2 = l3 < 0.5 ? l3 * (1 + s3) : l3 + s3 - l3 * s3;
      const p3 = 2 * l3 - q2;
      const r2 = 255 * hueToRgb(p3, q2, h3 + 1 / 3);
      const g2 = 255 * hueToRgb(p3, q2, h3);
      const b2 = 255 * hueToRgb(p3, q2, h3 - 1 / 3);
      const color = new Color(r2, g2, b2);
      return color;
    } else if (this.space === "cmyk") {
      const {
        c: c4,
        m: m4,
        y: y4,
        k: k2
      } = this;
      const r2 = 255 * (1 - Math.min(1, c4 * (1 - k2) + k2));
      const g2 = 255 * (1 - Math.min(1, m4 * (1 - k2) + k2));
      const b2 = 255 * (1 - Math.min(1, y4 * (1 - k2) + k2));
      const color = new Color(r2, g2, b2);
      return color;
    } else {
      return this;
    }
  }
  toArray() {
    const {
      _a: _a2,
      _b: _b2,
      _c,
      _d,
      space
    } = this;
    return [_a2, _b2, _c, _d, space];
  }
  toHex() {
    const [r2, g2, b2] = this._clamped().map(componentHex);
    return `#${r2}${g2}${b2}`;
  }
  toRgb() {
    const [rV, gV, bV] = this._clamped();
    const string3 = `rgb(${rV},${gV},${bV})`;
    return string3;
  }
  toString() {
    return this.toHex();
  }
  xyz() {
    const {
      _a: r255,
      _b: g255,
      _c: b255
    } = this.rgb();
    const [r2, g2, b2] = [r255, g255, b255].map((v3) => v3 / 255);
    const rL = r2 > 0.04045 ? Math.pow((r2 + 0.055) / 1.055, 2.4) : r2 / 12.92;
    const gL = g2 > 0.04045 ? Math.pow((g2 + 0.055) / 1.055, 2.4) : g2 / 12.92;
    const bL = b2 > 0.04045 ? Math.pow((b2 + 0.055) / 1.055, 2.4) : b2 / 12.92;
    const xU = (rL * 0.4124 + gL * 0.3576 + bL * 0.1805) / 0.95047;
    const yU = (rL * 0.2126 + gL * 0.7152 + bL * 0.0722) / 1;
    const zU = (rL * 0.0193 + gL * 0.1192 + bL * 0.9505) / 1.08883;
    const x3 = xU > 8856e-6 ? Math.pow(xU, 1 / 3) : 7.787 * xU + 16 / 116;
    const y4 = yU > 8856e-6 ? Math.pow(yU, 1 / 3) : 7.787 * yU + 16 / 116;
    const z2 = zU > 8856e-6 ? Math.pow(zU, 1 / 3) : 7.787 * zU + 16 / 116;
    const color = new Color(x3, y4, z2, "xyz");
    return color;
  }
  /*
  Input and Output methods
  */
  _clamped() {
    const {
      _a: _a2,
      _b: _b2,
      _c
    } = this.rgb();
    const {
      max: max3,
      min: min5,
      round
    } = Math;
    const format = (v3) => max3(0, min5(round(v3), 255));
    return [_a2, _b2, _c].map(format);
  }
  /*
  Constructing colors
  */
};
var Point = class {
  // Initialize
  constructor(...args) {
    this.init(...args);
  }
  // Clone point
  clone() {
    return new Point(this);
  }
  init(x3, y4) {
    const base = {
      x: 0,
      y: 0
    };
    const source = Array.isArray(x3) ? {
      x: x3[0],
      y: x3[1]
    } : typeof x3 === "object" ? {
      x: x3.x,
      y: x3.y
    } : {
      x: x3,
      y: y4
    };
    this.x = source.x == null ? base.x : source.x;
    this.y = source.y == null ? base.y : source.y;
    return this;
  }
  toArray() {
    return [this.x, this.y];
  }
  transform(m4) {
    return this.clone().transformO(m4);
  }
  // Transform point with matrix
  transformO(m4) {
    if (!Matrix.isMatrixLike(m4)) {
      m4 = new Matrix(m4);
    }
    const {
      x: x3,
      y: y4
    } = this;
    this.x = m4.a * x3 + m4.c * y4 + m4.e;
    this.y = m4.b * x3 + m4.d * y4 + m4.f;
    return this;
  }
};
function point(x3, y4) {
  return new Point(x3, y4).transform(this.screenCTM().inverse());
}
function closeEnough(a3, b2, threshold) {
  return Math.abs(b2 - a3) < (threshold || 1e-6);
}
var Matrix = class {
  constructor(...args) {
    this.init(...args);
  }
  static formatTransforms(o3) {
    const flipBoth = o3.flip === "both" || o3.flip === true;
    const flipX = o3.flip && (flipBoth || o3.flip === "x") ? -1 : 1;
    const flipY = o3.flip && (flipBoth || o3.flip === "y") ? -1 : 1;
    const skewX = o3.skew && o3.skew.length ? o3.skew[0] : isFinite(o3.skew) ? o3.skew : isFinite(o3.skewX) ? o3.skewX : 0;
    const skewY = o3.skew && o3.skew.length ? o3.skew[1] : isFinite(o3.skew) ? o3.skew : isFinite(o3.skewY) ? o3.skewY : 0;
    const scaleX = o3.scale && o3.scale.length ? o3.scale[0] * flipX : isFinite(o3.scale) ? o3.scale * flipX : isFinite(o3.scaleX) ? o3.scaleX * flipX : flipX;
    const scaleY = o3.scale && o3.scale.length ? o3.scale[1] * flipY : isFinite(o3.scale) ? o3.scale * flipY : isFinite(o3.scaleY) ? o3.scaleY * flipY : flipY;
    const shear = o3.shear || 0;
    const theta = o3.rotate || o3.theta || 0;
    const origin = new Point(o3.origin || o3.around || o3.ox || o3.originX, o3.oy || o3.originY);
    const ox = origin.x;
    const oy = origin.y;
    const position3 = new Point(o3.position || o3.px || o3.positionX || NaN, o3.py || o3.positionY || NaN);
    const px = position3.x;
    const py = position3.y;
    const translate = new Point(o3.translate || o3.tx || o3.translateX, o3.ty || o3.translateY);
    const tx = translate.x;
    const ty = translate.y;
    const relative = new Point(o3.relative || o3.rx || o3.relativeX, o3.ry || o3.relativeY);
    const rx2 = relative.x;
    const ry2 = relative.y;
    return {
      scaleX,
      scaleY,
      skewX,
      skewY,
      shear,
      theta,
      rx: rx2,
      ry: ry2,
      tx,
      ty,
      ox,
      oy,
      px,
      py
    };
  }
  static fromArray(a3) {
    return {
      a: a3[0],
      b: a3[1],
      c: a3[2],
      d: a3[3],
      e: a3[4],
      f: a3[5]
    };
  }
  static isMatrixLike(o3) {
    return o3.a != null || o3.b != null || o3.c != null || o3.d != null || o3.e != null || o3.f != null;
  }
  // left matrix, right matrix, target matrix which is overwritten
  static matrixMultiply(l3, r2, o3) {
    const a3 = l3.a * r2.a + l3.c * r2.b;
    const b2 = l3.b * r2.a + l3.d * r2.b;
    const c4 = l3.a * r2.c + l3.c * r2.d;
    const d2 = l3.b * r2.c + l3.d * r2.d;
    const e2 = l3.e + l3.a * r2.e + l3.c * r2.f;
    const f3 = l3.f + l3.b * r2.e + l3.d * r2.f;
    o3.a = a3;
    o3.b = b2;
    o3.c = c4;
    o3.d = d2;
    o3.e = e2;
    o3.f = f3;
    return o3;
  }
  around(cx2, cy2, matrix) {
    return this.clone().aroundO(cx2, cy2, matrix);
  }
  // Transform around a center point
  aroundO(cx2, cy2, matrix) {
    const dx2 = cx2 || 0;
    const dy2 = cy2 || 0;
    return this.translateO(-dx2, -dy2).lmultiplyO(matrix).translateO(dx2, dy2);
  }
  // Clones this matrix
  clone() {
    return new Matrix(this);
  }
  // Decomposes this matrix into its affine parameters
  decompose(cx2 = 0, cy2 = 0) {
    const a3 = this.a;
    const b2 = this.b;
    const c4 = this.c;
    const d2 = this.d;
    const e2 = this.e;
    const f3 = this.f;
    const determinant = a3 * d2 - b2 * c4;
    const ccw = determinant > 0 ? 1 : -1;
    const sx = ccw * Math.sqrt(a3 * a3 + b2 * b2);
    const thetaRad = Math.atan2(ccw * b2, ccw * a3);
    const theta = 180 / Math.PI * thetaRad;
    const ct2 = Math.cos(thetaRad);
    const st2 = Math.sin(thetaRad);
    const lam = (a3 * c4 + b2 * d2) / determinant;
    const sy = c4 * sx / (lam * a3 - b2) || d2 * sx / (lam * b2 + a3);
    const tx = e2 - cx2 + cx2 * ct2 * sx + cy2 * (lam * ct2 * sx - st2 * sy);
    const ty = f3 - cy2 + cx2 * st2 * sx + cy2 * (lam * st2 * sx + ct2 * sy);
    return {
      // Return the affine parameters
      scaleX: sx,
      scaleY: sy,
      shear: lam,
      rotate: theta,
      translateX: tx,
      translateY: ty,
      originX: cx2,
      originY: cy2,
      // Return the matrix parameters
      a: this.a,
      b: this.b,
      c: this.c,
      d: this.d,
      e: this.e,
      f: this.f
    };
  }
  // Check if two matrices are equal
  equals(other) {
    if (other === this)
      return true;
    const comp = new Matrix(other);
    return closeEnough(this.a, comp.a) && closeEnough(this.b, comp.b) && closeEnough(this.c, comp.c) && closeEnough(this.d, comp.d) && closeEnough(this.e, comp.e) && closeEnough(this.f, comp.f);
  }
  // Flip matrix on x or y, at a given offset
  flip(axis, around) {
    return this.clone().flipO(axis, around);
  }
  flipO(axis, around) {
    return axis === "x" ? this.scaleO(-1, 1, around, 0) : axis === "y" ? this.scaleO(1, -1, 0, around) : this.scaleO(-1, -1, axis, around || axis);
  }
  // Initialize
  init(source) {
    const base = Matrix.fromArray([1, 0, 0, 1, 0, 0]);
    source = source instanceof Element ? source.matrixify() : typeof source === "string" ? Matrix.fromArray(source.split(delimiter).map(parseFloat)) : Array.isArray(source) ? Matrix.fromArray(source) : typeof source === "object" && Matrix.isMatrixLike(source) ? source : typeof source === "object" ? new Matrix().transform(source) : arguments.length === 6 ? Matrix.fromArray([].slice.call(arguments)) : base;
    this.a = source.a != null ? source.a : base.a;
    this.b = source.b != null ? source.b : base.b;
    this.c = source.c != null ? source.c : base.c;
    this.d = source.d != null ? source.d : base.d;
    this.e = source.e != null ? source.e : base.e;
    this.f = source.f != null ? source.f : base.f;
    return this;
  }
  inverse() {
    return this.clone().inverseO();
  }
  // Inverses matrix
  inverseO() {
    const a3 = this.a;
    const b2 = this.b;
    const c4 = this.c;
    const d2 = this.d;
    const e2 = this.e;
    const f3 = this.f;
    const det = a3 * d2 - b2 * c4;
    if (!det)
      throw new Error("Cannot invert " + this);
    const na = d2 / det;
    const nb = -b2 / det;
    const nc = -c4 / det;
    const nd = a3 / det;
    const ne2 = -(na * e2 + nc * f3);
    const nf = -(nb * e2 + nd * f3);
    this.a = na;
    this.b = nb;
    this.c = nc;
    this.d = nd;
    this.e = ne2;
    this.f = nf;
    return this;
  }
  lmultiply(matrix) {
    return this.clone().lmultiplyO(matrix);
  }
  lmultiplyO(matrix) {
    const r2 = this;
    const l3 = matrix instanceof Matrix ? matrix : new Matrix(matrix);
    return Matrix.matrixMultiply(l3, r2, this);
  }
  // Left multiplies by the given matrix
  multiply(matrix) {
    return this.clone().multiplyO(matrix);
  }
  multiplyO(matrix) {
    const l3 = this;
    const r2 = matrix instanceof Matrix ? matrix : new Matrix(matrix);
    return Matrix.matrixMultiply(l3, r2, this);
  }
  // Rotate matrix
  rotate(r2, cx2, cy2) {
    return this.clone().rotateO(r2, cx2, cy2);
  }
  rotateO(r2, cx2 = 0, cy2 = 0) {
    r2 = radians(r2);
    const cos = Math.cos(r2);
    const sin = Math.sin(r2);
    const {
      a: a3,
      b: b2,
      c: c4,
      d: d2,
      e: e2,
      f: f3
    } = this;
    this.a = a3 * cos - b2 * sin;
    this.b = b2 * cos + a3 * sin;
    this.c = c4 * cos - d2 * sin;
    this.d = d2 * cos + c4 * sin;
    this.e = e2 * cos - f3 * sin + cy2 * sin - cx2 * cos + cx2;
    this.f = f3 * cos + e2 * sin - cx2 * sin - cy2 * cos + cy2;
    return this;
  }
  // Scale matrix
  scale(x3, y4, cx2, cy2) {
    return this.clone().scaleO(...arguments);
  }
  scaleO(x3, y4 = x3, cx2 = 0, cy2 = 0) {
    if (arguments.length === 3) {
      cy2 = cx2;
      cx2 = y4;
      y4 = x3;
    }
    const {
      a: a3,
      b: b2,
      c: c4,
      d: d2,
      e: e2,
      f: f3
    } = this;
    this.a = a3 * x3;
    this.b = b2 * y4;
    this.c = c4 * x3;
    this.d = d2 * y4;
    this.e = e2 * x3 - cx2 * x3 + cx2;
    this.f = f3 * y4 - cy2 * y4 + cy2;
    return this;
  }
  // Shear matrix
  shear(a3, cx2, cy2) {
    return this.clone().shearO(a3, cx2, cy2);
  }
  shearO(lx, cx2 = 0, cy2 = 0) {
    const {
      a: a3,
      b: b2,
      c: c4,
      d: d2,
      e: e2,
      f: f3
    } = this;
    this.a = a3 + b2 * lx;
    this.c = c4 + d2 * lx;
    this.e = e2 + f3 * lx - cy2 * lx;
    return this;
  }
  // Skew Matrix
  skew(x3, y4, cx2, cy2) {
    return this.clone().skewO(...arguments);
  }
  skewO(x3, y4 = x3, cx2 = 0, cy2 = 0) {
    if (arguments.length === 3) {
      cy2 = cx2;
      cx2 = y4;
      y4 = x3;
    }
    x3 = radians(x3);
    y4 = radians(y4);
    const lx = Math.tan(x3);
    const ly = Math.tan(y4);
    const {
      a: a3,
      b: b2,
      c: c4,
      d: d2,
      e: e2,
      f: f3
    } = this;
    this.a = a3 + b2 * lx;
    this.b = b2 + a3 * ly;
    this.c = c4 + d2 * lx;
    this.d = d2 + c4 * ly;
    this.e = e2 + f3 * lx - cy2 * lx;
    this.f = f3 + e2 * ly - cx2 * ly;
    return this;
  }
  // SkewX
  skewX(x3, cx2, cy2) {
    return this.skew(x3, 0, cx2, cy2);
  }
  // SkewY
  skewY(y4, cx2, cy2) {
    return this.skew(0, y4, cx2, cy2);
  }
  toArray() {
    return [this.a, this.b, this.c, this.d, this.e, this.f];
  }
  // Convert matrix to string
  toString() {
    return "matrix(" + this.a + "," + this.b + "," + this.c + "," + this.d + "," + this.e + "," + this.f + ")";
  }
  // Transform a matrix into another matrix by manipulating the space
  transform(o3) {
    if (Matrix.isMatrixLike(o3)) {
      const matrix = new Matrix(o3);
      return matrix.multiplyO(this);
    }
    const t3 = Matrix.formatTransforms(o3);
    const current = this;
    const {
      x: ox,
      y: oy
    } = new Point(t3.ox, t3.oy).transform(current);
    const transformer = new Matrix().translateO(t3.rx, t3.ry).lmultiplyO(current).translateO(-ox, -oy).scaleO(t3.scaleX, t3.scaleY).skewO(t3.skewX, t3.skewY).shearO(t3.shear).rotateO(t3.theta).translateO(ox, oy);
    if (isFinite(t3.px) || isFinite(t3.py)) {
      const origin = new Point(ox, oy).transform(transformer);
      const dx2 = isFinite(t3.px) ? t3.px - origin.x : 0;
      const dy2 = isFinite(t3.py) ? t3.py - origin.y : 0;
      transformer.translateO(dx2, dy2);
    }
    transformer.translateO(t3.tx, t3.ty);
    return transformer;
  }
  // Translate matrix
  translate(x3, y4) {
    return this.clone().translateO(x3, y4);
  }
  translateO(x3, y4) {
    this.e += x3 || 0;
    this.f += y4 || 0;
    return this;
  }
  valueOf() {
    return {
      a: this.a,
      b: this.b,
      c: this.c,
      d: this.d,
      e: this.e,
      f: this.f
    };
  }
};
function ctm() {
  return new Matrix(this.node.getCTM());
}
function screenCTM() {
  if (typeof this.isRoot === "function" && !this.isRoot()) {
    const rect = this.rect(1, 1);
    const m4 = rect.node.getScreenCTM();
    rect.remove();
    return new Matrix(m4);
  }
  return new Matrix(this.node.getScreenCTM());
}
register(Matrix, "Matrix");
function parser() {
  if (!parser.nodes) {
    const svg2 = makeInstance().size(2, 0);
    svg2.node.style.cssText = ["opacity: 0", "position: absolute", "left: -100%", "top: -100%", "overflow: hidden"].join(";");
    svg2.attr("focusable", "false");
    svg2.attr("aria-hidden", "true");
    const path = svg2.path().node;
    parser.nodes = {
      svg: svg2,
      path
    };
  }
  if (!parser.nodes.svg.node.parentNode) {
    const b2 = globals.document.body || globals.document.documentElement;
    parser.nodes.svg.addTo(b2);
  }
  return parser.nodes;
}
function isNulledBox(box) {
  return !box.width && !box.height && !box.x && !box.y;
}
function domContains(node3) {
  return node3 === globals.document || (globals.document.documentElement.contains || function(node4) {
    while (node4.parentNode) {
      node4 = node4.parentNode;
    }
    return node4 === globals.document;
  }).call(globals.document.documentElement, node3);
}
var Box = class {
  constructor(...args) {
    this.init(...args);
  }
  addOffset() {
    this.x += globals.window.pageXOffset;
    this.y += globals.window.pageYOffset;
    return new Box(this);
  }
  init(source) {
    const base = [0, 0, 0, 0];
    source = typeof source === "string" ? source.split(delimiter).map(parseFloat) : Array.isArray(source) ? source : typeof source === "object" ? [source.left != null ? source.left : source.x, source.top != null ? source.top : source.y, source.width, source.height] : arguments.length === 4 ? [].slice.call(arguments) : base;
    this.x = source[0] || 0;
    this.y = source[1] || 0;
    this.width = this.w = source[2] || 0;
    this.height = this.h = source[3] || 0;
    this.x2 = this.x + this.w;
    this.y2 = this.y + this.h;
    this.cx = this.x + this.w / 2;
    this.cy = this.y + this.h / 2;
    return this;
  }
  isNulled() {
    return isNulledBox(this);
  }
  // Merge rect box with another, return a new instance
  merge(box) {
    const x3 = Math.min(this.x, box.x);
    const y4 = Math.min(this.y, box.y);
    const width2 = Math.max(this.x + this.width, box.x + box.width) - x3;
    const height2 = Math.max(this.y + this.height, box.y + box.height) - y4;
    return new Box(x3, y4, width2, height2);
  }
  toArray() {
    return [this.x, this.y, this.width, this.height];
  }
  toString() {
    return this.x + " " + this.y + " " + this.width + " " + this.height;
  }
  transform(m4) {
    if (!(m4 instanceof Matrix)) {
      m4 = new Matrix(m4);
    }
    let xMin = Infinity;
    let xMax = -Infinity;
    let yMin = Infinity;
    let yMax = -Infinity;
    const pts = [new Point(this.x, this.y), new Point(this.x2, this.y), new Point(this.x, this.y2), new Point(this.x2, this.y2)];
    pts.forEach(function(p3) {
      p3 = p3.transform(m4);
      xMin = Math.min(xMin, p3.x);
      xMax = Math.max(xMax, p3.x);
      yMin = Math.min(yMin, p3.y);
      yMax = Math.max(yMax, p3.y);
    });
    return new Box(xMin, yMin, xMax - xMin, yMax - yMin);
  }
};
function getBox(el2, getBBoxFn, retry) {
  let box;
  try {
    box = getBBoxFn(el2.node);
    if (isNulledBox(box) && !domContains(el2.node)) {
      throw new Error("Element not in the dom");
    }
  } catch (e2) {
    box = retry(el2);
  }
  return box;
}
function bbox() {
  const getBBox = (node3) => node3.getBBox();
  const retry = (el2) => {
    try {
      const clone = el2.clone().addTo(parser().svg).show();
      const box2 = clone.node.getBBox();
      clone.remove();
      return box2;
    } catch (e2) {
      throw new Error(`Getting bbox of element "${el2.node.nodeName}" is not possible: ${e2.toString()}`);
    }
  };
  const box = getBox(this, getBBox, retry);
  const bbox2 = new Box(box);
  return bbox2;
}
function rbox(el2) {
  const getRBox = (node3) => node3.getBoundingClientRect();
  const retry = (el3) => {
    throw new Error(`Getting rbox of element "${el3.node.nodeName}" is not possible`);
  };
  const box = getBox(this, getRBox, retry);
  const rbox2 = new Box(box);
  if (el2) {
    return rbox2.transform(el2.screenCTM().inverseO());
  }
  return rbox2.addOffset();
}
function inside(x3, y4) {
  const box = this.bbox();
  return x3 > box.x && y4 > box.y && x3 < box.x + box.width && y4 < box.y + box.height;
}
registerMethods({
  viewbox: {
    viewbox(x3, y4, width2, height2) {
      if (x3 == null)
        return new Box(this.attr("viewBox"));
      return this.attr("viewBox", new Box(x3, y4, width2, height2));
    },
    zoom(level, point4) {
      let {
        width: width2,
        height: height2
      } = this.attr(["width", "height"]);
      if (!width2 && !height2 || typeof width2 === "string" || typeof height2 === "string") {
        width2 = this.node.clientWidth;
        height2 = this.node.clientHeight;
      }
      if (!width2 || !height2) {
        throw new Error("Impossible to get absolute width and height. Please provide an absolute width and height attribute on the zooming element");
      }
      const v3 = this.viewbox();
      const zoomX = width2 / v3.width;
      const zoomY = height2 / v3.height;
      const zoom = Math.min(zoomX, zoomY);
      if (level == null) {
        return zoom;
      }
      let zoomAmount = zoom / level;
      if (zoomAmount === Infinity)
        zoomAmount = Number.MAX_SAFE_INTEGER / 100;
      point4 = point4 || new Point(width2 / 2 / zoomX + v3.x, height2 / 2 / zoomY + v3.y);
      const box = new Box(v3).transform(new Matrix({
        scale: zoomAmount,
        origin: point4
      }));
      return this.viewbox(box);
    }
  }
});
register(Box, "Box");
var List = class extends Array {
  constructor(arr = [], ...args) {
    super(arr, ...args);
    if (typeof arr === "number")
      return this;
    this.length = 0;
    this.push(...arr);
  }
};
extend([List], {
  each(fnOrMethodName, ...args) {
    if (typeof fnOrMethodName === "function") {
      return this.map((el2, i3, arr) => {
        return fnOrMethodName.call(el2, el2, i3, arr);
      });
    } else {
      return this.map((el2) => {
        return el2[fnOrMethodName](...args);
      });
    }
  },
  toArray() {
    return Array.prototype.concat.apply([], this);
  }
});
var reserved = ["toArray", "constructor", "each"];
List.extend = function(methods2) {
  methods2 = methods2.reduce((obj, name) => {
    if (reserved.includes(name))
      return obj;
    if (name[0] === "_")
      return obj;
    obj[name] = function(...attrs2) {
      return this.each(name, ...attrs2);
    };
    return obj;
  }, {});
  extend([List], methods2);
};
function baseFind(query, parent) {
  return new List(map((parent || globals.document).querySelectorAll(query), function(node3) {
    return adopt(node3);
  }));
}
function find(query) {
  return baseFind(query, this.node);
}
function findOne(query) {
  return adopt(this.node.querySelector(query));
}
var listenerId = 0;
var windowEvents = {};
function getEvents(instance) {
  let n3 = instance.getEventHolder();
  if (n3 === globals.window)
    n3 = windowEvents;
  if (!n3.events)
    n3.events = {};
  return n3.events;
}
function getEventTarget(instance) {
  return instance.getEventTarget();
}
function clearEvents(instance) {
  let n3 = instance.getEventHolder();
  if (n3 === globals.window)
    n3 = windowEvents;
  if (n3.events)
    n3.events = {};
}
function on(node3, events, listener, binding, options) {
  const l3 = listener.bind(binding || node3);
  const instance = makeInstance(node3);
  const bag = getEvents(instance);
  const n3 = getEventTarget(instance);
  events = Array.isArray(events) ? events : events.split(delimiter);
  if (!listener._svgjsListenerId) {
    listener._svgjsListenerId = ++listenerId;
  }
  events.forEach(function(event) {
    const ev = event.split(".")[0];
    const ns = event.split(".")[1] || "*";
    bag[ev] = bag[ev] || {};
    bag[ev][ns] = bag[ev][ns] || {};
    bag[ev][ns][listener._svgjsListenerId] = l3;
    n3.addEventListener(ev, l3, options || false);
  });
}
function off(node3, events, listener, options) {
  const instance = makeInstance(node3);
  const bag = getEvents(instance);
  const n3 = getEventTarget(instance);
  if (typeof listener === "function") {
    listener = listener._svgjsListenerId;
    if (!listener)
      return;
  }
  events = Array.isArray(events) ? events : (events || "").split(delimiter);
  events.forEach(function(event) {
    const ev = event && event.split(".")[0];
    const ns = event && event.split(".")[1];
    let namespace, l3;
    if (listener) {
      if (bag[ev] && bag[ev][ns || "*"]) {
        n3.removeEventListener(ev, bag[ev][ns || "*"][listener], options || false);
        delete bag[ev][ns || "*"][listener];
      }
    } else if (ev && ns) {
      if (bag[ev] && bag[ev][ns]) {
        for (l3 in bag[ev][ns]) {
          off(n3, [ev, ns].join("."), l3);
        }
        delete bag[ev][ns];
      }
    } else if (ns) {
      for (event in bag) {
        for (namespace in bag[event]) {
          if (ns === namespace) {
            off(n3, [event, ns].join("."));
          }
        }
      }
    } else if (ev) {
      if (bag[ev]) {
        for (namespace in bag[ev]) {
          off(n3, [ev, namespace].join("."));
        }
        delete bag[ev];
      }
    } else {
      for (event in bag) {
        off(n3, event);
      }
      clearEvents(instance);
    }
  });
}
function dispatch(node3, event, data2, options) {
  const n3 = getEventTarget(node3);
  if (event instanceof globals.window.Event) {
    n3.dispatchEvent(event);
  } else {
    event = new globals.window.CustomEvent(event, {
      detail: data2,
      cancelable: true,
      ...options
    });
    n3.dispatchEvent(event);
  }
  return event;
}
var EventTarget = class extends Base {
  addEventListener() {
  }
  dispatch(event, data2, options) {
    return dispatch(this, event, data2, options);
  }
  dispatchEvent(event) {
    const bag = this.getEventHolder().events;
    if (!bag)
      return true;
    const events = bag[event.type];
    for (const i3 in events) {
      for (const j2 in events[i3]) {
        events[i3][j2](event);
      }
    }
    return !event.defaultPrevented;
  }
  // Fire given event
  fire(event, data2, options) {
    this.dispatch(event, data2, options);
    return this;
  }
  getEventHolder() {
    return this;
  }
  getEventTarget() {
    return this;
  }
  // Unbind event from listener
  off(event, listener, options) {
    off(this, event, listener, options);
    return this;
  }
  // Bind given event to listener
  on(event, listener, binding, options) {
    on(this, event, listener, binding, options);
    return this;
  }
  removeEventListener() {
  }
};
register(EventTarget, "EventTarget");
function noop() {
}
var timeline = {
  duration: 400,
  ease: ">",
  delay: 0
};
var attrs = {
  // fill and stroke
  "fill-opacity": 1,
  "stroke-opacity": 1,
  "stroke-width": 0,
  "stroke-linejoin": "miter",
  "stroke-linecap": "butt",
  fill: "#000000",
  stroke: "#000000",
  opacity: 1,
  // position
  x: 0,
  y: 0,
  cx: 0,
  cy: 0,
  // size
  width: 0,
  height: 0,
  // radius
  r: 0,
  rx: 0,
  ry: 0,
  // gradient
  offset: 0,
  "stop-opacity": 1,
  "stop-color": "#000000",
  // text
  "text-anchor": "start"
};
var SVGArray = class extends Array {
  constructor(...args) {
    super(...args);
    this.init(...args);
  }
  clone() {
    return new this.constructor(this);
  }
  init(arr) {
    if (typeof arr === "number")
      return this;
    this.length = 0;
    this.push(...this.parse(arr));
    return this;
  }
  // Parse whitespace separated string
  parse(array2 = []) {
    if (array2 instanceof Array)
      return array2;
    return array2.trim().split(delimiter).map(parseFloat);
  }
  toArray() {
    return Array.prototype.concat.apply([], this);
  }
  toSet() {
    return new Set(this);
  }
  toString() {
    return this.join(" ");
  }
  // Flattens the array if needed
  valueOf() {
    const ret = [];
    ret.push(...this);
    return ret;
  }
};
var SVGNumber = class {
  // Initialize
  constructor(...args) {
    this.init(...args);
  }
  convert(unit) {
    return new SVGNumber(this.value, unit);
  }
  // Divide number
  divide(number) {
    number = new SVGNumber(number);
    return new SVGNumber(this / number, this.unit || number.unit);
  }
  init(value, unit) {
    unit = Array.isArray(value) ? value[1] : unit;
    value = Array.isArray(value) ? value[0] : value;
    this.value = 0;
    this.unit = unit || "";
    if (typeof value === "number") {
      this.value = isNaN(value) ? 0 : !isFinite(value) ? value < 0 ? -34e37 : 34e37 : value;
    } else if (typeof value === "string") {
      unit = value.match(numberAndUnit);
      if (unit) {
        this.value = parseFloat(unit[1]);
        if (unit[5] === "%") {
          this.value /= 100;
        } else if (unit[5] === "s") {
          this.value *= 1e3;
        }
        this.unit = unit[5];
      }
    } else {
      if (value instanceof SVGNumber) {
        this.value = value.valueOf();
        this.unit = value.unit;
      }
    }
    return this;
  }
  // Subtract number
  minus(number) {
    number = new SVGNumber(number);
    return new SVGNumber(this - number, this.unit || number.unit);
  }
  // Add number
  plus(number) {
    number = new SVGNumber(number);
    return new SVGNumber(this + number, this.unit || number.unit);
  }
  // Multiply number
  times(number) {
    number = new SVGNumber(number);
    return new SVGNumber(this * number, this.unit || number.unit);
  }
  toArray() {
    return [this.value, this.unit];
  }
  toJSON() {
    return this.toString();
  }
  toString() {
    return (this.unit === "%" ? ~~(this.value * 1e8) / 1e6 : this.unit === "s" ? this.value / 1e3 : this.value) + this.unit;
  }
  valueOf() {
    return this.value;
  }
};
var hooks = [];
function registerAttrHook(fn) {
  hooks.push(fn);
}
function attr(attr2, val, ns) {
  if (attr2 == null) {
    attr2 = {};
    val = this.node.attributes;
    for (const node3 of val) {
      attr2[node3.nodeName] = isNumber.test(node3.nodeValue) ? parseFloat(node3.nodeValue) : node3.nodeValue;
    }
    return attr2;
  } else if (attr2 instanceof Array) {
    return attr2.reduce((last, curr) => {
      last[curr] = this.attr(curr);
      return last;
    }, {});
  } else if (typeof attr2 === "object" && attr2.constructor === Object) {
    for (val in attr2)
      this.attr(val, attr2[val]);
  } else if (val === null) {
    this.node.removeAttribute(attr2);
  } else if (val == null) {
    val = this.node.getAttribute(attr2);
    return val == null ? attrs[attr2] : isNumber.test(val) ? parseFloat(val) : val;
  } else {
    val = hooks.reduce((_val, hook) => {
      return hook(attr2, _val, this);
    }, val);
    if (typeof val === "number") {
      val = new SVGNumber(val);
    } else if (Color.isColor(val)) {
      val = new Color(val);
    } else if (val.constructor === Array) {
      val = new SVGArray(val);
    }
    if (attr2 === "leading") {
      if (this.leading) {
        this.leading(val);
      }
    } else {
      typeof ns === "string" ? this.node.setAttributeNS(ns, attr2, val.toString()) : this.node.setAttribute(attr2, val.toString());
    }
    if (this.rebuild && (attr2 === "font-size" || attr2 === "x")) {
      this.rebuild();
    }
  }
  return this;
}
var Dom = class extends EventTarget {
  constructor(node3, attrs2) {
    super();
    this.node = node3;
    this.type = node3.nodeName;
    if (attrs2 && node3 !== attrs2) {
      this.attr(attrs2);
    }
  }
  // Add given element at a position
  add(element2, i3) {
    element2 = makeInstance(element2);
    if (element2.removeNamespace && this.node instanceof globals.window.SVGElement) {
      element2.removeNamespace();
    }
    if (i3 == null) {
      this.node.appendChild(element2.node);
    } else if (element2.node !== this.node.childNodes[i3]) {
      this.node.insertBefore(element2.node, this.node.childNodes[i3]);
    }
    return this;
  }
  // Add element to given container and return self
  addTo(parent, i3) {
    return makeInstance(parent).put(this, i3);
  }
  // Returns all child elements
  children() {
    return new List(map(this.node.children, function(node3) {
      return adopt(node3);
    }));
  }
  // Remove all elements in this container
  clear() {
    while (this.node.hasChildNodes()) {
      this.node.removeChild(this.node.lastChild);
    }
    return this;
  }
  // Clone element
  clone(deep = true) {
    this.writeDataToDom();
    return new this.constructor(assignNewId(this.node.cloneNode(deep)));
  }
  // Iterates over all children and invokes a given block
  each(block, deep) {
    const children = this.children();
    let i3, il;
    for (i3 = 0, il = children.length; i3 < il; i3++) {
      block.apply(children[i3], [i3, children]);
      if (deep) {
        children[i3].each(block, deep);
      }
    }
    return this;
  }
  element(nodeName, attrs2) {
    return this.put(new Dom(create(nodeName), attrs2));
  }
  // Get first child
  first() {
    return adopt(this.node.firstChild);
  }
  // Get a element at the given index
  get(i3) {
    return adopt(this.node.childNodes[i3]);
  }
  getEventHolder() {
    return this.node;
  }
  getEventTarget() {
    return this.node;
  }
  // Checks if the given element is a child
  has(element2) {
    return this.index(element2) >= 0;
  }
  html(htmlOrFn, outerHTML) {
    return this.xml(htmlOrFn, outerHTML, html);
  }
  // Get / set id
  id(id) {
    if (typeof id === "undefined" && !this.node.id) {
      this.node.id = eid(this.type);
    }
    return this.attr("id", id);
  }
  // Gets index of given element
  index(element2) {
    return [].slice.call(this.node.childNodes).indexOf(element2.node);
  }
  // Get the last child
  last() {
    return adopt(this.node.lastChild);
  }
  // matches the element vs a css selector
  matches(selector) {
    const el2 = this.node;
    const matcher = el2.matches || el2.matchesSelector || el2.msMatchesSelector || el2.mozMatchesSelector || el2.webkitMatchesSelector || el2.oMatchesSelector || null;
    return matcher && matcher.call(el2, selector);
  }
  // Returns the parent element instance
  parent(type) {
    let parent = this;
    if (!parent.node.parentNode)
      return null;
    parent = adopt(parent.node.parentNode);
    if (!type)
      return parent;
    do {
      if (typeof type === "string" ? parent.matches(type) : parent instanceof type)
        return parent;
    } while (parent = adopt(parent.node.parentNode));
    return parent;
  }
  // Basically does the same as `add()` but returns the added element instead
  put(element2, i3) {
    element2 = makeInstance(element2);
    this.add(element2, i3);
    return element2;
  }
  // Add element to given container and return container
  putIn(parent, i3) {
    return makeInstance(parent).add(this, i3);
  }
  // Remove element
  remove() {
    if (this.parent()) {
      this.parent().removeElement(this);
    }
    return this;
  }
  // Remove a given child
  removeElement(element2) {
    this.node.removeChild(element2.node);
    return this;
  }
  // Replace this with element
  replace(element2) {
    element2 = makeInstance(element2);
    if (this.node.parentNode) {
      this.node.parentNode.replaceChild(element2.node, this.node);
    }
    return element2;
  }
  round(precision = 2, map3 = null) {
    const factor = 10 ** precision;
    const attrs2 = this.attr(map3);
    for (const i3 in attrs2) {
      if (typeof attrs2[i3] === "number") {
        attrs2[i3] = Math.round(attrs2[i3] * factor) / factor;
      }
    }
    this.attr(attrs2);
    return this;
  }
  // Import / Export raw svg
  svg(svgOrFn, outerSVG) {
    return this.xml(svgOrFn, outerSVG, svg);
  }
  // Return id on string conversion
  toString() {
    return this.id();
  }
  words(text3) {
    this.node.textContent = text3;
    return this;
  }
  wrap(node3) {
    const parent = this.parent();
    if (!parent) {
      return this.addTo(node3);
    }
    const position3 = parent.index(this);
    return parent.put(node3, position3).put(this);
  }
  // write svgjs data to the dom
  writeDataToDom() {
    this.each(function() {
      this.writeDataToDom();
    });
    return this;
  }
  // Import / Export raw svg
  xml(xmlOrFn, outerXML, ns) {
    if (typeof xmlOrFn === "boolean") {
      ns = outerXML;
      outerXML = xmlOrFn;
      xmlOrFn = null;
    }
    if (xmlOrFn == null || typeof xmlOrFn === "function") {
      outerXML = outerXML == null ? true : outerXML;
      this.writeDataToDom();
      let current = this;
      if (xmlOrFn != null) {
        current = adopt(current.node.cloneNode(true));
        if (outerXML) {
          const result = xmlOrFn(current);
          current = result || current;
          if (result === false)
            return "";
        }
        current.each(function() {
          const result = xmlOrFn(this);
          const _this = result || this;
          if (result === false) {
            this.remove();
          } else if (result && this !== _this) {
            this.replace(_this);
          }
        }, true);
      }
      return outerXML ? current.node.outerHTML : current.node.innerHTML;
    }
    outerXML = outerXML == null ? false : outerXML;
    const well = create("wrapper", ns);
    const fragment = globals.document.createDocumentFragment();
    well.innerHTML = xmlOrFn;
    for (let len = well.children.length; len--; ) {
      fragment.appendChild(well.firstElementChild);
    }
    const parent = this.parent();
    return outerXML ? this.replace(fragment) && parent : this.add(fragment);
  }
};
extend(Dom, {
  attr,
  find,
  findOne
});
register(Dom, "Dom");
var Element = class extends Dom {
  constructor(node3, attrs2) {
    super(node3, attrs2);
    this.dom = {};
    this.node.instance = this;
    if (node3.hasAttribute("svgjs:data")) {
      this.setData(JSON.parse(node3.getAttribute("svgjs:data")) || {});
    }
  }
  // Move element by its center
  center(x3, y4) {
    return this.cx(x3).cy(y4);
  }
  // Move by center over x-axis
  cx(x3) {
    return x3 == null ? this.x() + this.width() / 2 : this.x(x3 - this.width() / 2);
  }
  // Move by center over y-axis
  cy(y4) {
    return y4 == null ? this.y() + this.height() / 2 : this.y(y4 - this.height() / 2);
  }
  // Get defs
  defs() {
    const root2 = this.root();
    return root2 && root2.defs();
  }
  // Relative move over x and y axes
  dmove(x3, y4) {
    return this.dx(x3).dy(y4);
  }
  // Relative move over x axis
  dx(x3 = 0) {
    return this.x(new SVGNumber(x3).plus(this.x()));
  }
  // Relative move over y axis
  dy(y4 = 0) {
    return this.y(new SVGNumber(y4).plus(this.y()));
  }
  getEventHolder() {
    return this;
  }
  // Set height of element
  height(height2) {
    return this.attr("height", height2);
  }
  // Move element to given x and y values
  move(x3, y4) {
    return this.x(x3).y(y4);
  }
  // return array of all ancestors of given type up to the root svg
  parents(until = this.root()) {
    const isSelector = typeof until === "string";
    if (!isSelector) {
      until = makeInstance(until);
    }
    const parents = new List();
    let parent = this;
    while ((parent = parent.parent()) && parent.node !== globals.document && parent.nodeName !== "#document-fragment") {
      parents.push(parent);
      if (!isSelector && parent.node === until.node) {
        break;
      }
      if (isSelector && parent.matches(until)) {
        break;
      }
      if (parent.node === this.root().node) {
        return null;
      }
    }
    return parents;
  }
  // Get referenced element form attribute value
  reference(attr2) {
    attr2 = this.attr(attr2);
    if (!attr2)
      return null;
    const m4 = (attr2 + "").match(reference);
    return m4 ? makeInstance(m4[1]) : null;
  }
  // Get parent document
  root() {
    const p3 = this.parent(getClass(root));
    return p3 && p3.root();
  }
  // set given data to the elements data property
  setData(o3) {
    this.dom = o3;
    return this;
  }
  // Set element size to given width and height
  size(width2, height2) {
    const p3 = proportionalSize(this, width2, height2);
    return this.width(new SVGNumber(p3.width)).height(new SVGNumber(p3.height));
  }
  // Set width of element
  width(width2) {
    return this.attr("width", width2);
  }
  // write svgjs data to the dom
  writeDataToDom() {
    this.node.removeAttribute("svgjs:data");
    if (Object.keys(this.dom).length) {
      this.node.setAttribute("svgjs:data", JSON.stringify(this.dom));
    }
    return super.writeDataToDom();
  }
  // Move over x-axis
  x(x3) {
    return this.attr("x", x3);
  }
  // Move over y-axis
  y(y4) {
    return this.attr("y", y4);
  }
};
extend(Element, {
  bbox,
  rbox,
  inside,
  point,
  ctm,
  screenCTM
});
register(Element, "Element");
var sugar = {
  stroke: ["color", "width", "opacity", "linecap", "linejoin", "miterlimit", "dasharray", "dashoffset"],
  fill: ["color", "opacity", "rule"],
  prefix: function(t3, a3) {
    return a3 === "color" ? t3 : t3 + "-" + a3;
  }
};
["fill", "stroke"].forEach(function(m4) {
  const extension2 = {};
  let i3;
  extension2[m4] = function(o3) {
    if (typeof o3 === "undefined") {
      return this.attr(m4);
    }
    if (typeof o3 === "string" || o3 instanceof Color || Color.isRgb(o3) || o3 instanceof Element) {
      this.attr(m4, o3);
    } else {
      for (i3 = sugar[m4].length - 1; i3 >= 0; i3--) {
        if (o3[sugar[m4][i3]] != null) {
          this.attr(sugar.prefix(m4, sugar[m4][i3]), o3[sugar[m4][i3]]);
        }
      }
    }
    return this;
  };
  registerMethods(["Element", "Runner"], extension2);
});
registerMethods(["Element", "Runner"], {
  // Let the user set the matrix directly
  matrix: function(mat, b2, c4, d2, e2, f3) {
    if (mat == null) {
      return new Matrix(this);
    }
    return this.attr("transform", new Matrix(mat, b2, c4, d2, e2, f3));
  },
  // Map rotation to transform
  rotate: function(angle, cx2, cy2) {
    return this.transform({
      rotate: angle,
      ox: cx2,
      oy: cy2
    }, true);
  },
  // Map skew to transform
  skew: function(x3, y4, cx2, cy2) {
    return arguments.length === 1 || arguments.length === 3 ? this.transform({
      skew: x3,
      ox: y4,
      oy: cx2
    }, true) : this.transform({
      skew: [x3, y4],
      ox: cx2,
      oy: cy2
    }, true);
  },
  shear: function(lam, cx2, cy2) {
    return this.transform({
      shear: lam,
      ox: cx2,
      oy: cy2
    }, true);
  },
  // Map scale to transform
  scale: function(x3, y4, cx2, cy2) {
    return arguments.length === 1 || arguments.length === 3 ? this.transform({
      scale: x3,
      ox: y4,
      oy: cx2
    }, true) : this.transform({
      scale: [x3, y4],
      ox: cx2,
      oy: cy2
    }, true);
  },
  // Map translate to transform
  translate: function(x3, y4) {
    return this.transform({
      translate: [x3, y4]
    }, true);
  },
  // Map relative translations to transform
  relative: function(x3, y4) {
    return this.transform({
      relative: [x3, y4]
    }, true);
  },
  // Map flip to transform
  flip: function(direction = "both", origin = "center") {
    if ("xybothtrue".indexOf(direction) === -1) {
      origin = direction;
      direction = "both";
    }
    return this.transform({
      flip: direction,
      origin
    }, true);
  },
  // Opacity
  opacity: function(value) {
    return this.attr("opacity", value);
  }
});
registerMethods("radius", {
  // Add x and y radius
  radius: function(x3, y4 = x3) {
    const type = (this._element || this).type;
    return type === "radialGradient" ? this.attr("r", new SVGNumber(x3)) : this.rx(x3).ry(y4);
  }
});
registerMethods("Path", {
  // Get path length
  length: function() {
    return this.node.getTotalLength();
  },
  // Get point at length
  pointAt: function(length2) {
    return new Point(this.node.getPointAtLength(length2));
  }
});
registerMethods(["Element", "Runner"], {
  // Set font
  font: function(a3, v3) {
    if (typeof a3 === "object") {
      for (v3 in a3)
        this.font(v3, a3[v3]);
      return this;
    }
    return a3 === "leading" ? this.leading(v3) : a3 === "anchor" ? this.attr("text-anchor", v3) : a3 === "size" || a3 === "family" || a3 === "weight" || a3 === "stretch" || a3 === "variant" || a3 === "style" ? this.attr("font-" + a3, v3) : this.attr(a3, v3);
  }
});
var methods = ["click", "dblclick", "mousedown", "mouseup", "mouseover", "mouseout", "mousemove", "mouseenter", "mouseleave", "touchstart", "touchmove", "touchleave", "touchend", "touchcancel"].reduce(function(last, event) {
  const fn = function(f3) {
    if (f3 === null) {
      this.off(event);
    } else {
      this.on(event, f3);
    }
    return this;
  };
  last[event] = fn;
  return last;
}, {});
registerMethods("Element", methods);
function untransform() {
  return this.attr("transform", null);
}
function matrixify() {
  const matrix = (this.attr("transform") || "").split(transforms).slice(0, -1).map(function(str) {
    const kv = str.trim().split("(");
    return [kv[0], kv[1].split(delimiter).map(function(str2) {
      return parseFloat(str2);
    })];
  }).reverse().reduce(function(matrix2, transform2) {
    if (transform2[0] === "matrix") {
      return matrix2.lmultiply(Matrix.fromArray(transform2[1]));
    }
    return matrix2[transform2[0]].apply(matrix2, transform2[1]);
  }, new Matrix());
  return matrix;
}
function toParent(parent, i3) {
  if (this === parent)
    return this;
  const ctm2 = this.screenCTM();
  const pCtm = parent.screenCTM().inverse();
  this.addTo(parent, i3).untransform().transform(pCtm.multiply(ctm2));
  return this;
}
function toRoot(i3) {
  return this.toParent(this.root(), i3);
}
function transform(o3, relative) {
  if (o3 == null || typeof o3 === "string") {
    const decomposed = new Matrix(this).decompose();
    return o3 == null ? decomposed : decomposed[o3];
  }
  if (!Matrix.isMatrixLike(o3)) {
    o3 = {
      ...o3,
      origin: getOrigin(o3, this)
    };
  }
  const cleanRelative = relative === true ? this : relative || false;
  const result = new Matrix(cleanRelative).transform(o3);
  return this.attr("transform", result);
}
registerMethods("Element", {
  untransform,
  matrixify,
  toParent,
  toRoot,
  transform
});
var Container = class extends Element {
  flatten(parent = this, index3) {
    this.each(function() {
      if (this instanceof Container) {
        return this.flatten().ungroup();
      }
    });
    return this;
  }
  ungroup(parent = this.parent(), index3 = parent.index(this)) {
    index3 = index3 === -1 ? parent.children().length : index3;
    this.each(function(i3, children) {
      return children[children.length - i3 - 1].toParent(parent, index3);
    });
    return this.remove();
  }
};
register(Container, "Container");
var Defs = class extends Container {
  constructor(node3, attrs2 = node3) {
    super(nodeOrNew("defs", node3), attrs2);
  }
  flatten() {
    return this;
  }
  ungroup() {
    return this;
  }
};
register(Defs, "Defs");
var Shape = class extends Element {
};
register(Shape, "Shape");
function rx(rx2) {
  return this.attr("rx", rx2);
}
function ry(ry2) {
  return this.attr("ry", ry2);
}
function x$3(x3) {
  return x3 == null ? this.cx() - this.rx() : this.cx(x3 + this.rx());
}
function y$3(y4) {
  return y4 == null ? this.cy() - this.ry() : this.cy(y4 + this.ry());
}
function cx$1(x3) {
  return this.attr("cx", x3);
}
function cy$1(y4) {
  return this.attr("cy", y4);
}
function width$2(width2) {
  return width2 == null ? this.rx() * 2 : this.rx(new SVGNumber(width2).divide(2));
}
function height$2(height2) {
  return height2 == null ? this.ry() * 2 : this.ry(new SVGNumber(height2).divide(2));
}
var circled = {
  __proto__: null,
  rx,
  ry,
  x: x$3,
  y: y$3,
  cx: cx$1,
  cy: cy$1,
  width: width$2,
  height: height$2
};
var Ellipse = class extends Shape {
  constructor(node3, attrs2 = node3) {
    super(nodeOrNew("ellipse", node3), attrs2);
  }
  size(width2, height2) {
    const p3 = proportionalSize(this, width2, height2);
    return this.rx(new SVGNumber(p3.width).divide(2)).ry(new SVGNumber(p3.height).divide(2));
  }
};
extend(Ellipse, circled);
registerMethods("Container", {
  // Create an ellipse
  ellipse: wrapWithAttrCheck(function(width2 = 0, height2 = width2) {
    return this.put(new Ellipse()).size(width2, height2).move(0, 0);
  })
});
register(Ellipse, "Ellipse");
var Fragment = class extends Dom {
  constructor(node3 = globals.document.createDocumentFragment()) {
    super(node3);
  }
  // Import / Export raw xml
  xml(xmlOrFn, outerXML, ns) {
    if (typeof xmlOrFn === "boolean") {
      ns = outerXML;
      outerXML = xmlOrFn;
      xmlOrFn = null;
    }
    if (xmlOrFn == null || typeof xmlOrFn === "function") {
      const wrapper = new Dom(create("wrapper", ns));
      wrapper.add(this.node.cloneNode(true));
      return wrapper.xml(false, ns);
    }
    return super.xml(xmlOrFn, false, ns);
  }
};
register(Fragment, "Fragment");
function from(x3, y4) {
  return (this._element || this).type === "radialGradient" ? this.attr({
    fx: new SVGNumber(x3),
    fy: new SVGNumber(y4)
  }) : this.attr({
    x1: new SVGNumber(x3),
    y1: new SVGNumber(y4)
  });
}
function to(x3, y4) {
  return (this._element || this).type === "radialGradient" ? this.attr({
    cx: new SVGNumber(x3),
    cy: new SVGNumber(y4)
  }) : this.attr({
    x2: new SVGNumber(x3),
    y2: new SVGNumber(y4)
  });
}
var gradiented = {
  __proto__: null,
  from,
  to
};
var Gradient = class extends Container {
  constructor(type, attrs2) {
    super(nodeOrNew(type + "Gradient", typeof type === "string" ? null : type), attrs2);
  }
  // custom attr to handle transform
  attr(a3, b2, c4) {
    if (a3 === "transform")
      a3 = "gradientTransform";
    return super.attr(a3, b2, c4);
  }
  bbox() {
    return new Box();
  }
  targets() {
    return baseFind('svg [fill*="' + this.id() + '"]');
  }
  // Alias string conversion to fill
  toString() {
    return this.url();
  }
  // Update gradient
  update(block) {
    this.clear();
    if (typeof block === "function") {
      block.call(this, this);
    }
    return this;
  }
  // Return the fill id
  url() {
    return 'url("#' + this.id() + '")';
  }
};
extend(Gradient, gradiented);
registerMethods({
  Container: {
    // Create gradient element in defs
    gradient(...args) {
      return this.defs().gradient(...args);
    }
  },
  // define gradient
  Defs: {
    gradient: wrapWithAttrCheck(function(type, block) {
      return this.put(new Gradient(type)).update(block);
    })
  }
});
register(Gradient, "Gradient");
var Pattern = class extends Container {
  // Initialize node
  constructor(node3, attrs2 = node3) {
    super(nodeOrNew("pattern", node3), attrs2);
  }
  // custom attr to handle transform
  attr(a3, b2, c4) {
    if (a3 === "transform")
      a3 = "patternTransform";
    return super.attr(a3, b2, c4);
  }
  bbox() {
    return new Box();
  }
  targets() {
    return baseFind('svg [fill*="' + this.id() + '"]');
  }
  // Alias string conversion to fill
  toString() {
    return this.url();
  }
  // Update pattern by rebuilding
  update(block) {
    this.clear();
    if (typeof block === "function") {
      block.call(this, this);
    }
    return this;
  }
  // Return the fill id
  url() {
    return 'url("#' + this.id() + '")';
  }
};
registerMethods({
  Container: {
    // Create pattern element in defs
    pattern(...args) {
      return this.defs().pattern(...args);
    }
  },
  Defs: {
    pattern: wrapWithAttrCheck(function(width2, height2, block) {
      return this.put(new Pattern()).update(block).attr({
        x: 0,
        y: 0,
        width: width2,
        height: height2,
        patternUnits: "userSpaceOnUse"
      });
    })
  }
});
register(Pattern, "Pattern");
var Image2 = class extends Shape {
  constructor(node3, attrs2 = node3) {
    super(nodeOrNew("image", node3), attrs2);
  }
  // (re)load image
  load(url, callback) {
    if (!url)
      return this;
    const img = new globals.window.Image();
    on(img, "load", function(e2) {
      const p3 = this.parent(Pattern);
      if (this.width() === 0 && this.height() === 0) {
        this.size(img.width, img.height);
      }
      if (p3 instanceof Pattern) {
        if (p3.width() === 0 && p3.height() === 0) {
          p3.size(this.width(), this.height());
        }
      }
      if (typeof callback === "function") {
        callback.call(this, e2);
      }
    }, this);
    on(img, "load error", function() {
      off(img);
    });
    return this.attr("href", img.src = url, xlink);
  }
};
registerAttrHook(function(attr2, val, _this) {
  if (attr2 === "fill" || attr2 === "stroke") {
    if (isImage.test(val)) {
      val = _this.root().defs().image(val);
    }
  }
  if (val instanceof Image2) {
    val = _this.root().defs().pattern(0, 0, (pattern) => {
      pattern.add(val);
    });
  }
  return val;
});
registerMethods({
  Container: {
    // create image element, load image and set its size
    image: wrapWithAttrCheck(function(source, callback) {
      return this.put(new Image2()).size(0, 0).load(source, callback);
    })
  }
});
register(Image2, "Image");
var PointArray = class extends SVGArray {
  // Get bounding box of points
  bbox() {
    let maxX = -Infinity;
    let maxY = -Infinity;
    let minX = Infinity;
    let minY = Infinity;
    this.forEach(function(el2) {
      maxX = Math.max(el2[0], maxX);
      maxY = Math.max(el2[1], maxY);
      minX = Math.min(el2[0], minX);
      minY = Math.min(el2[1], minY);
    });
    return new Box(minX, minY, maxX - minX, maxY - minY);
  }
  // Move point string
  move(x3, y4) {
    const box = this.bbox();
    x3 -= box.x;
    y4 -= box.y;
    if (!isNaN(x3) && !isNaN(y4)) {
      for (let i3 = this.length - 1; i3 >= 0; i3--) {
        this[i3] = [this[i3][0] + x3, this[i3][1] + y4];
      }
    }
    return this;
  }
  // Parse point string and flat array
  parse(array2 = [0, 0]) {
    const points = [];
    if (array2 instanceof Array) {
      array2 = Array.prototype.concat.apply([], array2);
    } else {
      array2 = array2.trim().split(delimiter).map(parseFloat);
    }
    if (array2.length % 2 !== 0)
      array2.pop();
    for (let i3 = 0, len = array2.length; i3 < len; i3 = i3 + 2) {
      points.push([array2[i3], array2[i3 + 1]]);
    }
    return points;
  }
  // Resize poly string
  size(width2, height2) {
    let i3;
    const box = this.bbox();
    for (i3 = this.length - 1; i3 >= 0; i3--) {
      if (box.width)
        this[i3][0] = (this[i3][0] - box.x) * width2 / box.width + box.x;
      if (box.height)
        this[i3][1] = (this[i3][1] - box.y) * height2 / box.height + box.y;
    }
    return this;
  }
  // Convert array to line object
  toLine() {
    return {
      x1: this[0][0],
      y1: this[0][1],
      x2: this[1][0],
      y2: this[1][1]
    };
  }
  // Convert array to string
  toString() {
    const array2 = [];
    for (let i3 = 0, il = this.length; i3 < il; i3++) {
      array2.push(this[i3].join(","));
    }
    return array2.join(" ");
  }
  transform(m4) {
    return this.clone().transformO(m4);
  }
  // transform points with matrix (similar to Point.transform)
  transformO(m4) {
    if (!Matrix.isMatrixLike(m4)) {
      m4 = new Matrix(m4);
    }
    for (let i3 = this.length; i3--; ) {
      const [x3, y4] = this[i3];
      this[i3][0] = m4.a * x3 + m4.c * y4 + m4.e;
      this[i3][1] = m4.b * x3 + m4.d * y4 + m4.f;
    }
    return this;
  }
};
var MorphArray = PointArray;
function x$2(x3) {
  return x3 == null ? this.bbox().x : this.move(x3, this.bbox().y);
}
function y$2(y4) {
  return y4 == null ? this.bbox().y : this.move(this.bbox().x, y4);
}
function width$1(width2) {
  const b2 = this.bbox();
  return width2 == null ? b2.width : this.size(width2, b2.height);
}
function height$1(height2) {
  const b2 = this.bbox();
  return height2 == null ? b2.height : this.size(b2.width, height2);
}
var pointed = {
  __proto__: null,
  MorphArray,
  x: x$2,
  y: y$2,
  width: width$1,
  height: height$1
};
var Line = class extends Shape {
  // Initialize node
  constructor(node3, attrs2 = node3) {
    super(nodeOrNew("line", node3), attrs2);
  }
  // Get array
  array() {
    return new PointArray([[this.attr("x1"), this.attr("y1")], [this.attr("x2"), this.attr("y2")]]);
  }
  // Move by left top corner
  move(x3, y4) {
    return this.attr(this.array().move(x3, y4).toLine());
  }
  // Overwrite native plot() method
  plot(x1, y1, x22, y22) {
    if (x1 == null) {
      return this.array();
    } else if (typeof y1 !== "undefined") {
      x1 = {
        x1,
        y1,
        x2: x22,
        y2: y22
      };
    } else {
      x1 = new PointArray(x1).toLine();
    }
    return this.attr(x1);
  }
  // Set element size to given width and height
  size(width2, height2) {
    const p3 = proportionalSize(this, width2, height2);
    return this.attr(this.array().size(p3.width, p3.height).toLine());
  }
};
extend(Line, pointed);
registerMethods({
  Container: {
    // Create a line element
    line: wrapWithAttrCheck(function(...args) {
      return Line.prototype.plot.apply(this.put(new Line()), args[0] != null ? args : [0, 0, 0, 0]);
    })
  }
});
register(Line, "Line");
var Marker = class extends Container {
  // Initialize node
  constructor(node3, attrs2 = node3) {
    super(nodeOrNew("marker", node3), attrs2);
  }
  // Set height of element
  height(height2) {
    return this.attr("markerHeight", height2);
  }
  orient(orient) {
    return this.attr("orient", orient);
  }
  // Set marker refX and refY
  ref(x3, y4) {
    return this.attr("refX", x3).attr("refY", y4);
  }
  // Return the fill id
  toString() {
    return "url(#" + this.id() + ")";
  }
  // Update marker
  update(block) {
    this.clear();
    if (typeof block === "function") {
      block.call(this, this);
    }
    return this;
  }
  // Set width of element
  width(width2) {
    return this.attr("markerWidth", width2);
  }
};
registerMethods({
  Container: {
    marker(...args) {
      return this.defs().marker(...args);
    }
  },
  Defs: {
    // Create marker
    marker: wrapWithAttrCheck(function(width2, height2, block) {
      return this.put(new Marker()).size(width2, height2).ref(width2 / 2, height2 / 2).viewbox(0, 0, width2, height2).attr("orient", "auto").update(block);
    })
  },
  marker: {
    // Create and attach markers
    marker(marker, width2, height2, block) {
      let attr2 = ["marker"];
      if (marker !== "all")
        attr2.push(marker);
      attr2 = attr2.join("-");
      marker = arguments[1] instanceof Marker ? arguments[1] : this.defs().marker(width2, height2, block);
      return this.attr(attr2, marker);
    }
  }
});
register(Marker, "Marker");
function makeSetterGetter(k2, f3) {
  return function(v3) {
    if (v3 == null)
      return this[k2];
    this[k2] = v3;
    if (f3)
      f3.call(this);
    return this;
  };
}
var easing = {
  "-": function(pos) {
    return pos;
  },
  "<>": function(pos) {
    return -Math.cos(pos * Math.PI) / 2 + 0.5;
  },
  ">": function(pos) {
    return Math.sin(pos * Math.PI / 2);
  },
  "<": function(pos) {
    return -Math.cos(pos * Math.PI / 2) + 1;
  },
  bezier: function(x1, y1, x22, y22) {
    return function(t3) {
      if (t3 < 0) {
        if (x1 > 0) {
          return y1 / x1 * t3;
        } else if (x22 > 0) {
          return y22 / x22 * t3;
        } else {
          return 0;
        }
      } else if (t3 > 1) {
        if (x22 < 1) {
          return (1 - y22) / (1 - x22) * t3 + (y22 - x22) / (1 - x22);
        } else if (x1 < 1) {
          return (1 - y1) / (1 - x1) * t3 + (y1 - x1) / (1 - x1);
        } else {
          return 1;
        }
      } else {
        return 3 * t3 * (1 - t3) ** 2 * y1 + 3 * t3 ** 2 * (1 - t3) * y22 + t3 ** 3;
      }
    };
  },
  // see https://www.w3.org/TR/css-easing-1/#step-timing-function-algo
  steps: function(steps, stepPosition = "end") {
    stepPosition = stepPosition.split("-").reverse()[0];
    let jumps = steps;
    if (stepPosition === "none") {
      --jumps;
    } else if (stepPosition === "both") {
      ++jumps;
    }
    return (t3, beforeFlag = false) => {
      let step = Math.floor(t3 * steps);
      const jumping = t3 * step % 1 === 0;
      if (stepPosition === "start" || stepPosition === "both") {
        ++step;
      }
      if (beforeFlag && jumping) {
        --step;
      }
      if (t3 >= 0 && step < 0) {
        step = 0;
      }
      if (t3 <= 1 && step > jumps) {
        step = jumps;
      }
      return step / jumps;
    };
  }
};
var Stepper = class {
  done() {
    return false;
  }
};
var Ease = class extends Stepper {
  constructor(fn = timeline.ease) {
    super();
    this.ease = easing[fn] || fn;
  }
  step(from2, to2, pos) {
    if (typeof from2 !== "number") {
      return pos < 1 ? from2 : to2;
    }
    return from2 + (to2 - from2) * this.ease(pos);
  }
};
var Controller = class extends Stepper {
  constructor(fn) {
    super();
    this.stepper = fn;
  }
  done(c4) {
    return c4.done;
  }
  step(current, target, dt2, c4) {
    return this.stepper(current, target, dt2, c4);
  }
};
function recalculate() {
  const duration = (this._duration || 500) / 1e3;
  const overshoot = this._overshoot || 0;
  const eps = 1e-10;
  const pi = Math.PI;
  const os = Math.log(overshoot / 100 + eps);
  const zeta = -os / Math.sqrt(pi * pi + os * os);
  const wn = 3.9 / (zeta * duration);
  this.d = 2 * zeta * wn;
  this.k = wn * wn;
}
var Spring = class extends Controller {
  constructor(duration = 500, overshoot = 0) {
    super();
    this.duration(duration).overshoot(overshoot);
  }
  step(current, target, dt2, c4) {
    if (typeof current === "string")
      return current;
    c4.done = dt2 === Infinity;
    if (dt2 === Infinity)
      return target;
    if (dt2 === 0)
      return current;
    if (dt2 > 100)
      dt2 = 16;
    dt2 /= 1e3;
    const velocity = c4.velocity || 0;
    const acceleration = -this.d * velocity - this.k * (current - target);
    const newPosition = current + velocity * dt2 + acceleration * dt2 * dt2 / 2;
    c4.velocity = velocity + acceleration * dt2;
    c4.done = Math.abs(target - newPosition) + Math.abs(velocity) < 2e-3;
    return c4.done ? target : newPosition;
  }
};
extend(Spring, {
  duration: makeSetterGetter("_duration", recalculate),
  overshoot: makeSetterGetter("_overshoot", recalculate)
});
var PID = class extends Controller {
  constructor(p3 = 0.1, i3 = 0.01, d2 = 0, windup = 1e3) {
    super();
    this.p(p3).i(i3).d(d2).windup(windup);
  }
  step(current, target, dt2, c4) {
    if (typeof current === "string")
      return current;
    c4.done = dt2 === Infinity;
    if (dt2 === Infinity)
      return target;
    if (dt2 === 0)
      return current;
    const p3 = target - current;
    let i3 = (c4.integral || 0) + p3 * dt2;
    const d2 = (p3 - (c4.error || 0)) / dt2;
    const windup = this._windup;
    if (windup !== false) {
      i3 = Math.max(-windup, Math.min(i3, windup));
    }
    c4.error = p3;
    c4.integral = i3;
    c4.done = Math.abs(p3) < 1e-3;
    return c4.done ? target : current + (this.P * p3 + this.I * i3 + this.D * d2);
  }
};
extend(PID, {
  windup: makeSetterGetter("_windup"),
  p: makeSetterGetter("P"),
  i: makeSetterGetter("I"),
  d: makeSetterGetter("D")
});
var segmentParameters = {
  M: 2,
  L: 2,
  H: 1,
  V: 1,
  C: 6,
  S: 4,
  Q: 4,
  T: 2,
  A: 7,
  Z: 0
};
var pathHandlers = {
  M: function(c4, p3, p0) {
    p3.x = p0.x = c4[0];
    p3.y = p0.y = c4[1];
    return ["M", p3.x, p3.y];
  },
  L: function(c4, p3) {
    p3.x = c4[0];
    p3.y = c4[1];
    return ["L", c4[0], c4[1]];
  },
  H: function(c4, p3) {
    p3.x = c4[0];
    return ["H", c4[0]];
  },
  V: function(c4, p3) {
    p3.y = c4[0];
    return ["V", c4[0]];
  },
  C: function(c4, p3) {
    p3.x = c4[4];
    p3.y = c4[5];
    return ["C", c4[0], c4[1], c4[2], c4[3], c4[4], c4[5]];
  },
  S: function(c4, p3) {
    p3.x = c4[2];
    p3.y = c4[3];
    return ["S", c4[0], c4[1], c4[2], c4[3]];
  },
  Q: function(c4, p3) {
    p3.x = c4[2];
    p3.y = c4[3];
    return ["Q", c4[0], c4[1], c4[2], c4[3]];
  },
  T: function(c4, p3) {
    p3.x = c4[0];
    p3.y = c4[1];
    return ["T", c4[0], c4[1]];
  },
  Z: function(c4, p3, p0) {
    p3.x = p0.x;
    p3.y = p0.y;
    return ["Z"];
  },
  A: function(c4, p3) {
    p3.x = c4[5];
    p3.y = c4[6];
    return ["A", c4[0], c4[1], c4[2], c4[3], c4[4], c4[5], c4[6]];
  }
};
var mlhvqtcsaz = "mlhvqtcsaz".split("");
for (let i3 = 0, il = mlhvqtcsaz.length; i3 < il; ++i3) {
  pathHandlers[mlhvqtcsaz[i3]] = function(i4) {
    return function(c4, p3, p0) {
      if (i4 === "H")
        c4[0] = c4[0] + p3.x;
      else if (i4 === "V")
        c4[0] = c4[0] + p3.y;
      else if (i4 === "A") {
        c4[5] = c4[5] + p3.x;
        c4[6] = c4[6] + p3.y;
      } else {
        for (let j2 = 0, jl = c4.length; j2 < jl; ++j2) {
          c4[j2] = c4[j2] + (j2 % 2 ? p3.y : p3.x);
        }
      }
      return pathHandlers[i4](c4, p3, p0);
    };
  }(mlhvqtcsaz[i3].toUpperCase());
}
function makeAbsolut(parser2) {
  const command = parser2.segment[0];
  return pathHandlers[command](parser2.segment.slice(1), parser2.p, parser2.p0);
}
function segmentComplete(parser2) {
  return parser2.segment.length && parser2.segment.length - 1 === segmentParameters[parser2.segment[0].toUpperCase()];
}
function startNewSegment(parser2, token) {
  parser2.inNumber && finalizeNumber(parser2, false);
  const pathLetter = isPathLetter.test(token);
  if (pathLetter) {
    parser2.segment = [token];
  } else {
    const lastCommand = parser2.lastCommand;
    const small = lastCommand.toLowerCase();
    const isSmall = lastCommand === small;
    parser2.segment = [small === "m" ? isSmall ? "l" : "L" : lastCommand];
  }
  parser2.inSegment = true;
  parser2.lastCommand = parser2.segment[0];
  return pathLetter;
}
function finalizeNumber(parser2, inNumber) {
  if (!parser2.inNumber)
    throw new Error("Parser Error");
  parser2.number && parser2.segment.push(parseFloat(parser2.number));
  parser2.inNumber = inNumber;
  parser2.number = "";
  parser2.pointSeen = false;
  parser2.hasExponent = false;
  if (segmentComplete(parser2)) {
    finalizeSegment(parser2);
  }
}
function finalizeSegment(parser2) {
  parser2.inSegment = false;
  if (parser2.absolute) {
    parser2.segment = makeAbsolut(parser2);
  }
  parser2.segments.push(parser2.segment);
}
function isArcFlag(parser2) {
  if (!parser2.segment.length)
    return false;
  const isArc = parser2.segment[0].toUpperCase() === "A";
  const length2 = parser2.segment.length;
  return isArc && (length2 === 4 || length2 === 5);
}
function isExponential(parser2) {
  return parser2.lastToken.toUpperCase() === "E";
}
function pathParser(d2, toAbsolute = true) {
  let index3 = 0;
  let token = "";
  const parser2 = {
    segment: [],
    inNumber: false,
    number: "",
    lastToken: "",
    inSegment: false,
    segments: [],
    pointSeen: false,
    hasExponent: false,
    absolute: toAbsolute,
    p0: new Point(),
    p: new Point()
  };
  while (parser2.lastToken = token, token = d2.charAt(index3++)) {
    if (!parser2.inSegment) {
      if (startNewSegment(parser2, token)) {
        continue;
      }
    }
    if (token === ".") {
      if (parser2.pointSeen || parser2.hasExponent) {
        finalizeNumber(parser2, false);
        --index3;
        continue;
      }
      parser2.inNumber = true;
      parser2.pointSeen = true;
      parser2.number += token;
      continue;
    }
    if (!isNaN(parseInt(token))) {
      if (parser2.number === "0" || isArcFlag(parser2)) {
        parser2.inNumber = true;
        parser2.number = token;
        finalizeNumber(parser2, true);
        continue;
      }
      parser2.inNumber = true;
      parser2.number += token;
      continue;
    }
    if (token === " " || token === ",") {
      if (parser2.inNumber) {
        finalizeNumber(parser2, false);
      }
      continue;
    }
    if (token === "-") {
      if (parser2.inNumber && !isExponential(parser2)) {
        finalizeNumber(parser2, false);
        --index3;
        continue;
      }
      parser2.number += token;
      parser2.inNumber = true;
      continue;
    }
    if (token.toUpperCase() === "E") {
      parser2.number += token;
      parser2.hasExponent = true;
      continue;
    }
    if (isPathLetter.test(token)) {
      if (parser2.inNumber) {
        finalizeNumber(parser2, false);
      } else if (!segmentComplete(parser2)) {
        throw new Error("parser Error");
      } else {
        finalizeSegment(parser2);
      }
      --index3;
    }
  }
  if (parser2.inNumber) {
    finalizeNumber(parser2, false);
  }
  if (parser2.inSegment && segmentComplete(parser2)) {
    finalizeSegment(parser2);
  }
  return parser2.segments;
}
function arrayToString(a3) {
  let s3 = "";
  for (let i3 = 0, il = a3.length; i3 < il; i3++) {
    s3 += a3[i3][0];
    if (a3[i3][1] != null) {
      s3 += a3[i3][1];
      if (a3[i3][2] != null) {
        s3 += " ";
        s3 += a3[i3][2];
        if (a3[i3][3] != null) {
          s3 += " ";
          s3 += a3[i3][3];
          s3 += " ";
          s3 += a3[i3][4];
          if (a3[i3][5] != null) {
            s3 += " ";
            s3 += a3[i3][5];
            s3 += " ";
            s3 += a3[i3][6];
            if (a3[i3][7] != null) {
              s3 += " ";
              s3 += a3[i3][7];
            }
          }
        }
      }
    }
  }
  return s3 + " ";
}
var PathArray = class extends SVGArray {
  // Get bounding box of path
  bbox() {
    parser().path.setAttribute("d", this.toString());
    return new Box(parser.nodes.path.getBBox());
  }
  // Move path string
  move(x3, y4) {
    const box = this.bbox();
    x3 -= box.x;
    y4 -= box.y;
    if (!isNaN(x3) && !isNaN(y4)) {
      for (let l3, i3 = this.length - 1; i3 >= 0; i3--) {
        l3 = this[i3][0];
        if (l3 === "M" || l3 === "L" || l3 === "T") {
          this[i3][1] += x3;
          this[i3][2] += y4;
        } else if (l3 === "H") {
          this[i3][1] += x3;
        } else if (l3 === "V") {
          this[i3][1] += y4;
        } else if (l3 === "C" || l3 === "S" || l3 === "Q") {
          this[i3][1] += x3;
          this[i3][2] += y4;
          this[i3][3] += x3;
          this[i3][4] += y4;
          if (l3 === "C") {
            this[i3][5] += x3;
            this[i3][6] += y4;
          }
        } else if (l3 === "A") {
          this[i3][6] += x3;
          this[i3][7] += y4;
        }
      }
    }
    return this;
  }
  // Absolutize and parse path to array
  parse(d2 = "M0 0") {
    if (Array.isArray(d2)) {
      d2 = Array.prototype.concat.apply([], d2).toString();
    }
    return pathParser(d2);
  }
  // Resize path string
  size(width2, height2) {
    const box = this.bbox();
    let i3, l3;
    box.width = box.width === 0 ? 1 : box.width;
    box.height = box.height === 0 ? 1 : box.height;
    for (i3 = this.length - 1; i3 >= 0; i3--) {
      l3 = this[i3][0];
      if (l3 === "M" || l3 === "L" || l3 === "T") {
        this[i3][1] = (this[i3][1] - box.x) * width2 / box.width + box.x;
        this[i3][2] = (this[i3][2] - box.y) * height2 / box.height + box.y;
      } else if (l3 === "H") {
        this[i3][1] = (this[i3][1] - box.x) * width2 / box.width + box.x;
      } else if (l3 === "V") {
        this[i3][1] = (this[i3][1] - box.y) * height2 / box.height + box.y;
      } else if (l3 === "C" || l3 === "S" || l3 === "Q") {
        this[i3][1] = (this[i3][1] - box.x) * width2 / box.width + box.x;
        this[i3][2] = (this[i3][2] - box.y) * height2 / box.height + box.y;
        this[i3][3] = (this[i3][3] - box.x) * width2 / box.width + box.x;
        this[i3][4] = (this[i3][4] - box.y) * height2 / box.height + box.y;
        if (l3 === "C") {
          this[i3][5] = (this[i3][5] - box.x) * width2 / box.width + box.x;
          this[i3][6] = (this[i3][6] - box.y) * height2 / box.height + box.y;
        }
      } else if (l3 === "A") {
        this[i3][1] = this[i3][1] * width2 / box.width;
        this[i3][2] = this[i3][2] * height2 / box.height;
        this[i3][6] = (this[i3][6] - box.x) * width2 / box.width + box.x;
        this[i3][7] = (this[i3][7] - box.y) * height2 / box.height + box.y;
      }
    }
    return this;
  }
  // Convert array to string
  toString() {
    return arrayToString(this);
  }
};
var getClassForType = (value) => {
  const type = typeof value;
  if (type === "number") {
    return SVGNumber;
  } else if (type === "string") {
    if (Color.isColor(value)) {
      return Color;
    } else if (delimiter.test(value)) {
      return isPathLetter.test(value) ? PathArray : SVGArray;
    } else if (numberAndUnit.test(value)) {
      return SVGNumber;
    } else {
      return NonMorphable;
    }
  } else if (morphableTypes.indexOf(value.constructor) > -1) {
    return value.constructor;
  } else if (Array.isArray(value)) {
    return SVGArray;
  } else if (type === "object") {
    return ObjectBag;
  } else {
    return NonMorphable;
  }
};
var Morphable = class {
  constructor(stepper) {
    this._stepper = stepper || new Ease("-");
    this._from = null;
    this._to = null;
    this._type = null;
    this._context = null;
    this._morphObj = null;
  }
  at(pos) {
    return this._morphObj.morph(this._from, this._to, pos, this._stepper, this._context);
  }
  done() {
    const complete = this._context.map(this._stepper.done).reduce(function(last, curr) {
      return last && curr;
    }, true);
    return complete;
  }
  from(val) {
    if (val == null) {
      return this._from;
    }
    this._from = this._set(val);
    return this;
  }
  stepper(stepper) {
    if (stepper == null)
      return this._stepper;
    this._stepper = stepper;
    return this;
  }
  to(val) {
    if (val == null) {
      return this._to;
    }
    this._to = this._set(val);
    return this;
  }
  type(type) {
    if (type == null) {
      return this._type;
    }
    this._type = type;
    return this;
  }
  _set(value) {
    if (!this._type) {
      this.type(getClassForType(value));
    }
    let result = new this._type(value);
    if (this._type === Color) {
      result = this._to ? result[this._to[4]]() : this._from ? result[this._from[4]]() : result;
    }
    if (this._type === ObjectBag) {
      result = this._to ? result.align(this._to) : this._from ? result.align(this._from) : result;
    }
    result = result.toConsumable();
    this._morphObj = this._morphObj || new this._type();
    this._context = this._context || Array.apply(null, Array(result.length)).map(Object).map(function(o3) {
      o3.done = true;
      return o3;
    });
    return result;
  }
};
var NonMorphable = class {
  constructor(...args) {
    this.init(...args);
  }
  init(val) {
    val = Array.isArray(val) ? val[0] : val;
    this.value = val;
    return this;
  }
  toArray() {
    return [this.value];
  }
  valueOf() {
    return this.value;
  }
};
var TransformBag = class {
  constructor(...args) {
    this.init(...args);
  }
  init(obj) {
    if (Array.isArray(obj)) {
      obj = {
        scaleX: obj[0],
        scaleY: obj[1],
        shear: obj[2],
        rotate: obj[3],
        translateX: obj[4],
        translateY: obj[5],
        originX: obj[6],
        originY: obj[7]
      };
    }
    Object.assign(this, TransformBag.defaults, obj);
    return this;
  }
  toArray() {
    const v3 = this;
    return [v3.scaleX, v3.scaleY, v3.shear, v3.rotate, v3.translateX, v3.translateY, v3.originX, v3.originY];
  }
};
TransformBag.defaults = {
  scaleX: 1,
  scaleY: 1,
  shear: 0,
  rotate: 0,
  translateX: 0,
  translateY: 0,
  originX: 0,
  originY: 0
};
var sortByKey = (a3, b2) => {
  return a3[0] < b2[0] ? -1 : a3[0] > b2[0] ? 1 : 0;
};
var ObjectBag = class {
  constructor(...args) {
    this.init(...args);
  }
  align(other) {
    const values = this.values;
    for (let i3 = 0, il = values.length; i3 < il; ++i3) {
      if (values[i3 + 1] === other[i3 + 1]) {
        if (values[i3 + 1] === Color && other[i3 + 7] !== values[i3 + 7]) {
          const space = other[i3 + 7];
          const color = new Color(this.values.splice(i3 + 3, 5))[space]().toArray();
          this.values.splice(i3 + 3, 0, ...color);
        }
        i3 += values[i3 + 2] + 2;
        continue;
      }
      if (!other[i3 + 1]) {
        return this;
      }
      const defaultObject = new other[i3 + 1]().toArray();
      const toDelete = values[i3 + 2] + 3;
      values.splice(i3, toDelete, other[i3], other[i3 + 1], other[i3 + 2], ...defaultObject);
      i3 += values[i3 + 2] + 2;
    }
    return this;
  }
  init(objOrArr) {
    this.values = [];
    if (Array.isArray(objOrArr)) {
      this.values = objOrArr.slice();
      return;
    }
    objOrArr = objOrArr || {};
    const entries = [];
    for (const i3 in objOrArr) {
      const Type = getClassForType(objOrArr[i3]);
      const val = new Type(objOrArr[i3]).toArray();
      entries.push([i3, Type, val.length, ...val]);
    }
    entries.sort(sortByKey);
    this.values = entries.reduce((last, curr) => last.concat(curr), []);
    return this;
  }
  toArray() {
    return this.values;
  }
  valueOf() {
    const obj = {};
    const arr = this.values;
    while (arr.length) {
      const key = arr.shift();
      const Type = arr.shift();
      const num = arr.shift();
      const values = arr.splice(0, num);
      obj[key] = new Type(values);
    }
    return obj;
  }
};
var morphableTypes = [NonMorphable, TransformBag, ObjectBag];
function registerMorphableType(type = []) {
  morphableTypes.push(...[].concat(type));
}
function makeMorphable() {
  extend(morphableTypes, {
    to(val) {
      return new Morphable().type(this.constructor).from(this.toArray()).to(val);
    },
    fromArray(arr) {
      this.init(arr);
      return this;
    },
    toConsumable() {
      return this.toArray();
    },
    morph(from2, to2, pos, stepper, context) {
      const mapper = function(i3, index3) {
        return stepper.step(i3, to2[index3], pos, context[index3], context);
      };
      return this.fromArray(from2.map(mapper));
    }
  });
}
var Path = class extends Shape {
  // Initialize node
  constructor(node3, attrs2 = node3) {
    super(nodeOrNew("path", node3), attrs2);
  }
  // Get array
  array() {
    return this._array || (this._array = new PathArray(this.attr("d")));
  }
  // Clear array cache
  clear() {
    delete this._array;
    return this;
  }
  // Set height of element
  height(height2) {
    return height2 == null ? this.bbox().height : this.size(this.bbox().width, height2);
  }
  // Move by left top corner
  move(x3, y4) {
    return this.attr("d", this.array().move(x3, y4));
  }
  // Plot new path
  plot(d2) {
    return d2 == null ? this.array() : this.clear().attr("d", typeof d2 === "string" ? d2 : this._array = new PathArray(d2));
  }
  // Set element size to given width and height
  size(width2, height2) {
    const p3 = proportionalSize(this, width2, height2);
    return this.attr("d", this.array().size(p3.width, p3.height));
  }
  // Set width of element
  width(width2) {
    return width2 == null ? this.bbox().width : this.size(width2, this.bbox().height);
  }
  // Move by left top corner over x-axis
  x(x3) {
    return x3 == null ? this.bbox().x : this.move(x3, this.bbox().y);
  }
  // Move by left top corner over y-axis
  y(y4) {
    return y4 == null ? this.bbox().y : this.move(this.bbox().x, y4);
  }
};
Path.prototype.MorphArray = PathArray;
registerMethods({
  Container: {
    // Create a wrapped path element
    path: wrapWithAttrCheck(function(d2) {
      return this.put(new Path()).plot(d2 || new PathArray());
    })
  }
});
register(Path, "Path");
function array() {
  return this._array || (this._array = new PointArray(this.attr("points")));
}
function clear() {
  delete this._array;
  return this;
}
function move$2(x3, y4) {
  return this.attr("points", this.array().move(x3, y4));
}
function plot(p3) {
  return p3 == null ? this.array() : this.clear().attr("points", typeof p3 === "string" ? p3 : this._array = new PointArray(p3));
}
function size$1(width2, height2) {
  const p3 = proportionalSize(this, width2, height2);
  return this.attr("points", this.array().size(p3.width, p3.height));
}
var poly = {
  __proto__: null,
  array,
  clear,
  move: move$2,
  plot,
  size: size$1
};
var Polygon = class extends Shape {
  // Initialize node
  constructor(node3, attrs2 = node3) {
    super(nodeOrNew("polygon", node3), attrs2);
  }
};
registerMethods({
  Container: {
    // Create a wrapped polygon element
    polygon: wrapWithAttrCheck(function(p3) {
      return this.put(new Polygon()).plot(p3 || new PointArray());
    })
  }
});
extend(Polygon, pointed);
extend(Polygon, poly);
register(Polygon, "Polygon");
var Polyline = class extends Shape {
  // Initialize node
  constructor(node3, attrs2 = node3) {
    super(nodeOrNew("polyline", node3), attrs2);
  }
};
registerMethods({
  Container: {
    // Create a wrapped polygon element
    polyline: wrapWithAttrCheck(function(p3) {
      return this.put(new Polyline()).plot(p3 || new PointArray());
    })
  }
});
extend(Polyline, pointed);
extend(Polyline, poly);
register(Polyline, "Polyline");
var Rect = class extends Shape {
  // Initialize node
  constructor(node3, attrs2 = node3) {
    super(nodeOrNew("rect", node3), attrs2);
  }
};
extend(Rect, {
  rx,
  ry
});
registerMethods({
  Container: {
    // Create a rect element
    rect: wrapWithAttrCheck(function(width2, height2) {
      return this.put(new Rect()).size(width2, height2);
    })
  }
});
register(Rect, "Rect");
var Queue = class {
  constructor() {
    this._first = null;
    this._last = null;
  }
  // Shows us the first item in the list
  first() {
    return this._first && this._first.value;
  }
  // Shows us the last item in the list
  last() {
    return this._last && this._last.value;
  }
  push(value) {
    const item = typeof value.next !== "undefined" ? value : {
      value,
      next: null,
      prev: null
    };
    if (this._last) {
      item.prev = this._last;
      this._last.next = item;
      this._last = item;
    } else {
      this._last = item;
      this._first = item;
    }
    return item;
  }
  // Removes the item that was returned from the push
  remove(item) {
    if (item.prev)
      item.prev.next = item.next;
    if (item.next)
      item.next.prev = item.prev;
    if (item === this._last)
      this._last = item.prev;
    if (item === this._first)
      this._first = item.next;
    item.prev = null;
    item.next = null;
  }
  shift() {
    const remove = this._first;
    if (!remove)
      return null;
    this._first = remove.next;
    if (this._first)
      this._first.prev = null;
    this._last = this._first ? this._last : null;
    return remove.value;
  }
};
var Animator = {
  nextDraw: null,
  frames: new Queue(),
  timeouts: new Queue(),
  immediates: new Queue(),
  timer: () => globals.window.performance || globals.window.Date,
  transforms: [],
  frame(fn) {
    const node3 = Animator.frames.push({
      run: fn
    });
    if (Animator.nextDraw === null) {
      Animator.nextDraw = globals.window.requestAnimationFrame(Animator._draw);
    }
    return node3;
  },
  timeout(fn, delay) {
    delay = delay || 0;
    const time = Animator.timer().now() + delay;
    const node3 = Animator.timeouts.push({
      run: fn,
      time
    });
    if (Animator.nextDraw === null) {
      Animator.nextDraw = globals.window.requestAnimationFrame(Animator._draw);
    }
    return node3;
  },
  immediate(fn) {
    const node3 = Animator.immediates.push(fn);
    if (Animator.nextDraw === null) {
      Animator.nextDraw = globals.window.requestAnimationFrame(Animator._draw);
    }
    return node3;
  },
  cancelFrame(node3) {
    node3 != null && Animator.frames.remove(node3);
  },
  clearTimeout(node3) {
    node3 != null && Animator.timeouts.remove(node3);
  },
  cancelImmediate(node3) {
    node3 != null && Animator.immediates.remove(node3);
  },
  _draw(now) {
    let nextTimeout = null;
    const lastTimeout = Animator.timeouts.last();
    while (nextTimeout = Animator.timeouts.shift()) {
      if (now >= nextTimeout.time) {
        nextTimeout.run();
      } else {
        Animator.timeouts.push(nextTimeout);
      }
      if (nextTimeout === lastTimeout)
        break;
    }
    let nextFrame = null;
    const lastFrame = Animator.frames.last();
    while (nextFrame !== lastFrame && (nextFrame = Animator.frames.shift())) {
      nextFrame.run(now);
    }
    let nextImmediate = null;
    while (nextImmediate = Animator.immediates.shift()) {
      nextImmediate();
    }
    Animator.nextDraw = Animator.timeouts.first() || Animator.frames.first() ? globals.window.requestAnimationFrame(Animator._draw) : null;
  }
};
var makeSchedule = function(runnerInfo) {
  const start = runnerInfo.start;
  const duration = runnerInfo.runner.duration();
  const end = start + duration;
  return {
    start,
    duration,
    end,
    runner: runnerInfo.runner
  };
};
var defaultSource = function() {
  const w2 = globals.window;
  return (w2.performance || w2.Date).now();
};
var Timeline = class extends EventTarget {
  // Construct a new timeline on the given element
  constructor(timeSource = defaultSource) {
    super();
    this._timeSource = timeSource;
    this._startTime = 0;
    this._speed = 1;
    this._persist = 0;
    this._nextFrame = null;
    this._paused = true;
    this._runners = [];
    this._runnerIds = [];
    this._lastRunnerId = -1;
    this._time = 0;
    this._lastSourceTime = 0;
    this._lastStepTime = 0;
    this._step = this._stepFn.bind(this, false);
    this._stepImmediate = this._stepFn.bind(this, true);
  }
  active() {
    return !!this._nextFrame;
  }
  finish() {
    this.time(this.getEndTimeOfTimeline() + 1);
    return this.pause();
  }
  // Calculates the end of the timeline
  getEndTime() {
    const lastRunnerInfo = this.getLastRunnerInfo();
    const lastDuration = lastRunnerInfo ? lastRunnerInfo.runner.duration() : 0;
    const lastStartTime = lastRunnerInfo ? lastRunnerInfo.start : this._time;
    return lastStartTime + lastDuration;
  }
  getEndTimeOfTimeline() {
    const endTimes = this._runners.map((i3) => i3.start + i3.runner.duration());
    return Math.max(0, ...endTimes);
  }
  getLastRunnerInfo() {
    return this.getRunnerInfoById(this._lastRunnerId);
  }
  getRunnerInfoById(id) {
    return this._runners[this._runnerIds.indexOf(id)] || null;
  }
  pause() {
    this._paused = true;
    return this._continue();
  }
  persist(dtOrForever) {
    if (dtOrForever == null)
      return this._persist;
    this._persist = dtOrForever;
    return this;
  }
  play() {
    this._paused = false;
    return this.updateTime()._continue();
  }
  reverse(yes) {
    const currentSpeed = this.speed();
    if (yes == null)
      return this.speed(-currentSpeed);
    const positive = Math.abs(currentSpeed);
    return this.speed(yes ? -positive : positive);
  }
  // schedules a runner on the timeline
  schedule(runner, delay, when) {
    if (runner == null) {
      return this._runners.map(makeSchedule);
    }
    let absoluteStartTime = 0;
    const endTime = this.getEndTime();
    delay = delay || 0;
    if (when == null || when === "last" || when === "after") {
      absoluteStartTime = endTime;
    } else if (when === "absolute" || when === "start") {
      absoluteStartTime = delay;
      delay = 0;
    } else if (when === "now") {
      absoluteStartTime = this._time;
    } else if (when === "relative") {
      const runnerInfo2 = this.getRunnerInfoById(runner.id);
      if (runnerInfo2) {
        absoluteStartTime = runnerInfo2.start + delay;
        delay = 0;
      }
    } else if (when === "with-last") {
      const lastRunnerInfo = this.getLastRunnerInfo();
      const lastStartTime = lastRunnerInfo ? lastRunnerInfo.start : this._time;
      absoluteStartTime = lastStartTime;
    } else {
      throw new Error('Invalid value for the "when" parameter');
    }
    runner.unschedule();
    runner.timeline(this);
    const persist = runner.persist();
    const runnerInfo = {
      persist: persist === null ? this._persist : persist,
      start: absoluteStartTime + delay,
      runner
    };
    this._lastRunnerId = runner.id;
    this._runners.push(runnerInfo);
    this._runners.sort((a3, b2) => a3.start - b2.start);
    this._runnerIds = this._runners.map((info) => info.runner.id);
    this.updateTime()._continue();
    return this;
  }
  seek(dt2) {
    return this.time(this._time + dt2);
  }
  source(fn) {
    if (fn == null)
      return this._timeSource;
    this._timeSource = fn;
    return this;
  }
  speed(speed) {
    if (speed == null)
      return this._speed;
    this._speed = speed;
    return this;
  }
  stop() {
    this.time(0);
    return this.pause();
  }
  time(time) {
    if (time == null)
      return this._time;
    this._time = time;
    return this._continue(true);
  }
  // Remove the runner from this timeline
  unschedule(runner) {
    const index3 = this._runnerIds.indexOf(runner.id);
    if (index3 < 0)
      return this;
    this._runners.splice(index3, 1);
    this._runnerIds.splice(index3, 1);
    runner.timeline(null);
    return this;
  }
  // Makes sure, that after pausing the time doesn't jump
  updateTime() {
    if (!this.active()) {
      this._lastSourceTime = this._timeSource();
    }
    return this;
  }
  // Checks if we are running and continues the animation
  _continue(immediateStep = false) {
    Animator.cancelFrame(this._nextFrame);
    this._nextFrame = null;
    if (immediateStep)
      return this._stepImmediate();
    if (this._paused)
      return this;
    this._nextFrame = Animator.frame(this._step);
    return this;
  }
  _stepFn(immediateStep = false) {
    const time = this._timeSource();
    let dtSource = time - this._lastSourceTime;
    if (immediateStep)
      dtSource = 0;
    const dtTime = this._speed * dtSource + (this._time - this._lastStepTime);
    this._lastSourceTime = time;
    if (!immediateStep) {
      this._time += dtTime;
      this._time = this._time < 0 ? 0 : this._time;
    }
    this._lastStepTime = this._time;
    this.fire("time", this._time);
    for (let k2 = this._runners.length; k2--; ) {
      const runnerInfo = this._runners[k2];
      const runner = runnerInfo.runner;
      const dtToStart = this._time - runnerInfo.start;
      if (dtToStart <= 0) {
        runner.reset();
      }
    }
    let runnersLeft = false;
    for (let i3 = 0, len = this._runners.length; i3 < len; i3++) {
      const runnerInfo = this._runners[i3];
      const runner = runnerInfo.runner;
      let dt2 = dtTime;
      const dtToStart = this._time - runnerInfo.start;
      if (dtToStart <= 0) {
        runnersLeft = true;
        continue;
      } else if (dtToStart < dt2) {
        dt2 = dtToStart;
      }
      if (!runner.active())
        continue;
      const finished = runner.step(dt2).done;
      if (!finished) {
        runnersLeft = true;
      } else if (runnerInfo.persist !== true) {
        const endTime = runner.duration() - runner.time() + this._time;
        if (endTime + runnerInfo.persist < this._time) {
          runner.unschedule();
          --i3;
          --len;
        }
      }
    }
    if (runnersLeft && !(this._speed < 0 && this._time === 0) || this._runnerIds.length && this._speed < 0 && this._time > 0) {
      this._continue();
    } else {
      this.pause();
      this.fire("finished");
    }
    return this;
  }
};
registerMethods({
  Element: {
    timeline: function(timeline2) {
      if (timeline2 == null) {
        this._timeline = this._timeline || new Timeline();
        return this._timeline;
      } else {
        this._timeline = timeline2;
        return this;
      }
    }
  }
});
var Runner = class extends EventTarget {
  constructor(options) {
    super();
    this.id = Runner.id++;
    options = options == null ? timeline.duration : options;
    options = typeof options === "function" ? new Controller(options) : options;
    this._element = null;
    this._timeline = null;
    this.done = false;
    this._queue = [];
    this._duration = typeof options === "number" && options;
    this._isDeclarative = options instanceof Controller;
    this._stepper = this._isDeclarative ? options : new Ease();
    this._history = {};
    this.enabled = true;
    this._time = 0;
    this._lastTime = 0;
    this._reseted = true;
    this.transforms = new Matrix();
    this.transformId = 1;
    this._haveReversed = false;
    this._reverse = false;
    this._loopsDone = 0;
    this._swing = false;
    this._wait = 0;
    this._times = 1;
    this._frameId = null;
    this._persist = this._isDeclarative ? true : null;
  }
  static sanitise(duration, delay, when) {
    let times = 1;
    let swing = false;
    let wait = 0;
    duration = duration || timeline.duration;
    delay = delay || timeline.delay;
    when = when || "last";
    if (typeof duration === "object" && !(duration instanceof Stepper)) {
      delay = duration.delay || delay;
      when = duration.when || when;
      swing = duration.swing || swing;
      times = duration.times || times;
      wait = duration.wait || wait;
      duration = duration.duration || timeline.duration;
    }
    return {
      duration,
      delay,
      swing,
      times,
      wait,
      when
    };
  }
  active(enabled) {
    if (enabled == null)
      return this.enabled;
    this.enabled = enabled;
    return this;
  }
  /*
  Private Methods
  ===============
  Methods that shouldn't be used externally
  */
  addTransform(transform2, index3) {
    this.transforms.lmultiplyO(transform2);
    return this;
  }
  after(fn) {
    return this.on("finished", fn);
  }
  animate(duration, delay, when) {
    const o3 = Runner.sanitise(duration, delay, when);
    const runner = new Runner(o3.duration);
    if (this._timeline)
      runner.timeline(this._timeline);
    if (this._element)
      runner.element(this._element);
    return runner.loop(o3).schedule(o3.delay, o3.when);
  }
  clearTransform() {
    this.transforms = new Matrix();
    return this;
  }
  // TODO: Keep track of all transformations so that deletion is faster
  clearTransformsFromQueue() {
    if (!this.done || !this._timeline || !this._timeline._runnerIds.includes(this.id)) {
      this._queue = this._queue.filter((item) => {
        return !item.isTransform;
      });
    }
  }
  delay(delay) {
    return this.animate(0, delay);
  }
  duration() {
    return this._times * (this._wait + this._duration) - this._wait;
  }
  during(fn) {
    return this.queue(null, fn);
  }
  ease(fn) {
    this._stepper = new Ease(fn);
    return this;
  }
  /*
  Runner Definitions
  ==================
  These methods help us define the runtime behaviour of the Runner or they
  help us make new runners from the current runner
  */
  element(element2) {
    if (element2 == null)
      return this._element;
    this._element = element2;
    element2._prepareRunner();
    return this;
  }
  finish() {
    return this.step(Infinity);
  }
  loop(times, swing, wait) {
    if (typeof times === "object") {
      swing = times.swing;
      wait = times.wait;
      times = times.times;
    }
    this._times = times || Infinity;
    this._swing = swing || false;
    this._wait = wait || 0;
    if (this._times === true) {
      this._times = Infinity;
    }
    return this;
  }
  loops(p3) {
    const loopDuration = this._duration + this._wait;
    if (p3 == null) {
      const loopsDone = Math.floor(this._time / loopDuration);
      const relativeTime = this._time - loopsDone * loopDuration;
      const position3 = relativeTime / this._duration;
      return Math.min(loopsDone + position3, this._times);
    }
    const whole = Math.floor(p3);
    const partial = p3 % 1;
    const time = loopDuration * whole + this._duration * partial;
    return this.time(time);
  }
  persist(dtOrForever) {
    if (dtOrForever == null)
      return this._persist;
    this._persist = dtOrForever;
    return this;
  }
  position(p3) {
    const x3 = this._time;
    const d2 = this._duration;
    const w2 = this._wait;
    const t3 = this._times;
    const s3 = this._swing;
    const r2 = this._reverse;
    let position3;
    if (p3 == null) {
      const f3 = function(x4) {
        const swinging = s3 * Math.floor(x4 % (2 * (w2 + d2)) / (w2 + d2));
        const backwards = swinging && !r2 || !swinging && r2;
        const uncliped = Math.pow(-1, backwards) * (x4 % (w2 + d2)) / d2 + backwards;
        const clipped = Math.max(Math.min(uncliped, 1), 0);
        return clipped;
      };
      const endTime = t3 * (w2 + d2) - w2;
      position3 = x3 <= 0 ? Math.round(f3(1e-5)) : x3 < endTime ? f3(x3) : Math.round(f3(endTime - 1e-5));
      return position3;
    }
    const loopsDone = Math.floor(this.loops());
    const swingForward = s3 && loopsDone % 2 === 0;
    const forwards = swingForward && !r2 || r2 && swingForward;
    position3 = loopsDone + (forwards ? p3 : 1 - p3);
    return this.loops(position3);
  }
  progress(p3) {
    if (p3 == null) {
      return Math.min(1, this._time / this.duration());
    }
    return this.time(p3 * this.duration());
  }
  /*
  Basic Functionality
  ===================
  These methods allow us to attach basic functions to the runner directly
  */
  queue(initFn, runFn, retargetFn, isTransform) {
    this._queue.push({
      initialiser: initFn || noop,
      runner: runFn || noop,
      retarget: retargetFn,
      isTransform,
      initialised: false,
      finished: false
    });
    const timeline2 = this.timeline();
    timeline2 && this.timeline()._continue();
    return this;
  }
  reset() {
    if (this._reseted)
      return this;
    this.time(0);
    this._reseted = true;
    return this;
  }
  reverse(reverse2) {
    this._reverse = reverse2 == null ? !this._reverse : reverse2;
    return this;
  }
  schedule(timeline2, delay, when) {
    if (!(timeline2 instanceof Timeline)) {
      when = delay;
      delay = timeline2;
      timeline2 = this.timeline();
    }
    if (!timeline2) {
      throw Error("Runner cannot be scheduled without timeline");
    }
    timeline2.schedule(this, delay, when);
    return this;
  }
  step(dt2) {
    if (!this.enabled)
      return this;
    dt2 = dt2 == null ? 16 : dt2;
    this._time += dt2;
    const position3 = this.position();
    const running = this._lastPosition !== position3 && this._time >= 0;
    this._lastPosition = position3;
    const duration = this.duration();
    const justStarted = this._lastTime <= 0 && this._time > 0;
    const justFinished = this._lastTime < duration && this._time >= duration;
    this._lastTime = this._time;
    if (justStarted) {
      this.fire("start", this);
    }
    const declarative = this._isDeclarative;
    this.done = !declarative && !justFinished && this._time >= duration;
    this._reseted = false;
    let converged = false;
    if (running || declarative) {
      this._initialise(running);
      this.transforms = new Matrix();
      converged = this._run(declarative ? dt2 : position3);
      this.fire("step", this);
    }
    this.done = this.done || converged && declarative;
    if (justFinished) {
      this.fire("finished", this);
    }
    return this;
  }
  /*
  Runner animation methods
  ========================
  Control how the animation plays
  */
  time(time) {
    if (time == null) {
      return this._time;
    }
    const dt2 = time - this._time;
    this.step(dt2);
    return this;
  }
  timeline(timeline2) {
    if (typeof timeline2 === "undefined")
      return this._timeline;
    this._timeline = timeline2;
    return this;
  }
  unschedule() {
    const timeline2 = this.timeline();
    timeline2 && timeline2.unschedule(this);
    return this;
  }
  // Run each initialise function in the runner if required
  _initialise(running) {
    if (!running && !this._isDeclarative)
      return;
    for (let i3 = 0, len = this._queue.length; i3 < len; ++i3) {
      const current = this._queue[i3];
      const needsIt = this._isDeclarative || !current.initialised && running;
      running = !current.finished;
      if (needsIt && running) {
        current.initialiser.call(this);
        current.initialised = true;
      }
    }
  }
  // Save a morpher to the morpher list so that we can retarget it later
  _rememberMorpher(method, morpher) {
    this._history[method] = {
      morpher,
      caller: this._queue[this._queue.length - 1]
    };
    if (this._isDeclarative) {
      const timeline2 = this.timeline();
      timeline2 && timeline2.play();
    }
  }
  // Try to set the target for a morpher if the morpher exists, otherwise
  // Run each run function for the position or dt given
  _run(positionOrDt) {
    let allfinished = true;
    for (let i3 = 0, len = this._queue.length; i3 < len; ++i3) {
      const current = this._queue[i3];
      const converged = current.runner.call(this, positionOrDt);
      current.finished = current.finished || converged === true;
      allfinished = allfinished && current.finished;
    }
    return allfinished;
  }
  // do nothing and return false
  _tryRetarget(method, target, extra) {
    if (this._history[method]) {
      if (!this._history[method].caller.initialised) {
        const index3 = this._queue.indexOf(this._history[method].caller);
        this._queue.splice(index3, 1);
        return false;
      }
      if (this._history[method].caller.retarget) {
        this._history[method].caller.retarget.call(this, target, extra);
      } else {
        this._history[method].morpher.to(target);
      }
      this._history[method].caller.finished = false;
      const timeline2 = this.timeline();
      timeline2 && timeline2.play();
      return true;
    }
    return false;
  }
};
Runner.id = 0;
var FakeRunner = class {
  constructor(transforms2 = new Matrix(), id = -1, done = true) {
    this.transforms = transforms2;
    this.id = id;
    this.done = done;
  }
  clearTransformsFromQueue() {
  }
};
extend([Runner, FakeRunner], {
  mergeWith(runner) {
    return new FakeRunner(runner.transforms.lmultiply(this.transforms), runner.id);
  }
});
var lmultiply = (last, curr) => last.lmultiplyO(curr);
var getRunnerTransform = (runner) => runner.transforms;
function mergeTransforms() {
  const runners = this._transformationRunners.runners;
  const netTransform = runners.map(getRunnerTransform).reduce(lmultiply, new Matrix());
  this.transform(netTransform);
  this._transformationRunners.merge();
  if (this._transformationRunners.length() === 1) {
    this._frameId = null;
  }
}
var RunnerArray = class {
  constructor() {
    this.runners = [];
    this.ids = [];
  }
  add(runner) {
    if (this.runners.includes(runner))
      return;
    const id = runner.id + 1;
    this.runners.push(runner);
    this.ids.push(id);
    return this;
  }
  clearBefore(id) {
    const deleteCnt = this.ids.indexOf(id + 1) || 1;
    this.ids.splice(0, deleteCnt, 0);
    this.runners.splice(0, deleteCnt, new FakeRunner()).forEach((r2) => r2.clearTransformsFromQueue());
    return this;
  }
  edit(id, newRunner) {
    const index3 = this.ids.indexOf(id + 1);
    this.ids.splice(index3, 1, id + 1);
    this.runners.splice(index3, 1, newRunner);
    return this;
  }
  getByID(id) {
    return this.runners[this.ids.indexOf(id + 1)];
  }
  length() {
    return this.ids.length;
  }
  merge() {
    let lastRunner = null;
    for (let i3 = 0; i3 < this.runners.length; ++i3) {
      const runner = this.runners[i3];
      const condition = lastRunner && runner.done && lastRunner.done && (!runner._timeline || !runner._timeline._runnerIds.includes(runner.id)) && (!lastRunner._timeline || !lastRunner._timeline._runnerIds.includes(lastRunner.id));
      if (condition) {
        this.remove(runner.id);
        const newRunner = runner.mergeWith(lastRunner);
        this.edit(lastRunner.id, newRunner);
        lastRunner = newRunner;
        --i3;
      } else {
        lastRunner = runner;
      }
    }
    return this;
  }
  remove(id) {
    const index3 = this.ids.indexOf(id + 1);
    this.ids.splice(index3, 1);
    this.runners.splice(index3, 1);
    return this;
  }
};
registerMethods({
  Element: {
    animate(duration, delay, when) {
      const o3 = Runner.sanitise(duration, delay, when);
      const timeline2 = this.timeline();
      return new Runner(o3.duration).loop(o3).element(this).timeline(timeline2.play()).schedule(o3.delay, o3.when);
    },
    delay(by, when) {
      return this.animate(0, by, when);
    },
    // this function searches for all runners on the element and deletes the ones
    // which run before the current one. This is because absolute transformations
    // overwfrite anything anyway so there is no need to waste time computing
    // other runners
    _clearTransformRunnersBefore(currentRunner) {
      this._transformationRunners.clearBefore(currentRunner.id);
    },
    _currentTransform(current) {
      return this._transformationRunners.runners.filter((runner) => runner.id <= current.id).map(getRunnerTransform).reduce(lmultiply, new Matrix());
    },
    _addRunner(runner) {
      this._transformationRunners.add(runner);
      Animator.cancelImmediate(this._frameId);
      this._frameId = Animator.immediate(mergeTransforms.bind(this));
    },
    _prepareRunner() {
      if (this._frameId == null) {
        this._transformationRunners = new RunnerArray().add(new FakeRunner(new Matrix(this)));
      }
    }
  }
});
var difference = (a3, b2) => a3.filter((x3) => !b2.includes(x3));
extend(Runner, {
  attr(a3, v3) {
    return this.styleAttr("attr", a3, v3);
  },
  // Add animatable styles
  css(s3, v3) {
    return this.styleAttr("css", s3, v3);
  },
  styleAttr(type, nameOrAttrs, val) {
    if (typeof nameOrAttrs === "string") {
      return this.styleAttr(type, {
        [nameOrAttrs]: val
      });
    }
    let attrs2 = nameOrAttrs;
    if (this._tryRetarget(type, attrs2))
      return this;
    let morpher = new Morphable(this._stepper).to(attrs2);
    let keys = Object.keys(attrs2);
    this.queue(function() {
      morpher = morpher.from(this.element()[type](keys));
    }, function(pos) {
      this.element()[type](morpher.at(pos).valueOf());
      return morpher.done();
    }, function(newToAttrs) {
      const newKeys = Object.keys(newToAttrs);
      const differences = difference(newKeys, keys);
      if (differences.length) {
        const addedFromAttrs = this.element()[type](differences);
        const oldFromAttrs = new ObjectBag(morpher.from()).valueOf();
        Object.assign(oldFromAttrs, addedFromAttrs);
        morpher.from(oldFromAttrs);
      }
      const oldToAttrs = new ObjectBag(morpher.to()).valueOf();
      Object.assign(oldToAttrs, newToAttrs);
      morpher.to(oldToAttrs);
      keys = newKeys;
      attrs2 = newToAttrs;
    });
    this._rememberMorpher(type, morpher);
    return this;
  },
  zoom(level, point4) {
    if (this._tryRetarget("zoom", level, point4))
      return this;
    let morpher = new Morphable(this._stepper).to(new SVGNumber(level));
    this.queue(function() {
      morpher = morpher.from(this.element().zoom());
    }, function(pos) {
      this.element().zoom(morpher.at(pos), point4);
      return morpher.done();
    }, function(newLevel, newPoint) {
      point4 = newPoint;
      morpher.to(newLevel);
    });
    this._rememberMorpher("zoom", morpher);
    return this;
  },
  /**
   ** absolute transformations
   **/
  //
  // M v -----|-----(D M v = F v)------|----->  T v
  //
  // 1. define the final state (T) and decompose it (once)
  //    t = [tx, ty, the, lam, sy, sx]
  // 2. on every frame: pull the current state of all previous transforms
  //    (M - m can change)
  //   and then write this as m = [tx0, ty0, the0, lam0, sy0, sx0]
  // 3. Find the interpolated matrix F(pos) = m + pos * (t - m)
  //   - Note F(0) = M
  //   - Note F(1) = T
  // 4. Now you get the delta matrix as a result: D = F * inv(M)
  transform(transforms2, relative, affine) {
    relative = transforms2.relative || relative;
    if (this._isDeclarative && !relative && this._tryRetarget("transform", transforms2)) {
      return this;
    }
    const isMatrix = Matrix.isMatrixLike(transforms2);
    affine = transforms2.affine != null ? transforms2.affine : affine != null ? affine : !isMatrix;
    const morpher = new Morphable(this._stepper).type(affine ? TransformBag : Matrix);
    let origin;
    let element2;
    let current;
    let currentAngle;
    let startTransform;
    function setup() {
      element2 = element2 || this.element();
      origin = origin || getOrigin(transforms2, element2);
      startTransform = new Matrix(relative ? void 0 : element2);
      element2._addRunner(this);
      if (!relative) {
        element2._clearTransformRunnersBefore(this);
      }
    }
    function run(pos) {
      if (!relative)
        this.clearTransform();
      const {
        x: x3,
        y: y4
      } = new Point(origin).transform(element2._currentTransform(this));
      let target = new Matrix({
        ...transforms2,
        origin: [x3, y4]
      });
      let start = this._isDeclarative && current ? current : startTransform;
      if (affine) {
        target = target.decompose(x3, y4);
        start = start.decompose(x3, y4);
        const rTarget = target.rotate;
        const rCurrent = start.rotate;
        const possibilities = [rTarget - 360, rTarget, rTarget + 360];
        const distances = possibilities.map((a3) => Math.abs(a3 - rCurrent));
        const shortest = Math.min(...distances);
        const index3 = distances.indexOf(shortest);
        target.rotate = possibilities[index3];
      }
      if (relative) {
        if (!isMatrix) {
          target.rotate = transforms2.rotate || 0;
        }
        if (this._isDeclarative && currentAngle) {
          start.rotate = currentAngle;
        }
      }
      morpher.from(start);
      morpher.to(target);
      const affineParameters = morpher.at(pos);
      currentAngle = affineParameters.rotate;
      current = new Matrix(affineParameters);
      this.addTransform(current);
      element2._addRunner(this);
      return morpher.done();
    }
    function retarget(newTransforms) {
      if ((newTransforms.origin || "center").toString() !== (transforms2.origin || "center").toString()) {
        origin = getOrigin(newTransforms, element2);
      }
      transforms2 = {
        ...newTransforms,
        origin
      };
    }
    this.queue(setup, run, retarget, true);
    this._isDeclarative && this._rememberMorpher("transform", morpher);
    return this;
  },
  // Animatable x-axis
  x(x3, relative) {
    return this._queueNumber("x", x3);
  },
  // Animatable y-axis
  y(y4) {
    return this._queueNumber("y", y4);
  },
  dx(x3 = 0) {
    return this._queueNumberDelta("x", x3);
  },
  dy(y4 = 0) {
    return this._queueNumberDelta("y", y4);
  },
  dmove(x3, y4) {
    return this.dx(x3).dy(y4);
  },
  _queueNumberDelta(method, to2) {
    to2 = new SVGNumber(to2);
    if (this._tryRetarget(method, to2))
      return this;
    const morpher = new Morphable(this._stepper).to(to2);
    let from2 = null;
    this.queue(function() {
      from2 = this.element()[method]();
      morpher.from(from2);
      morpher.to(from2 + to2);
    }, function(pos) {
      this.element()[method](morpher.at(pos));
      return morpher.done();
    }, function(newTo) {
      morpher.to(from2 + new SVGNumber(newTo));
    });
    this._rememberMorpher(method, morpher);
    return this;
  },
  _queueObject(method, to2) {
    if (this._tryRetarget(method, to2))
      return this;
    const morpher = new Morphable(this._stepper).to(to2);
    this.queue(function() {
      morpher.from(this.element()[method]());
    }, function(pos) {
      this.element()[method](morpher.at(pos));
      return morpher.done();
    });
    this._rememberMorpher(method, morpher);
    return this;
  },
  _queueNumber(method, value) {
    return this._queueObject(method, new SVGNumber(value));
  },
  // Animatable center x-axis
  cx(x3) {
    return this._queueNumber("cx", x3);
  },
  // Animatable center y-axis
  cy(y4) {
    return this._queueNumber("cy", y4);
  },
  // Add animatable move
  move(x3, y4) {
    return this.x(x3).y(y4);
  },
  // Add animatable center
  center(x3, y4) {
    return this.cx(x3).cy(y4);
  },
  // Add animatable size
  size(width2, height2) {
    let box;
    if (!width2 || !height2) {
      box = this._element.bbox();
    }
    if (!width2) {
      width2 = box.width / box.height * height2;
    }
    if (!height2) {
      height2 = box.height / box.width * width2;
    }
    return this.width(width2).height(height2);
  },
  // Add animatable width
  width(width2) {
    return this._queueNumber("width", width2);
  },
  // Add animatable height
  height(height2) {
    return this._queueNumber("height", height2);
  },
  // Add animatable plot
  plot(a3, b2, c4, d2) {
    if (arguments.length === 4) {
      return this.plot([a3, b2, c4, d2]);
    }
    if (this._tryRetarget("plot", a3))
      return this;
    const morpher = new Morphable(this._stepper).type(this._element.MorphArray).to(a3);
    this.queue(function() {
      morpher.from(this._element.array());
    }, function(pos) {
      this._element.plot(morpher.at(pos));
      return morpher.done();
    });
    this._rememberMorpher("plot", morpher);
    return this;
  },
  // Add leading method
  leading(value) {
    return this._queueNumber("leading", value);
  },
  // Add animatable viewbox
  viewbox(x3, y4, width2, height2) {
    return this._queueObject("viewbox", new Box(x3, y4, width2, height2));
  },
  update(o3) {
    if (typeof o3 !== "object") {
      return this.update({
        offset: arguments[0],
        color: arguments[1],
        opacity: arguments[2]
      });
    }
    if (o3.opacity != null)
      this.attr("stop-opacity", o3.opacity);
    if (o3.color != null)
      this.attr("stop-color", o3.color);
    if (o3.offset != null)
      this.attr("offset", o3.offset);
    return this;
  }
});
extend(Runner, {
  rx,
  ry,
  from,
  to
});
register(Runner, "Runner");
var Svg = class extends Container {
  constructor(node3, attrs2 = node3) {
    super(nodeOrNew("svg", node3), attrs2);
    this.namespace();
  }
  // Creates and returns defs element
  defs() {
    if (!this.isRoot())
      return this.root().defs();
    return adopt(this.node.querySelector("defs")) || this.put(new Defs());
  }
  isRoot() {
    return !this.node.parentNode || !(this.node.parentNode instanceof globals.window.SVGElement) && this.node.parentNode.nodeName !== "#document-fragment";
  }
  // Add namespaces
  namespace() {
    if (!this.isRoot())
      return this.root().namespace();
    return this.attr({
      xmlns: svg,
      version: "1.1"
    }).attr("xmlns:xlink", xlink, xmlns).attr("xmlns:svgjs", svgjs, xmlns);
  }
  removeNamespace() {
    return this.attr({
      xmlns: null,
      version: null
    }).attr("xmlns:xlink", null, xmlns).attr("xmlns:svgjs", null, xmlns);
  }
  // Check if this is a root svg
  // If not, call root() from this element
  root() {
    if (this.isRoot())
      return this;
    return super.root();
  }
};
registerMethods({
  Container: {
    // Create nested svg document
    nested: wrapWithAttrCheck(function() {
      return this.put(new Svg());
    })
  }
});
register(Svg, "Svg", true);
var Symbol2 = class extends Container {
  // Initialize node
  constructor(node3, attrs2 = node3) {
    super(nodeOrNew("symbol", node3), attrs2);
  }
};
registerMethods({
  Container: {
    symbol: wrapWithAttrCheck(function() {
      return this.put(new Symbol2());
    })
  }
});
register(Symbol2, "Symbol");
function plain(text3) {
  if (this._build === false) {
    this.clear();
  }
  this.node.appendChild(globals.document.createTextNode(text3));
  return this;
}
function length() {
  return this.node.getComputedTextLength();
}
function x$1(x3, box = this.bbox()) {
  if (x3 == null) {
    return box.x;
  }
  return this.attr("x", this.attr("x") + x3 - box.x);
}
function y$1(y4, box = this.bbox()) {
  if (y4 == null) {
    return box.y;
  }
  return this.attr("y", this.attr("y") + y4 - box.y);
}
function move$1(x3, y4, box = this.bbox()) {
  return this.x(x3, box).y(y4, box);
}
function cx(x3, box = this.bbox()) {
  if (x3 == null) {
    return box.cx;
  }
  return this.attr("x", this.attr("x") + x3 - box.cx);
}
function cy(y4, box = this.bbox()) {
  if (y4 == null) {
    return box.cy;
  }
  return this.attr("y", this.attr("y") + y4 - box.cy);
}
function center(x3, y4, box = this.bbox()) {
  return this.cx(x3, box).cy(y4, box);
}
function ax(x3) {
  return this.attr("x", x3);
}
function ay(y4) {
  return this.attr("y", y4);
}
function amove(x3, y4) {
  return this.ax(x3).ay(y4);
}
function build(build2) {
  this._build = !!build2;
  return this;
}
var textable = {
  __proto__: null,
  plain,
  length,
  x: x$1,
  y: y$1,
  move: move$1,
  cx,
  cy,
  center,
  ax,
  ay,
  amove,
  build
};
var Text2 = class extends Shape {
  // Initialize node
  constructor(node3, attrs2 = node3) {
    super(nodeOrNew("text", node3), attrs2);
    this.dom.leading = new SVGNumber(1.3);
    this._rebuild = true;
    this._build = false;
  }
  // Set / get leading
  leading(value) {
    if (value == null) {
      return this.dom.leading;
    }
    this.dom.leading = new SVGNumber(value);
    return this.rebuild();
  }
  // Rebuild appearance type
  rebuild(rebuild) {
    if (typeof rebuild === "boolean") {
      this._rebuild = rebuild;
    }
    if (this._rebuild) {
      const self2 = this;
      let blankLineOffset = 0;
      const leading = this.dom.leading;
      this.each(function(i3) {
        const fontSize = globals.window.getComputedStyle(this.node).getPropertyValue("font-size");
        const dy2 = leading * new SVGNumber(fontSize);
        if (this.dom.newLined) {
          this.attr("x", self2.attr("x"));
          if (this.text() === "\n") {
            blankLineOffset += dy2;
          } else {
            this.attr("dy", i3 ? dy2 + blankLineOffset : 0);
            blankLineOffset = 0;
          }
        }
      });
      this.fire("rebuild");
    }
    return this;
  }
  // overwrite method from parent to set data properly
  setData(o3) {
    this.dom = o3;
    this.dom.leading = new SVGNumber(o3.leading || 1.3);
    return this;
  }
  // Set the text content
  text(text3) {
    if (text3 === void 0) {
      const children = this.node.childNodes;
      let firstLine = 0;
      text3 = "";
      for (let i3 = 0, len = children.length; i3 < len; ++i3) {
        if (children[i3].nodeName === "textPath") {
          if (i3 === 0)
            firstLine = 1;
          continue;
        }
        if (i3 !== firstLine && children[i3].nodeType !== 3 && adopt(children[i3]).dom.newLined === true) {
          text3 += "\n";
        }
        text3 += children[i3].textContent;
      }
      return text3;
    }
    this.clear().build(true);
    if (typeof text3 === "function") {
      text3.call(this, this);
    } else {
      text3 = (text3 + "").split("\n");
      for (let j2 = 0, jl = text3.length; j2 < jl; j2++) {
        this.newLine(text3[j2]);
      }
    }
    return this.build(false).rebuild();
  }
};
extend(Text2, textable);
registerMethods({
  Container: {
    // Create text element
    text: wrapWithAttrCheck(function(text3 = "") {
      return this.put(new Text2()).text(text3);
    }),
    // Create plain text element
    plain: wrapWithAttrCheck(function(text3 = "") {
      return this.put(new Text2()).plain(text3);
    })
  }
});
register(Text2, "Text");
var Tspan = class extends Shape {
  // Initialize node
  constructor(node3, attrs2 = node3) {
    super(nodeOrNew("tspan", node3), attrs2);
    this._build = false;
  }
  // Shortcut dx
  dx(dx2) {
    return this.attr("dx", dx2);
  }
  // Shortcut dy
  dy(dy2) {
    return this.attr("dy", dy2);
  }
  // Create new line
  newLine() {
    this.dom.newLined = true;
    const text3 = this.parent();
    if (!(text3 instanceof Text2)) {
      return this;
    }
    const i3 = text3.index(this);
    const fontSize = globals.window.getComputedStyle(this.node).getPropertyValue("font-size");
    const dy2 = text3.dom.leading * new SVGNumber(fontSize);
    return this.dy(i3 ? dy2 : 0).attr("x", text3.x());
  }
  // Set text content
  text(text3) {
    if (text3 == null)
      return this.node.textContent + (this.dom.newLined ? "\n" : "");
    if (typeof text3 === "function") {
      this.clear().build(true);
      text3.call(this, this);
      this.build(false);
    } else {
      this.plain(text3);
    }
    return this;
  }
};
extend(Tspan, textable);
registerMethods({
  Tspan: {
    tspan: wrapWithAttrCheck(function(text3 = "") {
      const tspan = new Tspan();
      if (!this._build) {
        this.clear();
      }
      return this.put(tspan).text(text3);
    })
  },
  Text: {
    newLine: function(text3 = "") {
      return this.tspan(text3).newLine();
    }
  }
});
register(Tspan, "Tspan");
var Circle = class extends Shape {
  constructor(node3, attrs2 = node3) {
    super(nodeOrNew("circle", node3), attrs2);
  }
  radius(r2) {
    return this.attr("r", r2);
  }
  // Radius x value
  rx(rx2) {
    return this.attr("r", rx2);
  }
  // Alias radius x value
  ry(ry2) {
    return this.rx(ry2);
  }
  size(size2) {
    return this.radius(new SVGNumber(size2).divide(2));
  }
};
extend(Circle, {
  x: x$3,
  y: y$3,
  cx: cx$1,
  cy: cy$1,
  width: width$2,
  height: height$2
});
registerMethods({
  Container: {
    // Create circle element
    circle: wrapWithAttrCheck(function(size2 = 0) {
      return this.put(new Circle()).size(size2).move(0, 0);
    })
  }
});
register(Circle, "Circle");
var ClipPath = class extends Container {
  constructor(node3, attrs2 = node3) {
    super(nodeOrNew("clipPath", node3), attrs2);
  }
  // Unclip all clipped elements and remove itself
  remove() {
    this.targets().forEach(function(el2) {
      el2.unclip();
    });
    return super.remove();
  }
  targets() {
    return baseFind('svg [clip-path*="' + this.id() + '"]');
  }
};
registerMethods({
  Container: {
    // Create clipping element
    clip: wrapWithAttrCheck(function() {
      return this.defs().put(new ClipPath());
    })
  },
  Element: {
    // Distribute clipPath to svg element
    clipper() {
      return this.reference("clip-path");
    },
    clipWith(element2) {
      const clipper = element2 instanceof ClipPath ? element2 : this.parent().clip().add(element2);
      return this.attr("clip-path", 'url("#' + clipper.id() + '")');
    },
    // Unclip element
    unclip() {
      return this.attr("clip-path", null);
    }
  }
});
register(ClipPath, "ClipPath");
var ForeignObject = class extends Element {
  constructor(node3, attrs2 = node3) {
    super(nodeOrNew("foreignObject", node3), attrs2);
  }
};
registerMethods({
  Container: {
    foreignObject: wrapWithAttrCheck(function(width2, height2) {
      return this.put(new ForeignObject()).size(width2, height2);
    })
  }
});
register(ForeignObject, "ForeignObject");
function dmove(dx2, dy2) {
  this.children().forEach((child, i3) => {
    let bbox2;
    try {
      bbox2 = child.bbox();
    } catch (e2) {
      return;
    }
    const m4 = new Matrix(child);
    const matrix = m4.translate(dx2, dy2).transform(m4.inverse());
    const p3 = new Point(bbox2.x, bbox2.y).transform(matrix);
    child.move(p3.x, p3.y);
  });
  return this;
}
function dx(dx2) {
  return this.dmove(dx2, 0);
}
function dy(dy2) {
  return this.dmove(0, dy2);
}
function height(height2, box = this.bbox()) {
  if (height2 == null)
    return box.height;
  return this.size(box.width, height2, box);
}
function move(x3 = 0, y4 = 0, box = this.bbox()) {
  const dx2 = x3 - box.x;
  const dy2 = y4 - box.y;
  return this.dmove(dx2, dy2);
}
function size(width2, height2, box = this.bbox()) {
  const p3 = proportionalSize(this, width2, height2, box);
  const scaleX = p3.width / box.width;
  const scaleY = p3.height / box.height;
  this.children().forEach((child, i3) => {
    const o3 = new Point(box).transform(new Matrix(child).inverse());
    child.scale(scaleX, scaleY, o3.x, o3.y);
  });
  return this;
}
function width(width2, box = this.bbox()) {
  if (width2 == null)
    return box.width;
  return this.size(width2, box.height, box);
}
function x(x3, box = this.bbox()) {
  if (x3 == null)
    return box.x;
  return this.move(x3, box.y, box);
}
function y(y4, box = this.bbox()) {
  if (y4 == null)
    return box.y;
  return this.move(box.x, y4, box);
}
var containerGeometry = {
  __proto__: null,
  dmove,
  dx,
  dy,
  height,
  move,
  size,
  width,
  x,
  y
};
var G = class extends Container {
  constructor(node3, attrs2 = node3) {
    super(nodeOrNew("g", node3), attrs2);
  }
};
extend(G, containerGeometry);
registerMethods({
  Container: {
    // Create a group element
    group: wrapWithAttrCheck(function() {
      return this.put(new G());
    })
  }
});
register(G, "G");
var A = class extends Container {
  constructor(node3, attrs2 = node3) {
    super(nodeOrNew("a", node3), attrs2);
  }
  // Link target attribute
  target(target) {
    return this.attr("target", target);
  }
  // Link url
  to(url) {
    return this.attr("href", url, xlink);
  }
};
extend(A, containerGeometry);
registerMethods({
  Container: {
    // Create a hyperlink element
    link: wrapWithAttrCheck(function(url) {
      return this.put(new A()).to(url);
    })
  },
  Element: {
    unlink() {
      const link = this.linker();
      if (!link)
        return this;
      const parent = link.parent();
      if (!parent) {
        return this.remove();
      }
      const index3 = parent.index(link);
      parent.add(this, index3);
      link.remove();
      return this;
    },
    linkTo(url) {
      let link = this.linker();
      if (!link) {
        link = new A();
        this.wrap(link);
      }
      if (typeof url === "function") {
        url.call(link, link);
      } else {
        link.to(url);
      }
      return this;
    },
    linker() {
      const link = this.parent();
      if (link && link.node.nodeName.toLowerCase() === "a") {
        return link;
      }
      return null;
    }
  }
});
register(A, "A");
var Mask = class extends Container {
  // Initialize node
  constructor(node3, attrs2 = node3) {
    super(nodeOrNew("mask", node3), attrs2);
  }
  // Unmask all masked elements and remove itself
  remove() {
    this.targets().forEach(function(el2) {
      el2.unmask();
    });
    return super.remove();
  }
  targets() {
    return baseFind('svg [mask*="' + this.id() + '"]');
  }
};
registerMethods({
  Container: {
    mask: wrapWithAttrCheck(function() {
      return this.defs().put(new Mask());
    })
  },
  Element: {
    // Distribute mask to svg element
    masker() {
      return this.reference("mask");
    },
    maskWith(element2) {
      const masker = element2 instanceof Mask ? element2 : this.parent().mask().add(element2);
      return this.attr("mask", 'url("#' + masker.id() + '")');
    },
    // Unmask element
    unmask() {
      return this.attr("mask", null);
    }
  }
});
register(Mask, "Mask");
var Stop = class extends Element {
  constructor(node3, attrs2 = node3) {
    super(nodeOrNew("stop", node3), attrs2);
  }
  // add color stops
  update(o3) {
    if (typeof o3 === "number" || o3 instanceof SVGNumber) {
      o3 = {
        offset: arguments[0],
        color: arguments[1],
        opacity: arguments[2]
      };
    }
    if (o3.opacity != null)
      this.attr("stop-opacity", o3.opacity);
    if (o3.color != null)
      this.attr("stop-color", o3.color);
    if (o3.offset != null)
      this.attr("offset", new SVGNumber(o3.offset));
    return this;
  }
};
registerMethods({
  Gradient: {
    // Add a color stop
    stop: function(offset, color, opacity) {
      return this.put(new Stop()).update(offset, color, opacity);
    }
  }
});
register(Stop, "Stop");
function cssRule(selector, rule) {
  if (!selector)
    return "";
  if (!rule)
    return selector;
  let ret = selector + "{";
  for (const i3 in rule) {
    ret += unCamelCase(i3) + ":" + rule[i3] + ";";
  }
  ret += "}";
  return ret;
}
var Style2 = class extends Element {
  constructor(node3, attrs2 = node3) {
    super(nodeOrNew("style", node3), attrs2);
  }
  addText(w2 = "") {
    this.node.textContent += w2;
    return this;
  }
  font(name, src, params = {}) {
    return this.rule("@font-face", {
      fontFamily: name,
      src,
      ...params
    });
  }
  rule(selector, obj) {
    return this.addText(cssRule(selector, obj));
  }
};
registerMethods("Dom", {
  style(selector, obj) {
    return this.put(new Style2()).rule(selector, obj);
  },
  fontface(name, src, params) {
    return this.put(new Style2()).font(name, src, params);
  }
});
register(Style2, "Style");
var TextPath = class extends Text2 {
  // Initialize node
  constructor(node3, attrs2 = node3) {
    super(nodeOrNew("textPath", node3), attrs2);
  }
  // return the array of the path track element
  array() {
    const track = this.track();
    return track ? track.array() : null;
  }
  // Plot path if any
  plot(d2) {
    const track = this.track();
    let pathArray = null;
    if (track) {
      pathArray = track.plot(d2);
    }
    return d2 == null ? pathArray : this;
  }
  // Get the path element
  track() {
    return this.reference("href");
  }
};
registerMethods({
  Container: {
    textPath: wrapWithAttrCheck(function(text3, path) {
      if (!(text3 instanceof Text2)) {
        text3 = this.text(text3);
      }
      return text3.path(path);
    })
  },
  Text: {
    // Create path for text to run on
    path: wrapWithAttrCheck(function(track, importNodes = true) {
      const textPath = new TextPath();
      if (!(track instanceof Path)) {
        track = this.defs().path(track);
      }
      textPath.attr("href", "#" + track, xlink);
      let node3;
      if (importNodes) {
        while (node3 = this.node.firstChild) {
          textPath.node.appendChild(node3);
        }
      }
      return this.put(textPath);
    }),
    // Get the textPath children
    textPath() {
      return this.findOne("textPath");
    }
  },
  Path: {
    // creates a textPath from this path
    text: wrapWithAttrCheck(function(text3) {
      if (!(text3 instanceof Text2)) {
        text3 = new Text2().addTo(this.parent()).text(text3);
      }
      return text3.path(this);
    }),
    targets() {
      return baseFind("svg textPath").filter((node3) => {
        return (node3.attr("href") || "").includes(this.id());
      });
    }
  }
});
TextPath.prototype.MorphArray = PathArray;
register(TextPath, "TextPath");
var Use = class extends Shape {
  constructor(node3, attrs2 = node3) {
    super(nodeOrNew("use", node3), attrs2);
  }
  // Use element as a reference
  use(element2, file) {
    return this.attr("href", (file || "") + "#" + element2, xlink);
  }
};
registerMethods({
  Container: {
    // Create a use element
    use: wrapWithAttrCheck(function(element2, file) {
      return this.put(new Use()).use(element2, file);
    })
  }
});
register(Use, "Use");
var SVG = makeInstance;
extend([Svg, Symbol2, Image2, Pattern, Marker], getMethodsFor("viewbox"));
extend([Line, Polyline, Polygon, Path], getMethodsFor("marker"));
extend(Text2, getMethodsFor("Text"));
extend(Path, getMethodsFor("Path"));
extend(Defs, getMethodsFor("Defs"));
extend([Text2, Tspan], getMethodsFor("Tspan"));
extend([Rect, Ellipse, Gradient, Runner], getMethodsFor("radius"));
extend(EventTarget, getMethodsFor("EventTarget"));
extend(Dom, getMethodsFor("Dom"));
extend(Element, getMethodsFor("Element"));
extend(Shape, getMethodsFor("Shape"));
extend([Container, Fragment], getMethodsFor("Container"));
extend(Gradient, getMethodsFor("Gradient"));
extend(Runner, getMethodsFor("Runner"));
List.extend(getMethodNames());
registerMorphableType([SVGNumber, Color, Box, Matrix, SVGArray, PointArray, PathArray, Point]);
makeMorphable();

// ../simple-mind-map/src/core/render/node/Shape.js
var Shape2 = class {
  constructor(node3) {
    this.node = node3;
  }
  //  形状需要的padding
  getShapePadding(width2, height2, paddingX, paddingY) {
    const shape = this.node.getShape();
    const defaultPaddingX = 15;
    const defaultPaddingY = 5;
    const actWidth = width2 + paddingX * 2;
    const actHeight = height2 + paddingY * 2;
    const actOffset = Math.abs(actWidth - actHeight);
    switch (shape) {
      case CONSTANTS.SHAPE.ROUNDED_RECTANGLE:
        return {
          paddingX: height2 > width2 ? (height2 - width2) / 2 : 0,
          paddingY: 0
        };
      case CONSTANTS.SHAPE.DIAMOND:
        return {
          paddingX: width2 / 2,
          paddingY: height2 / 2
        };
      case CONSTANTS.SHAPE.PARALLELOGRAM:
        return {
          paddingX: paddingX <= 0 ? defaultPaddingX : 0,
          paddingY: 0
        };
      case CONSTANTS.SHAPE.OUTER_TRIANGULAR_RECTANGLE:
        return {
          paddingX: paddingX <= 0 ? defaultPaddingX : 0,
          paddingY: 0
        };
      case CONSTANTS.SHAPE.INNER_TRIANGULAR_RECTANGLE:
        return {
          paddingX: paddingX <= 0 ? defaultPaddingX : 0,
          paddingY: 0
        };
      case CONSTANTS.SHAPE.ELLIPSE:
        return {
          paddingX: paddingX <= 0 ? defaultPaddingX : 0,
          paddingY: paddingY <= 0 ? defaultPaddingY : 0
        };
      case CONSTANTS.SHAPE.CIRCLE:
        return {
          paddingX: actHeight > actWidth ? actOffset / 2 : 0,
          paddingY: actHeight < actWidth ? actOffset / 2 : 0
        };
      default:
        return {
          paddingX: 0,
          paddingY: 0
        };
    }
  }
  //  创建形状节点
  createShape() {
    const shape = this.node.getShape();
    let { width: width2, height: height2 } = this.node;
    let node3 = null;
    if (shape === CONSTANTS.SHAPE.RECTANGLE) {
      node3 = new Rect().size(width2, height2);
    } else if (shape === CONSTANTS.SHAPE.DIAMOND) {
      node3 = this.createDiamond();
    } else if (shape === CONSTANTS.SHAPE.PARALLELOGRAM) {
      node3 = this.createParallelogram();
    } else if (shape === CONSTANTS.SHAPE.ROUNDED_RECTANGLE) {
      node3 = this.createRoundedRectangle();
    } else if (shape === CONSTANTS.SHAPE.OCTAGONAL_RECTANGLE) {
      node3 = this.createOctagonalRectangle();
    } else if (shape === CONSTANTS.SHAPE.OUTER_TRIANGULAR_RECTANGLE) {
      node3 = this.createOuterTriangularRectangle();
    } else if (shape === CONSTANTS.SHAPE.INNER_TRIANGULAR_RECTANGLE) {
      node3 = this.createInnerTriangularRectangle();
    } else if (shape === CONSTANTS.SHAPE.ELLIPSE) {
      node3 = this.createEllipse();
    } else if (shape === CONSTANTS.SHAPE.CIRCLE) {
      node3 = this.createCircle();
    }
    return node3;
  }
  //  创建菱形
  createDiamond() {
    let { width: width2, height: height2 } = this.node;
    let halfWidth = width2 / 2;
    let halfHeight = height2 / 2;
    let topX = halfWidth;
    let topY = 0;
    let rightX = width2;
    let rightY = halfHeight;
    let bottomX = halfWidth;
    let bottomY = height2;
    let leftX = 0;
    let leftY = halfHeight;
    return new Polygon().plot([
      [topX, topY],
      [rightX, rightY],
      [bottomX, bottomY],
      [leftX, leftY]
    ]);
  }
  //  创建平行四边形
  createParallelogram() {
    let { paddingX } = this.node.getPaddingVale();
    paddingX = paddingX || this.node.shapePadding.paddingX;
    let { width: width2, height: height2 } = this.node;
    return new Polygon().plot([
      [paddingX, 0],
      [width2, 0],
      [width2 - paddingX, height2],
      [0, height2]
    ]);
  }
  //  创建圆角矩形
  createRoundedRectangle() {
    let { width: width2, height: height2 } = this.node;
    let halfHeight = height2 / 2;
    return new Path().plot(`
      M${halfHeight},0
      L${width2 - halfHeight},0
      A${height2 / 2},${height2 / 2} 0 0,1 ${width2 - halfHeight},${height2} 
      L${halfHeight},${height2}
      A${height2 / 2},${height2 / 2} 0 0,1 ${halfHeight},${0}
    `);
  }
  //  创建八角矩形
  createOctagonalRectangle() {
    let w2 = 5;
    let { width: width2, height: height2 } = this.node;
    return new Polygon().plot([
      [0, w2],
      [w2, 0],
      [width2 - w2, 0],
      [width2, w2],
      [width2, height2 - w2],
      [width2 - w2, height2],
      [w2, height2],
      [0, height2 - w2]
    ]);
  }
  //  创建外三角矩形
  createOuterTriangularRectangle() {
    let { paddingX } = this.node.getPaddingVale();
    paddingX = paddingX || this.node.shapePadding.paddingX;
    let { width: width2, height: height2 } = this.node;
    return new Polygon().plot([
      [paddingX, 0],
      [width2 - paddingX, 0],
      [width2, height2 / 2],
      [width2 - paddingX, height2],
      [paddingX, height2],
      [0, height2 / 2]
    ]);
  }
  //  创建内三角矩形
  createInnerTriangularRectangle() {
    let { paddingX } = this.node.getPaddingVale();
    paddingX = paddingX || this.node.shapePadding.paddingX;
    let { width: width2, height: height2 } = this.node;
    return new Polygon().plot([
      [0, 0],
      [width2, 0],
      [width2 - paddingX / 2, height2 / 2],
      [width2, height2],
      [0, height2],
      [paddingX / 2, height2 / 2]
    ]);
  }
  //  创建椭圆
  createEllipse() {
    let { width: width2, height: height2 } = this.node;
    let halfWidth = width2 / 2;
    let halfHeight = height2 / 2;
    return new Path().plot(`
      M${halfWidth},0
      A${halfWidth},${halfHeight} 0 0,1 ${halfWidth},${height2} 
      M${halfWidth},${height2} 
      A${halfWidth},${halfHeight} 0 0,1 ${halfWidth},${0} 
    `);
  }
  //  创建圆
  createCircle() {
    let { width: width2, height: height2 } = this.node;
    let halfWidth = width2 / 2;
    let halfHeight = height2 / 2;
    return new Path().plot(`
      M${halfWidth},0
      A${halfWidth},${halfHeight} 0 0,1 ${halfWidth},${height2} 
      M${halfWidth},${height2} 
      A${halfWidth},${halfHeight} 0 0,1 ${halfWidth},${0} 
    `);
  }
};
var shapeList = [
  CONSTANTS.SHAPE.RECTANGLE,
  CONSTANTS.SHAPE.DIAMOND,
  CONSTANTS.SHAPE.PARALLELOGRAM,
  CONSTANTS.SHAPE.ROUNDED_RECTANGLE,
  CONSTANTS.SHAPE.OCTAGONAL_RECTANGLE,
  CONSTANTS.SHAPE.OUTER_TRIANGULAR_RECTANGLE,
  CONSTANTS.SHAPE.INNER_TRIANGULAR_RECTANGLE,
  CONSTANTS.SHAPE.ELLIPSE,
  CONSTANTS.SHAPE.CIRCLE
];

// ../simple-mind-map/src/utils/index.js
var walk = (root2, parent, beforeCallback, afterCallback, isRoot, layerIndex = 0, index3 = 0) => {
  let stop = false;
  if (beforeCallback) {
    stop = beforeCallback(root2, parent, isRoot, layerIndex, index3);
  }
  if (!stop && root2.children && root2.children.length > 0) {
    let _layerIndex = layerIndex + 1;
    root2.children.forEach((node3, nodeIndex) => {
      walk(
        node3,
        root2,
        beforeCallback,
        afterCallback,
        false,
        _layerIndex,
        nodeIndex
      );
    });
  }
  afterCallback && afterCallback(root2, parent, isRoot, layerIndex, index3);
};
var bfsWalk = (root2, callback) => {
  callback(root2);
  let stack = [root2];
  let isStop = false;
  while (stack.length) {
    if (isStop) {
      break;
    }
    let cur = stack.shift();
    if (cur.children && cur.children.length) {
      cur.children.forEach((item) => {
        stack.push(item);
        if (callback(item) === "stop") {
          isStop = true;
        }
      });
    }
  }
};
var resizeImgSize = (width2, height2, maxWidth, maxHeight) => {
  let nRatio = width2 / height2;
  let arr = [];
  if (maxWidth && maxHeight) {
    if (width2 <= maxWidth && height2 <= maxHeight) {
      arr = [width2, height2];
    } else {
      let mRatio = maxWidth / maxHeight;
      if (nRatio > mRatio) {
        arr = [nRatio * maxHeight, maxHeight];
      } else {
        arr = [maxWidth, maxWidth / nRatio];
      }
    }
  } else if (maxWidth) {
    if (width2 <= maxWidth) {
      arr = [width2, height2];
    } else {
      arr = [maxWidth, maxWidth / nRatio];
    }
  } else if (maxHeight) {
    if (height2 <= maxHeight) {
      arr = [width2, height2];
    } else {
      arr = [nRatio * maxHeight, maxHeight];
    }
  }
  return arr;
};
var getStrWithBrFromHtml = (str) => {
  str = str.replace(/<br>/gim, "\n");
  let el2 = document.createElement("div");
  el2.innerHTML = str;
  str = el2.textContent;
  return str;
};
var simpleDeepClone = (data2) => {
  try {
    return JSON.parse(JSON.stringify(data2));
  } catch (error) {
    return null;
  }
};
var copyRenderTree = (tree, root2, removeActiveState = false) => {
  tree.data = simpleDeepClone(root2.data);
  if (removeActiveState) {
    tree.data.isActive = false;
  }
  tree.children = [];
  if (root2.children && root2.children.length > 0) {
    root2.children.forEach((item, index3) => {
      tree.children[index3] = copyRenderTree({}, item, removeActiveState);
    });
  }
  return tree;
};
var copyNodeTree = (tree, root2, removeActiveState = false, keepId = false) => {
  tree.data = simpleDeepClone(root2.nodeData ? root2.nodeData.data : root2.data);
  if (tree.data.id && !keepId)
    delete tree.data.id;
  if (tree.data.uid)
    delete tree.data.uid;
  if (removeActiveState) {
    tree.data.isActive = false;
  }
  tree.children = [];
  if (root2.children && root2.children.length > 0) {
    root2.children.forEach((item, index3) => {
      tree.children[index3] = copyNodeTree({}, item, removeActiveState, keepId);
    });
  } else if (root2.nodeData && root2.nodeData.children && root2.nodeData.children.length > 0) {
    root2.nodeData.children.forEach((item, index3) => {
      tree.children[index3] = copyNodeTree({}, item, removeActiveState, keepId);
    });
  }
  return tree;
};
var imgToDataUrl = (src) => {
  return new Promise((resolve, reject) => {
    const img = new Image();
    img.setAttribute("crossOrigin", "anonymous");
    img.onload = () => {
      try {
        let canvas = document.createElement("canvas");
        canvas.width = img.width;
        canvas.height = img.height;
        let ctx = canvas.getContext("2d");
        ctx.drawImage(img, 0, 0, img.width, img.height);
        resolve(canvas.toDataURL());
      } catch (e2) {
        reject(e2);
      }
    };
    img.onerror = (e2) => {
      reject(e2);
    };
    img.src = src;
  });
};
var downloadFile = (file, fileName) => {
  let a3 = document.createElement("a");
  a3.href = file;
  a3.download = fileName;
  a3.click();
};
var throttle = (fn, time = 300, ctx) => {
  let timer = null;
  return (...args) => {
    if (timer) {
      return;
    }
    timer = setTimeout(() => {
      fn.call(ctx, ...args);
      timer = null;
    }, time);
  };
};
var asyncRun = (taskList, callback = () => {
}) => {
  let index3 = 0;
  let len = taskList.length;
  if (len <= 0) {
    return callback();
  }
  let loop = () => {
    if (index3 >= len) {
      callback();
      return;
    }
    taskList[index3]();
    setTimeout(() => {
      index3++;
      loop();
    }, 0);
  };
  loop();
};
var degToRad = (deg) => {
  return deg * (Math.PI / 180);
};
var camelCaseToHyphen = (str) => {
  return str.replace(/([a-z])([A-Z])/g, (...args) => {
    return args[1] + "-" + args[2].toLowerCase();
  });
};
var measureTextContext = null;
var measureText = (text3, { italic, bold, fontSize, fontFamily }) => {
  const font = joinFontStr({
    italic,
    bold,
    fontSize,
    fontFamily
  });
  if (!measureTextContext) {
    const canvas = document.createElement("canvas");
    measureTextContext = canvas.getContext("2d");
  }
  measureTextContext.save();
  measureTextContext.font = font;
  const {
    width: width2,
    actualBoundingBoxAscent,
    actualBoundingBoxDescent
  } = measureTextContext.measureText(text3);
  measureTextContext.restore();
  const height2 = actualBoundingBoxAscent + actualBoundingBoxDescent;
  return { width: width2, height: height2 };
};
var joinFontStr = ({ italic, bold, fontSize, fontFamily }) => {
  return `${italic ? "italic " : ""} ${bold ? "bold " : ""} ${fontSize}px ${fontFamily} `;
};
var nextTick = function(fn, ctx) {
  let pending = false;
  let timerFunc = null;
  let handle = () => {
    pending = false;
    ctx ? fn.call(ctx) : fn();
  };
  if (typeof MutationObserver !== "undefined") {
    let counter = 1;
    let observer = new MutationObserver(handle);
    let textNode = document.createTextNode(counter);
    observer.observe(textNode, {
      characterData: true
      // 设为 true 表示监视指定目标节点或子节点树中节点所包含的字符数据的变化
    });
    timerFunc = function() {
      counter = (counter + 1) % 2;
      textNode.data = counter;
    };
  } else {
    timerFunc = setTimeout;
  }
  return function() {
    if (pending)
      return;
    pending = true;
    timerFunc(handle, 0);
  };
};
var checkNodeOuter = (mindMap, node3) => {
  let elRect = mindMap.elRect;
  let { scaleX, scaleY, translateX, translateY } = mindMap.draw.transform();
  let { left, top, width: width2, height: height2 } = node3;
  let right = (left + width2) * scaleX + translateX;
  let bottom = (top + height2) * scaleY + translateY;
  left = left * scaleX + translateX;
  top = top * scaleY + translateY;
  let offsetLeft = 0;
  let offsetTop = 0;
  if (left < 0) {
    offsetLeft = -left;
  }
  if (right > elRect.width) {
    offsetLeft = -(right - elRect.width);
  }
  if (top < 0) {
    offsetTop = -top;
  }
  if (bottom > elRect.height) {
    offsetTop = -(bottom - elRect.height);
  }
  return {
    isOuter: offsetLeft !== 0 || offsetTop !== 0,
    offsetLeft,
    offsetTop
  };
};
var getTextFromHtmlEl = null;
var getTextFromHtml = (html2) => {
  if (!getTextFromHtmlEl) {
    getTextFromHtmlEl = document.createElement("div");
  }
  getTextFromHtmlEl.innerHTML = html2;
  return getTextFromHtmlEl.textContent;
};
var readBlob = (blob) => {
  return new Promise((resolve, reject) => {
    let reader = new FileReader();
    reader.onload = (evt) => {
      resolve(evt.target.result);
    };
    reader.onerror = (err) => {
      reject(err);
    };
    reader.readAsDataURL(blob);
  });
};

// ../simple-mind-map/src/core/render/node/nodeGeneralization.js
function checkHasGeneralization() {
  return !!this.nodeData.data.generalization;
}
function createGeneralizationNode() {
  if (this.isGeneralization || !this.checkHasGeneralization()) {
    return;
  }
  if (!this._generalizationLine) {
    this._generalizationLine = this.draw.path();
  }
  if (!this._generalizationNode) {
    this._generalizationNode = new Node_default({
      data: {
        data: this.nodeData.data.generalization
      },
      uid: this.mindMap.uid++,
      renderer: this.renderer,
      mindMap: this.mindMap,
      draw: this.draw,
      isGeneralization: true
    });
    this._generalizationNodeWidth = this._generalizationNode.width;
    this._generalizationNodeHeight = this._generalizationNode.height;
    this._generalizationNode.generalizationBelongNode = this;
    if (this.nodeData.data.generalization.isActive) {
      this.renderer.addActiveNode(this._generalizationNode);
    }
  }
}
function updateGeneralization() {
  this.removeGeneralization();
  this.createGeneralizationNode();
}
function renderGeneralization() {
  if (this.isGeneralization) {
    return;
  }
  if (!this.checkHasGeneralization()) {
    this.removeGeneralization();
    this._generalizationNodeWidth = 0;
    this._generalizationNodeHeight = 0;
    return;
  }
  if (this.nodeData.data.expand === false) {
    this.removeGeneralization();
    return;
  }
  this.createGeneralizationNode();
  this.renderer.layout.renderGeneralization(
    this,
    this._generalizationLine,
    this._generalizationNode
  );
  this.style.generalizationLine(this._generalizationLine);
  this._generalizationNode.render();
}
function removeGeneralization() {
  if (this._generalizationLine) {
    this._generalizationLine.remove();
    this._generalizationLine = null;
  }
  if (this._generalizationNode) {
    this.renderer.removeActiveNode(this._generalizationNode);
    this._generalizationNode.remove();
    this._generalizationNode = null;
  }
  if (this.generalizationBelongNode) {
    this.draw.find(".generalization_" + this.generalizationBelongNode.uid).remove();
  }
}
function hideGeneralization() {
  if (this._generalizationLine) {
    this._generalizationLine.hide();
  }
  if (this._generalizationNode) {
    this._generalizationNode.hide();
  }
}
function showGeneralization() {
  if (this._generalizationLine) {
    this._generalizationLine.show();
  }
  if (this._generalizationNode) {
    this._generalizationNode.show();
  }
}
var nodeGeneralization_default = {
  checkHasGeneralization,
  createGeneralizationNode,
  updateGeneralization,
  renderGeneralization,
  removeGeneralization,
  hideGeneralization,
  showGeneralization
};

// ../simple-mind-map/src/svg/btns.js
var open2 = `<svg t="1618141562310" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="13476" width="200" height="200"><path d="M475.136 327.168v147.968h-147.968v74.24h147.968v147.968h74.24v-147.968h147.968v-74.24h-147.968v-147.968h-74.24z m36.864-222.208c225.28 0 407.04 181.76 407.04 407.04s-181.76 407.04-407.04 407.04-407.04-181.76-407.04-407.04 181.76-407.04 407.04-407.04z m0-74.24c-265.216 0-480.768 215.552-480.768 480.768s215.552 480.768 480.768 480.768 480.768-215.552 480.768-480.768-215.552-480.768-480.768-480.768z" p-id="13477"></path></svg>`;
var close = `<svg t="1618141589243" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="13611" width="200" height="200"><path d="M512 105.472c225.28 0 407.04 181.76 407.04 407.04s-181.76 407.04-407.04 407.04-407.04-181.76-407.04-407.04 181.76-407.04 407.04-407.04z m0-74.24c-265.216 0-480.768 215.552-480.768 480.768s215.552 480.768 480.768 480.768 480.768-215.552 480.768-480.768-215.552-480.768-480.768-480.768z" p-id="13612"></path><path d="M252.928 474.624h518.144v74.24h-518.144z" p-id="13613"></path></svg>`;
var btns_default = {
  open: open2,
  close
};

// ../simple-mind-map/src/core/render/node/nodeExpandBtn.js
function createExpandNodeContent() {
  if (this._openExpandNode) {
    return;
  }
  let { open: open3, close: close2 } = this.mindMap.opt.expandBtnIcon || {};
  this._openExpandNode = SVG(open3 || btns_default.open).size(
    this.expandBtnSize,
    this.expandBtnSize
  );
  this._openExpandNode.x(0).y(-this.expandBtnSize / 2);
  this._closeExpandNode = SVG(close2 || btns_default.close).size(
    this.expandBtnSize,
    this.expandBtnSize
  );
  this._closeExpandNode.x(0).y(-this.expandBtnSize / 2);
  this._fillExpandNode = new Circle().size(this.expandBtnSize);
  this._fillExpandNode.x(0).y(-this.expandBtnSize / 2);
  this.style.iconBtn(
    this._openExpandNode,
    this._closeExpandNode,
    this._fillExpandNode
  );
}
function updateExpandBtnNode() {
  let { expand } = this.nodeData.data;
  if (expand === this._lastExpandBtnType)
    return;
  if (this._expandBtn) {
    this._expandBtn.clear();
  }
  this.createExpandNodeContent();
  let node3;
  if (expand === false) {
    node3 = this._openExpandNode;
    this._lastExpandBtnType = false;
  } else {
    node3 = this._closeExpandNode;
    this._lastExpandBtnType = true;
  }
  if (this._expandBtn)
    this._expandBtn.add(this._fillExpandNode).add(node3);
}
function updateExpandBtnPos() {
  if (!this._expandBtn) {
    return;
  }
  this.renderer.layout.renderExpandBtn(this, this._expandBtn);
}
function renderExpandBtn() {
  if (!this.nodeData.children || this.nodeData.children.length <= 0 || this.isRoot) {
    return;
  }
  if (this._expandBtn) {
    this.group.add(this._expandBtn);
  } else {
    this._expandBtn = new G();
    this._expandBtn.on("mouseover", (e2) => {
      e2.stopPropagation();
      this._expandBtn.css({
        cursor: "pointer"
      });
    });
    this._expandBtn.on("mouseout", (e2) => {
      e2.stopPropagation();
      this._expandBtn.css({
        cursor: "auto"
      });
    });
    this._expandBtn.on("click", (e2) => {
      e2.stopPropagation();
      this.mindMap.execCommand(
        "SET_NODE_EXPAND",
        this,
        !this.nodeData.data.expand
      );
      this.mindMap.emit("expand_btn_click", this);
    });
    this._expandBtn.on("dblclick", (e2) => {
      e2.stopPropagation();
    });
    this.group.add(this._expandBtn);
  }
  this._showExpandBtn = true;
  this.updateExpandBtnNode();
  this.updateExpandBtnPos();
}
function removeExpandBtn() {
  if (this._expandBtn && this._showExpandBtn) {
    this._expandBtn.remove();
    this._showExpandBtn = false;
  }
}
function showExpandBtn() {
  if (this.mindMap.opt.alwaysShowExpandBtn)
    return;
  setTimeout(() => {
    this.renderExpandBtn();
  }, 0);
}
function hideExpandBtn() {
  if (this.mindMap.opt.alwaysShowExpandBtn || this._isMouseenter)
    return;
  let { isActive, expand } = this.nodeData.data;
  if (!isActive && expand) {
    setTimeout(() => {
      this.removeExpandBtn();
    }, 0);
  }
}
var nodeExpandBtn_default = {
  createExpandNodeContent,
  updateExpandBtnNode,
  updateExpandBtnPos,
  renderExpandBtn,
  removeExpandBtn,
  showExpandBtn,
  hideExpandBtn
};

// ../simple-mind-map/src/core/render/node/nodeCommandWraps.js
function setData(data2 = {}) {
  this.mindMap.execCommand("SET_NODE_DATA", this, data2);
}
function setText(text3, richText) {
  this.mindMap.execCommand("SET_NODE_TEXT", this, text3, richText);
}
function setImage(imgData) {
  this.mindMap.execCommand("SET_NODE_IMAGE", this, imgData);
}
function setIcon(icons) {
  this.mindMap.execCommand("SET_NODE_ICON", this, icons);
}
function setHyperlink(link, title) {
  this.mindMap.execCommand("SET_NODE_HYPERLINK", this, link, title);
}
function setNote(note2) {
  this.mindMap.execCommand("SET_NODE_NOTE", this, note2);
}
function setTag(tag) {
  this.mindMap.execCommand("SET_NODE_TAG", this, tag);
}
function setShape(shape) {
  this.mindMap.execCommand("SET_NODE_SHAPE", this, shape);
}
function setStyle(prop, value, isActive) {
  this.mindMap.execCommand("SET_NODE_STYLE", this, prop, value, isActive);
}
var nodeCommandWraps_default = {
  setData,
  setText,
  setImage,
  setIcon,
  setHyperlink,
  setNote,
  setTag,
  setShape,
  setStyle
};

// ../simple-mind-map/src/svg/icons.js
var hyperlink = '<svg t="1624174958075" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7982" ><path d="M435.484444 251.733333v68.892445L295.822222 320.682667a168.504889 168.504889 0 0 0-2.844444 336.952889h142.506666v68.892444H295.822222a237.397333 237.397333 0 0 1 0-474.794667h139.662222z m248.945778 0a237.397333 237.397333 0 0 1 0 474.851556H544.654222v-69.006222l139.776 0.056889a168.504889 168.504889 0 0 0 2.844445-336.952889H544.597333V251.676444h139.776z m-25.827555 203.946667a34.474667 34.474667 0 0 1 0 68.892444H321.649778a34.474667 34.474667 0 0 1 0-68.892444h336.952889z" p-id="7983"></path></svg>';
var note = '<svg t="1624195132675" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8792" ><path d="M152.768 985.984 152.768 49.856l434.56 0 66.816 0 234.048 267.392 0 66.816 0 601.92L152.768 985.984 152.768 985.984zM654.144 193.088l0 124.16 108.736 0L654.144 193.088 654.144 193.088zM821.312 384.064l-167.168 0L587.328 384.064 587.328 317.312 587.328 116.736 219.584 116.736 219.584 919.04l601.728 0L821.312 384.064 821.312 384.064zM386.688 517.888 319.808 517.888 319.808 450.944l66.816 0L386.624 517.888 386.688 517.888zM386.688 651.584 319.808 651.584 319.808 584.704l66.816 0L386.624 651.584 386.688 651.584zM386.688 785.344 319.808 785.344l0-66.88 66.816 0L386.624 785.344 386.688 785.344zM721.024 517.888 453.632 517.888 453.632 450.944l267.392 0L721.024 517.888 721.024 517.888zM654.144 651.584 453.632 651.584 453.632 584.704l200.512 0L654.144 651.584 654.144 651.584zM620.672 785.344l-167.04 0 0-66.88 167.04 0L620.672 785.344 620.672 785.344z" p-id="8793"></path></svg>';
var nodeIconList = [
  {
    name: "\u4F18\u5148\u7EA7\u56FE\u6807",
    type: "priority",
    list: [
      {
        name: "1",
        icon: `<svg viewBox="0 0 1024 1024"><path d="M512.042667 1024C229.248 1024 0 794.794667 0 511.957333 0 229.205333 229.248 0 512.042667 0 794.752 0 1024 229.205333 1024 511.957333 1024 794.794667 794.752 1024 512.042667 1024z" fill="#E93B30"></path><path d="M580.309333 256h-75.52c-10.666667 29.824-30.165333 55.765333-58.709333 78.165333-28.416 22.314667-54.869333 37.418667-79.146667 45.397334v84.608a320 320 0 0 0 120.234667-70.698667v352.085333H580.266667V256z" fill="#FFFFFF"></path></svg>`
      },
      {
        name: "2",
        icon: `<svg viewBox="0 0 1024 1024"><path d="M511.957333 1024C229.248 1024 0 794.752 0 512S229.248 0 511.957333 0C794.752 0 1024 229.248 1024 512s-229.248 512-512.042667 512z" fill="#FA8D2E"></path><path d="M667.946667 658.602667h-185.301334c4.864-8.533333 11.178667-17.066667 19.072-25.984 7.808-8.874667 26.453333-26.837333 55.936-53.888 29.525333-27.008 49.877333-47.786667 61.226667-62.165334 16.981333-21.717333 29.44-42.453333 37.290667-62.293333 7.808-19.84 11.776-40.746667 11.776-62.677333 0-38.570667-13.738667-70.741333-41.088-96.725334C599.466667 268.928 561.706667 256 513.834667 256c-43.690667 0-80.128 11.136-109.354667 33.578667-29.098667 22.4-46.506667 59.306667-52.010667 110.805333l93.184 9.301333c1.792-27.349333 8.405333-46.890667 19.754667-58.624 11.434667-11.776 26.837333-17.664 46.165333-17.664 19.541333 0 34.858667 5.589333 45.909334 16.768 11.136 11.264 16.682667 27.221333 16.682666 48.042667 0 18.858667-6.4 37.930667-19.242666 57.258667-9.472 14.037333-35.157333 40.533333-77.098667 79.872-52.096 48.554667-87.04 87.509333-104.704 116.821333A226.688 226.688 0 0 0 341.333333 745.429333h326.613334v-86.826666z" fill="#FFFFFF"></path></svg>`
      },
      {
        name: "3",
        icon: `<svg viewBox="0 0 1024 1024"><path d="M512 0C229.248 0 0 229.248 0 512s229.248 512 512 512 512-229.248 512-512S794.752 0 512 0z" fill="#2E66FA"></path><path d="M627.754667 731.733333c-29.354667 25.088-66.901333 37.632-112.725334 37.632-44.928 0-81.792-11.52-110.592-34.773333-33.066667-26.538667-49.877333-64.469333-50.304-114.133333h92.16c0.426667 21.76 7.552 38.314667 21.333334 49.664 12.288 10.88 28.117333 16.341333 47.402666 16.341333 20.309333 0 36.778667-6.101333 49.322667-18.432 12.544-12.330667 18.773333-29.568 18.773333-51.797333 0-21.290667-6.229333-38.186667-18.773333-50.773334-12.544-12.501333-29.866667-18.773333-52.138667-18.773333h-13.525333v-80.042667H512c42.112 0 63.274667-21.034667 63.274667-63.146666 0-20.309333-5.888-36.096-17.706667-47.445334a60.757333 60.757333 0 0 0-43.818667-17.066666c-17.493333 0-32 5.504-43.434666 16.298666-11.562667 10.88-17.792 25.728-18.773334 44.714667H359.68c0.981333-43.946667 16.042667-78.976 45.397333-104.96 29.354667-25.941333 65.706667-39.04 109.226667-39.04 44.928 0 81.792 13.525333 110.592 40.490667 28.8 26.922667 43.306667 61.610667 43.306667 104.149333 0 48.213333-19.413333 82.688-58.154667 103.552 43.52 23.125333 65.28 61.44 65.28 114.858667 0 48.128-15.957333 85.76-47.573333 112.682666z" fill="#FFFFFF"></path></svg>`
      },
      {
        name: "4",
        icon: `<svg viewBox="0 0 1024 1024"><path d="M512.042667 1024C229.248 1024 0 794.794667 0 512.042667 0 229.205333 229.248 0 512.042667 0 794.752 0 1024 229.205333 1024 512.042667 1024 794.794667 794.752 1024 512.042667 1024z" fill="#6D768D"></path><path d="M600.96 256v309.802667h60.117333v81.536h-60.16v98.218666h-90.154666v-98.218666H311.466667v-81.237334L522.666667 256h78.293333zM510.72 399.104l-112.042667 166.698667h112.042667V399.104z" fill="#FFFFFF"></path></svg>`
      },
      {
        name: "5",
        icon: `<svg viewBox="0 0 1024 1024"><path d="M512.042667 1024C229.248 1024 0 794.794667 0 512.042667 0 229.205333 229.248 0 512.042667 0 794.752 0 1024 229.205333 1024 512.042667 1024 794.794667 794.752 1024 512.042667 1024z" fill="#6D768D"></path><path d="M470.912 343.552h175.786667V256H400.256l-47.786667 253.952 75.434667 10.837333c21.205333-23.552 45.269333-35.413333 72.021333-35.413333 21.546667 0 38.997333 7.509333 52.437334 22.4 13.312 15.018667 20.053333 37.418667 20.053333 67.328 0 31.872-6.741333 55.765333-20.181333 71.552-13.397333 15.872-29.866667 23.765333-49.237334 23.765333-17.066667 0-32.085333-6.186667-45.013333-18.432-13.013333-12.373333-20.821333-29.013333-23.466667-50.133333L341.333333 611.498667c5.546667 40.874667 22.485333 73.429333 50.730667 97.621333 28.330667 24.32 64.938667 36.437333 109.866667 36.437333 56.149333 0 100.053333-21.546667 131.754666-64.554666a176.64 176.64 0 0 0 34.816-107.52c0-48.042667-14.378667-87.210667-43.221333-117.333334-28.8-30.208-63.957333-45.312-105.514667-45.312-21.674667 0-42.922667 5.248-63.829333 15.616l14.976-82.901333z" fill="#FFFFFF"></path></svg>`
      },
      {
        name: "6",
        icon: `<svg viewBox="0 0 1024 1024"><path d="M512 1024C229.248 1024 0 794.794667 0 512.042667 0 229.205333 229.248 0 512 0c282.88 0 512 229.205333 512 512.042667C1024 794.794667 794.88 1024 512 1024z" fill="#6D768D"></path><path d="M519.210667 256c36.992 0 67.626667 10.368 91.776 31.189333 24.192 20.821333 39.68 51.029333 46.293333 90.709334l-90.197333 9.984c-2.176-18.56-7.978667-32.298667-17.28-41.173334-9.258667-8.874667-21.418667-13.226667-36.224-13.226666-19.754667 0-36.437333 8.789333-50.048 26.453333-13.696 17.664-22.314667 54.613333-25.856 110.549333 23.296-27.52 52.138667-41.258667 86.656-41.258666 38.997333 0 72.362667 14.805333 100.181333 44.544 27.733333 29.696 41.685333 68.010667 41.685333 114.858666 0 49.877333-14.634667 89.856-43.818666 119.936-29.226667 30.208-66.730667 45.226667-112.554667 45.226667-49.066667 0-89.429333-19.072-121.130667-57.344C357.12 658.218667 341.333333 595.541333 341.333333 508.416c0-89.344 16.469333-153.813333 49.493334-193.194667C423.722667 275.754667 466.56 256 519.168 256z m-9.472 241.834667c-17.962667 0-33.066667 6.997333-45.525334 21.12-12.330667 14.037333-18.56 34.858667-18.56 62.293333 0 30.421333 6.912 53.76 20.906667 70.4 13.952 16.469333 29.866667 24.746667 47.786667 24.746667 17.28 0 31.701333-6.826667 43.178666-20.309334 11.52-13.525333 17.237333-35.669333 17.237334-66.56 0-31.658667-6.186667-54.869333-18.517334-69.546666a58.197333 58.197333 0 0 0-46.506666-22.144z" fill="#FFFFFF"></path></svg>`
      },
      {
        name: "7",
        icon: `<svg viewBox="0 0 1024 1024"><path d="M512.042667 1024C229.248 1024 0 794.752 0 512S229.248 0 512.042667 0C794.752 0 1024 229.248 1024 512s-229.248 512-511.957333 512z" fill="#6D768D"></path><path d="M673.024 273.066667H354.133333v86.869333h212.224a691.2 691.2 0 0 0-104.746666 187.989333c-26.026667 70.101333-39.978667 138.88-41.429334 206.293334h89.6c-0.298667-42.922667 6.698667-91.776 21.034667-146.474667a654.72 654.72 0 0 1 62.08-154.965333c27.136-48.554667 53.888-85.76 80.128-111.701334V273.066667z" fill="#FFFFFF"></path></svg>`
      },
      {
        name: "8",
        icon: `<svg viewBox="0 0 1024 1024"><path d="M512 1024C229.248 1024 0 794.752 0 512S229.248 0 512 0s512 229.248 512 512-229.248 512-512 512z" fill="#6D768D"></path><path d="M512.426667 256c46.208 0 82.048 11.861333 107.605333 35.541333 25.6 23.68 38.314667 53.674667 38.314667 89.898667 0 22.613333-5.802667 42.666667-17.578667 60.330667a111.445333 111.445333 0 0 1-49.450667 40.277333c26.965333 10.837333 47.36 26.752 61.312 47.658667 13.994667 20.906667 21.034667 45.013333 21.034667 72.362666 0 45.098667-14.336 81.834667-42.965333 109.952-28.586667 28.245333-66.602667 42.368-114.090667 42.368-44.245333 0-81.066667-11.648-110.464-34.986666-34.645333-27.52-52.010667-65.28-52.010667-113.365334 0-26.368 6.528-50.645333 19.626667-72.746666 13.056-22.144 33.578667-39.210667 61.696-51.242667-24.064-10.154667-41.557333-24.192-52.48-41.941333a109.824 109.824 0 0 1-16.512-58.666667c0-36.224 12.757333-66.218667 37.973333-89.898667 25.386667-23.68 61.354667-35.541333 108.032-35.541333z m1.28 265.429333c-22.784 0-39.722667 7.978667-50.901334 23.893334-11.136 15.786667-16.64 33.066667-16.64 51.498666 0 25.984 6.485333 46.208 19.712 60.714667 13.098667 14.506667 29.525333 21.802667 49.152 21.802667 19.242667 0 35.157333-6.997333 47.786667-20.992 12.629333-13.909333 18.858667-34.048 18.858667-60.416 0-23.082667-6.314667-41.557333-19.2-55.466667a63.274667 63.274667 0 0 0-48.725334-21.034667z m-0.341334-191.488c-17.792 0-32 5.333333-42.581333 16-10.538667 10.666667-15.872 24.746667-15.872 42.325334 0 18.645333 5.248 33.152 15.701333 43.648 10.453333 10.453333 24.362667 15.658667 41.770667 15.658666 17.664 0 31.658667-5.290667 42.24-15.872 10.538667-10.581333 15.872-25.173333 15.872-43.818666 0-17.493333-5.248-31.573333-15.701333-42.154667s-24.277333-15.786667-41.429334-15.786667z" fill="#FFFFFF"></path></svg>`
      },
      {
        name: "9",
        icon: `<svg viewBox="0 0 1024 1024"><path d="M512 1024C229.248 1024 0 794.794667 0 512.042667 0 229.333333 229.248 0 512 0c282.88 0 512 229.333333 512 512.042667C1024 794.794667 794.88 1024 512 1024z" fill="#6D768D"></path><path d="M497.28 256c49.365333 0 89.856 19.157333 121.429333 57.429333 31.701333 38.229333 47.488 101.205333 47.488 188.842667 0 89.173333-16.384 153.386667-49.365333 192.853333-32.853333 39.594667-75.605333 59.264-128.426667 59.264-37.888 0-68.608-10.154667-91.989333-30.506666s-38.4-50.816-45.013333-91.306667l90.112-9.984c2.261333 18.474667 8.021333 32.085333 17.28 41.088 9.173333 8.874667 21.418667 13.312 36.608 13.312 19.2 0 35.541333-8.874667 48.981333-26.752 13.44-17.749333 22.016-54.613333 25.770667-110.549333-23.466667 27.264-52.821333 40.874667-88.064 40.874666-38.314667 0-71.253333-14.72-99.114667-44.330666C355.242667 506.709333 341.333333 468.224 341.333333 420.864c0-49.493333 14.592-89.258667 43.946667-119.466667C414.549333 271.104 451.925333 256 497.237333 256z m-4.352 77.482667c-17.237333 0-31.658667 6.826667-43.008 20.437333-11.477333 13.653333-17.194667 35.84-17.194667 66.816 0 31.402667 6.229333 54.485333 18.645334 69.205333 12.458667 14.72 27.946667 22.101333 46.592 22.101334 18.005333 0 33.066667-7.082667 45.44-21.205334 12.330667-14.208 18.432-35.029333 18.432-62.506666 0-29.994667-6.912-53.376-20.821334-69.973334-13.824-16.597333-29.866667-24.874667-48.085333-24.874666z" fill="#FFFFFF"></path></svg>`
      },
      {
        name: "10",
        icon: `<svg viewBox="0 0 1024 1024"><path d="M512.042667 1024C229.248 1024 0 794.794667 0 511.957333 0 229.205333 229.248 0 512.042667 0 794.752 0 1024 229.205333 1024 511.957333 1024 794.794667 794.752 1024 512.042667 1024z" fill="#6D768D"></path><path d="M619.946667 273.066667c46.976 0 83.754667 16.042667 110.250666 48.042666 31.573333 37.973333 47.36 100.864 47.36 188.672 0 87.722667-15.829333 150.698667-47.658666 189.056-26.325333 31.616-62.976 47.36-109.952 47.36-47.274667 0-85.418667-17.237333-114.346667-51.968-28.885333-34.602667-43.392-96.426667-43.392-185.386666 0-87.168 15.872-150.016 47.701333-188.416 26.282667-31.488 62.933333-47.36 110.037334-47.36z m-207.488 12.8v452.266666H325.504V411.690667A299.904 299.904 0 0 1 213.333333 476.373333V398.933333c22.656-7.296 47.36-21.12 73.856-41.514666 26.624-20.522667 44.842667-44.288 54.784-71.552h70.485334z m207.488 60.842666c-11.306667 0-21.461333 3.413333-30.336 10.24-8.874667 6.826667-15.786667 19.157333-20.693334 36.864-6.4 22.997333-9.642667 61.653333-9.642666 115.968 0 54.442667 2.944 91.733333 8.661333 112.128 5.802667 20.352 13.098667 33.877333 21.845333 40.618667 8.789333 6.741333 18.858667 10.154667 30.165334 10.154667 11.349333 0 21.376-3.498667 30.250666-10.325334 8.874667-6.826667 15.786667-19.157333 20.693334-36.778666 6.4-22.826667 9.642667-61.354667 9.642666-115.797334 0-54.314667-2.858667-91.648-8.661333-112.042666-5.802667-20.352-13.013333-33.962667-21.76-40.789334a47.616 47.616 0 0 0-30.165333-10.24z" fill="#FFFFFF"></path></svg>`
      }
    ]
  },
  {
    name: "\u8FDB\u5EA6\u56FE\u6807",
    type: "progress",
    list: [
      {
        name: "1",
        icon: `<svg viewBox="0 0 1024 1024"><path d="M512 0C229.248 0 0 229.248 0 512s229.248 512 512 512 512-229.248 512-512S794.752 0 512 0z" fill="#12BB37"></path><path d="M512 928c-229.76 0-416-186.24-416-416S282.24 96 512 96V512l294.144-294.144A414.72 414.72 0 0 1 928 512c0 229.76-186.24 416-416 416z" fill="#FFFFFF"></path></svg>`
      },
      {
        name: "2",
        icon: `<svg viewBox="0 0 1024 1024"><path d="M512 0C229.248 0 0 229.248 0 512s229.248 512 512 512 512-229.248 512-512S794.752 0 512 0z" fill="#12BB37"></path><path d="M512 928c-229.76 0-416-186.24-416-416S282.24 96 512 96V512h416c0 229.76-186.24 416-416 416z" fill="#FFFFFF"></path></svg>`
      },
      {
        name: "3",
        icon: `<svg viewBox="0 0 1024 1024"><path d="M512 0C229.248 0 0 229.248 0 512s229.248 512 512 512 512-229.248 512-512S794.752 0 512 0z" fill="#12BB37"></path><path d="M512 928c-229.76 0-416-186.24-416-416S282.24 96 512 96V512l294.144 294.144A414.72 414.72 0 0 1 512 928z" fill="#FFFFFF"></path></svg>`
      },
      {
        name: "4",
        icon: `<svg viewBox="0 0 1024 1024"><path d="M512 0C229.248 0 0 229.248 0 512s229.248 512 512 512 512-229.248 512-512S794.752 0 512 0z" fill="#12BB37"></path><path d="M512 928c-229.76 0-416-186.24-416-416S282.24 96 512 96v832z" fill="#FFFFFF"></path></svg>`
      },
      {
        name: "5",
        icon: `<svg viewBox="0 0 1024 1024"><path d="M512 0C229.248 0 0 229.248 0 512s229.248 512 512 512 512-229.248 512-512S794.752 0 512 0z" fill="#12BB37"></path><path d="M512 512l-294.144 294.144A414.72 414.72 0 0 1 96 512c0-229.76 186.24-416 416-416V512z" fill="#FFFFFF"></path></svg>`
      },
      {
        name: "6",
        icon: `<svg viewBox="0 0 1024 1024"><path d="M512 0C229.248 0 0 229.248 0 512s229.248 512 512 512 512-229.248 512-512S794.752 0 512 0z" fill="#12BB37"></path><path d="M512 512H96c0-229.76 186.24-416 416-416V512z" fill="#FFFFFF"></path></svg>`
      },
      {
        name: "7",
        icon: `<svg viewBox="0 0 1024 1024"><path d="M512 0C229.248 0 0 229.248 0 512s229.248 512 512 512 512-229.248 512-512S794.752 0 512 0z" fill="#12BB37"></path><path d="M512 512L217.856 217.856A414.72 414.72 0 0 1 512 96V512z" fill="#FFFFFF"></path></svg>`
      },
      {
        name: "8",
        icon: `<svg viewBox="0 0 1024 1024"><path d="M0 512c0 282.752 229.248 512 512 512s512-229.248 512-512S794.752 0 512 0 0 229.248 0 512z" fill="#12BB37"></path><path d="M716.629333 341.333333h-51.328a35.072 35.072 0 0 0-28.330666 14.293334l-171.989334 233.984-77.909333-106.026667a35.2 35.2 0 0 0-28.330667-14.293333H307.413333c-7.082667 0-11.264 7.936-7.082666 13.653333l136.32 185.472a35.2 35.2 0 0 0 56.533333 0l230.4-313.429333a8.533333 8.533333 0 0 0-6.954667-13.653334z" fill="#FFFFFF"></path></svg>`
      }
    ]
  },
  {
    name: "\u8868\u60C5\u56FE\u6807",
    type: "expression",
    list: [
      {
        name: "1",
        icon: `<svg t="1624457751393" class="icon" viewBox="0 0 1026 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="12255"><path d="M1.097856 1.097642h1021.804717v1021.804716H1.097856z" fill="#F09495" p-id="12256"></path><path d="M1024.000214 1024H0.000214V0h1024v1024z m-1021.804716-2.195284h1019.609433V2.195284H2.195498v1019.609432z" fill="#FFFFFF" p-id="12257"></path><path d="M234.695985 335.179887m-27.341259 0a27.341259 27.341259 0 1 0 54.682518 0 27.341259 27.341259 0 1 0-54.682518 0Z" fill="#040000" p-id="12258"></path><path d="M234.695985 363.519002c-15.666342 0-28.339115-12.772559-28.339115-28.339115 0-15.666342 12.772559-28.339115 28.339115-28.339115s28.339115 12.772559 28.339115 28.339115c0.099786 15.666342-12.672773 28.339115-28.339115 28.339115z m0-54.582732c-14.468914 0-26.243617 11.774703-26.243617 26.243617s11.774703 26.243617 26.243617 26.243617 26.243617-11.774703 26.243617-26.243617-11.774703-26.243617-26.243617-26.243617z" fill="#FFFFFF" p-id="12259"></path><path d="M776.232528 335.179887m-27.341259 0a27.341259 27.341259 0 1 0 54.682518 0 27.341259 27.341259 0 1 0-54.682518 0Z" fill="#040000" p-id="12260"></path><path d="M776.232528 363.519002c-15.666342 0-28.339115-12.772559-28.339115-28.339115 0-15.666342 12.772559-28.339115 28.339115-28.339115 15.666342 0 28.339115 12.772559 28.339115 28.339115 0 15.666342-12.772559 28.339115-28.339115 28.339115z m0-54.582732c-14.468914 0-26.243617 11.774703-26.243617 26.243617s11.774703 26.243617 26.243617 26.243617 26.243617-11.774703 26.243617-26.243617c-0.099786-14.468914-11.874488-26.243617-26.243617-26.243617z" fill="#FFFFFF" p-id="12261"></path><path d="M512.000214 671.656987c-52.58702 0-105.872539-17.961411-105.872539-52.387449S459.413194 566.882089 512.000214 566.882089s105.872539 17.961411 105.87254 52.387449S564.587234 671.656987 512.000214 671.656987z m0-74.240499c-21.952836 0-43.207172 3.592282-58.2748 9.77899-13.870201 5.68778-17.06334 11.275775-17.06334 12.07406s3.19314 6.386279 17.06334 12.07406c15.067628 6.186708 36.321965 9.77899 58.2748 9.77899s43.207172-3.592282 58.274801-9.77899c13.870201-5.68778 17.06334-11.275775 17.06334-12.07406s-3.19314-6.386279-17.06334-12.07406c-15.067628-6.286494-36.321965-9.77899-58.274801-9.77899z" fill="#040000" p-id="12262"></path></svg>`
      },
      {
        name: "2",
        icon: `<svg t="1624457767572" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1048"><path d="M0 0h1024v1024H0z" fill="#E6A6C9" p-id="1049"></path><path d="M315.1 368.1c-23.9 0-43.3-19.4-43.3-43.3s19.4-43.3 43.3-43.3 43.3 19.4 43.3 43.3-19.4 43.3-43.3 43.3z m0-74.7c-17.3 0-31.3 14.1-31.3 31.3 0 17.3 14.1 31.3 31.3 31.3 17.3 0 31.3-14.1 31.3-31.3 0-17.2-14-31.3-31.3-31.3zM738.7 368.1c-23.9 0-43.3-19.4-43.3-43.3s19.4-43.3 43.3-43.3 43.3 19.4 43.3 43.3-19.4 43.3-43.3 43.3z m0-74.7c-17.3 0-31.3 14.1-31.3 31.3 0 17.3 14.1 31.3 31.3 31.3 17.3 0 31.3-14.1 31.3-31.3 0-17.2-14-31.3-31.3-31.3zM293.5 698.8l-14.5-1.3c0.1-0.6 1.5-14.6 15.1-27.9 17.2-16.7 45-24.8 82.7-24 4.9-0.1 10.9-10.5 16.1-19.6 8.4-14.7 19-33.1 37.9-34.3 19.4-1.2 42.2 16.4 71.5 55.4 9.9 5.2 16.5 11.2 21.8 16.1 8.4 7.7 13.1 11.9 25.1 10.8 14.9-1.4 38.9-11.1 77.5-31.4 26.8-28.4 56.4-41.4 83.5-36.6 27.9 4.9 50.6 27.6 67.5 67.5l-13.4 5.7c-14.7-34.5-34.3-54.9-56.7-58.8-22.3-3.9-47.6 7.8-71.2 33.1l-0.8 0.9-1.1 0.6c-85.6 45.1-99.4 38-120.2 19.1-5.5-5-11.2-10.2-20.1-14.7l-1.5-0.8-1-1.4c-32.2-43.2-50.4-51.6-60-51-11.1 0.7-18.8 14-26.2 27-7.6 13.2-15.4 26.9-28.8 26.9h-0.2c-78.4-1.6-83 38.3-83 38.7z" fill="#040000" p-id="1050"></path></svg>`
      },
      {
        name: "3",
        icon: `<svg t="1624457776082" class="icon" viewBox="0 0 1026 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1204" ><path d="M1.1 1.097642h1021.804716v1021.804716H1.1z" fill="#F7E983" p-id="1205"></path><path d="M1024.002358 1024H0.002358V0h1024v1024z m-1021.804716-2.195284h1019.609433V2.195284H2.197642v1019.609432z" fill="#FFFFFF" p-id="1206"></path><path d="M329.174412 344.491728a38.118106 10.277919 57.6 1 0 17.355867-11.014369 38.118106 10.277919 57.6 1 0-17.355867 11.014369Z" fill="#040000" p-id="1207"></path><path d="M644.769475 355.956059a11.175989 36.321965 30 1 0 36.321965-62.911488 11.175989 36.321965 30 1 0-36.321965 62.911488Z" fill="#040000" p-id="1208"></path><path d="M569.678445 671.158059c-26.343403 0-51.190021-5.288638-70.049503-14.967843-20.755408-10.577275-32.230754-25.445332-32.230755-41.710388 0-16.265056 11.475346-31.133112 32.230755-41.710387 18.859482-9.579419 43.805886-14.967843 70.049503-14.967843s51.190021 5.288638 70.049503 14.967843c20.755408 10.577275 32.230754 25.445332 32.230754 41.710387 0 16.265056-11.475346 31.133112-32.230754 41.710388-18.859482 9.679205-43.805886 14.967843-70.049503 14.967843z m0-95.095693c-49.693237 0-84.318846 20.356266-84.318846 38.517248s34.625609 38.517248 84.318846 38.517248 84.318846-20.356266 84.318846-38.517248-34.725395-38.517248-84.318846-38.517248z" fill="#040000" p-id="1209"></path></svg>`
      },
      {
        name: "4",
        icon: `<svg t="1624457781889" class="icon" viewBox="0 0 1026 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1363" ><path d="M1.1 1.097642h1021.804716v1021.804716H1.1z" fill="#A6D9E2" p-id="1364"></path><path d="M1024.002358 1024H0.002358V0h1024v1024z m-1021.804716-2.195284h1019.609433V2.195284H2.197642v1019.609432z" fill="#FFFFFF" p-id="1365"></path><path d="M376.194134 348.950302m-23.44962 0a23.44962 23.44962 0 1 0 46.89924 0 23.44962 23.44962 0 1 0-46.89924 0Z" fill="#040000" p-id="1366"></path><path d="M629.150672 348.950302m-24.647047 0a24.647047 24.647047 0 1 0 49.294095 0 24.647047 24.647047 0 1 0-49.294095 0Z" fill="#040000" p-id="1367"></path><path d="M397.847613 603.503411c13.471058 8.282206 28.738258 14.468914 43.7061 19.458195 29.835899 9.978562 62.266225 14.169558 93.299551 7.483921 21.054765-4.490353 40.213604-14.369129 56.778016-28.039758 6.785422-5.587995-2.893783-15.167414-9.579419-9.579419-46.999026 38.916391-112.258819 31.033327-163.847983 6.086922-4.590138-2.195284-9.080491-4.490353-13.371272-7.184564-7.583707-4.590138-14.468914 7.184564-6.984993 11.774703z" fill="#040000" p-id="1368"></path><path d="M627.753674 534.052621c-31.033327 24.048334-58.474371 68.253362-37.419607 106.970182 10.577275 19.35841 29.835899 32.629897 48.795167 42.708244 7.982849 4.190996 15.067628-7.883064 7.084779-12.07406-25.245761-13.271487-53.485091-35.324108-49.094524-66.557006 2.793997-20.156695 15.766127-37.319821 29.736114-51.190022 3.392711-3.392711 6.984993-6.785422 10.776847-9.77899 2.993569-2.295069 2.394855-7.483921 0-9.878776-2.893783-3.19314-6.885208-2.49464-9.878776-0.199572z" fill="#040000" p-id="1369"></path></svg>`
      },
      {
        name: "5",
        icon: `<svg t="1624457787809" class="icon" viewBox="0 0 1026 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1523" ><path d="M1.1 1.097642h1021.804716v1021.804716H1.1z" fill="#AD6F59" p-id="1524"></path><path d="M1024.002358 1024H0.002358V0h1024v1024z m-1021.804716-2.195284h1019.609433V2.195284H2.197642v1019.609432z" fill="#FFFFFF" p-id="1525"></path><path d="M411.829832 330.730879a38.118106 10.277919 57.6 1 0 17.355867-11.014368 38.118106 10.277919 57.6 1 0-17.355867 11.014368Z" fill="#040000" p-id="1526"></path><path d="M480.669675 609.989476c11.774703-25.844475 27.740401-51.788735 44.60417-73.342429 13.770415-17.462483 29.237186-33.92711 47.897096-44.803742 17.262912-10.078347 35.324108-13.67063 54.283376-6.58585 11.974274 4.390567 23.948548 14.468914 33.128825 24.547261 14.369129 15.865913 25.145975 34.625609 34.725394 53.684662 4.290782 8.581563 17.262912 0.997856 12.972131-7.583707-15.167414-30.334828-35.224323-63.763009-66.157864-80.327421-21.054765-11.37556-44.504385-11.475346-66.157864-1.895927-21.054765 9.280062-38.617034 25.644904-53.485091 42.907815-14.468914 16.863769-27.041902 35.324108-38.217891 54.582733-5.887351 10.178133-11.674917 20.555837-16.464627 31.232898-1.696355 3.692068-0.997856 7.982849 2.694212 10.277918 3.19314 1.895927 8.581563 0.898071 10.178133-2.694211z" fill="#040000" p-id="1527"></path><path d="M663.863649 338.091735a14.468914 33.727538 30 1 0 33.727538-58.417811 14.468914 33.727538 30 1 0-33.727538 58.417811Z" fill="#040000" p-id="1528"></path></svg>`
      },
      {
        name: "6",
        icon: `<svg t="1624457794933" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1680" ><path d="M762.9 77.4H261.1L10.2 512l250.9 434.6h501.8L1013.8 512z" fill="#83CEE3" p-id="1681"></path><path d="M369 375.8m-34.6 0a34.6 34.6 0 1 0 69.2 0 34.6 34.6 0 1 0-69.2 0Z" fill="#040000" p-id="1682"></path><path d="M369 411.7c-19.8 0-36-16.1-36-36s16.1-36 36-36 36 16.1 36 36-16.1 36-36 36z m0-69.1c-18.3 0-33.2 14.9-33.2 33.2S350.7 409 369 409s33.2-14.9 33.2-33.2-14.9-33.2-33.2-33.2z" fill="#FFFFFF" p-id="1683"></path><path d="M672.2 333.6c-15.1 7.6-30.2 15.6-44.3 25-5.9 3.9-17 10.4-14.6 19.1 1.8 6.5 12 11.2 17.3 14.3 15.7 9.3 32.1 17.6 48.3 25.9 8.6 4.4 16.2-8.5 7.6-13-14.1-7.3-28.3-14.5-42.1-22.3-3.9-2.2-7.9-4.5-11.7-6.9-1.2-0.8-2.4-1.5-3.5-2.4-0.6-0.4-1.1-0.8-1.6-1.2 2.2 1.7-0.3-0.3-0.3-0.3-0.9 0.1-1.5-3.2-0.2 0.5 0.9 2.4 1.1 3.8 0.3 5.8 0.6-1.5-0.9 0.8-0.1 0 0.5-0.5 1-1.1 1.6-1.6 0.5-0.5 1-0.9 1.6-1.3 0.6-0.5 0 0 1.2-0.9 1.7-1.3 3.5-2.5 5.3-3.6 8.4-5.5 17.2-10.4 26-15.2 5.6-3 11.2-6 16.8-8.9 8.6-4.4 1-17.3-7.6-13zM578.2 720.9c-12.5-96.7-33.3-154.7-55.6-155.6-8.8 3.9-22.3 17.5-37.7 60.1-10.8 29.8-18.4 62.2-23 81.6-1.2 5.1-2.1 9.1-2.9 11.8l-9.3-2.4c0.7-2.6 1.6-6.6 2.8-11.6 14.9-63 36-136.8 67.5-148.8l0.8-0.3h0.8c18.2-0.4 33.2 19.5 45.8 60.8 10.2 33.3 16.7 74.6 20.5 103.3l-9.7 1.1z" fill="#040000" p-id="1684"></path></svg>`
      },
      {
        name: "7",
        icon: `<svg t="1624457802025" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1838" ><path d="M762.9 77.4H261.1L10.2 512l250.9 434.6h501.8L1013.8 512z" fill="#8CC66D" p-id="1839"></path><path d="M375.778679 404.47473a14.5 33.8 30 1 0 33.8-58.543317 14.5 33.8 30 1 0-33.8 58.543317Z" fill="#040000" p-id="1840"></path><path d="M627.220263 374.211388a43.1 11.6 57.6 1 0 19.588408-12.431182 43.1 11.6 57.6 1 0-19.588408 12.431182Z" fill="#040000" p-id="1841"></path><path d="M451.1 548.5c17.6-9.3 63.9-30 105.3-16.2 17 20.3 32.7 98.8 28.8 138.1-27.5 10.2-82.5 10.2-106.1 5.8-8.3-10.5-32.7-81.8-35.3-114.6-0.4-5.5 2.5-10.6 7.3-13.1z" fill="#040000" p-id="1842"></path></svg>`
      },
      {
        name: "8",
        icon: `<svg t="1624457816632" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1996" ><path d="M762.9 77.4H261.1L10.2 512l250.9 434.6h501.8L1013.8 512z" fill="#5A74B8" p-id="1997"></path><path d="M357.7 400m-34.6 0a34.6 34.6 0 1 0 69.2 0 34.6 34.6 0 1 0-69.2 0Z" fill="#040000" p-id="1998"></path><path d="M357.7 436c-19.8 0-36-16.1-36-36s16.1-36 36-36 36 16.1 36 36-16.2 36-36 36z m0-69.2c-18.3 0-33.2 14.9-33.2 33.2s14.9 33.2 33.2 33.2 33.2-14.9 33.2-33.2-14.9-33.2-33.2-33.2z" fill="#FFFFFF" p-id="1999"></path><path d="M676 400m-34.6 0a34.6 34.6 0 1 0 69.2 0 34.6 34.6 0 1 0-69.2 0Z" fill="#040000" p-id="2000"></path><path d="M676 436c-19.8 0-36-16.1-36-36s16.1-36 36-36 36 16.1 36 36-16.2 36-36 36z m0-69.2c-18.3 0-33.2 14.9-33.2 33.2s14.9 33.2 33.2 33.2c18.3 0 33.2-14.9 33.2-33.2s-14.9-33.2-33.2-33.2z" fill="#FFFFFF" p-id="2001"></path><path d="M347.6 684.1c0.3-0.9 0.6-1.7 0.9-2.6 0.2-0.5 1.4-3.2 0.3-0.8 0.6-1.4 1.3-2.9 2-4.3 3.2-6.3 6-10.7 10.9-15.3 4.3-4 10.8-7.5 17.1-6.1 3.9 0.9 7.9 4.9 11.1 7.2 3.1 2.2 6.3 4.5 9.7 6.2 7.5 3.8 15.3 4.4 23.4 1.9 4.7-1.5 9.2-3.6 13.6-5.9 5-2.6 10.7-5 14.2-9.5 4.5-5.7 6.1-8.5 11.4-14.1 1-1 2-2 3.1-3 0.2-0.2 2.2-1.7 0.6-0.5 0.6-0.4 1.2-0.9 1.8-1.3 1-0.6 2.1-1.3 3.2-1.7-2 0.8 0.2 0 0.6-0.1 2.3-0.7-0.3-0.2 1.2-0.3 2.8-0.1 3.6 0 5.5 1 3.8 1.9 6.6 4.7 9.5 7.8 4.5 5 7.5 11.1 11.7 16.2 1.8 2.2 3.7 4.3 5.4 6.5 8.1 10.3 17.7 22.2 32.2 22 8.8-0.1 16.6-5.2 22.6-11.2 4.2-4.1 7.7-8.9 11-13.7 2.9-4.2 4.6-9.9 6.2-13.5 3.2-7.1 7.2-13.1 13-18.1 4.8-4.2 11.1-6.5 16.7-5.3 10.5 2.4 17.2 12.1 23.1 20.2 4.7 6.5 9.8 13 16 18.2 7.8 6.4 17.1 11.4 27.5 11.1 14.1-0.4 25.5-9.5 34.2-19.9 3-3.6 3.6-8.8 0-12.4-3.1-3.1-9.4-3.7-12.4 0-6.3 7.6-14.7 15.9-24.9 14.7-2.2-0.3-5.3-1.5-7.9-3.1-3.5-2.1-6.1-4.4-9.1-7.5-4.9-5.1-6.8-8.1-10.9-13.8-7.3-10.1-16.1-19.6-28.2-23.7-18.5-6.3-35.7 5.6-46 20.1-2.4 3.3-4.4 6.9-6.1 10.6-1.8 3.9-2.7 8.5-5.2 11.9-3.1 4.4-6.2 8.8-10.2 12.5-3 2.8-5.7 4.4-8.6 5.1-0.4 0.1-1.7 0.1 0.1 0h-2.2c2.1 0.1 0 0-0.5-0.1-0.7-0.2-1.4-0.4-2-0.6 1.8 0.7-1.8-1.1-2.4-1.5l-1.2-0.9c1.5 1.2-0.9-0.9-1.2-1.1-4.7-4.3-8.4-9.5-12.3-14.4-10.9-13.6-20.9-34-41-34.9-14.2-0.6-24.5 10.6-32.4 20.8-1.2 1.6-2.5 3.2-3.7 4.8-1.5 1.9 1.1-1.4-0.4 0.5-0.4 0.5-0.8 1.2-1.3 1.6-1.7 1.4-4.6 2.6-6.6 3.6-2.9 1.6-5.9 3.2-9 4.5-1.6 0.7-3.4 1.2-5.1 1.7-2.2 0.6-0.7 0.5-2.8 0.4-2.8 0-3.9-0.4-6.6-1.9-3.9-2.2-7.5-4.9-11.1-7.5-5.6-4-10-6.9-17-7.5-10.5-0.9-20.3 3.2-28.2 9.9-9.4 8.1-16.4 20.2-20.1 32-3.6 11.2 13.3 15.8 16.8 5.1z" fill="#040000" p-id="2002"></path></svg>`
      },
      {
        name: "9",
        icon: `<svg t="1624457826949" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2156" ><path d="M762.9 77.4H261.1L10.2 512l250.9 434.6h501.8L1013.8 512z" fill="#F0884F" p-id="2157"></path><path d="M287.2 382c6.4 2.3 11.6-3.7 15.4-7.9 5.1-5.5 10.2-11 16-15.9 0.8-0.7 1.7-1.4 2.5-2.1 1.2-0.9-1.7 1.3 0.2-0.2l1.2-0.9c2.1-1.5 4.3-2.9 6.5-4.3 2-1.2 4-2.2 6.1-3.2 0.6-0.3 1.2-0.6 1.9-0.9-0.3 0.2-1.5 0.6 0.2-0.1 1.3-0.5 2.6-1 4-1.5 11.2-3.7 21.8-4 33.4-1.1 19.5 4.9 36.4 17 51.2 30.2 8.6 7.7 21.4-5 12.7-12.7-25.2-22.6-57.1-42.1-92.2-36.2-20.4 3.4-37.7 16.1-51.6 30.9-2.3 2.4-4.5 5-6.8 7.4-0.7 0.7-1.9 1.5-2.4 2.4-0.5 0.8 2.3-1.5 0.8-0.7 1.3-0.7 3.9-1.4 5.8-0.7-11.1-3.7-15.8 13.7-4.9 17.5zM598 382c6.4 2.3 11.6-3.7 15.4-7.9 5.1-5.5 10.2-11 16-15.9 0.8-0.7 1.7-1.4 2.5-2.1 1.2-0.9-1.7 1.3 0.2-0.2l1.2-0.9c2.1-1.5 4.3-2.9 6.5-4.3 2-1.2 4-2.2 6.1-3.2 0.6-0.3 1.2-0.6 1.9-0.9-0.3 0.2-1.5 0.6 0.2-0.1 1.3-0.5 2.6-1 4-1.5 11.2-3.7 21.8-4 33.4-1.1 19.5 4.9 36.4 17 51.2 30.2 8.6 7.7 21.4-5 12.7-12.7-25.2-22.6-57.1-42.1-92.2-36.2-20.4 3.4-37.7 16.1-51.6 30.9-2.3 2.4-4.5 5-6.8 7.4-0.7 0.7-1.9 1.5-2.4 2.4-0.5 0.8 2.3-1.5 0.8-0.7 1.3-0.7 3.9-1.4 5.8-0.7-11.1-3.7-15.8 13.7-4.9 17.5zM505.9 527.1c3.4 0.7 6.8 1.7 10.2 2.8 6.7 2.2 10.4 3.5 16.6 7.7 1.6 1.1-0.5-0.5 0.6 0.5 0.6 0.5 1.1 1.1 1.7 1.6 1.5 1.4-0.1-0.4 0.5 0.6 0.4 0.6 0.7 1.2 1 1.8-1-2 0.1 0 0 0.5 0.1-2-0.1 0-0.1 0-0.1 0.8 0 0.7 0.1-0.5-0.1 0.4-0.1 0.7-0.3 1.1-0.6 1 0.7-0.9-0.4 1-1.6 2.5-4.6 5.4-8.1 7.8-6.8 4.6-14.4 8.2-22 11.4-7 3-7.4 11.9 0 14.8 7.4 2.8 15 5.3 22.4 8.1 3.1 1.1 4.2 1.5 6.9 2.9 1.1 0.6 2.1 1.2 3.2 1.8 1.2 0.8-0.7-0.5 0.1 0 0.4 0.3 0.8 0.7 1.1 1.1 0.6 0.8-1.1-1.2-0.2-0.2 0.8 0.9-0.3-1.4-0.1-0.2 0.1 0.9 0.2-1.9 0-0.9-0.1 0.5-0.8 1.8 0 0.2-0.2 0.5-0.5 1-0.8 1.4-0.3 0.3-0.9 1.3-0.3 0.5-0.5 0.7-1.1 1.3-1.7 1.9-6.9 7.3-15.9 12.8-24.4 18.1-8.3 5.3-0.6 18.5 7.7 13.2 9.9-6.3 20.9-12.8 28.6-21.8 4.8-5.5 8.1-12.9 4.2-19.9-3.4-6-10.5-8.9-16.6-11.4-8.6-3.5-17.5-6.2-26.2-9.5v14.8c14.4-6.1 47.2-18.8 41.2-40.3-3.5-12.9-19.4-18.9-30.8-22.6-3.4-1.1-6.9-2.1-10.5-2.9-9.1-2.2-13.3 12.5-3.6 14.6z" fill="#040000" p-id="2158"></path></svg>`
      },
      {
        name: "10",
        icon: `<svg t="1624457835383" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2312" ><path d="M762.9 77.4H261.1L10.2 512l250.9 434.6h501.8L1013.8 512z" fill="#F6F180" p-id="2313"></path><path d="M342.9 400.6m-29.5 0a29.5 29.5 0 1 0 59 0 29.5 29.5 0 1 0-59 0Z" fill="#040000" p-id="2314"></path><path d="M342.9 431.3c-16.9 0-30.7-13.8-30.7-30.7s13.8-30.7 30.7-30.7 30.7 13.8 30.7 30.7-13.7 30.7-30.7 30.7z m0-59c-15.6 0-28.3 12.7-28.3 28.3s12.7 28.3 28.3 28.3 28.3-12.7 28.3-28.3-12.6-28.3-28.3-28.3z" fill="#FFFFFF" p-id="2315"></path><path d="M702 400.6m-29.5 0a29.5 29.5 0 1 0 59 0 29.5 29.5 0 1 0-59 0Z" fill="#040000" p-id="2316"></path><path d="M702 431.3c-16.9 0-30.7-13.8-30.7-30.7s13.8-30.7 30.7-30.7 30.7 13.8 30.7 30.7-13.8 30.7-30.7 30.7z m0-59c-15.6 0-28.3 12.7-28.3 28.3s12.7 28.3 28.3 28.3 28.3-12.7 28.3-28.3-12.7-28.3-28.3-28.3z" fill="#FFFFFF" p-id="2317"></path><path d="M358.7 519.9c20 22 45.5 40.4 71.3 54.8 51.2 28.5 111.7 39.9 168 19.5 44.3-16.1 80.7-47.8 110.2-83.9 3-3.7 3.6-8.9 0-12.5-3.1-3.1-9.5-3.7-12.5 0-25.5 31.4-56.2 59.7-93.7 76-27.1 11.7-56.6 15.7-85.8 12.2-24.7-2.9-49.5-11.8-71.5-23.4-18.7-9.8-36.6-22.2-51.1-34.3-7.8-6.5-15.5-13.3-22.4-20.9-7.7-8.5-20.1 4.1-12.5 12.5z" p-id="2318"></path></svg>`
      },
      {
        name: "11",
        icon: `<svg t="1624457841751" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2472" ><path d="M48.2 844.9c-68.5-210.6 186-782.1 409.1-795.4 6.3-0.4 12.5 0.2 18.6 1.6C665.1 94.6 985.4 515 987.1 821.3c0.1 20-12.9 37.9-22.4 43.1-162.7 89.8-605.8 179.7-884.4 30.9-15-7.9-24.2-26.1-32.1-50.4z" fill="#F0884F" p-id="2473"></path><path d="M401 352.1m-52.4 0a52.4 52.4 0 1 0 104.8 0 52.4 52.4 0 1 0-104.8 0Z" fill="#FFFFFF" p-id="2474"></path><path d="M408.7 329m-29.3 0a29.3 29.3 0 1 0 58.6 0 29.3 29.3 0 1 0-58.6 0Z" fill="#040000" p-id="2475"></path><path d="M527.5 352.1m-52.4 0a52.4 52.4 0 1 0 104.8 0 52.4 52.4 0 1 0-104.8 0Z" fill="#FFFFFF" p-id="2476"></path><path d="M527.5 329m-29.3 0a29.3 29.3 0 1 0 58.6 0 29.3 29.3 0 1 0-58.6 0Z" fill="#040000" p-id="2477"></path><path d="M450.7 517c1.1-8.2 3.2-16.4 6.1-24.1 0.1-0.3 1-2.5 0.5-1.4s0.3-0.7 0.5-1c0.7-1.4 1.4-2.8 2.2-4.1 0.4-0.8 2.8-3.9 1.3-2.1 0.8-1 1.7-1.9 2.6-2.8 1-1-1.5 1 0.1 0 0.5-0.3 1-0.6 1.5-0.8-1.3 0.7-1.2 0.3 0 0.1 1.9-0.3-1.8 0.3 0.1 0 1.2-0.2 1.5 0.3 0-0.1 0.6 0.2 1.3 0.3 1.9 0.5 0.3 0.1-1.3-0.7 0.2 0.1 0.8 0.5 1.6 0.9 2.4 1.4 1.4 1 0-0.1 1.4 1.1 0.9 0.8 1.8 1.7 2.6 2.6 1.8 1.9 3.5 3.9 5 6.1 5.1 7.1 9.3 14.8 13.2 22.6 3.5 6.9 13.7 4.7 15.8-2.1 2.6-8.7 4.8-17.4 7.4-26.1 0.9-3.2 1.9-6.4 3.2-9.4-0.7 1.6 0.8-1.6 1.2-2.2l0.9-1.5c0.7-1.2-1.4 0.7 0.1-0.1 1.7-0.9-1.2 0.3-0.3 0.1 0.8-0.2 1-1.2 0.3-0.3-0.6 0.8 0.6 0-0.5 0.2-2 0.3 2.4 0.5-1.1 0 0.5 0.1 1.2 0.2 1.6 0.4-1.1-0.8-0.8-0.4 0.2 0.2 0.7 0.4 3.4 2.3 2.7 1.8 8.9 7.1 15.9 16.9 22.5 26 2.8 3.8 7.5 5.6 11.8 3.1 3.7-2.2 5.9-8 3.1-11.8-8.2-11.1-16.6-23-27.7-31.4-6.3-4.7-14.5-7.6-21.7-3-6.7 4.2-9.6 12.5-11.9 19.6-3.2 9.9-5.5 20-8.6 29.9 5.3-0.7 10.5-1.4 15.8-2.1-7.8-15.5-24.8-50.1-48-41.7-14.1 5.1-19.7 23-22.9 36.2-0.9 3.8-1.8 7.7-2.3 11.6-0.6 4.6 1.1 9.3 6 10.6 4.2 1 10.2-1.5 10.8-6.1z" fill="#040000" p-id="2478"></path></svg>`
      },
      {
        name: "12",
        icon: `<svg t="1624457847424" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2632" ><path d="M485.538528 993.072489a362.00362 481.804818 3.149 1 0 52.933731-962.15464 362.00362 481.804818 3.149 1 0-52.933731 962.15464Z" fill="#AADCF0" p-id="2633"></path><path d="M688.2 334.1c-15.1 7.6-30.2 15.6-44.3 25-5.9 3.9-17 10.4-14.6 19.1 1.8 6.5 12 11.2 17.3 14.3 15.7 9.3 32.1 17.6 48.3 25.9 8.6 4.4 16.2-8.5 7.6-13-14.1-7.3-28.3-14.5-42.1-22.3-3.9-2.2-7.9-4.5-11.7-6.9-1.2-0.8-2.4-1.5-3.5-2.4-0.6-0.4-1.1-0.8-1.6-1.2 2.2 1.7-0.3-0.3-0.3-0.3-0.9 0.1-1.5-3.2-0.2 0.5 0.9 2.4 1.1 3.8 0.3 5.8 0.6-1.5-0.9 0.8-0.1 0 0.5-0.5 1-1.1 1.6-1.6 0.5-0.5 1-0.9 1.6-1.3 0.6-0.5 0 0 1.2-0.9 1.7-1.3 3.5-2.5 5.3-3.6 8.4-5.5 17.2-10.4 26-15.2 5.6-3 11.2-6 16.8-8.9 8.6-4.4 1-17.4-7.6-13zM375.8 347c13.4 6.8 26.7 14 39.5 21.9 1.8 1.2 3.7 2.3 5.5 3.5 0.9 0.6 1.7 1.2 2.6 1.8 0.9 0.6 1.9 1.4 1.6 1.1 1.1 0.9 2.1 1.9 3.1 2.8 1.2 1 0-0.3 0.1 0 0-0.2-0.8-2.4-0.3-4.1 1.5-5.5 2.3-2.7 0.8-2-0.4 0.2-0.9 0.8-1.3 1.1 1.7-1.4-1.6 1.1-2.3 1.6-3.4 2.3-6.9 4.4-10.4 6.4-14.9 8.6-30.3 16.4-45.6 24.3-8.6 4.4-1 17.4 7.6 13 15-7.7 30.1-15.4 44.8-23.8 6.2-3.6 13.8-7.3 18.7-12.7 7.6-8.3-3.8-16.6-9.9-20.9-8.7-6.1-18-11.3-27.3-16.4-6.5-3.6-13-7.1-19.6-10.4-8.6-4.5-16.3 8.5-7.6 12.8zM412.8 570.9c13.5 7.7 28.5 13.3 43.3 17.9 29.8 9.2 61.7 13.1 92.6 7.3 20.6-3.9 40-12.5 56.6-25.2 2.8-2.2 4.3-5.6 2.3-9-1.6-2.8-6.2-4.5-9-2.3-48.3 36.9-113.3 30-165.6 6.7-4.6-2.1-9.2-4.2-13.7-6.7-7.3-4.2-13.9 7.2-6.5 11.3z" fill="#040000" p-id="2634"></path><path d="M644.6 505.2c-30.1 21.5-60.6 62.5-39.1 99.8 10.7 18.6 30.3 30.9 49.1 40.1 7.8 3.8 14.6-7.9 6.8-11.7-23.6-11.5-53.7-31.4-49.4-60.9 2.8-18.9 15.8-34.6 29.5-47.2 2.5-2.3 5.1-4.6 7.8-6.7 0.5-0.4 0.9-0.7 1.4-1.1-0.4 0.3-1.2 0.9-0.1 0.1l0.9-0.6c6.9-5.1 0.2-16.8-6.9-11.8z" fill="#040000" p-id="2635"></path></svg>`
      },
      {
        name: "13",
        icon: `<svg t="1624457855182" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2789" ><path d="M235.1 76.9c75.6-26.5 297.3-90.1 514.2-16.6 16.3 5.5 29.8 17.4 37.1 33 57.5 122.4 127.1 602.1 62.1 785.6a62.58 62.58 0 0 1-32.5 35.8c-109.5 51.8-428.1 136.7-609.3 37.2-14.4-7.9-25-21.3-29.7-37.1-41.9-140.6-37-627.7 19.1-798 6.1-18.7 20.5-33.4 39-39.9z" fill="#F9DABD" p-id="2790"></path><path d="M392.2 360.2m-35.2 0a35.2 35.2 0 1 0 70.4 0 35.2 35.2 0 1 0-70.4 0Z" fill="#040000" p-id="2791"></path><path d="M618.6 360.2m-35.2 0a35.2 35.2 0 1 0 70.4 0 35.2 35.2 0 1 0-70.4 0Z" fill="#040000" p-id="2792"></path><path d="M512 562.6c-36 0-65.3-29.3-65.3-65.3S476 432 512 432s65.3 29.3 65.3 65.3-29.3 65.3-65.3 65.3z m0-122.9c-31.7 0-57.6 25.8-57.6 57.6s25.8 57.6 57.6 57.6c31.7 0 57.6-25.8 57.6-57.6s-25.9-57.6-57.6-57.6z" fill="#040000" p-id="2793"></path></svg>`
      },
      {
        name: "14",
        icon: `<svg t="1624457863444" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2947" ><path d="M178.1 971.5c38.1 15.9 98.7 26.6 171.3-12.3 3.7-2 8.4-1.6 11.6 1.1 43.3 35.9 123.3 80.8 236 10.9 3.8-2.4 8.7-2.4 12.6-0.2 41.8 23.9 191.6 58.2 246.6 14.2 4.4-3.5 9.1-6.6 14.5-8.5C1065 909.5 678.2-652 194.3 351c-37.5 77.8-38.4 94.1-71.9 211.3-27.6 96.3-29.1 231.3 1.4 348.1 7.2 27.3 27.3 49.9 54.3 61.1z" fill="#ABAAAA" p-id="2948"></path><path d="M468.9 349H418c-6.1 0-11.1-5-11.1-11.1V336c0-6.1 5-11.1 11.1-11.1h50.9c6.1 0 11.1 5 11.1 11.1v1.9c0 6.1-5 11.1-11.1 11.1zM643 471.9H390c-6.6 0-12-5.4-12-12s5.4-12 12-12h253c6.6 0 12 5.4 12 12s-5.4 12-12 12zM609 349h-61.2c-6 0-11-4.9-11-11v-2.1c0-6 4.9-11 11-11H609c6 0 11 4.9 11 11v2.1c0 6.1-4.9 11-11 11z" fill="#040000" p-id="2949"></path></svg>`
      },
      {
        name: "15",
        icon: `<svg t="1624457870536" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3103" ><path d="M673.1 318.7c3.7-17.5 5.6-35.7 5.6-54.4 0-137.9-105.5-249.7-235.6-249.7S207.4 126.4 207.4 264.3c0 55.4 17.1 106.7 45.9 148.1-55.2 63.3-88.6 145.9-88.6 236.3 0 199.2 162.1 360.6 362.1 360.6 200 0 362.1-161.5 362.1-360.6 0.1-147.3-88.7-274-215.8-330z" fill="#4F8A54" p-id="3104"></path><path d="M392 246.2m-47.1 0a47.1 47.1 0 1 0 94.2 0 47.1 47.1 0 1 0-94.2 0Z" fill="#FFFFFF" p-id="3105"></path><path d="M386 252.8m-26.4 0a26.4 26.4 0 1 0 52.8 0 26.4 26.4 0 1 0-52.8 0Z" fill="#040000" p-id="3106"></path><path d="M505.6 246.2m-47.1 0a47.1 47.1 0 1 0 94.2 0 47.1 47.1 0 1 0-94.2 0Z" fill="#FFFFFF" p-id="3107"></path><path d="M501.4 252.8m-26.4 0a26.4 26.4 0 1 0 52.8 0 26.4 26.4 0 1 0-52.8 0Z" fill="#040000" p-id="3108"></path><path d="M474.3 364.8h-50.9c-6.1 0-11.1-5-11.1-11.1v-1.9c0-6.1 5-11.1 11.1-11.1h50.9c6.1 0 11.1 5 11.1 11.1v1.9c0 6.2-5 11.1-11.1 11.1z" fill="#040000" p-id="3109"></path></svg>`
      },
      {
        name: "16",
        icon: `<svg t="1624457876371" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3263" ><path d="M246.4 227.6c-166.9 101.1-461.9 344 87 564.1 1.5 0.6 2.9 1.1 4.4 1.6 80.7 27.7 392.8 165.4 641-198.1 40-58.6 38.5-136.2-3.7-193.3C892 289.5 727 201.1 429.1 182.7c-64.1-4-127.8 11.6-182.7 44.9z" fill="#CF92BE" p-id="3264"></path><path d="M617.1 393.4c-17.4 8.8-34.9 18.1-51.2 28.9-6.9 4.6-20.3 12.3-17.4 22.6 1.2 4.3 5.6 7 9 9.5 3.7 2.7 7.6 5 11.5 7.3 18.2 10.8 37.1 20.3 55.9 30 10 5.1 18.9-10 8.8-15.1-16.4-8.4-32.9-16.9-49-26-4.5-2.6-9.1-5.2-13.5-8l-4.5-3c-0.7-0.5-1.3-1-2-1.5 1.6 1.2 0.7 0.4-0.2-0.2-1.3-0.9-0.3-0.9-0.5-0.3 0.2 0.2 0.4 0.5 0.6 0.7 1 1.9 1.3 3.7 0.8 5.7 0.1-0.6 0.7-1.4-0.6 1.3 0.7-1.5-0.1 0-0.2 0.1 0.6-0.6 1.2-1.3 1.9-1.9l1.8-1.5c1.8-1.6-0.6 0.3 1.2-0.9 2-1.5 4.1-2.9 6.2-4.3 10-6.5 20.4-12.4 30.9-18 6.5-3.5 13.1-7 19.7-10.4 9.6-5 0.8-20.1-9.2-15zM323.1 408.5c15.9 8.1 31.7 16.5 46.8 26 2.2 1.4 4.3 2.8 6.5 4.2 1 0.7 1.9 1.3 2.8 2 0.5 0.3 1 0.7 1.4 1.1-1.1-0.9-0.3-0.3 0.3 0.3 1.1 1 2.2 2.2 3.3 3.1 1.4 1.1-1-1.7-0.1-0.1-0.6-1.1-0.9-4.1 0.3-6.7 2.2-4.8 0.7 0.1 0-0.5 0 0-1.1 0.9-1.3 1 2.3-1.9 0 0-0.5 0.4-0.8 0.5-1.5 1.1-2.3 1.6-4 2.7-8.1 5.1-12.3 7.5-17.3 10-35.1 19.1-52.8 28.2-10 5.1-1.2 20.2 8.8 15.1 17.5-9 35-17.9 52-27.7 7.3-4.2 15.9-8.6 21.8-14.7 9.3-9.7-4.3-19.7-11.5-24.7-10.1-7.1-20.9-13.1-31.7-19-7.6-4.2-15.2-8.2-22.9-12.1-9.7-5.2-18.6 9.9-8.6 15zM513 592.1c-12.2 0-24.6-1.4-36.3-4.3-8-2-13.9-8.2-15.4-16.2s1.7-15.8 8.4-20.5c23.2-16.3 60.5-31.9 106.2-13 6.4 2.6 11 8.3 12.3 15.1 1.3 6.7-0.8 13.6-5.7 18.3-13.5 13.1-40.9 20.6-69.5 20.6z m-37.4-32.5c-3.4 2.4-4.9 6.2-4.2 10.2 0.8 4.1 3.6 7.1 7.7 8.1 39.1 9.7 81.2 0.7 96.1-13.7 2.4-2.3 3.4-5.6 2.7-8.9-0.7-3.4-2.9-6.2-6.1-7.5-41.2-17.2-75.1-3.1-96.2 11.8z" fill="#040000" p-id="3265"></path></svg>`
      },
      {
        name: "17",
        icon: `<svg t="1624457881793" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3419" ><path d="M1008.6 465.7c0-124.9-95.5-226.2-213.4-226.2-12 0-23.8 1.1-35.2 3.1v-3.1c0-124.9-95.5-226.2-213.4-226.2S333.4 114.6 333.4 239.5c0 2.4 0 4.8 0.1 7.2-17.1-4.7-35-7.2-53.4-7.2-117.8 0-213.4 101.3-213.4 226.2 0 92.1 51.9 171.3 126.3 206.6-13.7 29.9-21.4 63.4-21.4 98.8 0 124.9 95.5 226.2 213.4 226.2 68.8 0 130-34.5 169-88.1 39 53.6 100.2 88.1 169 88.1 117.8 0 213.4-101.3 213.4-226.2 0-41.2-10.4-79.9-28.6-113.1 60.5-39.9 100.8-111.1 100.8-192.3z" fill="#8CC66D" p-id="3420"></path><path d="M437.8 400.7m-24.7 0a24.7 24.7 0 1 0 49.4 0 24.7 24.7 0 1 0-49.4 0Z" fill="#040000" p-id="3421"></path><path d="M649.7 400.7m-24.7 0a24.7 24.7 0 1 0 49.4 0 24.7 24.7 0 1 0-49.4 0Z" fill="#040000" p-id="3422"></path><path d="M527.3 625.9c6.3-14.2 13.1-28.3 17.9-43 6.2-19 8.3-38.6 10.5-58.3l2.1-19.2c0.7-6.2-9-6.1-9.7 0-1.7 16.3-2.8 32.8-5.7 48.9-4.2 23.7-13.8 45-23.5 66.7-2.5 5.6 5.9 10.5 8.4 4.9z" fill="#252525" p-id="3423"></path><path d="M447.7 522.3c20.3-0.1 40.6-0.2 61-0.4l96.6-0.6c7.5 0 14.9-0.1 22.4-0.1 16.6-0.1 16.7-25.9 0-25.8-20.3 0.1-40.6 0.2-61 0.4l-96.6 0.6c-7.5 0-14.9 0.1-22.4 0.1-16.6 0.1-16.7 25.9 0 25.8z" fill="#040000" p-id="3424"></path><path d="M495.4 508.2c-10.3 3.8-9.2 20.9-9.2 29.5 0.1 16 2.1 32.3 6.1 47.8 3.5 13.7 8.7 29.9 20.6 38.7 12.9 9.5 27.6 2.1 37.6-7.9 10.2-10.3 17.8-23 24.7-35.6 11.6-21.3 20.9-43.8 29.7-66.4 3-7.8-9.5-11.1-12.5-3.4-7.4 19.1-15.3 38.1-24.7 56.4-5.9 11.5-12.2 23-20.3 33.1-2.8 3.5-5.8 6.9-9.2 9.8-1.9 1.7-1.4 1.3-3.3 2.5-1.3 0.8-2.6 1.6-3.9 2.2-0.7 0.3 1-0.2-0.8 0.3-0.6 0.2-1.2 0.3-1.8 0.5-1.1 0.3-1.2 0.2-0.5 0.1-0.6 0-1.3 0-1.9 0.1-2.2 0.1 0.6 0.5-1.8-0.2l-1.8-0.6c1.5 0.5 0.2 0.1-0.5-0.3-0.8-0.5-2.9-2.1-1.7-1.1-1-0.9-2-1.7-2.8-2.7-0.4-0.5-0.9-1-1.3-1.5 0.4 0.5 0.1 0.2-0.5-0.7-0.8-1.3-1.7-2.5-2.4-3.9-0.7-1.3-1.4-2.5-2-3.8-0.4-0.8-0.8-1.6-1.1-2.4-0.1-0.2-0.5-1.1 0 0l-0.6-1.5a86.8 86.8 0 0 1-3.3-9.8c-4.4-14.9-6.2-27.9-6.8-42.8-0.3-6.6-0.3-13.1 0.4-19.7 0.2-1.5-0.3 1.5 0.1-0.5l0.3-1.8c0.2-0.9 0.5-1.8 0.7-2.8 0.4-1.9-0.7 1.1 0.3-0.7 0.5-1-1.3 1.2-0.3 0.5-0.3 0.3-1.1 0.8-2 1.1 7.7-2.9 4.3-15.4-3.5-12.5z" fill="#040000" p-id="3425"></path></svg>`
      },
      {
        name: "18",
        icon: `<svg t="1624457899440" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3579" ><path d="M75.4 739.8c-78.7-134.4-194-455.7 401.4-579.6 9.8-2 19.2-6.2 29.2-7.5C656.8 133 947.3 205 1000.1 578.4c42.6 223.8 29.7 392.1-822 233.6-43.1-8-80.6-34.4-102.7-72.2z" fill="#F09495" p-id="3580"></path><path d="M704.6 875.4c-129 0-301.8-20.5-526.6-62.3-43.5-8.1-81.2-34.6-103.5-72.7-19.3-32.9-44.8-84.3-57.1-142.5-13.9-65.1-8.8-125.3 15.1-179.2 54.3-122.3 203.7-209.6 444-259.6 4.1-0.9 8.3-2.1 12.3-3.4 5.5-1.7 11.1-3.4 16.9-4.2 29-3.8 75.7-5.9 133.8 5.7 54.5 10.9 105.3 31 150.8 59.9C843.7 251 888.2 296 922.7 351c39.7 63.1 66.1 139.6 78.5 227.3 8.1 42.4 15.2 87.3 12.5 127.9-2.8 42.6-16.4 75.5-41.5 100.7-42.5 42.7-120.3 65-237.8 68.1-9.6 0.2-19.6 0.4-29.8 0.4zM76.3 739.3c22 37.6 59.2 63.7 102.1 71.7 242.5 45.1 424.4 65.3 556.1 61.9 116.9-3.1 194.1-25.2 236.3-67.5 55.4-55.6 44.4-142.5 28.3-226.7C976 415.8 903.4 291.5 789.2 219c-124-78.7-248.1-69.9-283.2-65.3-5.6 0.7-11.2 2.4-16.6 4.1-4.1 1.2-8.3 2.5-12.5 3.4C237.3 211.1 88.5 298 34.5 419.6c-54.6 122.8 2.8 253 41.8 319.7z" fill="#FFFFFF" p-id="3581"></path><path d="M424.1 442.5m-24.7 0a24.7 24.7 0 1 0 49.4 0 24.7 24.7 0 1 0-49.4 0Z" fill="#040000" p-id="3582"></path><path d="M635.9 442.5m-24.7 0a24.7 24.7 0 1 0 49.4 0 24.7 24.7 0 1 0-49.4 0Z" fill="#040000" p-id="3583"></path><path d="M426.2 543.3c17.1 7.9 36.6 26 25.5 46.1-6.9 12.5-19.8 21.2-31.7 28.4-4.5 2.7-0.4 9.8 4.1 7.1 17.4-10.5 41.6-27.6 39-51.1-1.6-14-12.4-24.8-23.5-32.3-3-2-6.1-3.9-9.3-5.4-4.8-2.1-8.9 5-4.1 7.2zM629.5 535.4c-21.8 11.7-40.6 37-25.7 61.3 8.2 13.4 22.2 22.7 35.7 30.3 4.7 2.7 8.9-4.6 4.2-7.2-15.5-8.7-39.9-23.9-36.9-45.2 1.6-11.4 10.7-20.7 19.6-27.2 2.4-1.7 4.8-3.4 7.4-4.8 4.7-2.5 0.4-9.8-4.3-7.2z" fill="#040000" p-id="3584"></path><path d="M457.2 584.6c25.6 25.6 66.7 41 101.8 28.3 18.2-6.6 33.2-19.1 45.5-33.8 4.2-5.1-3-12.4-7.3-7.3-18.5 22-43.3 38.1-73 35-18.6-1.9-36.2-10.8-50.9-22-2.9-2.2-6.1-4.8-8.8-7.5-4.7-4.7-12 2.6-7.3 7.3z" fill="#040000" p-id="3585"></path></svg>`
      },
      {
        name: "19",
        icon: `<svg t="1624457904464" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3739" ><path d="M915.9 510.5c8.4-19 13.1-39.8 13.1-61.7 0-90-78.9-162.9-176.2-162.9-3.2 0-6.3 0.1-9.5 0.2v-0.2c0-94.8-116.2-171.6-259.6-171.6S224 191.2 224 286v2c-96.2 0-174.1 72-174.1 160.9 0 38 14.3 73 38.2 100.5-41.8 29.4-68.8 75.9-68.8 128.2 0 88.9 78 160.9 174.1 160.9 17.1 0 33.6-2.3 49.3-6.5 28.9 46.1 88.7 77.7 157.6 77.7 49.4 0 94-16.2 126-42.3 32 26.1 76.6 42.3 126 42.3 77.3 0 143-39.7 166.7-95 3.1 0.2 6.3 0.2 9.5 0.2 97.3 0 176.2-72.9 176.2-162.9 0-60.6-35.7-113.4-88.8-141.5z" fill="#5A74B8" p-id="3740"></path><path d="M357.6 449.5a46.6 73.2 0 1 0 93.2 0 46.6 73.2 0 1 0-93.2 0Z" fill="#FEFEFD" p-id="3741"></path><path d="M357.5 449.5a25.1 39.4 0 1 0 50.2 0 25.1 39.4 0 1 0-50.2 0Z" fill="#040000" p-id="3742"></path><path d="M531.3 449.5a46.6 73.2 0 1 0 93.2 0 46.6 73.2 0 1 0-93.2 0Z" fill="#FEFEFD" p-id="3743"></path><path d="M531.2 449.5a25.1 39.4 0 1 0 50.2 0 25.1 39.4 0 1 0-50.2 0Z" fill="#040000" p-id="3744"></path><path d="M426.7 574.6c20.9 29.9 59.7 52.2 96.2 38.6 19.2-7.2 34.7-21.2 47.6-36.9 2.8-3.5 3.4-8.3 0-11.7-2.9-2.9-8.9-3.5-11.7 0-16.5 20.2-40.9 40.9-68.1 35.5-17.3-3.4-31-13.2-42.9-25.9-2-2.2-3.9-4.4-5.8-6.7-1.6-1.9 1.1 1.5-0.4-0.6-0.2-0.2-0.3-0.5-0.5-0.7-6.2-8.7-20.6-0.4-14.4 8.4z" fill="#040000" p-id="3745"></path></svg>`
      },
      {
        name: "20",
        icon: `<svg t="1624457910321" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3899" ><path d="M792.8 301.4c-8.2 0-16.2 0.4-24.2 1.3-12.3-81.8-129.2-145.9-271.8-145.9-137.1 0-250.5 59.3-269.9 136.6C105.3 295.5 7.4 391.2 7.4 508.9c0 119.1 100.2 215.6 223.7 215.6 5.3 0 10.6-0.2 15.8-0.5 14.4 80.5 130.4 143.2 271.3 143.2 135.9 0 248.6-58.3 269.4-134.6 1.7 0 3.4 0.1 5.1 0.1 123.6 0 223.7-96.5 223.7-215.6s-100-215.7-223.6-215.7z" fill="#F6CD50" p-id="3900"></path><path d="M435.9 431.5m-52.2 0a52.2 52.2 0 1 0 104.4 0 52.2 52.2 0 1 0-104.4 0Z" fill="#FAFAFA" p-id="3901"></path><path d="M588.1 431.5m-52.2 0a52.2 52.2 0 1 0 104.4 0 52.2 52.2 0 1 0-104.4 0Z" fill="#FAFAFA" p-id="3902"></path><path d="M435.9 431.5m-27.8 0a27.8 27.8 0 1 0 55.6 0 27.8 27.8 0 1 0-55.6 0Z" fill="#040000" p-id="3903"></path><path d="M601.9 407.4c-5.7 2.9-11.3 5.9-16.9 9-6.8 3.8-15.3 7.8-20.5 13.8-5.6 6.5 1.6 11.1 6.7 14.4 11.2 7.1 23.3 13 35.1 19 5.7 2.9 10.8-5.7 5.1-8.6-10.9-5.6-21.9-11.1-32.4-17.4-2.4-1.4-4.6-3.1-7-4.6 1 0.6-0.4-0.4-0.4-0.4-1.9-0.3-0.5 4.2 0.5 4.1-0.1 0-0.6 0.3 0.3-0.3 0.5-0.3 1-0.9 1.5-1.3 9.7-7.9 21.9-13.5 33.1-19.2 5.7-2.7 0.6-11.4-5.1-8.5zM406.6 547.6c11.5 14.4 27 26.7 42.7 36.3 32.2 19.8 71.2 27.2 107.6 15.4 29.5-9.6 54.6-29.1 75.5-51.6 10.8-11.6-6.6-29.1-17.5-17.5-9.4 10.1-19.5 19.7-30.8 27.7-4.6 3.2-9.3 6.2-14.2 8.9-5 2.8-9.9 5.1-14.1 6.7-4.6 1.7-9.3 3.2-14.1 4.4-2.2 0.5-4.4 1-6.6 1.4-1 0.2-2 0.3-2.9 0.5 2.6-0.4-2.1 0.2-2.5 0.3-4.1 0.4-8.3 0.5-12.5 0.4-2.2-0.1-4.4-0.2-6.6-0.4-1.1-0.1-2.2-0.2-3.2-0.3-1.5-0.2-1.4-0.2 0.1 0l-2.1-0.3c-7.8-1.3-15.4-3.4-22.8-6.2-0.9-0.4-1.8-0.7-2.8-1.1-3.1-1.2 2.3 1.1-0.7-0.3-1.5-0.7-2.9-1.3-4.4-2-3.7-1.8-7.2-3.7-10.8-5.8-5.7-3.4-11.1-7.1-16.4-11.1 3 2.3-1.1-0.9-1.8-1.5-1.1-0.9-2.1-1.7-3.1-2.6-2.1-1.8-4.2-3.7-6.3-5.6-4.4-4.1-8.7-8.4-12.4-13.1-4.2-5.2-13.1-4.3-17.5 0-5 5.1-4 12.2 0.2 17.4z" fill="#040000" p-id="3904"></path></svg>`
      }
    ]
  },
  {
    name: "\u6807\u8BB0\u56FE\u6807",
    type: "sign",
    list: [
      {
        name: "1",
        icon: `<svg viewBox="0 0 1024 1024"><path d="M512 512m-512 0a512 512 0 1 0 1024 0 512 512 0 1 0-1024 0Z" fill="#6D768D"></path><path d="M809.728 429.696a18.901333 18.901333 0 0 0-15.274667-12.885333l-183.466666-26.624-81.92-166.272a18.901333 18.901333 0 0 0-34.005334 0l-81.92 166.272-183.594666 26.624a19.029333 19.029333 0 0 0-10.496 32.298666l132.693333 129.536-31.274667 182.741334a18.816 18.816 0 0 0 27.477334 19.84l164.138666-86.186667 164.096 86.058667a18.773333 18.773333 0 1 0 27.434667-19.84l-31.36-182.741334 132.693333-129.408a18.901333 18.901333 0 0 0 4.778667-19.413333z" fill="#FFFFFF"></path></svg>`
      },
      {
        name: "2",
        icon: `<svg viewBox="0 0 1024 1024"><path d="M512 512m-512 0a512 512 0 1 0 1024 0 512 512 0 1 0-1024 0Z" fill="#6D768D"></path><path d="M644.565333 306.901333c32.128 0 65.834667-5.76 101.077334-17.237333a17.066667 17.066667 0 0 1 22.357333 16.213333v328.32c-1.109333 0.768 10.325333 27.093333-99.370667 19.84-109.653333-7.210667-181.76-45.098667-246.869333-45.098666-65.152 0-49.322667 2.688-74.154667 8.405333v168.064a24.746667 24.746667 0 0 1-24.490666 25.258667 22.528 22.528 0 0 1-17.28-7.253334 24.149333 24.149333 0 0 1-7.168-18.005333V281.258667C299.776 280.490667 328.106667 256 421.76 256s164.437333 50.901333 222.805333 50.901333z" fill="#FFFFFF"></path></svg>`
      },
      {
        name: "3",
        icon: `<svg viewBox="0 0 1024 1024"><path d="M512 512m-512 0a512 512 0 1 0 1024 0 512 512 0 1 0-1024 0Z" fill="#6D768D"></path><path d="M524.074667 225.408l274.517333 274.517333a17.066667 17.066667 0 0 1 0 24.149334l-274.517333 274.517333a17.066667 17.066667 0 0 1-24.149334 0l-274.517333-274.517333a17.066667 17.066667 0 0 1 0-24.149334l274.517333-274.517333a17.066667 17.066667 0 0 1 24.149334 0z" fill="#FFFFFF"></path></svg>`
      },
      {
        name: "4",
        icon: `<svg viewBox="0 0 1024 1024"><path d="M512 512m-512 0a512 512 0 1 0 1024 0 512 512 0 1 0-1024 0Z" fill="#6D768D"></path><path d="M317.866667 300.8h388.266666c9.386667 0 17.066667 7.68 17.066667 17.066667v388.266666a17.066667 17.066667 0 0 1-17.066667 17.066667h-388.266666a17.066667 17.066667 0 0 1-17.066667-17.066667v-388.266666c0-9.386667 7.68-17.066667 17.066667-17.066667z" fill="#FFFFFF"></path></svg>`
      },
      {
        name: "5",
        icon: `<svg viewBox="0 0 1024 1024"><path d="M512 512m-512 0a512 512 0 1 0 1024 0 512 512 0 1 0-1024 0Z" fill="#6D768D"></path><path d="M498.346667 279.082667L248.789333 701.44a15.829333 15.829333 0 0 0 13.653334 23.893333h499.114666a15.829333 15.829333 0 0 0 13.653334-23.893333l-249.6-422.357333a15.829333 15.829333 0 0 0-27.264 0z" fill="#FFFFFF"></path></svg>`
      },
      {
        name: "6",
        icon: `<svg viewBox="0 0 1024 1024"><path d="M512 512m-512 0a512 512 0 1 0 1024 0 512 512 0 1 0-1024 0Z" fill="#6D768D"></path><path d="M497.749333 798.549333l-31.445333-28.501333C313.941333 631.722667 213.333333 540.501333 213.333333 428.8a160.981333 160.981333 0 0 1 162.730667-162.730667c51.498667 0 100.906667 23.978667 133.12 61.696a177.536 177.536 0 0 1 133.162667-61.696 160.981333 160.981333 0 0 1 162.730666 162.730667c0 111.701333-100.608 202.965333-252.970666 341.333333l-31.445334 28.458667a17.066667 17.066667 0 0 1-22.912 0z" fill="#FFFFFF"></path><path d="M634.538667 487.808L555.050667 426.24 507.306667 256a201.002667 201.002667 0 0 0-23.594667 20.394667l-0.256-0.256L525.653333 426.666667l-133.290666 59.946666a14.08 14.08 0 0 0-8.021334 15.957334l28.757334 126.378666a14.208 14.208 0 0 0 27.733333-6.229333l-26.24-115.114667 126.037333-56.704 76.416 59.136a14.250667 14.250667 0 0 0 19.968-2.474666 14.08 14.08 0 0 0-2.474666-19.797334z" fill="#6D768D"></path></svg>`
      },
      {
        name: "7",
        icon: `<svg viewBox="0 0 1024 1024"><path d="M512 512m-512 0a512 512 0 1 0 1024 0 512 512 0 1 0-1024 0Z" fill="#6D768D"></path><path d="M497.749333 798.549333l-31.445333-28.501333C313.941333 631.722667 213.333333 540.501333 213.333333 428.8a160.981333 160.981333 0 0 1 162.730667-162.730667c51.498667 0 100.906667 23.978667 133.12 61.696a177.536 177.536 0 0 1 133.162667-61.696 160.981333 160.981333 0 0 1 162.730666 162.730667c0 111.701333-100.608 202.965333-252.970666 341.333333l-31.445334 28.458667a17.066667 17.066667 0 0 1-22.912 0z" fill="#FFFFFF"></path></svg>`
      },
      {
        name: "8",
        icon: `<svg viewBox="0 0 1024 1024"><path d="M512 512m-512 0a512 512 0 1 0 1024 0 512 512 0 1 0-1024 0Z" fill="#6D768D"></path><path d="M374.656 273.194667c5.973333 4.48 12.117333 9.6 18.346667 15.36 6.272 5.717333 11.904 12.373333 16.896 19.84 2.517333 4.010667 5.504 8.490667 9.002666 13.482666a529.493333 529.493333 0 0 1 20.266667 32.213334h155.221333a169.813333 169.813333 0 0 0 9.770667-15.744c2.474667-4.48 5.248-8.96 8.234667-13.482667a460.842667 460.842667 0 0 1 23.253333-31.829333c4.992-6.229333 12.245333-12.373333 21.76-18.346667a34.261333 34.261333 0 0 0 10.112-9.728 31.274667 31.274667 0 0 0 5.248-11.989333 18.56 18.56 0 0 0-1.536-11.605334 17.664 17.664 0 0 0-10.112-8.618666c-4.48-1.493333-8.362667-2.005333-11.605333-1.493334a46.933333 46.933333 0 0 0-9.770667 2.602667c-3.242667 1.28-6.613333 2.645333-10.112 4.138667a32.426667 32.426667 0 0 1-12.757333 2.261333 26.026667 26.026667 0 0 1-12.373334-2.645333 45.653333 45.653333 0 0 1-8.96-6.357334l-8.661333-7.850666a30.336 30.336 0 0 0-11.989333-6.4c-9.984-3.968-18.005333-4.693333-24.021334-2.218667-5.973333 2.474667-11.946667 6.485333-17.962666 11.946667a88.618667 88.618667 0 0 1-11.989334 10.496 7.338667 7.338667 0 0 1-3.754666 1.493333 46.165333 46.165333 0 0 1-8.277334-5.205333 71.808 71.808 0 0 1-7.125333-4.906667 37.973333 37.973333 0 0 1-6.4-6.357333c-3.968-3.968-9.941333-6.613333-17.92-7.850667a31.061333 31.061333 0 0 0-21.76 4.138667c-8.533333 5.461333-14.506667 10.069333-18.048 13.824a29.354667 29.354667 0 0 1-15.744 7.893333 23.978667 23.978667 0 0 1-13.098667-0.768 987.733333 987.733333 0 0 0-14.634666-4.48 80.725333 80.725333 0 0 0-14.250667-2.986667 16.768 16.768 0 0 0-11.989333 2.986667c-6.997333 5.461333-9.258667 12.074667-6.741334 19.84a34.56 34.56 0 0 0 13.482667 18.346667z" fill="#FFFFFF"></path><path d="M780.757333 545.152a219.306667 219.306667 0 0 0-19.882666-65.536 224.981333 224.981333 0 0 0-33.365334-49.792 430.336 430.336 0 0 0-37.12-37.12c-14.506667-11.946667-27.264-23.296-38.272-34.048a544.512 544.512 0 0 1-27.733333-28.842667 305.28 305.28 0 0 1-22.485333-26.197333h-168.746667c-6.485333 8.490667-13.994667 17.493333-22.485333 26.965333a360.96 360.96 0 0 1-26.24 28.074667c-10.538667 10.24-22.272 21.12-35.285334 32.597333a305.493333 305.493333 0 0 0-41.6 44.16 250.026667 250.026667 0 0 0-49.493333 117.589334 216.106667 216.106667 0 0 0 1.877333 70.4 220.586667 220.586667 0 0 0 75.349334 126.549333c21.248 18.005333 47.146667 32.597333 77.653333 43.818667 30.464 11.264 65.493333 16.853333 104.96 16.853333 38.528 0 72.874667-4.864 103.125333-14.592a265.045333 265.045333 0 0 0 78.378667-39.338667c21.973333-16.469333 39.594667-35.797333 52.864-58.026666 13.226667-22.186667 22.101333-45.824 26.624-70.784 4.992-30.421333 5.632-58.026667 1.877333-82.773334z" fill="#FFFFFF"></path><path d="M593.322667 647.509333a20.48 20.48 0 0 1-11.861334 3.2h-50.133333v14.165334c0 4.266667-1.792 8.362667-5.376 12.373333a15.914667 15.914667 0 0 1-13.952 5.333333 24.917333 24.917333 0 0 1-14.336-3.882666c-3.84-2.602667-5.973333-7.210667-6.4-13.824v-14.165334h-48.725333a17.792 17.792 0 0 1-11.818667-3.882666 10.24 10.24 0 0 1-3.968-9.6c0-4.266667 1.578667-7.68 4.693333-10.24a16.768 16.768 0 0 1 11.093334-3.925334h48.682666v-24.789333h-48.682666a15.573333 15.573333 0 0 1-11.52-4.266667 13.525333 13.525333 0 0 1-4.266667-9.941333 15.36 15.36 0 0 1 4.693333-10.624 14.72 14.72 0 0 1 11.093334-4.949333h48.682666l0.725334-14.890667a1053.568 1053.568 0 0 1-40.832-42.538667l-10.752-9.898666a41.216 41.216 0 0 1-6.442667-11.690667c-1.92-4.992-0.938667-10.069333 2.858667-15.274667a13.653333 13.653333 0 0 1 15.786666-3.84c6.186667 2.090667 11.221333 4.821333 15.018667 8.106667 1.92 2.389333 5.248 5.888 10.026667 10.666667l15.061333 14.848 19.328 19.157333 22.186667-20.565333a987.605333 987.605333 0 0 1 29.397333-25.514667 21.162667 21.162667 0 0 1 14.293333-5.674667c5.290667 0 9.557333 2.133333 12.928 6.4 6.186667 7.082667 3.84 15.36-7.168 24.789334a179.072 179.072 0 0 0-12.885333 12.373333c-5.76 5.973333-11.52 11.733333-17.194667 17.408-6.698667 7.082667-14.08 14.378667-22.186666 21.973333v13.44h46.506666c6.698667 0 11.605333 1.536 14.72 4.608a14.165333 14.165333 0 0 1 4.650667 10.282667c0 4.266667-1.450667 7.936-4.309333 11.008-2.858667 3.029333-7.637333 4.352-14.336 3.84l-46.506667 0.768-0.768 24.064h45.866667c13.354667 0 20.053333 4.992 20.053333 14.933333 0.469333 4.693333-0.853333 8.106667-3.925333 10.24z" fill="#6D768D"></path></svg>`
      },
      {
        name: "9",
        icon: `<svg viewBox="0 0 1024 1024"><path d="M512 512m-512 0a512 512 0 1 0 1024 0 512 512 0 1 0-1024 0Z" fill="#6D768D"></path><path d="M512 213.333333l234.666667 341.333334h-128v213.333333h-213.333334v-213.333333h-128L512 213.333333z" fill="#FFFFFF"></path></svg>`
      },
      {
        name: "10",
        icon: `<svg viewBox="0 0 1024 1024"><path d="M512 512m-512 0a512 512 0 1 0 1024 0 512 512 0 1 0-1024 0Z" fill="#6D768D"></path><path d="M533.333333 810.666667L298.666667 469.333333h128V256h213.333333v213.333333h128l-234.666667 341.333334z" fill="#FFFFFF"></path></svg>`
      },
      {
        name: "11",
        icon: `<svg viewBox="0 0 1024 1024"><path d="M512 512m-512 0a512 512 0 1 0 1024 0 512 512 0 1 0-1024 0Z" fill="#6D768D"></path><path d="M213.333333 533.333333L554.666667 298.666667v128h213.333333v213.333333h-213.333333v128l-341.333334-234.666667z" fill="#FFFFFF"></path></svg>`
      },
      {
        name: "12",
        icon: `<svg viewBox="0 0 1024 1024"><path d="M512 512m-512 0a512 512 0 1 0 1024 0 512 512 0 1 0-1024 0Z" fill="#6D768D"></path><path d="M810.666667 533.333333L469.333333 768v-128H256v-213.333333h213.333333V298.666667l341.333334 234.666666z" fill="#FFFFFF"></path></svg>`
      },
      {
        name: "13",
        icon: `<svg viewBox="0 0 1024 1024"><path d="M0 512c0 282.752 229.248 512 512 512s512-229.248 512-512S794.752 0 512 0 0 229.248 0 512z" fill="#6D768D"></path><path d="M571.349333 508.586667l162.389334-162.346667a44.330667 44.330667 0 1 0-62.72-62.72l-162.389334 162.389333-162.517333-162.389333a44.330667 44.330667 0 1 0-62.72 62.72l162.389333 162.389333-162.389333 162.474667a44.330667 44.330667 0 1 0 62.72 62.72l162.389333-162.346667 162.389334 162.389334a44.330667 44.330667 0 1 0 62.72-62.72l-162.261334-162.56z" fill="#FFFFFF"></path></svg>`
      },
      {
        name: "14",
        icon: `<svg viewBox="0 0 1024 1024"><path d="M512 0C233.386667 0 0 225.877333 0 512s225.877333 512 512 512 512-225.877333 512-512S790.613333 0 512 0z" fill="#6D768D"></path><path d="M726.144 311.210667l-277.333333 305.066666-124.8-124.8c-13.866667-13.866667-41.6-13.866667-55.466667 0-13.866667 13.866667-13.866667 41.6 0 55.466667l159.445333 152.533333c13.866667 13.866667 41.6 13.866667 55.466667 0l305.066667-332.8c13.866667-13.866667 13.866667-41.6 0-55.466666-20.778667-13.866667-48.512-13.866667-62.378667 0z" fill="#FFFFFF"></path></svg>`
      },
      {
        name: "15",
        icon: `<svg viewBox="0 0 1024 1024"><path d="M512 512m-512 0a512 512 0 1 0 1024 0 512 512 0 1 0-1024 0Z" fill="#6D768D"></path><path d="M541.952 755.626667a40.618667 40.618667 0 0 1-29.824 12.373333 41.344 41.344 0 0 1-30.122667-12.373333 40.106667 40.106667 0 0 1-12.672-30.122667c0-11.605333 4.096-21.845333 12.672-30.122667a40.405333 40.405333 0 0 1 30.122667-12.714666c11.605333 0 21.546667 4.138667 29.824 12.714666a40.32 40.32 0 0 1 12.714667 30.122667c0 11.861333-4.096 21.76-12.714667 30.122667zM450.986667 241.28A77.866667 77.866667 0 0 1 512.256 213.333333c24.874667 0 45.354667 8.917333 61.354667 27.946667 15.488 18.432 23.722667 41.685333 23.722666 69.674667 0 23.765333-33.152 200.533333-44.672 329.045333h-80.128C463.146667 511.402667 426.666667 334.677333 426.666667 310.954667c0-27.392 8.277333-50.645333 24.32-69.674667z" fill="#FFFFFF"></path></svg>`
      },
      {
        name: "16",
        icon: `<svg viewBox="0 0 1024 1024"><path d="M512 0C229.248 0 0 229.248 0 512s229.248 512 512 512 512-229.248 512-512S794.794667 0 512 0z" fill="#6D768D"></path><path d="M490.666667 682.666667a64 64 0 1 1 0 128 64 64 0 0 1 0-128z m13.994666-490.752c61.397333 0 112.341333 14.634667 153.002667 43.946666 40.533333 29.269333 60.885333 72.618667 60.885333 130.133334 0 35.242667-12.373333 64.938667-29.952 89.045333-10.282667 14.677333-33.664 33.408-62.890666 56.192l-32.426667 22.357333c-15.701333 12.202667-29.696 26.453333-34.858667 42.666667-1.706667 5.546667-3.072 14.677333-3.968 24.533333-0.426667 4.949333-4.864 15.018667-15.232 15.018667h-83.328c-13.568 0-15.957333-10.581333-15.744-15.786667 1.493333-34.005333 4.608-64.213333 18.474667-80.469333 28.074667-32.896 91.904-73.813333 91.904-73.813333a104.106667 104.106667 0 0 0 23.552-24.021334c10.837333-14.933333 19.797333-31.317333 19.797333-49.237333 0-20.565333-6.016-39.338667-18.090666-56.32-12.032-16.938667-34.090667-25.386667-66.005334-25.386667-31.445333 0-53.76 10.410667-66.901333 31.274667-9.685333 15.445333-15.786667 29.610667-18.346667 45.013333-0.853333 5.461333-4.394667 16.981333-16.042666 16.981334H327.210667c-17.322667 0-21.12-11.221333-20.650667-16.64 6.272-68.138667 32.896-114.688 80-144.597334 32-20.565333 71.381333-30.890667 118.101333-30.890666z" fill="#FFFFFF"></path></svg>`
      },
      {
        name: "17",
        icon: `<svg viewBox="0 0 1024 1024"><path d="M512 512m-512 0a512 512 0 1 0 1024 0 512 512 0 1 0-1024 0Z" fill="#6D768D"></path><path d="M336.256 410.026667H253.312a40.021333 40.021333 0 0 0-39.850667 43.264l23.296 278.101333c1.706667 20.693333 19.072 36.608 39.850667 36.608h59.648c11.050667 0 20.010667-8.96 20.010667-19.968v-318.037333a19.968 19.968 0 0 0-20.010667-19.968z m434.432 0h-178.944C653.312 182.314667 548.949333 170.666667 548.949333 170.666667c-44.288 0-35.114667 34.986667-38.442666 40.832 0 84.48-68.010667 155.093333-101.034667 184.362666a39.552 39.552 0 0 0-13.226667 29.653334v322.56c0 11.008 8.96 19.925333 20.010667 19.925333h233.728c30.378667 0 58.154667-17.152 71.68-44.373333 18.176-36.736 40.448-90.112 54.656-133.973334 13.781333-42.410667 26.24-94.976 33.578667-131.968a39.850667 39.850667 0 0 0-39.253334-47.658666z" fill="#FFFFFF"></path></svg>`
      },
      {
        name: "18",
        icon: `<svg viewBox="0 0 1024 1024"><path d="M512 512m-512 0a512 512 0 1 0 1024 0 512 512 0 1 0-1024 0Z" fill="#6D768D"></path><path d="M796.16 413.909333c-31.146667-0.298667-115.626667-0.085333-146.858667-0.085333h-158.464c8.533333-7.68 15.914667-14.506667 23.594667-20.906667 29.781333-24.874667 25.813333-71.082667-14.208-88.874666-22.954667-10.24-44.970667-5.632-64 11.52-34.944 31.274667-69.632 62.677333-104.277333 93.994666a15.488 15.488 0 0 1-11.178667 4.437334c-11.221333-0.085333-26.88-0.128-46.933333-0.170667a17.066667 17.066667 0 0 0-17.109334 17.066667L256 719.701333a17.066667 17.066667 0 0 0 17.066667 17.152l49.578666-0.085333c3.968 0 7.466667 0.768 10.88 2.602667 15.829333 8.832 31.701333 17.493333 47.616 26.24a18.133333 18.133333 0 0 0 9.301334 2.346666h168.405333c6.186667 0 11.946667-0.981333 17.834667-2.56 29.44-7.253333 40.021333-30.293333 38.528-52.565333-0.768-9.728-4.266667-18.346667-9.984-26.24 19.626667-5.76 35.114667-16.213333 42.112-36.096 7.125333-20.394667 1.621333-38.4-12.672-53.333333 28.16-19.754667 34.858667-44.672 18.645333-75.648h140.458667c6.570667 0 13.013333-0.597333 19.370666-2.645334 31.957333-9.813333 48.810667-42.88 35.626667-71.552-10.154667-22.186667-28.629333-33.152-52.608-33.450666z" fill="#FFFFFF"></path></svg>`
      },
      {
        name: "19",
        icon: `<svg viewBox="0 0 1024 1024"><path d="M512 512m-512 0a512 512 0 1 0 1024 0 512 512 0 1 0-1024 0Z" fill="#6D768D"></path><path d="M270.506667 413.909333c31.146667-0.298667 115.626667-0.085333 146.858666-0.085333h158.464c-8.533333-7.68-15.914667-14.506667-23.594666-20.906667-29.781333-24.874667-25.813333-71.082667 14.208-88.874666 22.954667-10.24 44.970667-5.632 64 11.52 34.944 31.274667 69.632 62.677333 104.277333 93.994666 3.413333 2.986667 6.528 4.437333 11.178667 4.437334 11.221333-0.085333 26.88-0.128 46.933333-0.170667a17.066667 17.066667 0 0 1 17.109333 17.066667l0.682667 288.853333a17.066667 17.066667 0 0 1-17.066667 17.152l-49.578666-0.085333a22.101333 22.101333 0 0 0-10.88 2.602666c-15.829333 8.832-31.701333 17.493333-47.616 26.24a18.133333 18.133333 0 0 1-9.301334 2.346667h-168.405333a68.693333 68.693333 0 0 1-17.834667-2.56c-29.44-7.253333-40.021333-30.293333-38.528-52.565333 0.768-9.728 4.266667-18.346667 9.984-26.24-19.626667-5.76-35.114667-16.213333-42.112-36.096-7.125333-20.394667-1.621333-38.4 12.672-53.333334-28.16-19.754667-34.858667-44.672-18.645333-75.648H272.853333c-6.570667 0-13.013333-0.597333-19.370666-2.645333-31.957333-9.813333-48.810667-42.88-35.626667-71.552 10.154667-22.186667 28.629333-33.152 52.608-33.450667z" fill="#FFFFFF"></path></svg>`
      },
      {
        name: "20",
        icon: `<svg viewBox="0 0 1024 1024"><path d="M512 512m-512 0a512 512 0 1 0 1024 0 512 512 0 1 0-1024 0Z" fill="#6D768D"></path><path d="M667.733333 480.128H400v-111.36a97.706667 97.706667 0 0 1 97.621333-97.621333 97.706667 97.706667 0 0 1 97.578667 97.621333 28.885333 28.885333 0 0 0 57.813333 0A155.605333 155.605333 0 0 0 497.621333 213.333333a155.605333 155.605333 0 0 0-155.392 155.434667v111.36h-14.677333A28.885333 28.885333 0 0 0 298.666667 509.013333v292.010667a28.885333 28.885333 0 0 0 28.885333 28.885333h340.138667a28.885333 28.885333 0 0 0 28.928-28.885333V509.013333a28.885333 28.885333 0 0 0-28.928-28.885333z" fill="#FFFFFF"></path></svg>`
      },
      {
        name: "21",
        icon: `<svg viewBox="0 0 1024 1024"><path d="M512 512m-512 0a512 512 0 1 0 1024 0 512 512 0 1 0-1024 0Z" fill="#6D768D"></path><path d="M400.042667 437.461333v-111.36a97.706667 97.706667 0 0 1 97.621333-97.621333 97.706667 97.706667 0 0 1 97.578667 97.621333 28.885333 28.885333 0 0 0 57.813333 0A155.605333 155.605333 0 0 0 497.621333 170.666667a155.605333 155.605333 0 0 0-155.392 155.434666v111.36h-14.677333A28.885333 28.885333 0 0 0 298.666667 466.346667v292.010666a28.885333 28.885333 0 0 0 28.885333 28.885334h340.138667a28.885333 28.885333 0 0 0 28.928-28.885334V466.346667a28.885333 28.885333 0 0 0-28.928-28.885334H400.042667z" fill="#FFFFFF"></path><path d="M595.242667 437.461333v-111.36a97.706667 97.706667 0 0 0-97.621334-97.621333 97.706667 97.706667 0 0 0-97.578666 97.621333 28.885333 28.885333 0 0 1-57.813334 0A155.605333 155.605333 0 0 1 497.621333 170.666667a155.605333 155.605333 0 0 1 155.434667 155.434666v111.36h14.634667c16 0 28.928 12.928 28.928 28.885334v292.010666a28.885333 28.885333 0 0 1-28.928 28.885334H327.552A28.885333 28.885333 0 0 1 298.666667 758.357333V466.346667c0-15.957333 12.928-28.885333 28.885333-28.885334h267.690667z" fill="#FFFFFF"></path></svg>`
      },
      {
        name: "22",
        icon: `<svg viewBox="0 0 1024 1024"><path d="M511.999787 512.000213m-511.999787 0a511.999787 511.999787 0 1 0 1023.999573 0 511.999787 511.999787 0 1 0-1023.999573 0Z" fill="#6D768D"></path><path d="M381.354508 364.586941c0 54.015977 29.013321 103.935957 75.946635 130.986613a152.53327 152.53327 0 0 0 151.935936 0 151.12527 151.12527 0 0 0 75.946636-130.986613A151.594604 151.594604 0 0 0 533.333111 213.333671a151.594604 151.594604 0 0 0-151.89327 151.25327zM660.479725 498.901552a185.258589 185.258589 0 0 1-127.146614 50.346646c-49.066646 0-93.866628-19.199992-127.06128-50.346646C317.141201 544.853533 255.999893 637.440161 255.999893 744.106783c0 13.183995 10.709329 23.850657 23.978657 23.850657h506.709122a23.893323 23.893323 0 0 0 23.978657-23.893323c0-106.538622-61.098641-199.25325-150.186604-245.205232z" fill="#FFFFFF"></path></svg>`
      },
      {
        name: "23",
        icon: `<svg viewBox="0 0 1024 1024"><path d="M512 512m-512 0a512 512 0 1 0 1024 0 512 512 0 1 0-1024 0Z" fill="#6D768D"></path><path d="M445.610667 401.578667a129.322667 129.322667 0 1 0 258.645333 0 129.322667 129.322667 0 0 0-258.645333 0z m237.568 114.901333a157.354667 157.354667 0 0 1-216.362667 0 236.373333 236.373333 0 0 0-127.957333 209.706667c0 11.264 9.130667 20.394667 20.394666 20.394666h431.402667a20.394667 20.394667 0 0 0 20.394667-20.394666 236.373333 236.373333 0 0 0-127.872-209.706667zM409.813333 401.578667c0-40.362667 14.592-77.397333 38.698667-106.112a112.725333 112.725333 0 0 0-29.013333-3.925334 112.64 112.64 0 0 0-112.426667 112.469334 112.64 112.64 0 0 0 144.853333 107.648 164.693333 164.693333 0 0 1-42.112-110.08z m-18.602666 136.704a136.533333 136.533333 0 0 1-65.706667-34.474667 205.44 205.44 0 0 0-111.232 182.4c0 9.813333 7.936 17.706667 17.706667 17.706667H303.36a273.621333 273.621333 0 0 1 87.893333-165.632z" fill="#FFFFFF"></path></svg>`
      }
    ]
  }
];
var getNodeIconListIcon = (name, extendIconList = []) => {
  let arr = name.split("_");
  let typeData = [...nodeIconList, ...extendIconList].find((item) => {
    return item.type === arr[0];
  });
  return typeData.list.find((item) => {
    return item.name === arr[1];
  }).icon;
};
var icons_default = {
  hyperlink,
  note,
  nodeIconList,
  getNodeIconListIcon
};

// ../simple-mind-map/src/core/render/node/nodeCreateContents.js
function createImgNode() {
  let img = this.nodeData.data.image;
  if (!img) {
    return;
  }
  let imgSize = this.getImgShowSize();
  let node3 = new Image2().load(img).size(...imgSize);
  if (this.nodeData.data.imageTitle) {
    node3.attr("title", this.nodeData.data.imageTitle);
  }
  node3.on("dblclick", (e2) => {
    this.mindMap.emit("node_img_dblclick", this, e2);
  });
  return {
    node: node3,
    width: imgSize[0],
    height: imgSize[1]
  };
}
function getImgShowSize() {
  return resizeImgSize(
    this.nodeData.data.imageSize.width,
    this.nodeData.data.imageSize.height,
    this.mindMap.themeConfig.imgMaxWidth,
    this.mindMap.themeConfig.imgMaxHeight
  );
}
function createIconNode() {
  let _data = this.nodeData.data;
  if (!_data.icon || _data.icon.length <= 0) {
    return [];
  }
  let iconSize = this.mindMap.themeConfig.iconSize;
  return _data.icon.map((item) => {
    let src = icons_default.getNodeIconListIcon(item, this.mindMap.opt.iconList || []);
    let node3 = null;
    if (/^<svg/.test(src)) {
      node3 = SVG(src);
    } else {
      node3 = new Image2().load(src);
    }
    node3.size(iconSize, iconSize);
    return {
      node: node3,
      width: iconSize,
      height: iconSize
    };
  });
}
function createRichTextNode() {
  let g2 = new G();
  if (this.nodeData.data.resetRichText || [CONSTANTS.CHANGE_THEME].includes(this.mindMap.renderer.renderSource)) {
    delete this.nodeData.data.resetRichText;
    let text3 = getTextFromHtml(this.nodeData.data.text);
    this.nodeData.data.text = `<p><span style="${this.style.createStyleText()}">${text3}</span></p>`;
  }
  let html2 = `<div>${this.nodeData.data.text}</div>`;
  let div = document.createElement("div");
  div.innerHTML = html2;
  div.style.cssText = `position: fixed; left: -999999px;`;
  let el2 = div.children[0];
  el2.classList.add("smm-richtext-node-wrap");
  el2.setAttribute("xmlns", "http://www.w3.org/1999/xhtml");
  el2.style.maxWidth = this.mindMap.opt.textAutoWrapWidth + "px";
  this.mindMap.el.appendChild(div);
  let { width: width2, height: height2 } = el2.getBoundingClientRect();
  width2 = Math.ceil(width2);
  height2 = Math.ceil(height2);
  g2.attr("data-width", width2);
  g2.attr("data-height", height2);
  html2 = div.innerHTML;
  this.mindMap.el.removeChild(div);
  let foreignObject = new ForeignObject();
  foreignObject.width(width2);
  foreignObject.height(height2);
  foreignObject.add(SVG(html2));
  g2.add(foreignObject);
  return {
    node: g2,
    width: width2,
    height: height2
  };
}
function createTextNode() {
  if (this.nodeData.data.richText) {
    return this.createRichTextNode();
  }
  let g2 = new G();
  let fontSize = this.getStyle("fontSize", false, this.nodeData.data.isActive);
  let lineHeight = this.getStyle(
    "lineHeight",
    false,
    this.nodeData.data.isActive
  );
  let textStyle = this.style.getTextFontStyle();
  let textArr = this.nodeData.data.text.split(/\n/gim);
  let maxWidth = this.mindMap.opt.textAutoWrapWidth;
  let isMultiLine = false;
  textArr.forEach((item, index3) => {
    let arr = item.split("");
    let lines = [];
    let line = [];
    while (arr.length) {
      let str = arr.shift();
      let text3 = [...line, str].join("");
      if (measureText(text3, textStyle).width <= maxWidth) {
        line.push(str);
      } else {
        lines.push(line.join(""));
        line = [str];
      }
    }
    if (line.length > 0) {
      lines.push(line.join(""));
    }
    if (lines.length > 1) {
      isMultiLine = true;
    }
    textArr[index3] = lines.join("\n");
  });
  textArr = textArr.join("\n").split(/\n/gim);
  textArr.forEach((item, index3) => {
    let node3 = new Text2().text(item);
    this.style.text(node3);
    node3.y(fontSize * lineHeight * index3);
    g2.add(node3);
  });
  let { width: width2, height: height2 } = g2.bbox();
  width2 = Math.ceil(width2);
  height2 = Math.ceil(height2);
  g2.attr("data-width", width2);
  g2.attr("data-height", height2);
  g2.attr("data-ismultiLine", isMultiLine || textArr.length > 1);
  return {
    node: g2,
    width: width2,
    height: height2
  };
}
function createHyperlinkNode() {
  let { hyperlink: hyperlink2, hyperlinkTitle } = this.nodeData.data;
  if (!hyperlink2) {
    return;
  }
  let iconSize = this.mindMap.themeConfig.iconSize;
  let node3 = new SVG();
  let a3 = new A().to(hyperlink2).target("_blank");
  a3.node.addEventListener("click", (e2) => {
    e2.stopPropagation();
  });
  if (hyperlinkTitle) {
    a3.attr("title", hyperlinkTitle);
  }
  a3.rect(iconSize, iconSize).fill({ color: "transparent" });
  let iconNode = SVG(icons_default.hyperlink).size(iconSize, iconSize);
  this.style.iconNode(iconNode);
  a3.add(iconNode);
  node3.add(a3);
  return {
    node: node3,
    width: iconSize,
    height: iconSize
  };
}
function createTagNode() {
  let tagData = this.nodeData.data.tag;
  if (!tagData || tagData.length <= 0) {
    return [];
  }
  let nodes = [];
  tagData.slice(0, this.mindMap.opt.maxTag).forEach((item, index3) => {
    let tag = new G();
    let text3 = new Text2().text(item).x(8).cy(10);
    this.style.tagText(text3, index3);
    let { width: width2 } = text3.bbox();
    let rect = new Rect().size(width2 + 16, 20);
    this.style.tagRect(rect, index3);
    tag.add(rect).add(text3);
    nodes.push({
      node: tag,
      width: width2 + 16,
      height: 20
    });
  });
  return nodes;
}
function createNoteNode() {
  if (!this.nodeData.data.note) {
    return null;
  }
  let iconSize = this.mindMap.themeConfig.iconSize;
  let node3 = new SVG().attr("cursor", "pointer");
  node3.add(new Rect().size(iconSize, iconSize).fill({ color: "transparent" }));
  let iconNode = SVG(icons_default.note).size(iconSize, iconSize);
  this.style.iconNode(iconNode);
  node3.add(iconNode);
  if (!this.mindMap.opt.customNoteContentShow) {
    if (!this.noteEl) {
      this.noteEl = document.createElement("div");
      this.noteEl.style.cssText = `
          position: absolute;
          padding: 10px;
          border-radius: 5px;
          box-shadow: 0 2px 5px rgb(0 0 0 / 10%);
          display: none;
          background-color: #fff;
          z-index: ${this.mindMap.opt.nodeNoteTooltipZIndex}
      `;
      document.body.appendChild(this.noteEl);
    }
    this.noteEl.innerText = this.nodeData.data.note;
  }
  node3.on("mouseover", () => {
    let { left, top } = node3.node.getBoundingClientRect();
    if (!this.mindMap.opt.customNoteContentShow) {
      this.noteEl.style.left = left + "px";
      this.noteEl.style.top = top + iconSize + "px";
      this.noteEl.style.display = "block";
    } else {
      this.mindMap.opt.customNoteContentShow.show(
        this.nodeData.data.note,
        left,
        top + iconSize
      );
    }
  });
  node3.on("mouseout", () => {
    if (!this.mindMap.opt.customNoteContentShow) {
      this.noteEl.style.display = "none";
    } else {
      this.mindMap.opt.customNoteContentShow.hide();
    }
  });
  return {
    node: node3,
    width: iconSize,
    height: iconSize
  };
}
var nodeCreateContents_default = {
  createImgNode,
  getImgShowSize,
  createIconNode,
  createRichTextNode,
  createTextNode,
  createHyperlinkNode,
  createTagNode,
  createNoteNode
};

// ../simple-mind-map/src/core/render/node/Node.js
var Node2 = class {
  //  构造函数
  constructor(opt = {}) {
    this.nodeData = this.handleData(opt.data || {});
    this.uid = opt.uid;
    this.mindMap = opt.mindMap;
    this.renderer = opt.renderer;
    this.draw = opt.draw || null;
    this.style = new Style_default(this);
    this.shapeInstance = new Shape2(this);
    this.shapePadding = {
      paddingX: 0,
      paddingY: 0
    };
    this.isRoot = opt.isRoot === void 0 ? false : opt.isRoot;
    this.isGeneralization = opt.isGeneralization === void 0 ? false : opt.isGeneralization;
    this.generalizationBelongNode = null;
    this.layerIndex = opt.layerIndex === void 0 ? 0 : opt.layerIndex;
    this.width = opt.width || 0;
    this.height = opt.height || 0;
    this._left = opt.left || 0;
    this._top = opt.top || 0;
    this.customLeft = opt.data.data.customLeft || void 0;
    this.customTop = opt.data.data.customTop || void 0;
    this.isDrag = false;
    this.parent = opt.parent || null;
    this.children = opt.children || [];
    this.group = null;
    this.shapeNode = null;
    this._imgData = null;
    this._iconData = null;
    this._textData = null;
    this._hyperlinkData = null;
    this._tagData = null;
    this._noteData = null;
    this.noteEl = null;
    this._expandBtn = null;
    this._lastExpandBtnType = null;
    this._showExpandBtn = false;
    this._openExpandNode = null;
    this._closeExpandNode = null;
    this._fillExpandNode = null;
    this._lines = [];
    this._generalizationLine = null;
    this._generalizationNode = null;
    this._unVisibleRectRegionNode = null;
    this._isMouseenter = false;
    this._rectInfo = {
      imgContentWidth: 0,
      imgContentHeight: 0,
      textContentWidth: 0,
      textContentHeight: 0
    };
    this._generalizationNodeWidth = 0;
    this._generalizationNodeHeight = 0;
    this.textContentItemMargin = this.mindMap.opt.textContentMargin;
    this.blockContentMargin = this.mindMap.opt.imgTextMargin;
    this.expandBtnSize = this.mindMap.opt.expandBtnSize;
    this.isMultipleChoice = false;
    this.needLayout = false;
    Object.keys(nodeGeneralization_default).forEach((item) => {
      this[item] = nodeGeneralization_default[item].bind(this);
    });
    Object.keys(nodeExpandBtn_default).forEach((item) => {
      this[item] = nodeExpandBtn_default[item].bind(this);
    });
    Object.keys(nodeCommandWraps_default).forEach((item) => {
      this[item] = nodeCommandWraps_default[item].bind(this);
    });
    Object.keys(nodeCreateContents_default).forEach((item) => {
      this[item] = nodeCreateContents_default[item].bind(this);
    });
    this.getSize();
  }
  // 支持自定义位置
  get left() {
    return this.customLeft || this._left;
  }
  set left(val) {
    this._left = val;
  }
  get top() {
    return this.customTop || this._top;
  }
  set top(val) {
    this._top = val;
  }
  //  复位部分布局时会重新设置的数据
  reset() {
    this.children = [];
    this.parent = null;
    this.isRoot = false;
    this.layerIndex = 0;
    this.left = 0;
    this.top = 0;
  }
  //  处理数据
  handleData(data2) {
    data2.data.expand = data2.data.expand === false ? false : true;
    data2.data.isActive = data2.data.isActive === true ? true : false;
    data2.children = data2.children || [];
    return data2;
  }
  //  创建节点的各个内容对象数据
  createNodeData() {
    this._imgData = this.createImgNode();
    this._iconData = this.createIconNode();
    this._textData = this.createTextNode();
    this._hyperlinkData = this.createHyperlinkNode();
    this._tagData = this.createTagNode();
    this._noteData = this.createNoteNode();
  }
  //  计算节点的宽高
  getSize() {
    this.updateGeneralization();
    this.createNodeData();
    let { width: width2, height: height2 } = this.getNodeRect();
    let changed = this.width !== width2 || this.height !== height2;
    this.width = width2;
    this.height = height2;
    return changed;
  }
  //  计算节点尺寸信息
  getNodeRect() {
    let imgContentWidth = 0;
    let imgContentHeight = 0;
    let textContentWidth = 0;
    let textContentHeight = 0;
    if (this._imgData) {
      this._rectInfo.imgContentWidth = imgContentWidth = this._imgData.width;
      this._rectInfo.imgContentHeight = imgContentHeight = this._imgData.height;
    }
    if (this._iconData.length > 0) {
      textContentWidth += this._iconData.reduce((sum, cur) => {
        textContentHeight = Math.max(textContentHeight, cur.height);
        return sum += cur.width + this.textContentItemMargin;
      }, 0);
    }
    if (this._textData) {
      textContentWidth += this._textData.width;
      textContentHeight = Math.max(textContentHeight, this._textData.height);
    }
    if (this._hyperlinkData) {
      textContentWidth += this._hyperlinkData.width;
      textContentHeight = Math.max(
        textContentHeight,
        this._hyperlinkData.height
      );
    }
    if (this._tagData.length > 0) {
      textContentWidth += this._tagData.reduce((sum, cur) => {
        textContentHeight = Math.max(textContentHeight, cur.height);
        return sum += cur.width + this.textContentItemMargin;
      }, 0);
    }
    if (this._noteData) {
      textContentWidth += this._noteData.width;
      textContentHeight = Math.max(textContentHeight, this._noteData.height);
    }
    this._rectInfo.textContentWidth = textContentWidth;
    this._rectInfo.textContentHeight = textContentHeight;
    let margin = imgContentHeight > 0 && textContentHeight > 0 ? this.blockContentMargin : 0;
    let { paddingX, paddingY } = this.getPaddingVale();
    let _width = Math.max(imgContentWidth, textContentWidth);
    let _height = imgContentHeight + textContentHeight;
    let { paddingX: shapePaddingX, paddingY: shapePaddingY } = this.shapeInstance.getShapePadding(_width, _height, paddingX, paddingY);
    this.shapePadding.paddingX = shapePaddingX;
    this.shapePadding.paddingY = shapePaddingY;
    return {
      width: _width + paddingX * 2 + shapePaddingX * 2,
      height: _height + paddingY * 2 + margin + shapePaddingY * 2
    };
  }
  //  定位节点内容
  layout() {
    this.group.clear();
    let { width: width2, height: height2, textContentItemMargin } = this;
    let { paddingY } = this.getPaddingVale();
    paddingY += this.shapePadding.paddingY;
    this.shapeNode = this.shapeInstance.createShape();
    this.group.add(this.shapeNode);
    this.updateNodeShape();
    if (!this.mindMap.opt.alwaysShowExpandBtn) {
      if (!this._unVisibleRectRegionNode) {
        this._unVisibleRectRegionNode = new Rect();
      }
      this._unVisibleRectRegionNode.fill({
        color: "transparent"
      }).size(this.expandBtnSize, height2).x(width2).y(0);
      this.group.add(this._unVisibleRectRegionNode);
    }
    if (this.isGeneralization && this.generalizationBelongNode) {
      this.group.addClass("generalization_" + this.generalizationBelongNode.uid);
    }
    let imgHeight = 0;
    if (this._imgData) {
      imgHeight = this._imgData.height;
      this.group.add(this._imgData.node);
      this._imgData.node.cx(width2 / 2).y(paddingY);
    }
    let textContentNested = new G();
    let textContentOffsetX = 0;
    let iconNested = new G();
    if (this._iconData && this._iconData.length > 0) {
      let iconLeft = 0;
      this._iconData.forEach((item) => {
        item.node.x(textContentOffsetX + iconLeft).y((this._rectInfo.textContentHeight - item.height) / 2);
        iconNested.add(item.node);
        iconLeft += item.width + textContentItemMargin;
      });
      textContentNested.add(iconNested);
      textContentOffsetX += iconLeft;
    }
    if (this._textData) {
      this._textData.node.attr("data-offsetx", textContentOffsetX);
      this._textData.node.x(textContentOffsetX).y(0);
      textContentNested.add(this._textData.node);
      textContentOffsetX += this._textData.width + textContentItemMargin;
    }
    if (this._hyperlinkData) {
      this._hyperlinkData.node.x(textContentOffsetX).y((this._rectInfo.textContentHeight - this._hyperlinkData.height) / 2);
      textContentNested.add(this._hyperlinkData.node);
      textContentOffsetX += this._hyperlinkData.width + textContentItemMargin;
    }
    let tagNested = new G();
    if (this._tagData && this._tagData.length > 0) {
      let tagLeft = 0;
      this._tagData.forEach((item) => {
        item.node.x(textContentOffsetX + tagLeft).y((this._rectInfo.textContentHeight - item.height) / 2);
        tagNested.add(item.node);
        tagLeft += item.width + textContentItemMargin;
      });
      textContentNested.add(tagNested);
      textContentOffsetX += tagLeft;
    }
    if (this._noteData) {
      this._noteData.node.x(textContentOffsetX).y((this._rectInfo.textContentHeight - this._noteData.height) / 2);
      textContentNested.add(this._noteData.node);
      textContentOffsetX += this._noteData.width;
    }
    textContentNested.translate(
      width2 / 2 - textContentNested.bbox().width / 2,
      imgHeight + paddingY + (imgHeight > 0 && this._rectInfo.textContentHeight > 0 ? this.blockContentMargin : 0)
    );
    this.group.add(textContentNested);
  }
  // 给节点绑定事件
  bindGroupEvent() {
    this.group.on("click", (e2) => {
      this.mindMap.emit("node_click", this, e2);
      if (this.isMultipleChoice) {
        e2.stopPropagation();
        this.isMultipleChoice = false;
        return;
      }
      this.active(e2);
    });
    this.group.on("mousedown", (e2) => {
      if (this.isRoot && e2.which === 3) {
        e2.stopPropagation();
      }
      if (!this.isRoot) {
        e2.stopPropagation();
      }
      if (e2.ctrlKey && this.mindMap.opt.enableCtrlKeyNodeSelection) {
        this.isMultipleChoice = true;
        let isActive = this.nodeData.data.isActive;
        if (!isActive)
          this.mindMap.emit(
            "before_node_active",
            this,
            this.renderer.activeNodeList
          );
        this.mindMap.execCommand("SET_NODE_ACTIVE", this, !isActive);
        this.mindMap.renderer[isActive ? "removeActiveNode" : "addActiveNode"](
          this
        );
        this.mindMap.emit(
          "node_active",
          isActive ? null : this,
          this.mindMap.renderer.activeNodeList
        );
      }
      this.mindMap.emit("node_mousedown", this, e2);
    });
    this.group.on("mouseup", (e2) => {
      if (!this.isRoot) {
        e2.stopPropagation();
      }
      this.mindMap.emit("node_mouseup", this, e2);
    });
    this.group.on("mouseenter", (e2) => {
      this._isMouseenter = true;
      this.showExpandBtn();
      this.mindMap.emit("node_mouseenter", this, e2);
    });
    this.group.on("mouseleave", (e2) => {
      this._isMouseenter = false;
      this.hideExpandBtn();
      this.mindMap.emit("node_mouseleave", this, e2);
    });
    this.group.on("dblclick", (e2) => {
      if (this.mindMap.opt.readonly) {
        return;
      }
      e2.stopPropagation();
      this.mindMap.emit("node_dblclick", this, e2);
    });
    this.group.on("contextmenu", (e2) => {
      if (this.mindMap.opt.readonly || e2.ctrlKey) {
        return;
      }
      e2.stopPropagation();
      e2.preventDefault();
      if (this.nodeData.data.isActive) {
        this.renderer.clearActive();
      }
      this.active(e2);
      this.mindMap.emit("node_contextmenu", e2, this);
    });
  }
  //  激活节点
  active(e2) {
    if (this.mindMap.opt.readonly) {
      return;
    }
    e2 && e2.stopPropagation();
    if (this.nodeData.data.isActive) {
      return;
    }
    this.mindMap.emit("before_node_active", this, this.renderer.activeNodeList);
    this.renderer.clearActive();
    this.mindMap.execCommand("SET_NODE_ACTIVE", this, true);
    this.renderer.addActiveNode(this);
    this.mindMap.emit("node_active", this, this.renderer.activeNodeList);
  }
  //  更新节点
  update(isLayout = false) {
    if (!this.group) {
      return;
    }
    let { enableNodeTransitionMove, nodeTransitionMoveDuration, alwaysShowExpandBtn } = this.mindMap.opt;
    if (alwaysShowExpandBtn) {
      if (this._expandBtn && this.nodeData.children.length <= 0) {
        this.removeExpandBtn();
      } else {
        this.renderExpandBtn();
      }
    } else {
      let { isActive, expand } = this.nodeData.data;
      if (expand && !isActive && !this._isMouseenter) {
        this.hideExpandBtn();
      } else {
        this.showExpandBtn();
      }
    }
    this.renderGeneralization();
    let t3 = this.group.transform();
    if (this.left === t3.translateX && this.top === t3.translateY)
      return;
    if (!isLayout && enableNodeTransitionMove) {
      this.group.animate(nodeTransitionMoveDuration).translate(this.left - t3.translateX, this.top - t3.translateY);
    } else {
      this.group.translate(this.left - t3.translateX, this.top - t3.translateY);
    }
  }
  // 重新渲染节点，即重新创建节点内容、计算节点大小、计算节点内容布局、更新展开收起按钮，概要及位置
  reRender() {
    let sizeChange = this.getSize();
    this.layout();
    this.update();
    return sizeChange;
  }
  // 更新节点形状样式
  updateNodeShape() {
    if (!this.shapeNode)
      return;
    const shape = this.getShape();
    this.style[shape === CONSTANTS.SHAPE.RECTANGLE ? "rect" : "shape"](
      this.shapeNode
    );
  }
  //  递归渲染
  render(callback = () => {
  }) {
    let { enableNodeTransitionMove, nodeTransitionMoveDuration } = this.mindMap.opt;
    this.renderLine();
    let isLayout = false;
    if (!this.group) {
      isLayout = true;
      this.group = new G();
      this.group.css({
        cursor: "default"
      });
      this.bindGroupEvent();
      this.draw.add(this.group);
      this.layout();
      this.update(isLayout);
    } else {
      this.draw.add(this.group);
      if (this.needLayout) {
        this.needLayout = false;
        this.layout();
      }
      this.update();
    }
    if (this.children && this.children.length && this.nodeData.data.expand !== false) {
      let index3 = 0;
      asyncRun(
        this.children.map((item) => {
          return () => {
            item.render(() => {
              index3++;
              if (index3 >= this.children.length) {
                callback();
              }
            });
          };
        })
      );
    } else {
      if (enableNodeTransitionMove && !isLayout) {
        setTimeout(() => {
          callback();
        }, nodeTransitionMoveDuration);
      } else {
        callback();
      }
    }
    if (this.nodeData.inserting) {
      delete this.nodeData.inserting;
      this.active();
      setTimeout(() => {
        this.mindMap.emit("node_dblclick", this);
      }, 0);
    }
  }
  //  递归删除，只是从画布删除，节点容器还在，后续还可以重新插回画布
  remove() {
    if (!this.group)
      return;
    this.group.remove();
    this.removeGeneralization();
    this.removeLine();
    if (this.children && this.children.length) {
      asyncRun(
        this.children.map((item) => {
          return () => {
            item.remove();
          };
        })
      );
    }
  }
  // 销毁节点，不但会从画布删除，而且原节点直接置空，后续无法再插回画布
  destroy() {
    if (!this.group)
      return;
    this.group.remove();
    this.removeGeneralization();
    this.removeLine();
    this.group = null;
  }
  //  隐藏节点
  hide() {
    this.group.hide();
    this.hideGeneralization();
    if (this.parent) {
      let index3 = this.parent.children.indexOf(this);
      this.parent._lines[index3] && this.parent._lines[index3].hide();
      this._lines.forEach((item) => {
        item.hide();
      });
    }
    if (this.children && this.children.length) {
      asyncRun(
        this.children.map((item) => {
          return () => {
            item.hide();
          };
        })
      );
    }
  }
  //  显示节点
  show() {
    if (!this.group) {
      return;
    }
    this.group.show();
    this.showGeneralization();
    if (this.parent) {
      let index3 = this.parent.children.indexOf(this);
      this.parent._lines[index3] && this.parent._lines[index3].show();
      this._lines.forEach((item) => {
        item.show();
      });
    }
    if (this.children && this.children.length) {
      asyncRun(
        this.children.map((item) => {
          return () => {
            item.show();
          };
        })
      );
    }
  }
  //  连线
  renderLine(deep = false) {
    if (this.nodeData.data.expand === false) {
      return;
    }
    let childrenLen = this.nodeData.children.length;
    if (this.mindMap.opt.layout === CONSTANTS.LAYOUT.FISHBONE && (this.isRoot || this.layerIndex === 1)) {
      childrenLen = 0;
    }
    if (childrenLen > this._lines.length) {
      new Array(childrenLen - this._lines.length).fill(0).forEach(() => {
        this._lines.push(this.draw.path());
      });
    } else if (childrenLen < this._lines.length) {
      this._lines.slice(childrenLen).forEach((line) => {
        line.remove();
      });
      this._lines = this._lines.slice(0, childrenLen);
    }
    this.renderer.layout.renderLine(
      this,
      this._lines,
      (line, node3) => {
        this.styleLine(line, node3);
      },
      this.style.getStyle("lineStyle", true)
    );
    if (deep && this.children && this.children.length > 0) {
      this.children.forEach((item) => {
        item.renderLine(deep);
      });
    }
  }
  //  获取节点形状
  getShape() {
    return this.mindMap.themeConfig.nodeUseLineStyle ? CONSTANTS.SHAPE.RECTANGLE : this.style.getStyle("shape", false, false);
  }
  //  检查节点是否存在自定义数据
  hasCustomPosition() {
    return this.customLeft !== void 0 && this.customTop !== void 0;
  }
  //  检查节点是否存在自定义位置的祖先节点
  ancestorHasCustomPosition() {
    let node3 = this;
    while (node3) {
      if (node3.hasCustomPosition()) {
        return true;
      }
      node3 = node3.parent;
    }
    return false;
  }
  //  添加子节点
  addChildren(node3) {
    this.children.push(node3);
  }
  //  设置连线样式
  styleLine(line, node3) {
    let width2 = node3.getSelfInhertStyle("lineWidth") || node3.getStyle("lineWidth", true);
    let color = node3.getSelfInhertStyle("lineColor") || node3.getStyle("lineColor", true);
    let dasharray = node3.getSelfInhertStyle("lineDasharray") || node3.getStyle("lineDasharray", true);
    this.style.line(line, {
      width: width2,
      color,
      dasharray
    });
  }
  //  移除连线
  removeLine() {
    this._lines.forEach((line) => {
      line.remove();
    });
    this._lines = [];
  }
  //  检测当前节点是否是某个节点的祖先节点
  isParent(node3) {
    if (this === node3) {
      return false;
    }
    let parent = node3.parent;
    while (parent) {
      if (this === parent) {
        return true;
      }
      parent = parent.parent;
    }
    return false;
  }
  //  检测当前节点是否是某个节点的兄弟节点
  isBrother(node3) {
    if (!this.parent || this === node3) {
      return false;
    }
    return this.parent.children.find((item) => {
      return item === node3;
    });
  }
  //  获取padding值
  getPaddingVale() {
    let { isActive } = this.nodeData.data;
    return {
      paddingX: this.getStyle("paddingX", true, isActive),
      paddingY: this.getStyle("paddingY", true, isActive)
    };
  }
  //  获取某个样式
  getStyle(prop, root2, isActive) {
    let v3 = this.style.merge(prop, root2, isActive);
    return v3 === void 0 ? "" : v3;
  }
  //  获取自定义样式
  getSelfStyle(prop) {
    return this.style.getSelfStyle(prop);
  }
  //   获取最近一个存在自身自定义样式的祖先节点的自定义样式
  getParentSelfStyle(prop) {
    if (this.parent) {
      return this.parent.getSelfStyle(prop) || this.parent.getParentSelfStyle(prop);
    }
    return null;
  }
  //  获取自身可继承的自定义样式
  getSelfInhertStyle(prop) {
    return this.getSelfStyle(prop) || // 自身
    this.getParentSelfStyle(prop);
  }
  //  获取数据
  getData(key) {
    return key ? this.nodeData.data[key] || "" : this.nodeData.data;
  }
};
var Node_default = Node2;

// ../simple-mind-map/src/utils/Lru.js
var CRU = class {
  constructor(max3) {
    this.max = max3 || 1e3;
    this.size = 0;
    this.pool = /* @__PURE__ */ new Map();
  }
  add(key, value) {
    this.delete(key);
    this.pool.set(key, value);
    this.size++;
    if (this.size > this.max) {
      let keys = this.pool.keys();
      let last = keys.next();
      this.delete(last.value);
    }
  }
  delete(key) {
    if (this.pool.has(key)) {
      this.pool.delete(key);
      this.size--;
    }
  }
  has(key) {
    return this.pool.has(key);
  }
  get(key) {
    if (this.pool.has(key)) {
      return this.pool.get(key);
    }
  }
};

// ../simple-mind-map/src/layouts/Base.js
var Base2 = class {
  //  构造函数
  constructor(renderer) {
    this.renderer = renderer;
    this.mindMap = renderer.mindMap;
    this.draw = this.mindMap.draw;
    this.root = null;
    this.lru = new CRU(this.mindMap.opt.maxNodeCacheCount);
  }
  //  计算节点位置
  doLayout() {
    throw new Error("\u3010computed\u3011\u65B9\u6CD5\u4E3A\u5FC5\u8981\u65B9\u6CD5\uFF0C\u9700\u8981\u5B50\u7C7B\u8FDB\u884C\u91CD\u5199\uFF01");
  }
  //  连线
  renderLine() {
    throw new Error("\u3010renderLine\u3011\u65B9\u6CD5\u4E3A\u5FC5\u8981\u65B9\u6CD5\uFF0C\u9700\u8981\u5B50\u7C7B\u8FDB\u884C\u91CD\u5199\uFF01");
  }
  //  定位展开收缩按钮
  renderExpandBtn() {
    throw new Error("\u3010renderExpandBtn\u3011\u65B9\u6CD5\u4E3A\u5FC5\u8981\u65B9\u6CD5\uFF0C\u9700\u8981\u5B50\u7C7B\u8FDB\u884C\u91CD\u5199\uFF01");
  }
  //  概要节点
  renderGeneralization() {
  }
  // 通过uid缓存节点
  cacheNode(uid, node3) {
    this.renderer.nodeCache[uid] = node3;
    this.lru.add(uid, node3);
  }
  // 检查当前来源是否需要重新计算节点大小
  checkIsNeedResizeSources() {
    return [CONSTANTS.CHANGE_THEME, CONSTANTS.TRANSFORM_TO_NORMAL_NODE].includes(this.renderer.renderSource);
  }
  //  创建节点实例
  createNode(data2, parent, isRoot, layerIndex) {
    let newNode = null;
    if (data2 && data2._node && !this.renderer.reRender) {
      newNode = data2._node;
      newNode.reset();
      newNode.layerIndex = layerIndex;
      this.cacheNode(data2._node.uid, newNode);
      if (this.checkIsNeedResizeSources()) {
        newNode.getSize();
        newNode.needLayout = true;
      }
    } else if (this.lru.has(data2.data.uid) && !this.renderer.reRender) {
      newNode = this.lru.get(data2.data.uid);
      let lastData = JSON.stringify(newNode.nodeData.data);
      newNode.reset();
      newNode.nodeData = newNode.handleData(data2 || {});
      newNode.layerIndex = layerIndex;
      this.cacheNode(data2.data.uid, newNode);
      data2._node = newNode;
      let isResizeSource = this.checkIsNeedResizeSources();
      let isNodeDataChange = lastData !== JSON.stringify(data2.data);
      if (isResizeSource || isNodeDataChange) {
        newNode.getSize();
        newNode.needLayout = true;
      }
    } else {
      let uid = this.mindMap.uid++;
      newNode = new Node_default({
        data: data2,
        uid,
        renderer: this.renderer,
        mindMap: this.mindMap,
        draw: this.draw,
        layerIndex
      });
      data2.data.uid = uid;
      this.cacheNode(uid, newNode);
      data2._node = newNode;
      if (data2.data.isActive) {
        this.renderer.addActiveNode(newNode);
      }
    }
    if (isRoot) {
      newNode.isRoot = true;
      this.root = newNode;
    } else {
      newNode.parent = parent._node;
      parent._node.addChildren(newNode);
    }
    return newNode;
  }
  // 格式化节点位置
  formatPosition(value, size2, nodeSize) {
    if (typeof value === "number") {
      return value;
    } else if (initRootNodePositionMap[value] !== void 0) {
      return size2 * initRootNodePositionMap[value];
    } else if (/^\d\d*%$/.test(value)) {
      return Number.parseFloat(value) / 100 * size2;
    } else {
      return (size2 - nodeSize) / 2;
    }
  }
  //  定位节点到画布中间
  setNodeCenter(node3) {
    let { initRootNodePosition } = this.mindMap.opt;
    let { CENTER } = CONSTANTS.INIT_ROOT_NODE_POSITION;
    if (!initRootNodePosition || !Array.isArray(initRootNodePosition) || initRootNodePosition.length < 2) {
      initRootNodePosition = [CENTER, CENTER];
    }
    node3.left = this.formatPosition(initRootNodePosition[0], this.mindMap.width, node3.width);
    node3.top = this.formatPosition(initRootNodePosition[1], this.mindMap.height, node3.height);
  }
  //  更新子节点属性
  updateChildren(children, prop, offset) {
    children.forEach((item) => {
      item[prop] += offset;
      if (item.children && item.children.length && !item.hasCustomPosition()) {
        this.updateChildren(item.children, prop, offset);
      }
    });
  }
  //  更新子节点多个属性
  updateChildrenPro(children, props) {
    children.forEach((item) => {
      Object.keys(props).forEach((prop) => {
        item[prop] += props[prop];
      });
      if (item.children && item.children.length && !item.hasCustomPosition()) {
        this.updateChildrenPro(item.children, props);
      }
    });
  }
  //  递归计算节点的宽度
  getNodeAreaWidth(node3) {
    let widthArr = [];
    let loop = (node4, width2) => {
      if (node4.children.length) {
        width2 += node4.width / 2;
        node4.children.forEach((item) => {
          loop(item, width2);
        });
      } else {
        width2 += node4.width;
        widthArr.push(width2);
      }
    };
    loop(node3, 0);
    return Math.max(...widthArr);
  }
  //  二次贝塞尔曲线
  quadraticCurvePath(x1, y1, x22, y22) {
    let cx2 = x1 + (x22 - x1) * 0.2;
    let cy2 = y1 + (y22 - y1) * 0.8;
    return `M ${x1},${y1} Q ${cx2},${cy2} ${x22},${y22}`;
  }
  //  三次贝塞尔曲线
  cubicBezierPath(x1, y1, x22, y22) {
    let cx1 = x1 + (x22 - x1) / 2;
    let cy1 = y1;
    let cx2 = cx1;
    let cy2 = y22;
    return `M ${x1},${y1} C ${cx1},${cy1} ${cx2},${cy2} ${x22},${y22}`;
  }
  //   获取节点的marginX
  getMarginX(layerIndex) {
    return layerIndex === 1 ? this.mindMap.themeConfig.second.marginX : this.mindMap.themeConfig.node.marginX;
  }
  //  获取节点的marginY
  getMarginY(layerIndex) {
    return layerIndex === 1 ? this.mindMap.themeConfig.second.marginY : this.mindMap.themeConfig.node.marginY;
  }
  //  获取节点包括概要在内的宽度
  getNodeWidthWithGeneralization(node3) {
    return Math.max(
      node3.width,
      node3.checkHasGeneralization() ? node3._generalizationNodeWidth : 0
    );
  }
  //  获取节点包括概要在内的高度
  getNodeHeightWithGeneralization(node3) {
    return Math.max(
      node3.height,
      node3.checkHasGeneralization() ? node3._generalizationNodeHeight : 0
    );
  }
  //  获取节点的边界值
  /**
   * dir：生长方向，h（水平）、v（垂直）
   * isLeft：是否向左生长
   */
  getNodeBoundaries(node3, dir) {
    let { generalizationLineMargin, generalizationNodeMargin } = this.mindMap.themeConfig;
    let walk2 = (root2) => {
      let _left = Infinity;
      let _right = -Infinity;
      let _top = Infinity;
      let _bottom = -Infinity;
      if (root2.children && root2.children.length > 0) {
        root2.children.forEach((child) => {
          let { left: left2, right: right2, top: top2, bottom: bottom2 } = walk2(child);
          let generalizationWidth = child.checkHasGeneralization() && child.nodeData.data.expand ? child._generalizationNodeWidth + generalizationNodeMargin : 0;
          let generalizationHeight = child.checkHasGeneralization() && child.nodeData.data.expand ? child._generalizationNodeHeight + generalizationNodeMargin : 0;
          if (left2 - (dir === "h" ? generalizationWidth : 0) < _left) {
            _left = left2 - (dir === "h" ? generalizationWidth : 0);
          }
          if (right2 + (dir === "h" ? generalizationWidth : 0) > _right) {
            _right = right2 + (dir === "h" ? generalizationWidth : 0);
          }
          if (top2 < _top) {
            _top = top2;
          }
          if (bottom2 + (dir === "v" ? generalizationHeight : 0) > _bottom) {
            _bottom = bottom2 + (dir === "v" ? generalizationHeight : 0);
          }
        });
      }
      let cur = {
        left: root2.left,
        right: root2.left + root2.width,
        top: root2.top,
        bottom: root2.top + root2.height
      };
      return {
        left: cur.left < _left ? cur.left : _left,
        right: cur.right > _right ? cur.right : _right,
        top: cur.top < _top ? cur.top : _top,
        bottom: cur.bottom > _bottom ? cur.bottom : _bottom
      };
    };
    let { left, right, top, bottom } = walk2(node3);
    return {
      left,
      right,
      top,
      bottom,
      generalizationLineMargin,
      generalizationNodeMargin
    };
  }
  // 获取节点实际存在几个子节点
  getNodeActChildrenLength(node3) {
    return node3.nodeData.children && node3.nodeData.children.length;
  }
};
var Base_default = Base2;

// ../simple-mind-map/src/layouts/LogicalStructure.js
var LogicalStructure = class extends Base_default {
  //  构造函数
  constructor(opt = {}) {
    super(opt);
  }
  //  布局
  doLayout(callback) {
    let task = [
      () => {
        this.computedBaseValue();
      },
      () => {
        this.computedTopValue();
      },
      () => {
        this.adjustTopValue();
      },
      () => {
        callback(this.root);
      }
    ];
    asyncRun(task);
  }
  //  遍历数据计算节点的left、width、height
  computedBaseValue() {
    walk(
      this.renderer.renderTree,
      null,
      (cur, parent, isRoot, layerIndex) => {
        let newNode = this.createNode(cur, parent, isRoot, layerIndex);
        if (isRoot) {
          this.setNodeCenter(newNode);
        } else {
          newNode.left = parent._node.left + parent._node.width + this.getMarginX(layerIndex);
        }
        if (!cur.data.expand) {
          return true;
        }
      },
      (cur, parent, isRoot, layerIndex) => {
        let len = cur.data.expand === false ? 0 : cur._node.children.length;
        cur._node.childrenAreaHeight = len ? cur._node.children.reduce((h3, item) => {
          return h3 + item.height;
        }, 0) + (len + 1) * this.getMarginY(layerIndex + 1) : 0;
      },
      true,
      0
    );
  }
  //  遍历节点树计算节点的top
  computedTopValue() {
    walk(
      this.root,
      null,
      (node3, parent, isRoot, layerIndex) => {
        if (node3.nodeData.data.expand && node3.children && node3.children.length) {
          let marginY = this.getMarginY(layerIndex + 1);
          let top = node3.top + node3.height / 2 - node3.childrenAreaHeight / 2;
          let totalTop = top + marginY;
          node3.children.forEach((cur) => {
            cur.top = totalTop;
            totalTop += cur.height + marginY;
          });
        }
      },
      null,
      true
    );
  }
  //  调整节点top
  adjustTopValue() {
    walk(
      this.root,
      null,
      (node3, parent, isRoot, layerIndex) => {
        if (!node3.nodeData.data.expand) {
          return;
        }
        let difference2 = node3.childrenAreaHeight - this.getMarginY(layerIndex + 1) * 2 - node3.height;
        if (difference2 > 0) {
          this.updateBrothers(node3, difference2 / 2);
        }
      },
      null,
      true
    );
  }
  //  更新兄弟节点的top
  updateBrothers(node3, addHeight) {
    if (node3.parent) {
      let childrenList = node3.parent.children;
      let index3 = childrenList.findIndex((item) => {
        return item === node3;
      });
      childrenList.forEach((item, _index) => {
        if (item === node3 || item.hasCustomPosition()) {
          return;
        }
        let _offset = 0;
        if (_index < index3) {
          _offset = -addHeight;
        } else if (_index > index3) {
          _offset = addHeight;
        }
        item.top += _offset;
        if (item.children && item.children.length) {
          this.updateChildren(item.children, "top", _offset);
        }
      });
      this.updateBrothers(node3.parent, addHeight);
    }
  }
  //  绘制连线，连接该节点到其子节点
  renderLine(node3, lines, style, lineStyle) {
    if (lineStyle === "curve") {
      this.renderLineCurve(node3, lines, style);
    } else if (lineStyle === "direct") {
      this.renderLineDirect(node3, lines, style);
    } else {
      this.renderLineStraight(node3, lines, style);
    }
  }
  //  直线风格连线
  renderLineStraight(node3, lines, style) {
    if (node3.children.length <= 0) {
      return [];
    }
    let { left, top, width: width2, height: height2, expandBtnSize } = node3;
    if (!this.mindMap.opt.alwaysShowExpandBtn) {
      expandBtnSize = 0;
    }
    let marginX = this.getMarginX(node3.layerIndex + 1);
    let s1 = (marginX - expandBtnSize) * 0.6;
    let nodeUseLineStyle = this.mindMap.themeConfig.nodeUseLineStyle;
    node3.children.forEach((item, index3) => {
      let x1 = node3.layerIndex === 0 ? left + width2 : left + width2 + expandBtnSize;
      let y1 = top + height2 / 2;
      let x22 = item.left;
      let y22 = item.top + item.height / 2;
      let nodeUseLineStyleOffset = nodeUseLineStyle ? item.width : 0;
      y1 = nodeUseLineStyle && !node3.isRoot ? y1 + height2 / 2 : y1;
      y22 = nodeUseLineStyle ? y22 + item.height / 2 : y22;
      let path = `M ${x1},${y1} L ${x1 + s1},${y1} L ${x1 + s1},${y22} L ${x22 + nodeUseLineStyleOffset},${y22}`;
      lines[index3].plot(path);
      style && style(lines[index3], item);
    });
  }
  //  直连风格
  renderLineDirect(node3, lines, style) {
    if (node3.children.length <= 0) {
      return [];
    }
    let { left, top, width: width2, height: height2, expandBtnSize } = node3;
    if (!this.mindMap.opt.alwaysShowExpandBtn) {
      expandBtnSize = 0;
    }
    let nodeUseLineStyle = this.mindMap.themeConfig.nodeUseLineStyle;
    node3.children.forEach((item, index3) => {
      let x1 = node3.layerIndex === 0 ? left + width2 / 2 : left + width2 + expandBtnSize;
      let y1 = top + height2 / 2;
      let x22 = item.left;
      let y22 = item.top + item.height / 2;
      y1 = nodeUseLineStyle && !node3.isRoot ? y1 + height2 / 2 : y1;
      y22 = nodeUseLineStyle ? y22 + item.height / 2 : y22;
      let nodeUseLineStylePath = nodeUseLineStyle ? ` L ${item.left + item.width},${y22}` : "";
      let path = `M ${x1},${y1} L ${x22},${y22}` + nodeUseLineStylePath;
      lines[index3].plot(path);
      style && style(lines[index3], item);
    });
  }
  //  曲线风格连线
  renderLineCurve(node3, lines, style) {
    if (node3.children.length <= 0) {
      return [];
    }
    let { left, top, width: width2, height: height2, expandBtnSize } = node3;
    if (!this.mindMap.opt.alwaysShowExpandBtn) {
      expandBtnSize = 0;
    }
    let nodeUseLineStyle = this.mindMap.themeConfig.nodeUseLineStyle;
    node3.children.forEach((item, index3) => {
      let x1 = node3.layerIndex === 0 ? left + width2 / 2 : left + width2 + expandBtnSize;
      let y1 = top + height2 / 2;
      let x22 = item.left;
      let y22 = item.top + item.height / 2;
      let path = "";
      y1 = nodeUseLineStyle && !node3.isRoot ? y1 + height2 / 2 : y1;
      y22 = nodeUseLineStyle ? y22 + item.height / 2 : y22;
      let nodeUseLineStylePath = nodeUseLineStyle ? ` L ${item.left + item.width},${y22}` : "";
      if (node3.isRoot) {
        path = this.quadraticCurvePath(x1, y1, x22, y22) + nodeUseLineStylePath;
      } else {
        path = this.cubicBezierPath(x1, y1, x22, y22) + nodeUseLineStylePath;
      }
      lines[index3].plot(path);
      style && style(lines[index3], item);
    });
  }
  //  渲染按钮
  renderExpandBtn(node3, btn) {
    let { width: width2, height: height2 } = node3;
    let { translateX, translateY } = btn.transform();
    let nodeUseLineStyleOffset = this.mindMap.themeConfig.nodeUseLineStyle ? height2 / 2 : 0;
    let _x = width2;
    let _y = height2 / 2 + nodeUseLineStyleOffset;
    if (_x === translateX && _y === translateY) {
      return;
    }
    btn.translate(
      _x - translateX,
      _y - translateY
    );
  }
  //  创建概要节点
  renderGeneralization(node3, gLine, gNode) {
    let {
      top,
      bottom,
      right,
      generalizationLineMargin,
      generalizationNodeMargin
    } = this.getNodeBoundaries(node3, "h");
    let x1 = right + generalizationLineMargin;
    let y1 = top;
    let x22 = right + generalizationLineMargin;
    let y22 = bottom;
    let cx2 = x1 + 20;
    let cy2 = y1 + (y22 - y1) / 2;
    let path = `M ${x1},${y1} Q ${cx2},${cy2} ${x22},${y22}`;
    gLine.plot(path);
    gNode.left = right + generalizationNodeMargin;
    gNode.top = top + (bottom - top - gNode.height) / 2;
  }
};
var LogicalStructure_default = LogicalStructure;

// ../simple-mind-map/src/layouts/MindMap.js
var MindMap = class extends Base_default {
  //  构造函数
  // 在逻辑结构图的基础上增加一个变量来记录生长方向，向左还是向右，同时在计算left的时候根据方向来计算、调整top时只考虑同方向的节点即可
  constructor(opt = {}) {
    super(opt);
  }
  //  布局
  doLayout(callback) {
    let task = [
      () => {
        this.computedBaseValue();
      },
      () => {
        this.computedTopValue();
      },
      () => {
        this.adjustTopValue();
      },
      () => {
        callback(this.root);
      }
    ];
    asyncRun(task);
  }
  //  遍历数据计算节点的left、width、height
  computedBaseValue() {
    walk(
      this.renderer.renderTree,
      null,
      (cur, parent, isRoot, layerIndex, index3) => {
        let newNode = this.createNode(cur, parent, isRoot, layerIndex);
        if (isRoot) {
          this.setNodeCenter(newNode);
        } else {
          if (parent._node.dir) {
            newNode.dir = parent._node.dir;
          } else {
            newNode.dir = index3 % 2 === 0 ? "right" : "left";
          }
          newNode.left = newNode.dir === "right" ? parent._node.left + parent._node.width + this.getMarginX(layerIndex) : parent._node.left - this.getMarginX(layerIndex) - newNode.width;
        }
        if (!cur.data.expand) {
          return true;
        }
      },
      (cur, parent, isRoot, layerIndex) => {
        if (!cur.data.expand) {
          cur._node.leftChildrenAreaHeight = 0;
          cur._node.rightChildrenAreaHeight = 0;
          return;
        }
        let leftLen = 0;
        let rightLen = 0;
        let leftChildrenAreaHeight = 0;
        let rightChildrenAreaHeight = 0;
        cur._node.children.forEach((item) => {
          if (item.dir === "left") {
            leftLen++;
            leftChildrenAreaHeight += item.height;
          } else {
            rightLen++;
            rightChildrenAreaHeight += item.height;
          }
        });
        cur._node.leftChildrenAreaHeight = leftChildrenAreaHeight + (leftLen + 1) * this.getMarginY(layerIndex + 1);
        cur._node.rightChildrenAreaHeight = rightChildrenAreaHeight + (rightLen + 1) * this.getMarginY(layerIndex + 1);
      },
      true,
      0
    );
  }
  //  遍历节点树计算节点的top
  computedTopValue() {
    walk(
      this.root,
      null,
      (node3, parent, isRoot, layerIndex) => {
        if (node3.nodeData.data.expand && node3.children && node3.children.length) {
          let marginY = this.getMarginY(layerIndex + 1);
          let baseTop = node3.top + node3.height / 2 + marginY;
          let leftTotalTop = baseTop - node3.leftChildrenAreaHeight / 2;
          let rightTotalTop = baseTop - node3.rightChildrenAreaHeight / 2;
          node3.children.forEach((cur) => {
            if (cur.dir === "left") {
              cur.top = leftTotalTop;
              leftTotalTop += cur.height + marginY;
            } else {
              cur.top = rightTotalTop;
              rightTotalTop += cur.height + marginY;
            }
          });
        }
      },
      null,
      true
    );
  }
  //  调整节点top
  adjustTopValue() {
    walk(
      this.root,
      null,
      (node3, parent, isRoot, layerIndex) => {
        if (!node3.nodeData.data.expand) {
          return;
        }
        let base = this.getMarginY(layerIndex + 1) * 2 + node3.height;
        let leftDifference = node3.leftChildrenAreaHeight - base;
        let rightDifference = node3.rightChildrenAreaHeight - base;
        if (leftDifference > 0 || rightDifference > 0) {
          this.updateBrothers(node3, leftDifference / 2, rightDifference / 2);
        }
      },
      null,
      true
    );
  }
  //  更新兄弟节点的top
  updateBrothers(node3, leftAddHeight, rightAddHeight) {
    if (node3.parent) {
      let childrenList = node3.parent.children.filter((item) => {
        return item.dir === node3.dir;
      });
      let index3 = childrenList.findIndex((item) => {
        return item === node3;
      });
      childrenList.forEach((item, _index) => {
        if (item.hasCustomPosition()) {
          return;
        }
        let _offset = 0;
        let addHeight = item.dir === "left" ? leftAddHeight : rightAddHeight;
        if (_index < index3) {
          _offset = -addHeight;
        } else if (_index > index3) {
          _offset = addHeight;
        }
        item.top += _offset;
        if (item.children && item.children.length) {
          this.updateChildren(item.children, "top", _offset);
        }
      });
      this.updateBrothers(node3.parent, leftAddHeight, rightAddHeight);
    }
  }
  //  绘制连线，连接该节点到其子节点
  renderLine(node3, lines, style, lineStyle) {
    if (lineStyle === "curve") {
      this.renderLineCurve(node3, lines, style);
    } else if (lineStyle === "direct") {
      this.renderLineDirect(node3, lines, style);
    } else {
      this.renderLineStraight(node3, lines, style);
    }
  }
  //  直线风格连线
  renderLineStraight(node3, lines, style) {
    if (node3.children.length <= 0) {
      return [];
    }
    let { left, top, width: width2, height: height2, expandBtnSize } = node3;
    if (!this.mindMap.opt.alwaysShowExpandBtn) {
      expandBtnSize = 0;
    }
    let marginX = this.getMarginX(node3.layerIndex + 1);
    let s1 = (marginX - expandBtnSize) * 0.6;
    let nodeUseLineStyle = this.mindMap.themeConfig.nodeUseLineStyle;
    node3.children.forEach((item, index3) => {
      let x1 = 0;
      let _s = 0;
      let nodeUseLineStyleOffset = nodeUseLineStyle ? item.width : 0;
      if (item.dir === "left") {
        _s = -s1;
        x1 = node3.layerIndex === 0 ? left : left - expandBtnSize;
        nodeUseLineStyleOffset = -nodeUseLineStyleOffset;
      } else {
        _s = s1;
        x1 = node3.layerIndex === 0 ? left + width2 : left + width2 + expandBtnSize;
      }
      let y1 = top + height2 / 2;
      let x22 = item.dir === "left" ? item.left + item.width : item.left;
      let y22 = item.top + item.height / 2;
      y1 = nodeUseLineStyle && !node3.isRoot ? y1 + height2 / 2 : y1;
      y22 = nodeUseLineStyle ? y22 + item.height / 2 : y22;
      let path = `M ${x1},${y1} L ${x1 + _s},${y1} L ${x1 + _s},${y22} L ${x22 + nodeUseLineStyleOffset},${y22}`;
      lines[index3].plot(path);
      style && style(lines[index3], item);
    });
  }
  //  直连风格
  renderLineDirect(node3, lines, style) {
    if (node3.children.length <= 0) {
      return [];
    }
    let { left, top, width: width2, height: height2, expandBtnSize } = node3;
    if (!this.mindMap.opt.alwaysShowExpandBtn) {
      expandBtnSize = 0;
    }
    let nodeUseLineStyle = this.mindMap.themeConfig.nodeUseLineStyle;
    node3.children.forEach((item, index3) => {
      let x1 = node3.layerIndex === 0 ? left + width2 / 2 : item.dir === "left" ? left - expandBtnSize : left + width2 + expandBtnSize;
      let y1 = top + height2 / 2;
      let x22 = item.dir === "left" ? item.left + item.width : item.left;
      let y22 = item.top + item.height / 2;
      y1 = nodeUseLineStyle && !node3.isRoot ? y1 + height2 / 2 : y1;
      y22 = nodeUseLineStyle ? y22 + item.height / 2 : y22;
      let nodeUseLineStylePath = "";
      if (nodeUseLineStyle) {
        if (item.dir === "left") {
          nodeUseLineStylePath = ` L ${item.left},${y22}`;
        } else {
          nodeUseLineStylePath = ` L ${item.left + item.width},${y22}`;
        }
      }
      let path = `M ${x1},${y1} L ${x22},${y22}` + nodeUseLineStylePath;
      lines[index3].plot(path);
      style && style(lines[index3], item);
    });
  }
  //  曲线风格连线
  renderLineCurve(node3, lines, style) {
    if (node3.children.length <= 0) {
      return [];
    }
    let { left, top, width: width2, height: height2, expandBtnSize } = node3;
    if (!this.mindMap.opt.alwaysShowExpandBtn) {
      expandBtnSize = 0;
    }
    let nodeUseLineStyle = this.mindMap.themeConfig.nodeUseLineStyle;
    node3.children.forEach((item, index3) => {
      let x1 = node3.layerIndex === 0 ? left + width2 / 2 : item.dir === "left" ? left - expandBtnSize : left + width2 + expandBtnSize;
      let y1 = top + height2 / 2;
      let x22 = item.dir === "left" ? item.left + item.width : item.left;
      let y22 = item.top + item.height / 2;
      let path = "";
      y1 = nodeUseLineStyle && !node3.isRoot ? y1 + height2 / 2 : y1;
      y22 = nodeUseLineStyle ? y22 + item.height / 2 : y22;
      let nodeUseLineStylePath = "";
      if (this.mindMap.themeConfig.nodeUseLineStyle) {
        if (item.dir === "left") {
          nodeUseLineStylePath = ` L ${item.left},${y22}`;
        } else {
          nodeUseLineStylePath = ` L ${item.left + item.width},${y22}`;
        }
      }
      if (node3.isRoot) {
        path = this.quadraticCurvePath(x1, y1, x22, y22) + nodeUseLineStylePath;
      } else {
        path = this.cubicBezierPath(x1, y1, x22, y22) + nodeUseLineStylePath;
      }
      lines[index3].plot(path);
      style && style(lines[index3], item);
    });
  }
  //  渲染按钮
  renderExpandBtn(node3, btn) {
    let { width: width2, height: height2, expandBtnSize } = node3;
    let { translateX, translateY } = btn.transform();
    let nodeUseLineStyleOffset = this.mindMap.themeConfig.nodeUseLineStyle ? height2 / 2 : 0;
    let _x = node3.dir === "left" ? 0 - expandBtnSize : width2;
    let _y = height2 / 2 + nodeUseLineStyleOffset;
    if (_x === translateX && _y === translateY) {
      return;
    }
    let x3 = _x - translateX;
    let y4 = _y - translateY;
    btn.translate(x3, y4);
  }
  //  创建概要节点
  renderGeneralization(node3, gLine, gNode) {
    let isLeft = node3.dir === "left";
    let {
      top,
      bottom,
      left,
      right,
      generalizationLineMargin,
      generalizationNodeMargin
    } = this.getNodeBoundaries(node3, "h", isLeft);
    let x3 = isLeft ? left - generalizationLineMargin : right + generalizationLineMargin;
    let x1 = x3;
    let y1 = top;
    let x22 = x3;
    let y22 = bottom;
    let cx2 = x1 + (isLeft ? -20 : 20);
    let cy2 = y1 + (y22 - y1) / 2;
    let path = `M ${x1},${y1} Q ${cx2},${cy2} ${x22},${y22}`;
    gLine.plot(path);
    gNode.left = x3 + (isLeft ? -generalizationNodeMargin : generalizationNodeMargin) - (isLeft ? gNode.width : 0);
    gNode.top = top + (bottom - top - gNode.height) / 2;
  }
};
var MindMap_default = MindMap;

// ../simple-mind-map/src/layouts/CatalogOrganization.js
var CatalogOrganization = class extends Base_default {
  //  构造函数
  constructor(opt = {}) {
    super(opt);
  }
  //  布局
  doLayout(callback) {
    let task = [
      () => {
        this.computedBaseValue();
      },
      () => {
        this.computedLeftTopValue();
      },
      () => {
        this.adjustLeftTopValue();
      },
      () => {
        callback(this.root);
      }
    ];
    asyncRun(task);
  }
  //  遍历数据计算节点的left、width、height
  computedBaseValue() {
    walk(
      this.renderer.renderTree,
      null,
      (cur, parent, isRoot, layerIndex) => {
        let newNode = this.createNode(cur, parent, isRoot, layerIndex);
        if (isRoot) {
          this.setNodeCenter(newNode);
        } else {
          if (parent._node.isRoot) {
            newNode.top = parent._node.top + parent._node.height + this.getMarginX(layerIndex);
          }
        }
        if (!cur.data.expand) {
          return true;
        }
      },
      (cur, parent, isRoot, layerIndex) => {
        if (isRoot) {
          let len = cur.data.expand === false ? 0 : cur._node.children.length;
          cur._node.childrenAreaWidth = len ? cur._node.children.reduce((h3, item) => {
            return h3 + item.width;
          }, 0) + (len + 1) * this.getMarginX(layerIndex + 1) : 0;
        }
      },
      true,
      0
    );
  }
  //  遍历节点树计算节点的left、top
  computedLeftTopValue() {
    walk(
      this.root,
      null,
      (node3, parent, isRoot, layerIndex) => {
        if (node3.nodeData.data.expand && node3.children && node3.children.length) {
          let marginX = this.getMarginX(layerIndex + 1);
          let marginY = this.getMarginY(layerIndex + 1);
          if (isRoot) {
            let left = node3.left + node3.width / 2 - node3.childrenAreaWidth / 2;
            let totalLeft = left + marginX;
            node3.children.forEach((cur) => {
              cur.left = totalLeft;
              totalLeft += cur.width + marginX;
            });
          } else {
            let totalTop = node3.top + node3.height + marginY + (this.getNodeActChildrenLength(node3) > 0 ? node3.expandBtnSize : 0);
            node3.children.forEach((cur) => {
              cur.left = node3.left + node3.width * 0.5;
              cur.top = totalTop;
              totalTop += cur.height + marginY + (this.getNodeActChildrenLength(cur) > 0 ? cur.expandBtnSize : 0);
            });
          }
        }
      },
      null,
      true
    );
  }
  //  调整节点left、top
  adjustLeftTopValue() {
    walk(
      this.root,
      null,
      (node3, parent, isRoot, layerIndex) => {
        if (!node3.nodeData.data.expand) {
          return;
        }
        if (parent && parent.isRoot) {
          let areaWidth = this.getNodeAreaWidth(node3);
          let difference2 = areaWidth - node3.width;
          if (difference2 > 0) {
            this.updateBrothersLeft(node3, difference2);
          }
        }
        let len = node3.children.length;
        if (parent && !parent.isRoot && len > 0) {
          let marginY = this.getMarginY(layerIndex + 1);
          let totalHeight = node3.children.reduce((h3, item) => {
            return h3 + item.height + (this.getNodeActChildrenLength(item) > 0 ? item.expandBtnSize : 0);
          }, 0) + len * marginY;
          this.updateBrothersTop(node3, totalHeight);
        }
      },
      (node3, parent, isRoot) => {
        if (isRoot) {
          let { right, left } = this.getNodeBoundaries(node3, "h");
          let childrenWidth = right - left;
          let offset = node3.left - left - (childrenWidth - node3.width) / 2;
          this.updateChildren(node3.children, "left", offset);
        }
      },
      true
    );
  }
  //  调整兄弟节点的left
  updateBrothersLeft(node3, addWidth) {
    if (node3.parent) {
      let childrenList = node3.parent.children;
      let index3 = childrenList.findIndex((item) => {
        return item === node3;
      });
      childrenList.forEach((item, _index) => {
        if (item.hasCustomPosition() || _index <= index3) {
          return;
        }
        item.left += addWidth;
        if (item.children && item.children.length) {
          this.updateChildren(item.children, "left", addWidth);
        }
      });
      this.updateBrothersLeft(node3.parent, addWidth);
    }
  }
  //  调整兄弟节点的top
  updateBrothersTop(node3, addHeight) {
    if (node3.parent && !node3.parent.isRoot) {
      let childrenList = node3.parent.children;
      let index3 = childrenList.findIndex((item) => {
        return item === node3;
      });
      childrenList.forEach((item, _index) => {
        if (item.hasCustomPosition()) {
          return;
        }
        let _offset = 0;
        if (_index > index3) {
          _offset = addHeight;
        }
        item.top += _offset;
        if (item.children && item.children.length) {
          this.updateChildren(item.children, "top", _offset);
        }
      });
      this.updateBrothersTop(node3.parent, addHeight);
    }
  }
  //  绘制连线，连接该节点到其子节点
  renderLine(node3, lines, style) {
    if (node3.children.length <= 0) {
      return [];
    }
    let { left, top, width: width2, height: height2, expandBtnSize } = node3;
    if (!this.mindMap.opt.alwaysShowExpandBtn) {
      expandBtnSize = 0;
    }
    let len = node3.children.length;
    let marginX = this.getMarginX(node3.layerIndex + 1);
    if (node3.isRoot) {
      let x1 = left + width2 / 2;
      let y1 = top + height2;
      let s1 = marginX * 0.7;
      let minx = Infinity;
      let maxx = -Infinity;
      node3.children.forEach((item, index3) => {
        let x22 = item.left + item.width / 2;
        let y22 = item.top;
        if (x22 < minx) {
          minx = x22;
        }
        if (x22 > maxx) {
          maxx = x22;
        }
        let nodeUseLineStylePath = this.mindMap.themeConfig.nodeUseLineStyle ? ` L ${item.left},${y22} L ${item.left + item.width},${y22}` : "";
        let path = `M ${x22},${y1 + s1} L ${x22},${y1 + s1 > y22 ? y22 + item.height : y22}` + nodeUseLineStylePath;
        lines[index3].plot(path);
        style && style(lines[index3], item);
      });
      minx = Math.min(minx, x1);
      maxx = Math.max(maxx, x1);
      let line1 = this.draw.path();
      node3.style.line(line1);
      line1.plot(`M ${x1},${y1} L ${x1},${y1 + s1}`);
      node3._lines.push(line1);
      style && style(line1, node3);
      if (len > 0) {
        let lin2 = this.draw.path();
        node3.style.line(lin2);
        lin2.plot(`M ${minx},${y1 + s1} L ${maxx},${y1 + s1}`);
        node3._lines.push(lin2);
        style && style(lin2, node3);
      }
    } else {
      let y1 = top + height2;
      let maxy = -Infinity;
      let x22 = node3.left + node3.width * 0.3;
      node3.children.forEach((item, index3) => {
        let y22 = item.top + item.height / 2;
        if (y22 > maxy) {
          maxy = y22;
        }
        let path = "";
        let _left = item.left;
        let _isLeft = item.left + item.width < x22;
        let _isXCenter = false;
        if (_isLeft) {
          _left = item.left + item.width;
        } else if (item.left < x22 && item.left + item.width > x22) {
          _isXCenter = true;
          y22 = item.top;
          maxy = y22;
        }
        if (y22 > top && y22 < y1) {
          path = `M ${_isLeft ? node3.left : node3.left + node3.width},${y22} L ${_left},${y22}`;
        } else if (y22 < y1) {
          if (_isXCenter) {
            y22 = item.top + item.height;
            _left = x22;
          }
          path = `M ${x22},${top} L ${x22},${y22} L ${_left},${y22}`;
        } else {
          if (_isXCenter) {
            _left = x22;
          }
          path = `M ${x22},${y22} L ${_left},${y22}`;
        }
        let nodeUseLineStylePath = this.mindMap.themeConfig.nodeUseLineStyle ? ` L ${_left},${y22 - item.height / 2} L ${_left},${y22 + item.height / 2}` : "";
        path += nodeUseLineStylePath;
        lines[index3].plot(path);
        style && style(lines[index3], item);
      });
      if (len > 0) {
        let lin2 = this.draw.path();
        expandBtnSize = len > 0 ? expandBtnSize : 0;
        node3.style.line(lin2);
        if (maxy < y1 + expandBtnSize) {
          lin2.hide();
        } else {
          lin2.plot(`M ${x22},${y1 + expandBtnSize} L ${x22},${maxy}`);
          lin2.show();
        }
        node3._lines.push(lin2);
        style && style(lin2, node3);
      }
    }
  }
  //  渲染按钮
  renderExpandBtn(node3, btn) {
    let { width: width2, height: height2, expandBtnSize, isRoot } = node3;
    if (!isRoot) {
      let { translateX, translateY } = btn.transform();
      btn.translate(
        width2 * 0.3 - expandBtnSize / 2 - translateX,
        height2 + expandBtnSize / 2 - translateY
      );
    }
  }
  //  创建概要节点
  renderGeneralization(node3, gLine, gNode) {
    let {
      top,
      bottom,
      right,
      generalizationLineMargin,
      generalizationNodeMargin
    } = this.getNodeBoundaries(node3, "h");
    let x1 = right + generalizationLineMargin;
    let y1 = top;
    let x22 = right + generalizationLineMargin;
    let y22 = bottom;
    let cx2 = x1 + 20;
    let cy2 = y1 + (y22 - y1) / 2;
    let path = `M ${x1},${y1} Q ${cx2},${cy2} ${x22},${y22}`;
    gLine.plot(path);
    gNode.left = right + generalizationNodeMargin;
    gNode.top = top + (bottom - top - gNode.height) / 2;
  }
};
var CatalogOrganization_default = CatalogOrganization;

// ../simple-mind-map/src/layouts/OrganizationStructure.js
var OrganizationStructure = class extends Base_default {
  //  构造函数
  constructor(opt = {}) {
    super(opt);
  }
  //  布局
  doLayout(callback) {
    let task = [
      () => {
        this.computedBaseValue();
      },
      () => {
        this.computedLeftValue();
      },
      () => {
        this.adjustLeftValue();
      },
      () => {
        callback(this.root);
      }
    ];
    asyncRun(task);
  }
  //  遍历数据计算节点的left、width、height
  computedBaseValue() {
    walk(
      this.renderer.renderTree,
      null,
      (cur, parent, isRoot, layerIndex) => {
        let newNode = this.createNode(cur, parent, isRoot, layerIndex);
        if (isRoot) {
          this.setNodeCenter(newNode);
        } else {
          newNode.top = parent._node.top + parent._node.height + this.getMarginX(layerIndex);
        }
        if (!cur.data.expand) {
          return true;
        }
      },
      (cur, parent, isRoot, layerIndex) => {
        let len = cur.data.expand === false ? 0 : cur._node.children.length;
        cur._node.childrenAreaWidth = len ? cur._node.children.reduce((h3, item) => {
          return h3 + item.width;
        }, 0) + (len + 1) * this.getMarginY(layerIndex + 1) : 0;
      },
      true,
      0
    );
  }
  //  遍历节点树计算节点的left
  computedLeftValue() {
    walk(
      this.root,
      null,
      (node3, parent, isRoot, layerIndex) => {
        if (node3.nodeData.data.expand && node3.children && node3.children.length) {
          let marginX = this.getMarginY(layerIndex + 1);
          let left = node3.left + node3.width / 2 - node3.childrenAreaWidth / 2;
          let totalLeft = left + marginX;
          node3.children.forEach((cur) => {
            cur.left = totalLeft;
            totalLeft += cur.width + marginX;
          });
        }
      },
      null,
      true
    );
  }
  //  调整节点left
  adjustLeftValue() {
    walk(
      this.root,
      null,
      (node3, parent, isRoot, layerIndex) => {
        if (!node3.nodeData.data.expand) {
          return;
        }
        let difference2 = node3.childrenAreaWidth - this.getMarginY(layerIndex + 1) * 2 - node3.width;
        if (difference2 > 0) {
          this.updateBrothers(node3, difference2 / 2);
        }
      },
      null,
      true
    );
  }
  //  更新兄弟节点的left
  updateBrothers(node3, addWidth) {
    if (node3.parent) {
      let childrenList = node3.parent.children;
      let index3 = childrenList.findIndex((item) => {
        return item === node3;
      });
      childrenList.forEach((item, _index) => {
        if (item.hasCustomPosition()) {
          return;
        }
        let _offset = 0;
        if (_index < index3) {
          _offset = -addWidth;
        } else if (_index > index3) {
          _offset = addWidth;
        }
        item.left += _offset;
        if (item.children && item.children.length) {
          this.updateChildren(item.children, "left", _offset);
        }
      });
      this.updateBrothers(node3.parent, addWidth);
    }
  }
  //  绘制连线，连接该节点到其子节点
  renderLine(node3, lines, style, lineStyle) {
    if (lineStyle === "direct") {
      this.renderLineDirect(node3, lines, style);
    } else {
      this.renderLineStraight(node3, lines, style);
    }
  }
  //  直连风格
  renderLineDirect(node3, lines, style) {
    if (node3.children.length <= 0) {
      return [];
    }
    let { left, top, width: width2, height: height2 } = node3;
    let x1 = left + width2 / 2;
    let y1 = top + height2;
    node3.children.forEach((item, index3) => {
      let x22 = item.left + item.width / 2;
      let y22 = item.top;
      let nodeUseLineStylePath = this.mindMap.themeConfig.nodeUseLineStyle ? ` L ${item.left},${y22} L ${item.left + item.width},${y22}` : "";
      let path = `M ${x1},${y1} L ${x22},${y22}` + nodeUseLineStylePath;
      lines[index3].plot(path);
      style && style(lines[index3], item);
    });
  }
  //  直线风格连线
  renderLineStraight(node3, lines, style) {
    if (node3.children.length <= 0) {
      return [];
    }
    let { left, top, width: width2, height: height2, expandBtnSize, isRoot } = node3;
    if (!this.mindMap.opt.alwaysShowExpandBtn) {
      expandBtnSize = 0;
    }
    let x1 = left + width2 / 2;
    let y1 = top + height2;
    let marginX = this.getMarginX(node3.layerIndex + 1);
    let s1 = marginX * 0.7;
    let minx = Infinity;
    let maxx = -Infinity;
    let len = node3.children.length;
    node3.children.forEach((item, index3) => {
      let x22 = item.left + item.width / 2;
      let y22 = y1 + s1 > item.top ? item.top + item.height : item.top;
      if (x22 < minx) {
        minx = x22;
      }
      if (x22 > maxx) {
        maxx = x22;
      }
      let nodeUseLineStylePath = this.mindMap.themeConfig.nodeUseLineStyle ? ` L ${item.left},${y22} L ${item.left + item.width},${y22}` : "";
      let path = `M ${x22},${y1 + s1} L ${x22},${y22}` + nodeUseLineStylePath;
      lines[index3].plot(path);
      style && style(lines[index3], item);
    });
    minx = Math.min(x1, minx);
    maxx = Math.max(x1, maxx);
    let line1 = this.draw.path();
    node3.style.line(line1);
    expandBtnSize = len > 0 && !isRoot ? expandBtnSize : 0;
    line1.plot(`M ${x1},${y1 + expandBtnSize} L ${x1},${y1 + s1}`);
    node3._lines.push(line1);
    style && style(line1, node3);
    if (len > 0) {
      let lin2 = this.draw.path();
      node3.style.line(lin2);
      lin2.plot(`M ${minx},${y1 + s1} L ${maxx},${y1 + s1}`);
      node3._lines.push(lin2);
      style && style(lin2, node3);
    }
  }
  //  渲染按钮
  renderExpandBtn(node3, btn) {
    let { width: width2, height: height2, expandBtnSize } = node3;
    let { translateX, translateY } = btn.transform();
    btn.translate(
      width2 / 2 - expandBtnSize / 2 - translateX,
      height2 + expandBtnSize / 2 - translateY
    );
  }
  //  创建概要节点
  renderGeneralization(node3, gLine, gNode) {
    let {
      bottom,
      left,
      right,
      generalizationLineMargin,
      generalizationNodeMargin
    } = this.getNodeBoundaries(node3, "v");
    let x1 = left;
    let y1 = bottom + generalizationLineMargin;
    let x22 = right;
    let y22 = bottom + generalizationLineMargin;
    let cx2 = x1 + (x22 - x1) / 2;
    let cy2 = y1 + 20;
    let path = `M ${x1},${y1} Q ${cx2},${cy2} ${x22},${y22}`;
    gLine.plot(path);
    gNode.top = bottom + generalizationNodeMargin;
    gNode.left = left + (right - left - gNode.width) / 2;
  }
};
var OrganizationStructure_default = OrganizationStructure;

// ../simple-mind-map/src/layouts/Timeline.js
var Timeline2 = class extends Base_default {
  //  构造函数
  constructor(opt = {}, layout) {
    super(opt);
    this.layout = layout;
  }
  //  布局
  doLayout(callback) {
    let task = [
      () => {
        this.computedBaseValue();
      },
      () => {
        this.computedLeftTopValue();
      },
      () => {
        this.adjustLeftTopValue();
      },
      () => {
        callback(this.root);
      }
    ];
    asyncRun(task);
  }
  //  遍历数据创建节点、计算根节点的位置，计算根节点的子节点的top值
  computedBaseValue() {
    walk(
      this.renderer.renderTree,
      null,
      (cur, parent, isRoot, layerIndex, index3) => {
        let newNode = this.createNode(cur, parent, isRoot, layerIndex);
        if (isRoot) {
          this.setNodeCenter(newNode);
        } else {
          if (this.layout === CONSTANTS.LAYOUT.TIMELINE2) {
            if (parent._node.dir) {
              newNode.dir = parent._node.dir;
            } else {
              newNode.dir = index3 % 2 === 0 ? CONSTANTS.TIMELINE_DIR.BOTTOM : CONSTANTS.TIMELINE_DIR.TOP;
            }
          } else {
            newNode.dir = "";
          }
          if (parent._node.isRoot) {
            newNode.top = parent._node.top + (cur._node.height > parent._node.height ? -(cur._node.height - parent._node.height) / 2 : (parent._node.height - cur._node.height) / 2);
          }
        }
        if (!cur.data.expand) {
          return true;
        }
      },
      null,
      true,
      0
    );
  }
  //  遍历节点树计算节点的left、top
  computedLeftTopValue() {
    walk(
      this.root,
      null,
      (node3, parent, isRoot, layerIndex, index3) => {
        if (node3.nodeData.data.expand && node3.children && node3.children.length) {
          let marginX = this.getMarginX(layerIndex + 1);
          let marginY = this.getMarginY(layerIndex + 1);
          if (isRoot) {
            let left = node3.left + node3.width;
            let totalLeft = left + marginX;
            node3.children.forEach((cur) => {
              cur.left = totalLeft;
              totalLeft += cur.width + marginX;
            });
          } else {
            let totalTop = node3.top + node3.height + marginY + (this.getNodeActChildrenLength(node3) > 0 ? node3.expandBtnSize : 0);
            node3.children.forEach((cur) => {
              cur.left = node3.left + node3.width * 0.5;
              cur.top = totalTop;
              totalTop += cur.height + marginY + (this.getNodeActChildrenLength(cur) > 0 ? cur.expandBtnSize : 0);
            });
          }
        }
      },
      null,
      true
    );
  }
  //  调整节点left、top
  adjustLeftTopValue() {
    walk(
      this.root,
      null,
      (node3, parent, isRoot, layerIndex) => {
        if (!node3.nodeData.data.expand) {
          return;
        }
        if (node3.isRoot) {
          this.updateBrothersLeft(node3);
        }
        let len = node3.children.length;
        if (parent && !parent.isRoot && len > 0) {
          let marginY = this.getMarginY(layerIndex + 1);
          let totalHeight = node3.children.reduce((h3, item) => {
            return h3 + item.height + (this.getNodeActChildrenLength(item) > 0 ? item.expandBtnSize : 0);
          }, 0) + len * marginY;
          this.updateBrothersTop(node3, totalHeight);
        }
      },
      (node3, parent, isRoot, layerIndex) => {
        if (parent && parent.isRoot && node3.dir === CONSTANTS.TIMELINE_DIR.TOP) {
          node3.children.forEach((item) => {
            let totalHeight = this.getNodeAreaHeight(item);
            let _top = item.top;
            item.top = node3.top - (item.top - node3.top) - totalHeight + node3.height;
            this.updateChildren(item.children, "top", item.top - _top);
          });
        }
      },
      true
    );
  }
  //  递归计算节点的宽度
  getNodeAreaHeight(node3) {
    let totalHeight = 0;
    let loop = (node4) => {
      totalHeight += node4.height + (this.getNodeActChildrenLength(node4) > 0 ? node4.expandBtnSize : 0) + this.getMarginY(node4.layerIndex);
      if (node4.children.length) {
        node4.children.forEach((item) => {
          loop(item);
        });
      }
    };
    loop(node3);
    return totalHeight;
  }
  //  调整兄弟节点的left
  updateBrothersLeft(node3) {
    let childrenList = node3.children;
    let totalAddWidth = 0;
    childrenList.forEach((item) => {
      item.left += totalAddWidth;
      if (item.children && item.children.length) {
        this.updateChildren(item.children, "left", totalAddWidth);
      }
      let { left, right } = this.getNodeBoundaries(item, "h");
      let areaWidth = right - left;
      let difference2 = areaWidth - item.width;
      if (difference2 > 0) {
        totalAddWidth += difference2;
      }
    });
  }
  //  调整兄弟节点的top
  updateBrothersTop(node3, addHeight) {
    if (node3.parent && !node3.parent.isRoot) {
      let childrenList = node3.parent.children;
      let index3 = childrenList.findIndex((item) => {
        return item === node3;
      });
      childrenList.forEach((item, _index) => {
        if (item.hasCustomPosition()) {
          return;
        }
        let _offset = 0;
        if (_index > index3) {
          _offset = addHeight;
        }
        item.top += _offset;
        if (item.children && item.children.length) {
          this.updateChildren(item.children, "top", _offset);
        }
      });
      this.updateBrothersTop(node3.parent, addHeight);
    }
  }
  //  绘制连线，连接该节点到其子节点
  renderLine(node3, lines, style) {
    if (node3.children.length <= 0) {
      return [];
    }
    let { left, top, width: width2, height: height2, expandBtnSize } = node3;
    if (!this.mindMap.opt.alwaysShowExpandBtn) {
      expandBtnSize = 0;
    }
    let len = node3.children.length;
    if (node3.isRoot) {
      let prevBother = node3;
      node3.children.forEach((item, index3) => {
        let x1 = prevBother.left + prevBother.width;
        let x22 = item.left;
        let y4 = node3.top + node3.height / 2;
        let path = `M ${x1},${y4} L ${x22},${y4}`;
        lines[index3].plot(path);
        style && style(lines[index3], item);
        prevBother = item;
      });
    } else {
      let maxy = -Infinity;
      let miny = Infinity;
      let x3 = node3.left + node3.width * 0.3;
      node3.children.forEach((item, index3) => {
        let y4 = item.top + item.height / 2;
        if (y4 > maxy) {
          maxy = y4;
        }
        if (y4 < miny) {
          miny = y4;
        }
        let path = `M ${x3},${y4} L ${item.left},${y4}`;
        lines[index3].plot(path);
        style && style(lines[index3], item);
      });
      if (len > 0) {
        let line = this.draw.path();
        expandBtnSize = len > 0 ? expandBtnSize : 0;
        if (node3.parent && node3.parent.isRoot && node3.dir === CONSTANTS.TIMELINE_DIR.TOP) {
          line.plot(`M ${x3},${top} L ${x3},${miny}`);
        } else {
          line.plot(`M ${x3},${top + height2 + expandBtnSize} L ${x3},${maxy}`);
        }
        node3.style.line(line);
        node3._lines.push(line);
        style && style(line, node3);
      }
    }
  }
  //  渲染按钮
  renderExpandBtn(node3, btn) {
    let { width: width2, height: height2, expandBtnSize, isRoot } = node3;
    if (!isRoot) {
      let { translateX, translateY } = btn.transform();
      if (node3.parent && node3.parent.isRoot && node3.dir === CONSTANTS.TIMELINE_DIR.TOP) {
        btn.translate(
          width2 * 0.3 - expandBtnSize / 2 - translateX,
          -expandBtnSize / 2 - translateY
        );
      } else {
        btn.translate(
          width2 * 0.3 - expandBtnSize / 2 - translateX,
          height2 + expandBtnSize / 2 - translateY
        );
      }
    }
  }
  //  创建概要节点
  renderGeneralization(node3, gLine, gNode) {
    let {
      top,
      bottom,
      right,
      generalizationLineMargin,
      generalizationNodeMargin
    } = this.getNodeBoundaries(node3, "h");
    let x1 = right + generalizationLineMargin;
    let y1 = top;
    let x22 = right + generalizationLineMargin;
    let y22 = bottom;
    let cx2 = x1 + 20;
    let cy2 = y1 + (y22 - y1) / 2;
    let path = `M ${x1},${y1} Q ${cx2},${cy2} ${x22},${y22}`;
    gLine.plot(path);
    gNode.left = right + generalizationNodeMargin;
    gNode.top = top + (bottom - top - gNode.height) / 2;
  }
};
var Timeline_default = Timeline2;

// ../simple-mind-map/src/layouts/fishboneUtils.js
var fishboneUtils_default = {
  top: {
    renderExpandBtn({
      node: node3,
      btn,
      expandBtnSize,
      translateX,
      translateY,
      width: width2,
      height: height2
    }) {
      if (node3.parent && node3.parent.isRoot) {
        btn.translate(
          width2 * 0.3 - expandBtnSize / 2 - translateX,
          -expandBtnSize / 2 - translateY
        );
      } else {
        btn.translate(
          width2 * 0.3 - expandBtnSize / 2 - translateX,
          height2 + expandBtnSize / 2 - translateY
        );
      }
    },
    renderLine({
      node: node3,
      line,
      top,
      x: x3,
      lineLength,
      height: height2,
      expandBtnSize,
      maxy,
      ctx
    }) {
      if (node3.parent && node3.parent.isRoot) {
        line.plot(
          `M ${x3},${top} L ${x3 + lineLength},${top - Math.tan(degToRad(ctx.mindMap.opt.fishboneDeg)) * lineLength}`
        );
      } else {
        line.plot(`M ${x3},${top + height2 + expandBtnSize} L ${x3},${maxy}`);
      }
    },
    computedLeftTopValue({ layerIndex, node: node3, ctx }) {
      if (layerIndex >= 1 && node3.children) {
        let startLeft = node3.left + node3.width * ctx.childIndent;
        let totalTop = node3.top + node3.height + (ctx.getNodeActChildrenLength(node3) > 0 ? node3.expandBtnSize : 0);
        node3.children.forEach((item) => {
          item.left = startLeft;
          item.top += totalTop;
          totalTop += item.height + (ctx.getNodeActChildrenLength(item) > 0 ? item.expandBtnSize : 0);
        });
      }
    },
    adjustLeftTopValueBefore({ node: node3, parent, ctx }) {
      let len = node3.children.length;
      if (parent && !parent.isRoot && len > 0) {
        let totalHeight = node3.children.reduce((h3, item) => {
          return h3 + item.height + (ctx.getNodeActChildrenLength(item) > 0 ? item.expandBtnSize : 0);
        }, 0);
        ctx.updateBrothersTop(node3, totalHeight);
      }
    },
    adjustLeftTopValueAfter({ parent, node: node3, ctx }) {
      if (parent && parent.isRoot) {
        let totalHeight = node3.expandBtnSize;
        node3.children.forEach((item) => {
          let nodeTotalHeight = ctx.getNodeAreaHeight(item);
          let _top = item.top;
          let _left = item.left;
          item.top = node3.top - (item.top - node3.top) - nodeTotalHeight + node3.height;
          item.left = node3.left + node3.width * ctx.indent + (nodeTotalHeight + totalHeight) / Math.tan(degToRad(ctx.mindMap.opt.fishboneDeg));
          totalHeight += nodeTotalHeight;
          ctx.updateChildrenPro(item.children, {
            top: item.top - _top,
            left: item.left - _left
          });
        });
      }
    }
  },
  bottom: {
    renderExpandBtn({
      node: node3,
      btn,
      expandBtnSize,
      translateX,
      translateY,
      width: width2,
      height: height2
    }) {
      if (node3.parent && node3.parent.isRoot) {
        btn.translate(
          width2 * 0.3 - expandBtnSize / 2 - translateX,
          height2 + expandBtnSize / 2 - translateY
        );
      } else {
        btn.translate(
          width2 * 0.3 - expandBtnSize / 2 - translateX,
          -expandBtnSize / 2 - translateY
        );
      }
    },
    renderLine({ node: node3, line, top, x: x3, lineLength, height: height2, miny, ctx }) {
      if (node3.parent && node3.parent.isRoot) {
        line.plot(
          `M ${x3},${top + height2} L ${x3 + lineLength},${top + height2 + Math.tan(degToRad(ctx.mindMap.opt.fishboneDeg)) * lineLength}`
        );
      } else {
        line.plot(`M ${x3},${top} L ${x3},${miny}`);
      }
    },
    computedLeftTopValue({ layerIndex, node: node3, ctx }) {
      if (layerIndex === 1 && node3.children) {
        let startLeft = node3.left + node3.width * ctx.childIndent;
        let totalTop = node3.top + node3.height + (ctx.getNodeActChildrenLength(node3) > 0 ? node3.expandBtnSize : 0);
        node3.children.forEach((item) => {
          item.left = startLeft;
          item.top = totalTop + (ctx.getNodeActChildrenLength(item) > 0 ? item.expandBtnSize : 0);
          totalTop += item.height + (ctx.getNodeActChildrenLength(item) > 0 ? item.expandBtnSize : 0);
        });
      }
      if (layerIndex > 1 && node3.children) {
        let startLeft = node3.left + node3.width * ctx.childIndent;
        let totalTop = node3.top - (ctx.getNodeActChildrenLength(node3) > 0 ? node3.expandBtnSize : 0);
        node3.children.forEach((item) => {
          item.left = startLeft;
          item.top = totalTop - item.height;
          totalTop -= item.height + (ctx.getNodeActChildrenLength(item) > 0 ? item.expandBtnSize : 0);
        });
      }
    },
    adjustLeftTopValueBefore({ node: node3, ctx, layerIndex }) {
      let len = node3.children.length;
      if (layerIndex > 2 && len > 0) {
        let totalHeight = node3.children.reduce((h3, item) => {
          return h3 + item.height + (ctx.getNodeActChildrenLength(item) > 0 ? item.expandBtnSize : 0);
        }, 0);
        ctx.updateBrothersTop(node3, -totalHeight);
      }
    },
    adjustLeftTopValueAfter({ parent, node: node3, ctx }) {
      if (parent && parent.isRoot) {
        let totalHeight = 0;
        let totalHeight2 = node3.expandBtnSize;
        node3.children.forEach((item) => {
          let hasChildren = ctx.getNodeActChildrenLength(item) > 0;
          let nodeTotalHeight = ctx.getNodeAreaHeight(item);
          let offset = hasChildren > 0 ? nodeTotalHeight - item.height - (hasChildren ? item.expandBtnSize : 0) : 0;
          let _top = totalHeight + offset;
          let _left = item.left;
          item.top += _top;
          item.left = node3.left + node3.width * ctx.indent + (nodeTotalHeight + totalHeight2) / Math.tan(degToRad(ctx.mindMap.opt.fishboneDeg));
          totalHeight += offset;
          totalHeight2 += nodeTotalHeight;
          ctx.updateChildrenPro(item.children, {
            top: _top,
            left: item.left - _left
          });
        });
      }
    }
  }
};

// ../simple-mind-map/src/layouts/Fishbone.js
var Fishbone = class extends Base_default {
  //  构造函数
  constructor(opt = {}) {
    super(opt);
    this.indent = 0.3;
    this.childIndent = 0.5;
  }
  //  布局
  doLayout(callback) {
    let task = [
      () => {
        this.computedBaseValue();
      },
      () => {
        this.computedLeftTopValue();
      },
      () => {
        this.adjustLeftTopValue();
      },
      () => {
        callback(this.root);
      }
    ];
    asyncRun(task);
  }
  //  遍历数据创建节点、计算根节点的位置，计算根节点的子节点的top值
  computedBaseValue() {
    walk(
      this.renderer.renderTree,
      null,
      (node3, parent, isRoot, layerIndex, index3) => {
        let newNode = this.createNode(node3, parent, isRoot, layerIndex);
        if (isRoot) {
          this.setNodeCenter(newNode);
        } else {
          if (parent._node.dir) {
            newNode.dir = parent._node.dir;
          } else {
            newNode.dir = index3 % 2 === 0 ? CONSTANTS.TIMELINE_DIR.TOP : CONSTANTS.TIMELINE_DIR.BOTTOM;
          }
          if (parent._node.isRoot) {
            if (this.checkIsTop(newNode)) {
              newNode.top = parent._node.top - newNode.height;
            } else {
              newNode.top = parent._node.top + parent._node.height;
            }
          }
        }
        if (!node3.data.expand) {
          return true;
        }
      },
      null,
      true,
      0
    );
  }
  //  遍历节点树计算节点的left、top
  computedLeftTopValue() {
    walk(
      this.root,
      null,
      (node3, parent, isRoot, layerIndex) => {
        if (node3.isRoot) {
          let topTotalLeft = node3.left + node3.width + node3.height;
          let bottomTotalLeft = node3.left + node3.width + node3.height;
          node3.children.forEach((item) => {
            if (this.checkIsTop(item)) {
              item.left = topTotalLeft;
              topTotalLeft += item.width;
            } else {
              item.left = bottomTotalLeft + 20;
              bottomTotalLeft += item.width;
            }
          });
        }
        let params = { layerIndex, node: node3, ctx: this };
        if (this.checkIsTop(node3)) {
          fishboneUtils_default.top.computedLeftTopValue(params);
        } else {
          fishboneUtils_default.bottom.computedLeftTopValue(params);
        }
      },
      null,
      true
    );
  }
  //  调整节点left、top
  adjustLeftTopValue() {
    walk(
      this.root,
      null,
      (node3, parent, isRoot, layerIndex) => {
        if (!node3.nodeData.data.expand) {
          return;
        }
        let params = { node: node3, parent, layerIndex, ctx: this };
        if (this.checkIsTop(node3)) {
          fishboneUtils_default.top.adjustLeftTopValueBefore(params);
        } else {
          fishboneUtils_default.bottom.adjustLeftTopValueBefore(params);
        }
      },
      (node3, parent) => {
        let params = { parent, node: node3, ctx: this };
        if (this.checkIsTop(node3)) {
          fishboneUtils_default.top.adjustLeftTopValueAfter(params);
        } else {
          fishboneUtils_default.bottom.adjustLeftTopValueAfter(params);
        }
        if (node3.isRoot) {
          let topTotalLeft = 0;
          let bottomTotalLeft = 0;
          node3.children.forEach((item) => {
            if (this.checkIsTop(item)) {
              item.left += topTotalLeft;
              this.updateChildren(item.children, "left", topTotalLeft);
              let { left, right } = this.getNodeBoundaries(item, "h");
              topTotalLeft += right - left;
            } else {
              item.left += bottomTotalLeft;
              this.updateChildren(item.children, "left", bottomTotalLeft);
              let { left, right } = this.getNodeBoundaries(item, "h");
              bottomTotalLeft += right - left;
            }
          });
        }
      },
      true
    );
  }
  //  递归计算节点的宽度
  getNodeAreaHeight(node3) {
    let totalHeight = 0;
    let loop = (node4) => {
      totalHeight += node4.height + (this.getNodeActChildrenLength(node4) > 0 ? node4.expandBtnSize : 0);
      if (node4.children.length) {
        node4.children.forEach((item) => {
          loop(item);
        });
      }
    };
    loop(node3);
    return totalHeight;
  }
  //  调整兄弟节点的left
  updateBrothersLeft(node3) {
    let childrenList = node3.children;
    let totalAddWidth = 0;
    childrenList.forEach((item) => {
      item.left += totalAddWidth;
      if (item.children && item.children.length) {
        this.updateChildren(item.children, "left", totalAddWidth);
      }
      let { left, right } = this.getNodeBoundaries(item, "h");
      let areaWidth = right - left;
      let difference2 = areaWidth - item.width;
      if (difference2 > 0) {
        totalAddWidth += difference2;
      }
    });
  }
  //  调整兄弟节点的top
  updateBrothersTop(node3, addHeight) {
    if (node3.parent && !node3.parent.isRoot) {
      let childrenList = node3.parent.children;
      let index3 = childrenList.findIndex((item) => {
        return item === node3;
      });
      childrenList.forEach((item, _index) => {
        if (item.hasCustomPosition()) {
          return;
        }
        let _offset = 0;
        if (_index > index3) {
          _offset = addHeight;
        }
        item.top += _offset;
        if (item.children && item.children.length) {
          this.updateChildren(item.children, "top", _offset);
        }
      });
      if (this.checkIsTop(node3)) {
        this.updateBrothersTop(node3.parent, addHeight);
      } else {
        this.updateBrothersTop(
          node3.parent,
          node3.layerIndex === 3 ? 0 : addHeight
        );
      }
    }
  }
  // 检查节点是否是上方节点
  checkIsTop(node3) {
    return node3.dir === CONSTANTS.TIMELINE_DIR.TOP;
  }
  //  绘制连线，连接该节点到其子节点
  renderLine(node3, lines, style) {
    if (node3.layerIndex !== 1 && node3.children.length <= 0) {
      return [];
    }
    let { top, height: height2, expandBtnSize } = node3;
    if (!this.mindMap.opt.alwaysShowExpandBtn) {
      expandBtnSize = 0;
    }
    let len = node3.children.length;
    if (node3.isRoot) {
      let maxx = -Infinity;
      node3.children.forEach((item) => {
        if (item.left > maxx) {
          maxx = item.left;
        }
        let nodeLineX = item.left;
        let offset2 = node3.height / 2;
        let offsetX = offset2 / Math.tan(degToRad(this.mindMap.opt.fishboneDeg));
        let line2 = this.draw.path();
        if (this.checkIsTop(item)) {
          line2.plot(
            `M ${nodeLineX - offsetX},${item.top + item.height + offset2} L ${item.left},${item.top + item.height}`
          );
        } else {
          line2.plot(
            `M ${nodeLineX - offsetX},${item.top - offset2} L ${nodeLineX},${item.top}`
          );
        }
        node3.style.line(line2);
        node3._lines.push(line2);
        style && style(line2, node3);
      });
      let nodeHalfTop = node3.top + node3.height / 2;
      let offset = node3.height / 2;
      let line = this.draw.path();
      line.plot(
        `M ${node3.left + node3.width},${nodeHalfTop} L ${maxx - offset / Math.tan(degToRad(this.mindMap.opt.fishboneDeg))},${nodeHalfTop}`
      );
      node3.style.line(line);
      node3._lines.push(line);
      style && style(line, node3);
    } else {
      let maxy = -Infinity;
      let miny = Infinity;
      let maxx = -Infinity;
      let x3 = node3.left + node3.width * this.indent;
      node3.children.forEach((item, index3) => {
        if (item.left > maxx) {
          maxx = item.left;
        }
        let y4 = item.top + item.height / 2;
        if (y4 > maxy) {
          maxy = y4;
        }
        if (y4 < miny) {
          miny = y4;
        }
        if (node3.layerIndex > 1) {
          let path = `M ${x3},${y4} L ${item.left},${y4}`;
          lines[index3].plot(path);
          style && style(lines[index3], item);
        }
      });
      if (len >= 0) {
        let line = this.draw.path();
        expandBtnSize = len > 0 ? expandBtnSize : 0;
        let lineLength = maxx - node3.left - node3.width * this.indent;
        lineLength = Math.max(lineLength, 0);
        let params = {
          node: node3,
          line,
          top,
          x: x3,
          lineLength,
          height: height2,
          expandBtnSize,
          maxy,
          miny,
          ctx: this
        };
        if (this.checkIsTop(node3)) {
          fishboneUtils_default.top.renderLine(params);
        } else {
          fishboneUtils_default.bottom.renderLine(params);
        }
        node3.style.line(line);
        node3._lines.push(line);
        style && style(line, node3);
      }
    }
  }
  //  渲染按钮
  renderExpandBtn(node3, btn) {
    let { width: width2, height: height2, expandBtnSize, isRoot } = node3;
    if (!isRoot) {
      let { translateX, translateY } = btn.transform();
      let params = {
        node: node3,
        btn,
        expandBtnSize,
        translateX,
        translateY,
        width: width2,
        height: height2
      };
      if (this.checkIsTop(node3)) {
        fishboneUtils_default.top.renderExpandBtn(params);
      } else {
        fishboneUtils_default.bottom.renderExpandBtn(params);
      }
    }
  }
  //  创建概要节点
  renderGeneralization(node3, gLine, gNode) {
    let {
      top,
      bottom,
      right,
      generalizationLineMargin,
      generalizationNodeMargin
    } = this.getNodeBoundaries(node3, "h");
    let x1 = right + generalizationLineMargin;
    let y1 = top;
    let x22 = right + generalizationLineMargin;
    let y22 = bottom;
    let cx2 = x1 + 20;
    let cy2 = y1 + (y22 - y1) / 2;
    let path = `M ${x1},${y1} Q ${cx2},${cy2} ${x22},${y22}`;
    gLine.plot(path);
    gNode.left = right + generalizationNodeMargin;
    gNode.top = top + (bottom - top - gNode.height) / 2;
  }
};
var Fishbone_default = Fishbone;

// ../simple-mind-map/src/core/render/TextEdit.js
var TextEdit = class {
  //  构造函数
  constructor(renderer) {
    this.renderer = renderer;
    this.mindMap = renderer.mindMap;
    this.currentNode = null;
    this.textEditNode = null;
    this.showTextEdit = false;
    this.cacheEditingText = "";
    this.bindEvent();
  }
  //  事件
  bindEvent() {
    this.show = this.show.bind(this);
    this.onScale = this.onScale.bind(this);
    this.mindMap.on("node_dblclick", this.show);
    this.mindMap.on("draw_click", () => {
      this.hideEditTextBox();
    });
    this.mindMap.on("body_click", () => {
      if (this.mindMap.opt.isEndNodeTextEditOnClickOuter) {
        this.hideEditTextBox();
      }
    });
    this.mindMap.on("svg_mousedown", () => {
      this.hideEditTextBox();
    });
    this.mindMap.on("expand_btn_click", () => {
      this.hideEditTextBox();
    });
    this.mindMap.on("before_node_active", () => {
      this.hideEditTextBox();
    });
    this.mindMap.keyCommand.addShortcut("F2", () => {
      if (this.renderer.activeNodeList.length <= 0) {
        return;
      }
      this.show(this.renderer.activeNodeList[0]);
    });
    this.mindMap.on("scale", this.onScale);
  }
  //  注册临时快捷键
  registerTmpShortcut() {
    this.mindMap.keyCommand.addShortcut("Enter", () => {
      this.hideEditTextBox();
    });
  }
  //  显示文本编辑框
  async show(node3) {
    if (typeof this.mindMap.opt.beforeTextEdit === "function") {
      let isShow = false;
      try {
        isShow = await this.mindMap.opt.beforeTextEdit(node3);
      } catch (error) {
        isShow = false;
      }
      if (!isShow)
        return;
    }
    this.currentNode = node3;
    let { offsetLeft, offsetTop } = checkNodeOuter(this.mindMap, node3);
    this.mindMap.view.translateXY(offsetLeft, offsetTop);
    let rect = node3._textData.node.node.getBoundingClientRect();
    if (this.mindMap.richText) {
      this.mindMap.richText.showEditText(node3, rect);
      return;
    }
    this.showEditTextBox(node3, rect);
  }
  // 处理画布缩放
  onScale() {
    if (!this.currentNode)
      return;
    if (this.mindMap.richText) {
      this.mindMap.richText.cacheEditingText = this.mindMap.richText.getEditText();
      this.mindMap.richText.showTextEdit = false;
    } else {
      this.cacheEditingText = this.getEditText();
      this.showTextEdit = false;
    }
    this.show(this.currentNode);
  }
  //  显示文本编辑框
  showEditTextBox(node3, rect) {
    this.mindMap.emit("before_show_text_edit");
    this.registerTmpShortcut();
    if (!this.textEditNode) {
      this.textEditNode = document.createElement("div");
      this.textEditNode.style.cssText = `position:fixed;box-sizing: border-box;background-color:#fff;box-shadow: 0 0 20px rgba(0,0,0,.5);padding: 3px 5px;margin-left: -5px;margin-top: -3px;outline: none; word-break: break-all;`;
      this.textEditNode.setAttribute("contenteditable", true);
      this.textEditNode.addEventListener("keyup", (e2) => {
        e2.stopPropagation();
      });
      this.textEditNode.addEventListener("click", (e2) => {
        e2.stopPropagation();
      });
      document.body.appendChild(this.textEditNode);
    }
    let scale = this.mindMap.view.scale;
    let lineHeight = node3.style.merge("lineHeight");
    let fontSize = node3.style.merge("fontSize");
    let textLines = (this.cacheEditingText || node3.nodeData.data.text).split(/\n/gim);
    let isMultiLine = node3._textData.node.attr("data-ismultiLine") === "true";
    node3.style.domText(this.textEditNode, scale, isMultiLine);
    this.textEditNode.style.zIndex = this.mindMap.opt.nodeTextEditZIndex;
    this.textEditNode.innerHTML = textLines.join("<br>");
    this.textEditNode.style.minWidth = rect.width + 10 + "px";
    this.textEditNode.style.minHeight = rect.height + 6 + "px";
    this.textEditNode.style.left = rect.left + "px";
    this.textEditNode.style.top = rect.top + "px";
    this.textEditNode.style.display = "block";
    this.textEditNode.style.maxWidth = this.mindMap.opt.textAutoWrapWidth * scale + "px";
    if (isMultiLine && lineHeight !== 1) {
      this.textEditNode.style.transform = `translateY(${-((lineHeight * fontSize - fontSize) / 2) * scale}px)`;
    }
    this.showTextEdit = true;
    if (!this.cacheEditingText) {
      this.selectNodeText();
    }
    this.cacheEditingText = "";
  }
  //  选中文本
  selectNodeText() {
    let selection = window.getSelection();
    let range = document.createRange();
    range.selectNodeContents(this.textEditNode);
    selection.removeAllRanges();
    selection.addRange(range);
  }
  // 获取当前正在编辑的内容
  getEditText() {
    return getStrWithBrFromHtml(this.textEditNode.innerHTML);
  }
  //  隐藏文本编辑框
  hideEditTextBox() {
    this.currentNode = null;
    if (this.mindMap.richText) {
      return this.mindMap.richText.hideEditText();
    }
    if (!this.showTextEdit) {
      return;
    }
    this.renderer.activeNodeList.forEach((node3) => {
      let str = this.getEditText();
      this.mindMap.execCommand("SET_NODE_TEXT", node3, str);
      if (node3.isGeneralization) {
        node3.generalizationBelongNode.updateGeneralization();
      }
      this.mindMap.render();
    });
    this.mindMap.emit(
      "hide_text_edit",
      this.textEditNode,
      this.renderer.activeNodeList
    );
    this.textEditNode.style.display = "none";
    this.textEditNode.innerHTML = "";
    this.textEditNode.style.fontFamily = "inherit";
    this.textEditNode.style.fontSize = "inherit";
    this.textEditNode.style.fontWeight = "normal";
    this.textEditNode.style.transform = "translateY(0)";
    this.showTextEdit = false;
  }
};

// ../simple-mind-map/src/themes/default.js
var default_default = {
  // 节点内边距
  paddingX: 15,
  paddingY: 5,
  // 图片显示的最大宽度
  imgMaxWidth: 100,
  // 图片显示的最大高度
  imgMaxHeight: 100,
  // icon的大小
  iconSize: 20,
  // 连线的粗细
  lineWidth: 1,
  // 连线的颜色
  lineColor: "#549688",
  // 连线样式
  lineDasharray: "none",
  // 连线风格
  lineStyle: "straight",
  // 针对logicalStructure、mindMap两种结构。曲线（curve）、直线（straight）、直连（direct）
  // 概要连线的粗细
  generalizationLineWidth: 1,
  // 概要连线的颜色
  generalizationLineColor: "#549688",
  // 概要曲线距节点的距离
  generalizationLineMargin: 0,
  // 概要节点距节点的距离
  generalizationNodeMargin: 20,
  // 关联线默认状态的粗细
  associativeLineWidth: 2,
  // 关联线默认状态的颜色
  associativeLineColor: "rgb(51, 51, 51)",
  // 关联线激活状态的粗细
  associativeLineActiveWidth: 8,
  // 关联线激活状态的颜色
  associativeLineActiveColor: "rgba(2, 167, 240, 1)",
  // 关联线文字颜色
  associativeLineTextColor: "rgb(51, 51, 51)",
  // 关联线文字大小
  associativeLineTextFontSize: 14,
  // 关联线文字行高
  associativeLineTextLineHeight: 1.2,
  // 关联线文字字体
  associativeLineTextFontFamily: "\u5FAE\u8F6F\u96C5\u9ED1, Microsoft YaHei",
  // 背景颜色
  backgroundColor: "#fafafa",
  // 背景图片
  backgroundImage: "none",
  // 背景重复
  backgroundRepeat: "no-repeat",
  // 设置背景图像的起始位置
  backgroundPosition: "center center",
  // 设置背景图片大小
  backgroundSize: "cover",
  // 节点使用横线样式
  nodeUseLineStyle: false,
  // 根节点样式
  root: {
    shape: "rectangle",
    fillColor: "#549688",
    fontFamily: "\u5FAE\u8F6F\u96C5\u9ED1, Microsoft YaHei",
    color: "#fff",
    fontSize: 16,
    fontWeight: "bold",
    fontStyle: "normal",
    lineHeight: 1.5,
    borderColor: "transparent",
    borderWidth: 0,
    borderDasharray: "none",
    borderRadius: 5,
    textDecoration: "none",
    active: {
      borderColor: "rgb(57, 80, 96)",
      borderWidth: 3,
      borderDasharray: "none"
    }
  },
  // 二级节点样式
  second: {
    shape: "rectangle",
    marginX: 100,
    marginY: 40,
    fillColor: "#fff",
    fontFamily: "\u5FAE\u8F6F\u96C5\u9ED1, Microsoft YaHei",
    color: "#565656",
    fontSize: 16,
    fontWeight: "noraml",
    fontStyle: "normal",
    lineHeight: 1.5,
    borderColor: "#549688",
    borderWidth: 1,
    borderDasharray: "none",
    borderRadius: 5,
    textDecoration: "none",
    active: {
      borderColor: "rgb(57, 80, 96)",
      borderWidth: 3,
      borderDasharray: "none"
    }
  },
  // 三级及以下节点样式
  node: {
    shape: "rectangle",
    marginX: 50,
    marginY: 0,
    fillColor: "transparent",
    fontFamily: "\u5FAE\u8F6F\u96C5\u9ED1, Microsoft YaHei",
    color: "#6a6d6c",
    fontSize: 14,
    fontWeight: "noraml",
    fontStyle: "normal",
    lineHeight: 1.5,
    borderColor: "transparent",
    borderWidth: 0,
    borderRadius: 5,
    borderDasharray: "none",
    textDecoration: "none",
    active: {
      borderColor: "rgb(57, 80, 96)",
      borderWidth: 3,
      borderDasharray: "none"
    }
  },
  // 概要节点样式
  generalization: {
    shape: "rectangle",
    marginX: 100,
    marginY: 40,
    fillColor: "#fff",
    fontFamily: "\u5FAE\u8F6F\u96C5\u9ED1, Microsoft YaHei",
    color: "#565656",
    fontSize: 16,
    fontWeight: "noraml",
    fontStyle: "normal",
    lineHeight: 1.5,
    borderColor: "#549688",
    borderWidth: 1,
    borderDasharray: "none",
    borderRadius: 5,
    textDecoration: "none",
    active: {
      borderColor: "rgb(57, 80, 96)",
      borderWidth: 3,
      borderDasharray: "none"
    }
  }
};
var nodeSizeIndependenceList = [
  "lineWidth",
  "lineColor",
  "lineDasharray",
  "lineStyle",
  "generalizationLineWidth",
  "generalizationLineColor",
  "associativeLineWidth",
  "associativeLineColor",
  "associativeLineActiveWidth",
  "associativeLineActiveColor",
  "associativeLineTextColor",
  "associativeLineTextFontSize",
  "associativeLineTextLineHeight",
  "associativeLineTextFontFamily",
  "backgroundColor",
  "backgroundImage",
  "backgroundRepeat",
  "backgroundPosition",
  "backgroundSize"
];
var checkIsNodeSizeIndependenceConfig = (config) => {
  let keys = Object.keys(config);
  for (let i3 = 0; i3 < keys.length; i3++) {
    if (!nodeSizeIndependenceList.find((item) => {
      return item === keys[i3];
    })) {
      return false;
    }
  }
  return true;
};
var lineStyleProps = ["lineColor", "lineDasharray", "lineWidth"];

// ../simple-mind-map/src/core/render/Render.js
var layouts = {
  // 逻辑结构图
  [CONSTANTS.LAYOUT.LOGICAL_STRUCTURE]: LogicalStructure_default,
  // 思维导图
  [CONSTANTS.LAYOUT.MIND_MAP]: MindMap_default,
  // 目录组织图
  [CONSTANTS.LAYOUT.CATALOG_ORGANIZATION]: CatalogOrganization_default,
  // 组织结构图
  [CONSTANTS.LAYOUT.ORGANIZATION_STRUCTURE]: OrganizationStructure_default,
  // 时间轴
  [CONSTANTS.LAYOUT.TIMELINE]: Timeline_default,
  // 时间轴2
  [CONSTANTS.LAYOUT.TIMELINE2]: Timeline_default,
  // 鱼骨图
  [CONSTANTS.LAYOUT.FISHBONE]: Fishbone_default
};
var Render = class {
  //  构造函数
  constructor(opt = {}) {
    this.opt = opt;
    this.mindMap = opt.mindMap;
    this.themeConfig = this.mindMap.themeConfig;
    this.draw = this.mindMap.draw;
    this.renderTree = (0, import_deepmerge.default)({}, this.mindMap.opt.data || {});
    this.reRender = false;
    this.isRendering = false;
    this.hasWaitRendering = false;
    this.nodeCache = {};
    this.lastNodeCache = {};
    this.renderSource = "";
    this.activeNodeList = [];
    this.root = null;
    this.textEdit = new TextEdit(this);
    this.setLayout();
    this.bindEvent();
    this.registerCommands();
    this.registerShortcutKeys();
  }
  //  设置布局结构
  setLayout() {
    this.layout = new (layouts[this.mindMap.opt.layout] ? layouts[this.mindMap.opt.layout] : layouts[CONSTANTS.LAYOUT.LOGICAL_STRUCTURE])(this, this.mindMap.opt.layout);
  }
  //   绑定事件
  bindEvent() {
    this.mindMap.on("draw_click", (e2) => {
      let isTrueClick = true;
      let { useLeftKeySelectionRightKeyDrag } = this.mindMap.opt;
      if (useLeftKeySelectionRightKeyDrag) {
        let mousedownPos = this.mindMap.event.mousedownPos;
        isTrueClick = Math.abs(e2.clientX - mousedownPos.x) <= 5 && Math.abs(e2.clientY - mousedownPos.y) <= 5;
      }
      if (isTrueClick && this.activeNodeList.length > 0) {
        this.mindMap.execCommand("CLEAR_ACTIVE_NODE");
      }
    });
  }
  //  注册命令
  registerCommands() {
    this.selectAll = this.selectAll.bind(this);
    this.mindMap.command.add("SELECT_ALL", this.selectAll);
    this.back = this.back.bind(this);
    this.mindMap.command.add("BACK", this.back);
    this.forward = this.forward.bind(this);
    this.mindMap.command.add("FORWARD", this.forward);
    this.insertNode = this.insertNode.bind(this);
    this.mindMap.command.add("INSERT_NODE", this.insertNode);
    this.insertChildNode = this.insertChildNode.bind(this);
    this.mindMap.command.add("INSERT_CHILD_NODE", this.insertChildNode);
    this.upNode = this.upNode.bind(this);
    this.mindMap.command.add("UP_NODE", this.upNode);
    this.downNode = this.downNode.bind(this);
    this.mindMap.command.add("DOWN_NODE", this.downNode);
    this.insertAfter = this.insertAfter.bind(this);
    this.mindMap.command.add("INSERT_AFTER", this.insertAfter);
    this.insertBefore = this.insertBefore.bind(this);
    this.mindMap.command.add("INSERT_BEFORE", this.insertBefore);
    this.moveNodeTo = this.moveNodeTo.bind(this);
    this.mindMap.command.add("MOVE_NODE_TO", this.moveNodeTo);
    this.removeNode = this.removeNode.bind(this);
    this.mindMap.command.add("REMOVE_NODE", this.removeNode);
    this.pasteNode = this.pasteNode.bind(this);
    this.mindMap.command.add("PASTE_NODE", this.pasteNode);
    this.cutNode = this.cutNode.bind(this);
    this.mindMap.command.add("CUT_NODE", this.cutNode);
    this.setNodeStyle = this.setNodeStyle.bind(this);
    this.mindMap.command.add("SET_NODE_STYLE", this.setNodeStyle);
    this.setNodeActive = this.setNodeActive.bind(this);
    this.mindMap.command.add("SET_NODE_ACTIVE", this.setNodeActive);
    this.clearAllActive = this.clearAllActive.bind(this);
    this.mindMap.command.add("CLEAR_ACTIVE_NODE", this.clearAllActive);
    this.setNodeExpand = this.setNodeExpand.bind(this);
    this.mindMap.command.add("SET_NODE_EXPAND", this.setNodeExpand);
    this.expandAllNode = this.expandAllNode.bind(this);
    this.mindMap.command.add("EXPAND_ALL", this.expandAllNode);
    this.unexpandAllNode = this.unexpandAllNode.bind(this);
    this.mindMap.command.add("UNEXPAND_ALL", this.unexpandAllNode);
    this.expandToLevel = this.expandToLevel.bind(this);
    this.mindMap.command.add("UNEXPAND_TO_LEVEL", this.expandToLevel);
    this.setNodeData = this.setNodeData.bind(this);
    this.mindMap.command.add("SET_NODE_DATA", this.setNodeData);
    this.setNodeText = this.setNodeText.bind(this);
    this.mindMap.command.add("SET_NODE_TEXT", this.setNodeText);
    this.setNodeImage = this.setNodeImage.bind(this);
    this.mindMap.command.add("SET_NODE_IMAGE", this.setNodeImage);
    this.setNodeIcon = this.setNodeIcon.bind(this);
    this.mindMap.command.add("SET_NODE_ICON", this.setNodeIcon);
    this.setNodeHyperlink = this.setNodeHyperlink.bind(this);
    this.mindMap.command.add("SET_NODE_HYPERLINK", this.setNodeHyperlink);
    this.setNodeNote = this.setNodeNote.bind(this);
    this.mindMap.command.add("SET_NODE_NOTE", this.setNodeNote);
    this.setNodeTag = this.setNodeTag.bind(this);
    this.mindMap.command.add("SET_NODE_TAG", this.setNodeTag);
    this.addGeneralization = this.addGeneralization.bind(this);
    this.mindMap.command.add("ADD_GENERALIZATION", this.addGeneralization);
    this.removeGeneralization = this.removeGeneralization.bind(this);
    this.mindMap.command.add("REMOVE_GENERALIZATION", this.removeGeneralization);
    this.setNodeCustomPosition = this.setNodeCustomPosition.bind(this);
    this.mindMap.command.add(
      "SET_NODE_CUSTOM_POSITION",
      this.setNodeCustomPosition
    );
    this.resetLayout = this.resetLayout.bind(this);
    this.mindMap.command.add("RESET_LAYOUT", this.resetLayout);
    this.setNodeShape = this.setNodeShape.bind(this);
    this.mindMap.command.add("SET_NODE_SHAPE", this.setNodeShape);
  }
  //  注册快捷键
  registerShortcutKeys() {
    this.mindMap.keyCommand.addShortcut("Tab", () => {
      this.mindMap.execCommand("INSERT_CHILD_NODE");
    });
    this.insertNodeWrap = () => {
      if (this.textEdit.showTextEdit) {
        return;
      }
      this.mindMap.execCommand("INSERT_NODE");
    };
    this.mindMap.keyCommand.addShortcut("Enter", this.insertNodeWrap);
    this.mindMap.keyCommand.addShortcut("Control+s", this.addGeneralization);
    this.toggleActiveExpand = this.toggleActiveExpand.bind(this);
    this.mindMap.keyCommand.addShortcut("/", this.toggleActiveExpand);
    this.removeNodeWrap = () => {
      this.mindMap.execCommand("REMOVE_NODE");
    };
    this.mindMap.keyCommand.addShortcut("Del|Backspace", this.removeNodeWrap);
    this.mindMap.on("before_show_text_edit", () => {
      this.startTextEdit();
    });
    this.mindMap.on("hide_text_edit", () => {
      this.endTextEdit();
    });
    this.mindMap.keyCommand.addShortcut("Control+a", () => {
      this.mindMap.execCommand("SELECT_ALL");
    });
    this.mindMap.keyCommand.addShortcut("Control+l", this.resetLayout);
    this.mindMap.keyCommand.addShortcut("Control+Up", this.upNode);
    this.mindMap.keyCommand.addShortcut("Control+Down", this.downNode);
  }
  //  开启文字编辑，会禁用回车键和删除键相关快捷键防止冲突
  startTextEdit() {
    this.mindMap.keyCommand.save();
  }
  //  结束文字编辑，会恢复回车键和删除键相关快捷键
  endTextEdit() {
    this.mindMap.keyCommand.restore();
  }
  //   渲染
  render(callback = () => {
  }, source) {
    let t3 = Date.now();
    if (this.isRendering) {
      this.hasWaitRendering = true;
      return;
    }
    this.isRendering = true;
    this.renderSource = source;
    this.lastNodeCache = this.nodeCache;
    this.nodeCache = {};
    if (this.reRender) {
      this.clearActive();
    }
    this.layout.doLayout((root2) => {
      Object.keys(this.lastNodeCache).forEach((uid) => {
        if (!this.nodeCache[uid]) {
          this.lastNodeCache[uid].destroy();
          if (this.lastNodeCache[uid].parent) {
            this.lastNodeCache[uid].parent.removeLine();
          }
        }
      });
      this.root = root2;
      const onEnd = () => {
        this.isRendering = false;
        this.mindMap.emit("node_tree_render_end");
        callback && callback();
        if (this.hasWaitRendering) {
          this.hasWaitRendering = false;
          this.render(callback, source);
        } else {
          if (this.mindMap.richText && [CONSTANTS.CHANGE_THEME, CONSTANTS.SET_DATA].includes(source)) {
            this.mindMap.command.addHistory();
          }
        }
      };
      let { enableNodeTransitionMove, nodeTransitionMoveDuration } = this.mindMap.opt;
      this.root.render(() => {
        let dur = Date.now() - t3;
        if (enableNodeTransitionMove && dur <= nodeTransitionMoveDuration) {
          setTimeout(() => {
            onEnd();
          }, nodeTransitionMoveDuration - dur);
        } else {
          onEnd();
        }
      });
    });
    this.mindMap.emit("node_active", null, this.activeNodeList);
  }
  //  清除当前激活的节点
  clearActive() {
    this.activeNodeList.forEach((item) => {
      this.setNodeActive(item, false);
    });
    this.activeNodeList = [];
  }
  //  清除当前所有激活节点，并会触发事件
  clearAllActive() {
    if (this.activeNodeList.length <= 0) {
      return;
    }
    this.clearActive();
    this.mindMap.emit("node_active", null, []);
  }
  //   添加节点到激活列表里
  addActiveNode(node3) {
    let index3 = this.findActiveNodeIndex(node3);
    if (index3 === -1) {
      this.activeNodeList.push(node3);
    }
  }
  //  在激活列表里移除某个节点
  removeActiveNode(node3) {
    let index3 = this.findActiveNodeIndex(node3);
    if (index3 === -1) {
      return;
    }
    this.activeNodeList.splice(index3, 1);
  }
  //  检索某个节点在激活列表里的索引
  findActiveNodeIndex(node3) {
    return this.activeNodeList.findIndex((item) => {
      return item === node3;
    });
  }
  //  获取节点在同级里的索引位置
  getNodeIndex(node3) {
    return node3.parent ? node3.parent.children.findIndex((item) => {
      return item === node3;
    }) : 0;
  }
  //  全选
  selectAll() {
    walk(
      this.root,
      null,
      (node3) => {
        if (!node3.nodeData.data.isActive) {
          node3.nodeData.data.isActive = true;
          this.addActiveNode(node3);
          node3.showExpandBtn();
          setTimeout(() => {
            node3.updateNodeShape();
          }, 0);
        }
      },
      null,
      true,
      0,
      0
    );
  }
  //  回退
  back(step) {
    this.clearAllActive();
    let data2 = this.mindMap.command.back(step);
    if (data2) {
      this.renderTree = data2;
      this.mindMap.render();
    }
  }
  //  前进
  forward(step) {
    this.clearAllActive();
    let data2 = this.mindMap.command.forward(step);
    if (data2) {
      this.renderTree = data2;
      this.mindMap.render();
    }
  }
  // 规范指定节点数据
  formatAppointNodes(appointNodes) {
    if (!appointNodes)
      return [];
    return Array.isArray(appointNodes) ? appointNodes : [appointNodes];
  }
  //  插入同级节点，多个节点只会操作第一个节点
  insertNode(openEdit = true, appointNodes = [], appointData = null) {
    appointNodes = this.formatAppointNodes(appointNodes);
    if (this.activeNodeList.length <= 0 && appointNodes.length <= 0) {
      return;
    }
    let { defaultInsertSecondLevelNodeText, defaultInsertBelowSecondLevelNodeText } = this.mindMap.opt;
    let list2 = appointNodes.length > 0 ? appointNodes : this.activeNodeList;
    let first = list2[0];
    if (first.isRoot) {
      this.insertChildNode(openEdit, appointNodes, appointData);
    } else {
      let text3 = first.layerIndex === 1 ? defaultInsertSecondLevelNodeText : defaultInsertBelowSecondLevelNodeText;
      if (first.layerIndex === 1) {
        first.parent.destroy();
      }
      let index3 = this.getNodeIndex(first);
      first.parent.nodeData.children.splice(index3 + 1, 0, {
        inserting: openEdit,
        data: {
          text: text3,
          expand: true,
          ...appointData || {}
        },
        children: []
      });
      this.mindMap.render();
    }
  }
  //  插入子节点
  insertChildNode(openEdit = true, appointNodes = [], appointData = null) {
    appointNodes = this.formatAppointNodes(appointNodes);
    if (this.activeNodeList.length <= 0 && appointNodes.length <= 0) {
      return;
    }
    let { defaultInsertSecondLevelNodeText, defaultInsertBelowSecondLevelNodeText } = this.mindMap.opt;
    let list2 = appointNodes.length > 0 ? appointNodes : this.activeNodeList;
    list2.forEach((node3) => {
      if (!node3.nodeData.children) {
        node3.nodeData.children = [];
      }
      let text3 = node3.isRoot ? defaultInsertSecondLevelNodeText : defaultInsertBelowSecondLevelNodeText;
      node3.nodeData.children.push({
        inserting: openEdit,
        data: {
          text: text3,
          expand: true,
          ...appointData || {}
        },
        children: []
      });
      node3.nodeData.data.expand = true;
      if (node3.isRoot) {
        node3.destroy();
      }
    });
    this.mindMap.render();
  }
  //  上移节点，多个节点只会操作第一个节点
  upNode() {
    if (this.activeNodeList.length <= 0) {
      return;
    }
    let node3 = this.activeNodeList[0];
    if (node3.isRoot) {
      return;
    }
    let parent = node3.parent;
    let childList = parent.children;
    let index3 = childList.findIndex((item) => {
      return item === node3;
    });
    if (index3 === -1 || index3 === 0) {
      return;
    }
    let insertIndex = index3 - 1;
    childList.splice(index3, 1);
    childList.splice(insertIndex, 0, node3);
    parent.nodeData.children.splice(index3, 1);
    parent.nodeData.children.splice(insertIndex, 0, node3.nodeData);
    this.mindMap.render();
  }
  //  下移节点，多个节点只会操作第一个节点
  downNode() {
    if (this.activeNodeList.length <= 0) {
      return;
    }
    let node3 = this.activeNodeList[0];
    if (node3.isRoot) {
      return;
    }
    let parent = node3.parent;
    let childList = parent.children;
    let index3 = childList.findIndex((item) => {
      return item === node3;
    });
    if (index3 === -1 || index3 === childList.length - 1) {
      return;
    }
    let insertIndex = index3 + 1;
    childList.splice(index3, 1);
    childList.splice(insertIndex, 0, node3);
    parent.nodeData.children.splice(index3, 1);
    parent.nodeData.children.splice(insertIndex, 0, node3.nodeData);
    this.mindMap.render();
  }
  //  将节点移动到另一个节点的前面
  insertBefore(node3, exist) {
    if (node3.isRoot) {
      return;
    }
    let nodeLayerChanged = node3.layerIndex === 1 && exist.layerIndex !== 1 || node3.layerIndex !== 1 && exist.layerIndex === 1;
    let nodeParent = node3.parent;
    let nodeBorthers = nodeParent.children;
    let nodeIndex = nodeBorthers.findIndex((item) => {
      return item === node3;
    });
    if (nodeIndex === -1) {
      return;
    }
    nodeBorthers.splice(nodeIndex, 1);
    nodeParent.nodeData.children.splice(nodeIndex, 1);
    let existParent = exist.parent;
    let existBorthers = existParent.children;
    let existIndex = existBorthers.findIndex((item) => {
      return item === exist;
    });
    if (existIndex === -1) {
      return;
    }
    existBorthers.splice(existIndex, 0, node3);
    existParent.nodeData.children.splice(existIndex, 0, node3.nodeData);
    this.mindMap.render(() => {
      if (nodeLayerChanged) {
        node3.reRender();
      }
    });
  }
  //  将节点移动到另一个节点的后面
  insertAfter(node3, exist) {
    if (node3.isRoot) {
      return;
    }
    let nodeLayerChanged = node3.layerIndex === 1 && exist.layerIndex !== 1 || node3.layerIndex !== 1 && exist.layerIndex === 1;
    let nodeParent = node3.parent;
    let nodeBorthers = nodeParent.children;
    let nodeIndex = nodeBorthers.findIndex((item) => {
      return item === node3;
    });
    if (nodeIndex === -1) {
      return;
    }
    nodeBorthers.splice(nodeIndex, 1);
    nodeParent.nodeData.children.splice(nodeIndex, 1);
    let existParent = exist.parent;
    let existBorthers = existParent.children;
    let existIndex = existBorthers.findIndex((item) => {
      return item === exist;
    });
    if (existIndex === -1) {
      return;
    }
    existIndex++;
    existBorthers.splice(existIndex, 0, node3);
    existParent.nodeData.children.splice(existIndex, 0, node3.nodeData);
    this.mindMap.render(() => {
      if (nodeLayerChanged) {
        node3.reRender();
      }
    });
  }
  //  移除节点
  removeNode(appointNodes = []) {
    appointNodes = this.formatAppointNodes(appointNodes);
    if (this.activeNodeList.length <= 0 && appointNodes.length <= 0) {
      return;
    }
    let isAppointNodes = appointNodes.length > 0;
    let list2 = isAppointNodes ? appointNodes : this.activeNodeList;
    let root2 = list2.find((node3) => {
      return node3.isRoot;
    });
    if (root2) {
      this.clearActive();
      root2.children.forEach((child) => {
        child.remove();
      });
      root2.children = [];
      root2.nodeData.children = [];
    } else {
      for (let i3 = 0; i3 < list2.length; i3++) {
        let node3 = list2[i3];
        if (isAppointNodes)
          list2.splice(i3, 1);
        if (node3.isGeneralization) {
          this.setNodeData(node3.generalizationBelongNode, {
            generalization: null
          });
          node3.generalizationBelongNode.update();
          this.removeActiveNode(node3);
          i3--;
        } else {
          this.removeActiveNode(node3);
          this.removeOneNode(node3);
          i3--;
        }
      }
    }
    this.mindMap.emit("node_active", null, this.activeNodeList);
    this.mindMap.render();
  }
  //  移除某个指定节点
  removeOneNode(node3) {
    let index3 = this.getNodeIndex(node3);
    node3.remove();
    node3.parent.children.splice(index3, 1);
    node3.parent.nodeData.children.splice(index3, 1);
  }
  //  复制节点，多个节点只会操作第一个节点
  copyNode() {
    if (this.activeNodeList.length <= 0) {
      return;
    }
    return copyNodeTree({}, this.activeNodeList[0], true);
  }
  //  剪切节点，多个节点只会操作第一个节点
  cutNode(callback) {
    if (this.activeNodeList.length <= 0) {
      return;
    }
    let node3 = this.activeNodeList[0];
    if (node3.isRoot) {
      return null;
    }
    let copyData = copyNodeTree({}, node3, true);
    this.removeActiveNode(node3);
    this.removeOneNode(node3);
    this.mindMap.emit("node_active", null, this.activeNodeList);
    this.mindMap.render();
    if (callback && typeof callback === "function") {
      callback(copyData);
    }
  }
  //  移动一个节点作为另一个节点的子节点
  moveNodeTo(node3, toNode) {
    if (node3.isRoot) {
      return;
    }
    let copyData = copyNodeTree({}, node3, false, true);
    this.removeActiveNode(node3);
    this.removeOneNode(node3);
    this.mindMap.emit("node_active", null, this.activeNodeList);
    toNode.nodeData.children.push(copyData);
    this.mindMap.render();
    if (toNode.isRoot) {
      toNode.destroy();
    }
  }
  //   粘贴节点到节点
  pasteNode(data2) {
    if (this.activeNodeList.length <= 0) {
      return;
    }
    this.activeNodeList.forEach((item) => {
      item.nodeData.children.push(simpleDeepClone(data2));
    });
    this.mindMap.render();
  }
  //  设置节点样式
  setNodeStyle(node3, prop, value, isActive) {
    let data2 = {};
    if (isActive) {
      data2 = {
        activeStyle: {
          ...node3.nodeData.data.activeStyle || {},
          [prop]: value
        }
      };
    } else {
      data2 = {
        [prop]: value
      };
    }
    if (this.mindMap.richText) {
      let config = this.mindMap.richText.normalStyleToRichTextStyle({
        [prop]: value
      });
      if (Object.keys(config).length > 0) {
        this.mindMap.richText.showEditText(node3);
        this.mindMap.richText.formatAllText(config);
        this.mindMap.richText.hideEditText([node3]);
      }
    }
    this.setNodeDataRender(node3, data2);
    if (lineStyleProps.includes(prop)) {
      ;
      (node3.parent || node3).renderLine(true);
    }
  }
  //  设置节点是否激活
  setNodeActive(node3, active) {
    this.setNodeData(node3, {
      isActive: active
    });
    if (active) {
      node3.showExpandBtn();
    } else {
      node3.hideExpandBtn();
    }
    node3.updateNodeShape();
  }
  //  设置节点是否展开
  setNodeExpand(node3, expand) {
    this.setNodeData(node3, {
      expand
    });
    if (expand) {
      node3.children.forEach((item) => {
        item.render();
      });
      node3.renderLine();
    } else {
      node3.children.forEach((item) => {
        item.remove();
      });
      node3.removeLine();
    }
    this.mindMap.render();
  }
  //  展开所有
  expandAllNode() {
    walk(
      this.renderTree,
      null,
      (node3) => {
        if (!node3.data.expand) {
          node3.data.expand = true;
        }
      },
      null,
      true,
      0,
      0
    );
    this.mindMap.render();
  }
  //  收起所有
  unexpandAllNode() {
    walk(
      this.renderTree,
      null,
      (node3, parent, isRoot) => {
        node3._node = null;
        if (!isRoot) {
          node3.data.expand = false;
        }
      },
      null,
      true,
      0,
      0
    );
    this.mindMap.render(() => {
      this.mindMap.view.reset();
    });
  }
  //  展开到指定层级
  expandToLevel(level) {
    walk(
      this.renderTree,
      null,
      (node3, parent, isRoot, layerIndex) => {
        node3._node = null;
        node3.data.expand = layerIndex < level;
      },
      null,
      true,
      0,
      0
    );
    this.mindMap.render();
  }
  //  切换激活节点的展开状态
  toggleActiveExpand() {
    this.activeNodeList.forEach((node3) => {
      if (node3.nodeData.children.length <= 0) {
        return;
      }
      this.toggleNodeExpand(node3);
    });
  }
  //  切换节点展开状态
  toggleNodeExpand(node3) {
    this.mindMap.execCommand(
      "SET_NODE_EXPAND",
      node3,
      !node3.nodeData.data.expand
    );
  }
  //  设置节点文本
  setNodeText(node3, text3, richText) {
    this.setNodeDataRender(node3, {
      text: text3,
      richText
    });
  }
  //  设置节点图片
  setNodeImage(node3, { url, title, width: width2, height: height2 }) {
    this.setNodeDataRender(node3, {
      image: url,
      imageTitle: title || "",
      imageSize: {
        width: width2,
        height: height2
      }
    });
  }
  //  设置节点图标
  setNodeIcon(node3, icons) {
    this.setNodeDataRender(node3, {
      icon: icons
    });
  }
  //  设置节点超链接
  setNodeHyperlink(node3, link, title = "") {
    this.setNodeDataRender(node3, {
      hyperlink: link,
      hyperlinkTitle: title
    });
  }
  //  设置节点备注
  setNodeNote(node3, note2) {
    this.setNodeDataRender(node3, {
      note: note2
    });
  }
  //  设置节点标签
  setNodeTag(node3, tag) {
    this.setNodeDataRender(node3, {
      tag
    });
  }
  //  添加节点概要
  addGeneralization(data2) {
    if (this.activeNodeList.length <= 0) {
      return;
    }
    this.activeNodeList.forEach((node3) => {
      if (node3.nodeData.data.generalization || node3.isRoot) {
        return;
      }
      this.setNodeData(node3, {
        generalization: data2 || {
          text: "\u6982\u8981"
        }
      });
      node3.update();
    });
    this.mindMap.render();
  }
  //  删除节点概要
  removeGeneralization() {
    if (this.activeNodeList.length <= 0) {
      return;
    }
    this.activeNodeList.forEach((node3) => {
      if (!node3.nodeData.data.generalization) {
        return;
      }
      this.setNodeData(node3, {
        generalization: null
      });
      node3.update();
    });
    this.mindMap.render();
  }
  //  设置节点自定义位置
  setNodeCustomPosition(node3, left = void 0, top = void 0) {
    let nodeList = [node3];
    nodeList.forEach((item) => {
      this.setNodeData(item, {
        customLeft: left,
        customTop: top
      });
    });
  }
  //  一键整理布局，即去除自定义位置
  resetLayout() {
    walk(
      this.root,
      null,
      (node3) => {
        node3.customLeft = void 0;
        node3.customTop = void 0;
        this.setNodeData(node3, {
          customLeft: void 0,
          customTop: void 0
        });
        this.mindMap.render();
      },
      null,
      true,
      0,
      0
    );
  }
  //  设置节点形状
  setNodeShape(node3, shape) {
    if (!shape || !shapeList.includes(shape)) {
      return;
    }
    let nodeList = [node3];
    nodeList.forEach((item) => {
      this.setNodeStyle(item, "shape", shape);
    });
  }
  //  更新节点数据
  setNodeData(node3, data2) {
    Object.keys(data2).forEach((key) => {
      node3.nodeData.data[key] = data2[key];
    });
  }
  //  设置节点数据，并判断是否渲染
  setNodeDataRender(node3, data2) {
    this.setNodeData(node3, data2);
    let changed = node3.reRender();
    if (changed) {
      if (node3.isGeneralization) {
        node3.generalizationBelongNode.updateGeneralization();
      }
      this.mindMap.render();
    }
  }
  //  移动节点到画布中心
  moveNodeToCenter(node3) {
    let halfWidth = this.mindMap.width / 2;
    let halfHeight = this.mindMap.height / 2;
    let { left, top, width: width2, height: height2 } = node3;
    let nodeCenterX = left + width2 / 2;
    let nodeCenterY = top + height2 / 2;
    let { state } = this.mindMap.view.getTransformData();
    let targetX = halfWidth - state.x;
    let targetY = halfHeight - state.y;
    let offsetX = targetX - nodeCenterX;
    let offsetY = targetY - nodeCenterY;
    this.mindMap.view.translateX(offsetX);
    this.mindMap.view.translateY(offsetY);
    this.mindMap.view.setScale(1);
  }
};
var Render_default = Render;

// ../simple-mind-map/index.js
var import_deepmerge33 = __toESM(require_cjs());

// ../simple-mind-map/src/themes/freshGreen.js
var import_deepmerge2 = __toESM(require_cjs());
var freshGreen_default = (0, import_deepmerge2.default)(default_default, {
  // 连线的颜色
  lineColor: "#333",
  // 背景颜色
  backgroundColor: "#d1f6ec",
  // 概要连线的粗细
  generalizationLineWidth: 1,
  // 概要连线的颜色
  generalizationLineColor: "#333",
  // 根节点样式
  root: {
    fillColor: "#1fb27d"
  },
  // 二级节点样式
  second: {
    fillColor: "#fff",
    color: "#565656",
    borderColor: "transparent",
    borderWidth: 0
  },
  // 概要节点样式
  generalization: {
    fillColor: "#fff",
    borderColor: "#333",
    color: "#333",
    active: {
      borderColor: "rgb(57, 80, 96)",
      borderWidth: 3,
      borderDasharray: "none"
    }
  }
});

// ../simple-mind-map/src/themes/blueSky.js
var import_deepmerge3 = __toESM(require_cjs());
var blueSky_default = (0, import_deepmerge3.default)(default_default, {
  // 连线的颜色
  lineColor: "rgb(115, 161, 191)",
  // 背景颜色
  backgroundColor: "rgb(251, 251, 251)",
  // 概要连线的粗细
  generalizationLineWidth: 1,
  // 概要连线的颜色
  generalizationLineColor: "#333",
  // 根节点样式
  root: {
    fillColor: "rgb(115, 161, 191)",
    active: {
      borderColor: "rgb(57, 80, 96)"
    }
  },
  // 二级节点样式
  second: {
    fillColor: "rgb(238, 243, 246)",
    color: "#333",
    borderColor: "rgb(115, 161, 191)",
    borderWidth: 1,
    fontSize: 14,
    active: {
      borderColor: "rgb(57, 80, 96)"
    }
  },
  // 三级及以下节点样式
  node: {
    fontSize: 12,
    color: "#333",
    active: {
      borderColor: "rgb(57, 80, 96)"
    }
  },
  // 概要节点样式
  generalization: {
    fillColor: "#fff",
    borderColor: "#333",
    color: "#333",
    active: {
      borderColor: "rgb(57, 80, 96)"
    }
  }
});

// ../simple-mind-map/src/themes/brainImpairedPink.js
var import_deepmerge4 = __toESM(require_cjs());
var brainImpairedPink_default = (0, import_deepmerge4.default)(default_default, {
  // 连线的颜色
  lineColor: "rgb(191, 115, 148)",
  // 背景颜色
  backgroundColor: "rgb(251, 251, 251)",
  // 概要连线的粗细
  generalizationLineWidth: 1,
  // 概要连线的颜色
  generalizationLineColor: "#333",
  // 根节点样式
  root: {
    fillColor: "rgb(191, 115, 148)",
    active: {
      borderColor: "rgb(96, 57, 74)"
    }
  },
  // 二级节点样式
  second: {
    fillColor: "rgb(246, 238, 242)",
    color: "#333",
    borderColor: "rgb(191, 115, 148)",
    borderWidth: 1,
    fontSize: 14,
    active: {
      borderColor: "rgb(96, 57, 74)"
    }
  },
  // 三级及以下节点样式
  node: {
    fontSize: 12,
    color: "#333",
    active: {
      borderColor: "rgb(96, 57, 74)"
    }
  },
  // 概要节点样式
  generalization: {
    fillColor: "#fff",
    borderColor: "#333",
    color: "#333",
    active: {
      borderColor: "rgb(96, 57, 74)"
    }
  }
});

// ../simple-mind-map/src/themes/romanticPurple.js
var import_deepmerge5 = __toESM(require_cjs());
var romanticPurple_default = (0, import_deepmerge5.default)(default_default, {
  // 连线的颜色
  lineColor: "rgb(123, 115, 191)",
  // 背景颜色
  backgroundColor: "rgb(251, 251, 251)",
  // 概要连线的粗细
  generalizationLineWidth: 1,
  // 概要连线的颜色
  generalizationLineColor: "#333",
  // 根节点样式
  root: {
    fillColor: "rgb(123, 115, 191)",
    active: {
      borderColor: "rgb(61, 57, 96)"
    }
  },
  // 二级节点样式
  second: {
    fillColor: "rgb(239, 238, 246)",
    color: "#333",
    borderColor: "rgb(123, 115, 191)",
    borderWidth: 1,
    fontSize: 14,
    active: {
      borderColor: "rgb(61, 57, 96)"
    }
  },
  // 三级及以下节点样式
  node: {
    fontSize: 12,
    color: "#333",
    active: {
      borderColor: "rgb(61, 57, 96)"
    }
  },
  // 概要节点样式
  generalization: {
    fillColor: "#fff",
    borderColor: "#333",
    color: "#333",
    active: {
      borderColor: "rgb(61, 57, 96)"
    }
  }
});

// ../simple-mind-map/src/themes/freshRed.js
var import_deepmerge6 = __toESM(require_cjs());
var freshRed_default = (0, import_deepmerge6.default)(default_default, {
  // 连线的颜色
  lineColor: "rgb(191, 115, 115)",
  // 背景颜色
  backgroundColor: "rgb(251, 251, 251)",
  // 概要连线的粗细
  generalizationLineWidth: 1,
  // 概要连线的颜色
  generalizationLineColor: "#333",
  // 根节点样式
  root: {
    fillColor: "rgb(191, 115, 115)",
    active: {
      borderColor: "rgb(96, 57, 57)"
    }
  },
  // 二级节点样式
  second: {
    fillColor: "rgb(246, 238, 238)",
    color: "#333",
    borderColor: "rgb(191, 115, 115)",
    borderWidth: 1,
    fontSize: 14,
    active: {
      borderColor: "rgb(96, 57, 57)"
    }
  },
  // 三级及以下节点样式
  node: {
    fontSize: 12,
    color: "#333",
    active: {
      borderColor: "rgb(96, 57, 57)"
    }
  },
  // 概要节点样式
  generalization: {
    fillColor: "#fff",
    borderColor: "#333",
    color: "#333",
    active: {
      borderColor: "rgb(96, 57, 57)"
    }
  }
});

// ../simple-mind-map/src/themes/earthYellow.js
var import_deepmerge7 = __toESM(require_cjs());
var earthYellow_default = (0, import_deepmerge7.default)(default_default, {
  // 连线的颜色
  lineColor: "rgb(191, 147, 115)",
  // 背景颜色
  backgroundColor: "rgb(251, 251, 251)",
  // 概要连线的粗细
  generalizationLineWidth: 1,
  // 概要连线的颜色
  generalizationLineColor: "#333",
  // 根节点样式
  root: {
    fillColor: "rgb(191, 147, 115)",
    active: {
      borderColor: "rgb(96, 73, 57)"
    }
  },
  // 二级节点样式
  second: {
    fillColor: "rgb(246, 242, 238)",
    color: "#333",
    borderColor: "rgb(191, 147, 115)",
    borderWidth: 1,
    fontSize: 14,
    active: {
      borderColor: "rgb(96, 73, 57)"
    }
  },
  // 三级及以下节点样式
  node: {
    fontSize: 12,
    color: "#333",
    active: {
      borderColor: "rgb(96, 73, 57)"
    }
  },
  // 概要节点样式
  generalization: {
    fillColor: "#fff",
    borderColor: "#333",
    color: "#333",
    active: {
      borderColor: "rgb(96, 73, 57)"
    }
  }
});

// ../simple-mind-map/src/themes/classic.js
var import_deepmerge8 = __toESM(require_cjs());
var classic_default = (0, import_deepmerge8.default)(default_default, {
  // 连线的颜色
  lineColor: "#fff",
  // 连线的粗细
  lineWidth: 3,
  // 概要连线的粗细
  generalizationLineWidth: 3,
  // 概要连线的颜色
  generalizationLineColor: "#fff",
  // 背景颜色
  backgroundColor: "rgb(58, 65, 68)",
  // 背景图片
  backgroundImage: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAIAAAACDbGyAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoTWFjaW50b3NoKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDowQzg5QTQ0NDhENzgxMUUzOENGREE4QTg0RDgzRTZDNyIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDowQzg5QTQ0NThENzgxMUUzOENGREE4QTg0RDgzRTZDNyI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkMwOEQ1NDRGOEQ3NzExRTM4Q0ZEQThBODREODNFNkM3IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkMwOEQ1NDUwOEQ3NzExRTM4Q0ZEQThBODREODNFNkM3Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+e9P33AAAACVJREFUeNpisXJ0YUACTAyoAMr/+eM7EGGRZ4FQ7BycEAZAgAEAHbEGtkoQm/wAAAAASUVORK5CYII=",
  // 背景重复
  backgroundRepeat: "repeat",
  // 根节点样式
  root: {
    fillColor: "rgb(233, 223, 152)",
    color: "#333",
    fontSize: 24,
    borderRadius: 21,
    active: {
      fillColor: "rgb(254, 219, 0)",
      borderColor: "transparent"
    }
  },
  // 二级节点样式
  second: {
    fillColor: "rgb(164, 197, 192)",
    borderColor: "transparent",
    color: "#333",
    fontSize: 16,
    borderRadius: 10,
    active: {
      fillColor: "rgb(254, 219, 0)",
      borderColor: "transparent"
    }
  },
  // 三级及以下节点样式
  node: {
    fontSize: 12,
    color: "#fff",
    fontWeight: "bold",
    active: {
      fillColor: "rgb(254, 219, 0)",
      borderColor: "transparent"
    }
  },
  // 概要节点样式
  generalization: {
    fillColor: "#fff",
    borderColor: "transparent",
    color: "#333",
    active: {
      fillColor: "rgb(254, 219, 0)",
      borderColor: "transparent"
    }
  }
});

// ../simple-mind-map/src/themes/classic2.js
var import_deepmerge9 = __toESM(require_cjs());
var classic2_default = (0, import_deepmerge9.default)(default_default, {
  // 连线的颜色
  lineColor: "rgb(51, 51, 51)",
  // 连线的粗细
  lineWidth: 2,
  // 概要连线的粗细
  generalizationLineWidth: 3,
  // 概要连线的颜色
  generalizationLineColor: "rgb(51, 51, 51)",
  // 背景颜色
  backgroundColor: "#fff",
  // 根节点样式
  root: {
    fillColor: "rgb(18, 187, 55)",
    color: "#fff",
    fontSize: 24,
    borderRadius: 10,
    active: {
      borderColor: "rgb(51, 51, 51)"
    }
  },
  // 二级节点样式
  second: {
    fillColor: "rgb(241, 242, 241)",
    borderColor: "transparent",
    color: "#1a1a1a",
    fontSize: 18,
    borderRadius: 10,
    active: {
      borderColor: "rgb(51, 51, 51)"
    }
  },
  // 三级及以下节点样式
  node: {
    fontSize: 14,
    color: "#1a1a1a",
    active: {
      borderColor: "rgb(51, 51, 51)"
    }
  },
  // 概要节点样式
  generalization: {
    fillColor: "#fff",
    borderColor: "rgb(51, 51, 51)",
    borderWidth: 2,
    color: "#1a1a1a",
    active: {
      borderColor: "rgb(18, 187, 55)"
    }
  }
});

// ../simple-mind-map/src/themes/classic3.js
var import_deepmerge10 = __toESM(require_cjs());
var classic3_default = (0, import_deepmerge10.default)(default_default, {
  // 连线的颜色
  lineColor: "rgb(94, 202, 110)",
  // 连线的粗细
  lineWidth: 2,
  // 概要连线的粗细
  generalizationLineWidth: 3,
  // 概要连线的颜色
  generalizationLineColor: "#1a1a1a",
  // 背景颜色
  backgroundColor: "rgb(241, 241, 241)",
  // 根节点样式
  root: {
    fillColor: "rgb(255, 245, 214)",
    color: "#1a1a1a",
    fontSize: 24,
    borderRadius: 10,
    borderColor: "rgb(249, 199, 84)",
    borderWidth: 1,
    active: {
      borderColor: "rgb(94, 202, 110)"
    }
  },
  // 二级节点样式
  second: {
    fillColor: "rgb(255, 245, 214)",
    borderColor: "rgb(249, 199, 84)",
    borderWidth: 1,
    color: "#1a1a1a",
    fontSize: 18,
    borderRadius: 10,
    active: {
      borderColor: "rgb(94, 202, 110)"
    }
  },
  // 三级及以下节点样式
  node: {
    fontSize: 14,
    color: "#1a1a1a",
    active: {
      borderColor: "rgb(94, 202, 110)"
    }
  },
  // 概要节点样式
  generalization: {
    fillColor: "#fff",
    borderColor: "#1a1a1a",
    color: "#1a1a1a",
    borderWidth: 2,
    active: {
      borderColor: "rgb(94, 202, 110)"
    }
  }
});

// ../simple-mind-map/src/themes/classic4.js
var import_deepmerge11 = __toESM(require_cjs());
var classic4_default = (0, import_deepmerge11.default)(default_default, {
  // 连线的颜色
  lineColor: "rgb(30, 53, 86)",
  // 连线的粗细
  lineWidth: 2,
  // 概要连线的粗细
  generalizationLineWidth: 2,
  // 概要连线的颜色
  generalizationLineColor: "rgb(56, 123, 233)",
  // 背景颜色
  backgroundColor: "rgb(241, 241, 241)",
  // 根节点样式
  root: {
    fillColor: "rgb(30, 53, 86)",
    color: "#fff",
    fontSize: 24,
    borderRadius: 10,
    borderColor: "rgb(189, 197, 201)",
    borderWidth: 2,
    active: {
      borderColor: "rgb(169, 218, 218)"
    }
  },
  // 二级节点样式
  second: {
    fillColor: "rgb(169, 218, 218)",
    borderColor: "rgb(30, 53, 86)",
    borderWidth: 2,
    color: "#fff",
    fontSize: 18,
    borderRadius: 10,
    active: {
      borderColor: "rgb(56, 123, 233)"
    }
  },
  // 三级及以下节点样式
  node: {
    fontSize: 14,
    color: "rgb(30, 53, 86)",
    borderColor: "rgb(30, 53, 86)",
    borderWidth: 1,
    marginY: 20,
    active: {
      borderColor: "rgb(169, 218, 218)"
    }
  },
  // 概要节点样式
  generalization: {
    fillColor: "rgb(56, 123, 233)",
    borderColor: "rgb(56, 123, 233)",
    color: "#fff",
    borderWidth: 0,
    active: {
      borderColor: "rgb(169, 218, 218)"
    }
  }
});

// ../simple-mind-map/src/themes/dark.js
var import_deepmerge12 = __toESM(require_cjs());
var dark_default = (0, import_deepmerge12.default)(default_default, {
  // 连线的颜色
  lineColor: "rgb(17, 68, 23)",
  // 连线的粗细
  lineWidth: 2,
  // 概要连线的粗细
  generalizationLineWidth: 2,
  // 概要连线的颜色
  generalizationLineColor: "#fff",
  // 背景颜色
  backgroundColor: "rgb(15, 16, 17)",
  // 根节点样式
  root: {
    fillColor: "rgb(28, 178, 43)",
    color: "#fff",
    fontSize: 24,
    borderRadius: 10,
    active: {
      borderColor: "rgb(17, 68, 23)"
    }
  },
  // 二级节点样式
  second: {
    fillColor: "rgb(55, 56, 58)",
    color: "rgb(147,148,149)",
    fontSize: 18,
    borderRadius: 10,
    borderWidth: 0,
    active: {
      borderColor: "rgb(17, 68, 23)"
    }
  },
  // 三级及以下节点样式
  node: {
    fontSize: 14,
    color: "rgb(147, 148, 149)",
    active: {
      borderColor: "rgb(17, 68, 23)"
    }
  },
  // 概要节点样式
  generalization: {
    fillColor: "#fff",
    borderColor: "transparent",
    color: "#333",
    active: {
      borderColor: "rgb(17, 68, 23)"
    }
  }
});

// ../simple-mind-map/src/themes/classicGreen.js
var import_deepmerge13 = __toESM(require_cjs());
var classicGreen_default = (0, import_deepmerge13.default)(default_default, {
  // 连线的颜色
  lineColor: "rgb(123, 199, 120)",
  // 背景颜色
  backgroundColor: "rgb(236, 245, 231)",
  // 概要连线的粗细
  generalizationLineWidth: 2,
  // 概要连线的颜色
  generalizationLineColor: "rgb(123, 199, 120)",
  // 根节点样式
  root: {
    fillColor: "rgb(253, 244, 217)",
    color: "#222",
    active: {
      borderColor: "rgb(94, 199, 248)"
    }
  },
  // 二级节点样式
  second: {
    fillColor: "rgb(253, 244, 217)",
    color: "#222",
    borderColor: "rgb(242, 200, 104)",
    borderWidth: 1,
    fontSize: 14,
    active: {
      borderColor: "rgb(94, 199, 248)"
    }
  },
  // 三级及以下节点样式
  node: {
    fontSize: 12,
    color: "#333",
    active: {
      borderColor: "rgb(94, 199, 248)"
    }
  },
  // 概要节点样式
  generalization: {
    fillColor: "rgb(123, 199, 120)",
    borderColor: "transparent",
    borderWidth: 2,
    color: "#fff",
    active: {
      borderColor: "rgb(94, 199, 248)"
    }
  }
});

// ../simple-mind-map/src/themes/classicBlue.js
var import_deepmerge14 = __toESM(require_cjs());
var classicBlue_default = (0, import_deepmerge14.default)(default_default, {
  // 连线的颜色
  lineColor: "rgb(51, 51, 51)",
  // 连线的粗细
  lineWidth: 2,
  // 概要连线的粗细
  generalizationLineWidth: 2,
  // 概要连线的颜色
  generalizationLineColor: "rgb(51, 51, 51)",
  // 背景颜色
  backgroundColor: "rgb(239, 248, 250)",
  // 根节点样式
  root: {
    fillColor: "rgb(255, 255, 255)",
    color: "#222",
    active: {
      borderColor: "rgb(94, 199, 248)"
    }
  },
  // 二级节点样式
  second: {
    fillColor: "rgb(255, 255, 255)",
    color: "#222",
    borderColor: "rgb(255, 255, 255)",
    borderWidth: 1,
    fontSize: 14,
    active: {
      borderColor: "rgb(94, 199, 248)"
    }
  },
  // 三级及以下节点样式
  node: {
    fontSize: 12,
    color: "#333",
    active: {
      borderColor: "rgb(94, 199, 248)"
    }
  },
  // 概要节点样式
  generalization: {
    fillColor: "#fff",
    borderColor: "rgb(51, 51, 51)",
    color: "#333",
    active: {
      borderColor: "rgb(94, 199, 248)"
    }
  }
});

// ../simple-mind-map/src/themes/minions.js
var import_deepmerge15 = __toESM(require_cjs());
var minions_default = (0, import_deepmerge15.default)(default_default, {
  // 连线的颜色
  lineColor: "rgb(51, 51, 51)",
  lineWidth: 3,
  // 概要连线的粗细
  generalizationLineWidth: 3,
  // 概要连线的颜色
  generalizationLineColor: "#222",
  // 背景颜色
  backgroundColor: "rgb(248, 215, 49)",
  // 根节点样式
  root: {
    fillColor: "rgb(55, 165, 255)",
    borderColor: "rgb(51, 51, 51)",
    borderWidth: 3,
    active: {
      borderColor: "rgb(255, 160, 36)"
    }
  },
  // 二级节点样式
  second: {
    fillColor: "rgb(255, 160, 36)",
    color: "#222",
    borderColor: "rgb(51, 51, 51)",
    borderWidth: 3,
    fontSize: 14,
    active: {
      borderColor: "rgb(55, 165, 255)"
    }
  },
  // 三级及以下节点样式
  node: {
    fontSize: 12,
    color: "#222",
    active: {
      borderColor: "rgb(55, 165, 255)"
    }
  },
  // 概要节点样式
  generalization: {
    borderColor: "#222",
    borderWidth: 3,
    color: "#222",
    active: {
      borderColor: "rgb(55, 165, 255)"
    }
  }
});

// ../simple-mind-map/src/themes/pinkGrape.js
var import_deepmerge16 = __toESM(require_cjs());
var pinkGrape_default = (0, import_deepmerge16.default)(default_default, {
  // 连线的颜色
  lineColor: "rgb(166, 101, 106)",
  lineWidth: 3,
  // 概要连线的粗细
  generalizationLineWidth: 3,
  // 概要连线的颜色
  generalizationLineColor: "#fff",
  // 背景颜色
  backgroundColor: "rgb(255, 208, 211)",
  // 根节点样式
  root: {
    fillColor: "rgb(139, 109, 225)",
    borderColor: "",
    borderWidth: 0,
    active: {
      borderColor: "rgb(243, 104, 138)",
      borderWidth: 2
    }
  },
  // 二级节点样式
  second: {
    fillColor: "rgb(243, 104, 138)",
    color: "#fff",
    borderColor: "",
    borderWidth: 0,
    fontSize: 14,
    active: {
      borderColor: "rgb(139, 109, 225)",
      borderWidth: 2
    }
  },
  // 三级及以下节点样式
  node: {
    fontSize: 12,
    color: "#222",
    active: {
      borderColor: "rgb(139, 109, 225)"
    }
  },
  // 概要节点样式
  generalization: {
    fillColor: "#fff",
    borderColor: "transparent",
    color: "#222",
    active: {
      borderColor: "rgb(139, 109, 225)",
      borderWidth: 2
    }
  }
});

// ../simple-mind-map/src/themes/mint.js
var import_deepmerge17 = __toESM(require_cjs());
var mint_default = (0, import_deepmerge17.default)(default_default, {
  // 连线的颜色
  lineColor: "rgb(104, 204, 202)",
  lineWidth: 3,
  // 概要连线的粗细
  generalizationLineWidth: 3,
  // 概要连线的颜色
  generalizationLineColor: "rgb(90, 206, 241)",
  // 背景颜色
  backgroundColor: "rgb(239, 255, 255)",
  // 根节点样式
  root: {
    fillColor: "rgb(0, 192, 184)",
    borderColor: "",
    borderWidth: 0,
    active: {
      borderColor: "rgb(255, 160, 36)",
      borderWidth: 3
    }
  },
  // 二级节点样式
  second: {
    fillColor: "#fff",
    color: "#222",
    borderColor: "rgb(184, 235, 233)",
    borderWidth: 2,
    fontSize: 14,
    active: {
      borderColor: "rgb(0, 192, 184)"
    }
  },
  // 三级及以下节点样式
  node: {
    fontSize: 12,
    color: "#222",
    active: {
      borderColor: "rgb(0, 192, 184)"
    }
  },
  // 概要节点样式
  generalization: {
    fillColor: "rgb(90, 206, 241)",
    borderColor: "transparent",
    color: "#fff",
    active: {
      borderColor: "rgb(0, 192, 184)"
    }
  }
});

// ../simple-mind-map/src/themes/gold.js
var import_deepmerge18 = __toESM(require_cjs());
var gold_default = (0, import_deepmerge18.default)(default_default, {
  // 连线的颜色
  lineColor: "rgb(51, 56, 62)",
  lineWidth: 3,
  // 概要连线的粗细
  generalizationLineWidth: 3,
  // 概要连线的颜色
  generalizationLineColor: "rgb(127, 93, 64)",
  // 背景颜色
  backgroundColor: "#fff",
  // 根节点样式
  root: {
    fillColor: "rgb(51, 56, 62)",
    color: "rgb(247, 208, 160)",
    borderColor: "",
    borderWidth: 0,
    active: {
      borderColor: "rgb(247, 208, 160)",
      borderWidth: 3
    }
  },
  // 二级节点样式
  second: {
    fillColor: "rgb(239, 209, 176)",
    color: "rgb(81, 58, 42)",
    borderColor: "",
    borderWidth: 0,
    fontSize: 14,
    active: {
      borderColor: "rgb(51, 56, 62)",
      borderWidth: 2
    }
  },
  // 三级及以下节点样式
  node: {
    fontSize: 12,
    color: "#222",
    active: {
      borderColor: "rgb(0, 192, 184)"
    }
  },
  // 概要节点样式
  generalization: {
    fillColor: "rgb(127, 93, 64)",
    borderColor: "transparent",
    color: "rgb(255, 214, 175)",
    active: {
      borderColor: "rgb(51, 56, 62)"
    }
  }
});

// ../simple-mind-map/src/themes/vitalityOrange.js
var import_deepmerge19 = __toESM(require_cjs());
var vitalityOrange_default = (0, import_deepmerge19.default)(default_default, {
  // 连线的颜色
  lineColor: "rgb(254, 146, 0)",
  lineWidth: 3,
  // 概要连线的粗细
  generalizationLineWidth: 3,
  // 概要连线的颜色
  generalizationLineColor: "rgb(255, 222, 69)",
  // 背景颜色
  backgroundColor: "rgb(255, 246, 243)",
  // 根节点样式
  root: {
    fillColor: "rgb(255, 112, 52)",
    color: "#fff",
    borderColor: "",
    borderWidth: 0,
    active: {
      borderColor: "rgb(51, 51, 51)",
      borderWidth: 3
    }
  },
  // 二级节点样式
  second: {
    fillColor: "#fff",
    color: "rgb(51, 51, 51)",
    borderColor: "",
    borderWidth: 0,
    fontSize: 14,
    active: {
      borderColor: "rgb(255, 112, 52)",
      borderWidth: 2
    }
  },
  // 三级及以下节点样式
  node: {
    fontSize: 12,
    color: "#222",
    active: {
      borderColor: "rgb(255, 112, 52)"
    }
  },
  // 概要节点样式
  generalization: {
    fillColor: "rgb(255, 222, 69)",
    borderColor: "transparent",
    color: "rgb(51, 51, 51)",
    active: {
      borderColor: "rgb(255, 112, 52)"
    }
  }
});

// ../simple-mind-map/src/themes/greenLeaf.js
var import_deepmerge20 = __toESM(require_cjs());
var greenLeaf_default = (0, import_deepmerge20.default)(default_default, {
  // 连线的颜色
  lineColor: "rgb(40, 193, 84)",
  lineWidth: 3,
  // 概要连线的粗细
  generalizationLineWidth: 3,
  // 概要连线的颜色
  generalizationLineColor: "rgb(251, 158, 0)",
  // 背景颜色
  backgroundColor: "rgb(238, 255, 243)",
  // 根节点样式
  root: {
    fillColor: "rgb(25, 193, 73)",
    color: "#fff",
    borderColor: "",
    borderWidth: 0,
    active: {
      borderColor: "#222",
      borderWidth: 3
    }
  },
  // 二级节点样式
  second: {
    fillColor: "#fff",
    color: "rgb(69, 149, 96)",
    borderColor: "",
    borderWidth: 0,
    fontSize: 14,
    active: {
      borderColor: "rgb(25, 193, 73)",
      borderWidth: 2
    }
  },
  // 三级及以下节点样式
  node: {
    fontSize: 12,
    color: "#222",
    active: {
      borderColor: "rgb(25, 193, 73)"
    }
  },
  // 概要节点样式
  generalization: {
    fillColor: "#fff",
    borderColor: "rgb(251, 158, 0)",
    borderWidth: 2,
    color: "rgb(51, 51, 51)",
    active: {
      borderColor: "rgb(25, 193, 73)"
    }
  }
});

// ../simple-mind-map/src/themes/dark2.js
var import_deepmerge21 = __toESM(require_cjs());
var dark2_default = (0, import_deepmerge21.default)(default_default, {
  // 连线的颜色
  lineColor: "rgb(75, 81, 78)",
  lineWidth: 3,
  // 概要连线的粗细
  generalizationLineWidth: 3,
  // 概要连线的颜色
  generalizationLineColor: "rgb(255, 119, 34)",
  // 背景颜色
  backgroundColor: "rgb(27, 31, 34)",
  // 根节点样式
  root: {
    fillColor: "rgb(36, 179, 96)",
    color: "#fff",
    borderColor: "",
    borderWidth: 0,
    active: {
      borderColor: "rgb(254, 199, 13)",
      borderWidth: 3
    }
  },
  // 二级节点样式
  second: {
    fillColor: "rgb(254, 199, 13)",
    color: "rgb(0, 0, 0)",
    borderColor: "",
    borderWidth: 0,
    fontSize: 14,
    active: {
      borderColor: "rgb(36, 179, 96)",
      borderWidth: 2
    }
  },
  // 三级及以下节点样式
  node: {
    fontSize: 12,
    color: "rgb(204, 204, 204)",
    active: {
      borderColor: "rgb(254, 199, 13)"
    }
  },
  // 概要节点样式
  generalization: {
    fillColor: "transparent",
    borderColor: "rgb(255, 119, 34)",
    borderWidth: 2,
    color: "rgb(204, 204, 204)",
    active: {
      borderColor: "rgb(254, 199, 13)"
    }
  }
});

// ../simple-mind-map/src/themes/skyGreen.js
var import_deepmerge22 = __toESM(require_cjs());
var skyGreen_default = (0, import_deepmerge22.default)(default_default, {
  // 连线的颜色
  lineColor: "#fff",
  lineWidth: 3,
  // 概要连线的粗细
  generalizationLineWidth: 3,
  // 概要连线的颜色
  generalizationLineColor: "#fff",
  // 背景颜色
  backgroundColor: "rgb(80, 156, 170)",
  // 根节点样式
  root: {
    fillColor: "#fff",
    borderColor: "",
    borderWidth: 0,
    color: "rgb(65, 89, 158)",
    active: {
      borderColor: "rgb(251, 227, 188)",
      borderWidth: 3
    }
  },
  // 二级节点样式
  second: {
    fillColor: "rgb(251, 227, 188)",
    color: "rgb(65, 89, 158)",
    borderColor: "",
    borderWidth: 0,
    fontSize: 14,
    active: {
      borderColor: "#fff",
      borderWidth: 2
    }
  },
  // 三级及以下节点样式
  node: {
    fontSize: 12,
    color: "rgb(65, 89, 158)",
    active: {
      borderColor: "rgb(251, 227, 188)"
    }
  },
  // 概要节点样式
  generalization: {
    fillColor: "#fff",
    borderColor: "transparent",
    color: "rgb(65, 89, 158)",
    active: {
      borderColor: "rgb(251, 227, 188)"
    }
  }
});

// ../simple-mind-map/src/themes/simpleBlack.js
var import_deepmerge23 = __toESM(require_cjs());
var simpleBlack_default = (0, import_deepmerge23.default)(default_default, {
  // 连线的颜色
  lineColor: "rgb(34, 34, 34)",
  lineWidth: 4,
  // 概要连线的粗细
  generalizationLineWidth: 4,
  // 概要连线的颜色
  generalizationLineColor: "rgb(34, 34, 34)",
  // 根节点样式
  root: {
    fillColor: "#fff",
    color: "rgb(34, 34, 34)",
    borderColor: "rgb(34, 34, 34)",
    borderWidth: 3,
    fontSize: 24,
    active: {
      borderColor: "#a13600"
    }
  },
  // 二级节点样式
  second: {
    fillColor: "rgb(241, 246, 248)",
    color: "rgb(34, 34, 34)",
    borderColor: "rgb(34, 34, 34)",
    borderWidth: 3,
    fontSize: 18,
    active: {
      borderColor: "#a13600"
    }
  },
  // 三级及以下节点样式
  node: {
    fontSize: 14,
    color: "rgb(34, 34, 34)",
    active: {
      borderColor: "#a13600"
    }
  },
  // 概要节点样式
  generalization: {
    fontSize: 14,
    fillColor: "transparent",
    borderColor: "rgb(34, 34, 34)",
    borderWidth: 2,
    color: "rgb(34, 34, 34)",
    active: {
      borderColor: "#a13600"
    }
  }
});

// ../simple-mind-map/src/themes/courseGreen.js
var import_deepmerge24 = __toESM(require_cjs());
var courseGreen_default = (0, import_deepmerge24.default)(default_default, {
  // 连线的颜色
  lineColor: "rgb(113, 195, 169)",
  lineWidth: 3,
  // 概要连线的粗细
  generalizationLineWidth: 3,
  // 概要连线的颜色
  generalizationLineColor: "rgb(113, 195, 169)",
  // 根节点样式
  root: {
    fillColor: "rgb(16, 160, 121)",
    color: "#fff",
    borderColor: "",
    borderWidth: 0,
    fontSize: 24,
    active: {
      borderColor: "rgb(173, 91, 12)",
      borderWidth: 3
    }
  },
  // 二级节点样式
  second: {
    fillColor: "rgb(240, 252, 249)",
    color: "rgb(50, 113, 96)",
    borderColor: "rgb(113, 195, 169)",
    borderWidth: 2,
    fontSize: 18,
    active: {
      borderColor: "rgb(173, 91, 12)"
    }
  },
  // 三级及以下节点样式
  node: {
    fontSize: 14,
    color: "rgb(10, 59, 43)",
    active: {
      borderColor: "rgb(173, 91, 12)"
    }
  },
  // 概要节点样式
  generalization: {
    fontSize: 14,
    fillColor: "rgb(246, 238, 211)",
    borderColor: "",
    borderWidth: 0,
    color: "rgb(173, 91, 12)",
    active: {
      borderColor: "rgb(113, 195, 169)"
    }
  }
});

// ../simple-mind-map/src/themes/coffee.js
var import_deepmerge25 = __toESM(require_cjs());
var coffee_default = (0, import_deepmerge25.default)(default_default, {
  // 连线的颜色
  lineColor: "rgb(173, 123, 91)",
  lineWidth: 4,
  // 概要连线的粗细
  generalizationLineWidth: 4,
  // 概要连线的颜色
  generalizationLineColor: "rgb(173, 123, 91)",
  // 根节点样式
  root: {
    fillColor: "rgb(202, 117, 79)",
    color: "#fff",
    borderColor: "",
    borderWidth: 0,
    fontSize: 24,
    active: {
      borderColor: "rgb(173, 123, 91)",
      borderWidth: 3
    }
  },
  // 二级节点样式
  second: {
    fillColor: "rgb(245, 231, 216)",
    color: "rgb(125, 86, 42)",
    borderColor: "",
    borderWidth: 0,
    fontSize: 18,
    active: {
      borderColor: "rgb(173, 123, 91)"
    }
  },
  // 三级及以下节点样式
  node: {
    fontSize: 14,
    color: "rgb(96, 71, 47)",
    active: {
      borderColor: "rgb(173, 123, 91)"
    }
  },
  // 概要节点样式
  generalization: {
    fontSize: 14,
    fillColor: "rgb(255, 249, 239)",
    borderColor: "rgb(173, 123, 91)",
    borderWidth: 2,
    color: "rgb(122, 83, 44)",
    active: {
      borderColor: "rgb(202, 117, 79)"
    }
  }
});

// ../simple-mind-map/src/themes/redSpirit.js
var import_deepmerge26 = __toESM(require_cjs());
var redSpirit_default = (0, import_deepmerge26.default)(default_default, {
  // 背景颜色
  backgroundColor: "rgb(255, 238, 228)",
  // 连线的颜色
  lineColor: "rgb(230, 138, 131)",
  lineWidth: 3,
  // 概要连线的粗细
  generalizationLineWidth: 3,
  // 概要连线的颜色
  generalizationLineColor: "rgb(222, 101, 85)",
  // 根节点样式
  root: {
    fillColor: "rgb(207, 44, 44)",
    color: "rgb(255, 233, 157)",
    borderColor: "",
    borderWidth: 0,
    fontSize: 24,
    active: {
      borderColor: "rgb(255, 233, 157)",
      borderWidth: 3
    }
  },
  // 二级节点样式
  second: {
    fillColor: "rgb(255, 255, 255)",
    color: "rgb(211, 58, 21)",
    borderColor: "rgb(222, 101, 85)",
    borderWidth: 2,
    fontSize: 18,
    active: {
      borderColor: "rgb(255, 233, 157)"
    }
  },
  // 三级及以下节点样式
  node: {
    fontSize: 14,
    color: "rgb(144, 71, 43)",
    active: {
      borderColor: "rgb(255, 233, 157)"
    }
  },
  // 概要节点样式
  generalization: {
    fontSize: 14,
    fillColor: "rgb(255, 247, 211)",
    borderColor: "rgb(255, 202, 162)",
    borderWidth: 2,
    color: "rgb(187, 101, 69)",
    active: {
      borderColor: "rgb(222, 101, 85)"
    }
  }
});

// ../simple-mind-map/src/themes/blackHumour.js
var import_deepmerge27 = __toESM(require_cjs());
var blackHumour_default = (0, import_deepmerge27.default)(default_default, {
  // 背景颜色
  backgroundColor: "rgb(27, 31, 34)",
  // 连线的颜色
  lineColor: "rgb(75, 81, 78)",
  lineWidth: 3,
  // 概要连线的粗细
  generalizationLineWidth: 3,
  // 概要连线的颜色
  generalizationLineColor: "rgb(255, 119, 34)",
  // 根节点样式
  root: {
    fillColor: "rgb(36, 179, 96)",
    color: "#fff",
    borderColor: "",
    borderWidth: 0,
    fontSize: 24,
    active: {
      borderColor: "rgb(254, 199, 13)",
      borderWidth: 3
    }
  },
  // 二级节点样式
  second: {
    fillColor: "rgb(254, 199, 13)",
    color: "rgb(0, 0, 0)",
    borderColor: "",
    borderWidth: 0,
    fontSize: 18,
    active: {
      borderColor: "rgb(36, 179, 96)",
      borderWidth: 3
    }
  },
  // 三级及以下节点样式
  node: {
    fontSize: 14,
    color: "rgb(204, 204, 204)",
    active: {
      borderColor: "rgb(254, 199, 13)"
    }
  },
  // 概要节点样式
  generalization: {
    fontSize: 14,
    fillColor: "rgb(27, 31, 34)",
    borderColor: "rgb(255, 119, 34)",
    borderWidth: 2,
    color: "rgb(204, 204, 204)",
    active: {
      borderColor: "rgb(36, 179, 96)"
    }
  }
});

// ../simple-mind-map/src/themes/lateNightOffice.js
var import_deepmerge28 = __toESM(require_cjs());
var lateNightOffice_default = (0, import_deepmerge28.default)(default_default, {
  // 背景颜色
  backgroundColor: "rgb(32, 37, 49)",
  // 连线的颜色
  lineColor: "rgb(137, 167, 196)",
  lineWidth: 3,
  // 概要连线的粗细
  generalizationLineWidth: 3,
  // 概要连线的颜色
  generalizationLineColor: "rgb(255, 119, 34)",
  // 根节点样式
  root: {
    fillColor: "rgb(23, 153, 243)",
    color: "rgb(255, 255, 255)",
    borderColor: "",
    borderWidth: 0,
    fontSize: 24,
    active: {
      borderColor: "rgb(255, 119, 34)",
      borderWidth: 3
    }
  },
  // 二级节点样式
  second: {
    fillColor: "rgb(70, 78, 94)",
    color: "rgb(209, 210, 210)",
    borderColor: "",
    borderWidth: 0,
    fontSize: 18,
    active: {
      borderColor: "rgb(255, 119, 34)",
      borderWidth: 3
    }
  },
  // 三级及以下节点样式
  node: {
    fontSize: 14,
    color: "rgb(204, 204, 204)",
    active: {
      borderColor: "rgb(255, 119, 34)"
    }
  },
  // 概要节点样式
  generalization: {
    fontSize: 14,
    fillColor: "rgb(255, 119, 34)",
    borderColor: "",
    borderWidth: 2,
    color: "#fff",
    active: {
      borderColor: "rgb(23, 153, 243)"
    }
  }
});

// ../simple-mind-map/src/themes/blackGold.js
var import_deepmerge29 = __toESM(require_cjs());
var blackGold_default = (0, import_deepmerge29.default)(default_default, {
  // 背景颜色
  backgroundColor: "rgb(18, 20, 20)",
  // 连线的颜色
  lineColor: "rgb(205, 186, 156)",
  lineWidth: 3,
  // 概要连线的粗细
  generalizationLineWidth: 3,
  // 概要连线的颜色
  generalizationLineColor: "rgb(245, 224, 191)",
  // 根节点样式
  root: {
    fillColor: "rgb(255, 208, 124)",
    color: "rgb(111, 61, 6)",
    borderColor: "",
    borderWidth: 0,
    fontSize: 24,
    active: {
      borderColor: "#fff",
      borderWidth: 3
    }
  },
  // 二级节点样式
  second: {
    fillColor: "rgb(66, 57, 46)",
    color: "rgb(225, 201, 158)",
    borderColor: "rgb(245, 224, 191)",
    borderWidth: 2,
    fontSize: 18,
    active: {
      borderColor: "rgb(255, 208, 124)"
    }
  },
  // 三级及以下节点样式
  node: {
    fontSize: 14,
    color: "rgb(231, 203, 155)",
    active: {
      borderColor: "rgb(255, 208, 124)"
    }
  },
  // 概要节点样式
  generalization: {
    fontSize: 14,
    fillColor: "rgb(56, 45, 34)",
    borderColor: "rgb(104, 84, 61)",
    borderWidth: 2,
    color: "rgb(242, 216, 176)",
    active: {
      borderColor: "rgb(255, 208, 124)"
    }
  }
});

// ../simple-mind-map/src/themes/avocado.js
var import_deepmerge30 = __toESM(require_cjs());
var avocado_default = (0, import_deepmerge30.default)(default_default, {
  // 背景颜色
  backgroundColor: "#e6f1de",
  // 连线的颜色
  lineColor: "#f5ffad",
  lineWidth: 4,
  // 概要连线的粗细
  generalizationLineWidth: 3,
  // 概要连线的颜色
  generalizationLineColor: "#749336",
  // 根节点样式
  root: {
    fillColor: "#94c143",
    color: "#fff",
    borderColor: "#94c143",
    borderWidth: 0,
    fontSize: 24,
    active: {
      borderColor: "#749336",
      borderWidth: 3
    }
  },
  // 二级节点样式
  second: {
    fillColor: "#cee498",
    color: "#749336",
    borderColor: "#aec668",
    borderWidth: 2,
    fontSize: 18,
    active: {
      borderColor: "#749336"
    }
  },
  // 三级及以下节点样式
  node: {
    fontSize: 14,
    color: "#749336",
    active: {
      borderColor: "#749336"
    }
  },
  // 概要节点样式
  generalization: {
    fontSize: 14,
    fillColor: "#cee498",
    borderColor: "#aec668",
    borderWidth: 2,
    color: "#749336",
    active: {
      borderColor: "#749336"
    }
  }
});

// ../simple-mind-map/src/themes/autumn.js
var import_deepmerge31 = __toESM(require_cjs());
var autumn_default = (0, import_deepmerge31.default)(default_default, {
  // 背景颜色
  backgroundColor: "#fff2df",
  // 连线的颜色
  lineColor: "#b0bc47",
  lineWidth: 3,
  // 概要连线的粗细
  generalizationLineWidth: 3,
  // 概要连线的颜色
  generalizationLineColor: "#b0bc47",
  // 根节点样式
  root: {
    fillColor: "#e68112",
    color: "#fff",
    borderColor: "#e68112",
    borderWidth: 0,
    fontSize: 24,
    active: {
      borderColor: "#b0bc47",
      borderWidth: 3
    }
  },
  // 二级节点样式
  second: {
    fillColor: "#ffd683",
    color: "#8c5416",
    borderColor: "#b0bc47",
    borderWidth: 2,
    fontSize: 18,
    active: {
      borderColor: "#e68112"
    }
  },
  // 三级及以下节点样式
  node: {
    fontSize: 14,
    color: "#8c5416",
    active: {
      borderColor: "#b0bc47"
    }
  },
  // 概要节点样式
  generalization: {
    fontSize: 14,
    fillColor: "#ffd683",
    borderColor: "#b0bc47",
    borderWidth: 2,
    color: "#8c5416",
    active: {
      borderColor: "#e68112"
    }
  }
});

// ../simple-mind-map/src/themes/orangeJuice.js
var import_deepmerge32 = __toESM(require_cjs());
var orangeJuice_default = (0, import_deepmerge32.default)(default_default, {
  // 背景颜色
  backgroundColor: "#070616",
  // 连线的颜色
  lineColor: "#fff",
  lineWidth: 3,
  // 概要连线的粗细
  generalizationLineWidth: 3,
  // 概要连线的颜色
  generalizationLineColor: "#fff",
  // 根节点样式
  root: {
    fillColor: "#ff6811",
    color: "#110501",
    borderColor: "#ff6811",
    borderWidth: 0,
    fontSize: 24,
    active: {
      borderColor: "#a9a4a9",
      borderWidth: 3
    }
  },
  // 二级节点样式
  second: {
    fillColor: "#070616",
    color: "#a9a4a9",
    borderColor: "#ff6811",
    borderWidth: 2,
    fontSize: 18,
    active: {
      borderColor: "#110501"
    }
  },
  // 三级及以下节点样式
  node: {
    fontSize: 14,
    color: "#a9a4a9",
    active: {
      borderColor: "#ff6811"
    }
  },
  // 概要节点样式
  generalization: {
    fontSize: 14,
    fillColor: "",
    borderColor: "#ff6811",
    borderWidth: 2,
    color: "#a9a4a9",
    active: {
      borderColor: "#110501"
    }
  }
});

// ../simple-mind-map/src/themes/index.js
var themes_default = {
  default: default_default,
  freshGreen: freshGreen_default,
  blueSky: blueSky_default,
  brainImpairedPink: brainImpairedPink_default,
  romanticPurple: romanticPurple_default,
  freshRed: freshRed_default,
  earthYellow: earthYellow_default,
  classic: classic_default,
  classic2: classic2_default,
  classic3: classic3_default,
  classic4: classic4_default,
  dark: dark_default,
  classicGreen: classicGreen_default,
  classicBlue: classicBlue_default,
  minions: minions_default,
  pinkGrape: pinkGrape_default,
  mint: mint_default,
  gold: gold_default,
  vitalityOrange: vitalityOrange_default,
  greenLeaf: greenLeaf_default,
  dark2: dark2_default,
  skyGreen: skyGreen_default,
  simpleBlack: simpleBlack_default,
  courseGreen: courseGreen_default,
  coffee: coffee_default,
  redSpirit: redSpirit_default,
  blackHumour: blackHumour_default,
  lateNightOffice: lateNightOffice_default,
  blackGold: blackGold_default,
  avocado: avocado_default,
  autumn: autumn_default,
  orangeJuice: orangeJuice_default
};

// ../simple-mind-map/src/core/command/keyMap.js
var map2 = {
  Backspace: 8,
  Tab: 9,
  Enter: 13,
  Shift: 16,
  Control: 17,
  Alt: 18,
  CapsLock: 20,
  Esc: 27,
  Spacebar: 32,
  PageUp: 33,
  PageDown: 34,
  End: 35,
  Home: 36,
  Insert: 45,
  Left: 37,
  Up: 38,
  Right: 39,
  Down: 40,
  Del: 46,
  NumLock: 144,
  Cmd: 91,
  CmdFF: 224,
  F1: 112,
  F2: 113,
  F3: 114,
  F4: 115,
  F5: 116,
  F6: 117,
  F7: 118,
  F8: 119,
  F9: 120,
  F10: 121,
  F11: 122,
  F12: 123,
  "`": 192,
  "=": 187,
  "-": 189,
  "/": 191,
  ".": 190
};
for (let i3 = 0; i3 <= 9; i3++) {
  map2[i3] = i3 + 48;
}
"abcdefghijklmnopqrstuvwxyz".split("").forEach((n3, index3) => {
  map2[n3] = index3 + 65;
});
var keyMap = map2;

// ../simple-mind-map/src/core/command/KeyCommand.js
var KeyCommand = class {
  //  构造函数
  constructor(opt) {
    this.opt = opt;
    this.mindMap = opt.mindMap;
    this.shortcutMap = {
      //Enter: [fn]
    };
    this.shortcutMapCache = {};
    this.isPause = false;
    this.isInSvg = false;
    this.bindEvent();
  }
  //  暂停快捷键响应
  pause() {
    this.isPause = true;
  }
  //  恢复快捷键响应
  recovery() {
    this.isPause = false;
  }
  //  保存当前注册的快捷键数据，然后清空快捷键数据
  save() {
    this.shortcutMapCache = this.shortcutMap;
    this.shortcutMap = {};
  }
  //  恢复保存的快捷键数据，然后清空缓存数据
  restore() {
    this.shortcutMap = this.shortcutMapCache;
    this.shortcutMapCache = {};
  }
  //  绑定事件
  bindEvent() {
    this.mindMap.on("svg_mouseenter", () => {
      this.isInSvg = true;
    });
    this.mindMap.on("svg_mouseleave", () => {
      if (this.mindMap.richText && this.mindMap.richText.showTextEdit) {
        return;
      }
      if (this.mindMap.renderer.textEdit.showTextEdit || this.mindMap.associativeLine && this.mindMap.associativeLine.showTextEdit) {
        return;
      }
      this.isInSvg = false;
    });
    window.addEventListener("keydown", (e2) => {
      if (this.isPause || this.mindMap.opt.enableShortcutOnlyWhenMouseInSvg && !this.isInSvg) {
        return;
      }
      Object.keys(this.shortcutMap).forEach((key) => {
        if (this.checkKey(e2, key)) {
          e2.stopPropagation();
          e2.preventDefault();
          this.shortcutMap[key].forEach((fn) => {
            fn();
          });
        }
      });
    });
  }
  //  检查键值是否符合
  checkKey(e2, key) {
    let o3 = this.getOriginEventCodeArr(e2);
    let k2 = this.getKeyCodeArr(key);
    if (o3.length !== k2.length) {
      return false;
    }
    for (let i3 = 0; i3 < o3.length; i3++) {
      let index3 = k2.findIndex((item) => {
        return item === o3[i3];
      });
      if (index3 === -1) {
        return false;
      } else {
        k2.splice(index3, 1);
      }
    }
    return true;
  }
  //  获取事件对象里的键值数组
  getOriginEventCodeArr(e2) {
    let arr = [];
    if (e2.ctrlKey || e2.metaKey) {
      arr.push(keyMap["Control"]);
    }
    if (e2.altKey) {
      arr.push(keyMap["Alt"]);
    }
    if (e2.shiftKey) {
      arr.push(keyMap["Shift"]);
    }
    if (!arr.includes(e2.keyCode)) {
      arr.push(e2.keyCode);
    }
    return arr;
  }
  //  获取快捷键对应的键值数组
  getKeyCodeArr(key) {
    let keyArr = key.split(/\s*\+\s*/);
    let arr = [];
    keyArr.forEach((item) => {
      arr.push(keyMap[item]);
    });
    return arr;
  }
  //  添加快捷键命令
  /**
   * Enter
   * Tab | Insert
   * Shift + a
   */
  addShortcut(key, fn) {
    key.split(/\s*\|\s*/).forEach((item) => {
      if (this.shortcutMap[item]) {
        this.shortcutMap[item].push(fn);
      } else {
        this.shortcutMap[item] = [fn];
      }
    });
  }
  //  移除快捷键命令
  removeShortcut(key, fn) {
    key.split(/\s*\|\s*/).forEach((item) => {
      if (this.shortcutMap[item]) {
        if (fn) {
          let index3 = this.shortcutMap[item].findIndex((f3) => {
            return f3 === fn;
          });
          if (index3 !== -1) {
            this.shortcutMap[item].splice(index3, 1);
          }
        } else {
          this.shortcutMap[item] = [];
          delete this.shortcutMap[item];
        }
      }
    });
  }
  //  获取指定快捷键的处理函数
  getShortcutFn(key) {
    let res = [];
    key.split(/\s*\|\s*/).forEach((item) => {
      res = this.shortcutMap[item] || [];
    });
    return res;
  }
};

// ../simple-mind-map/src/core/command/Command.js
var Command = class {
  //  构造函数
  constructor(opt = {}) {
    this.opt = opt;
    this.mindMap = opt.mindMap;
    this.commands = {};
    this.history = [];
    this.activeHistoryIndex = 0;
    this.registerShortcutKeys();
    this.addHistory = nextTick(this.addHistory, this);
  }
  //  清空历史数据
  clearHistory() {
    this.history = [];
    this.activeHistoryIndex = 0;
    this.mindMap.emit("back_forward", 0, 0);
  }
  //  注册快捷键
  registerShortcutKeys() {
    this.mindMap.keyCommand.addShortcut("Control+z", () => {
      this.mindMap.execCommand("BACK");
    });
    this.mindMap.keyCommand.addShortcut("Control+y", () => {
      this.mindMap.execCommand("FORWARD");
    });
  }
  //  执行命令
  exec(name, ...args) {
    if (this.commands[name]) {
      this.commands[name].forEach((fn) => {
        fn(...args);
      });
      if (["BACK", "FORWARD", "SET_NODE_ACTIVE", "CLEAR_ACTIVE_NODE"].includes(name)) {
        return;
      }
      this.addHistory();
    }
  }
  //  添加命令
  add(name, fn) {
    if (this.commands[name]) {
      this.commands[name].push(fn);
    } else {
      this.commands[name] = [fn];
    }
  }
  //  移除命令
  remove(name, fn) {
    if (!this.commands[name]) {
      return;
    }
    if (!fn) {
      this.commands[name] = [];
      delete this.commands[name];
    } else {
      let index3 = this.commands[name].find((item) => {
        return item === fn;
      });
      if (index3 !== -1) {
        this.commands[name].splice(index3, 1);
      }
    }
  }
  //  添加回退数据
  addHistory() {
    if (this.mindMap.opt.readonly) {
      return;
    }
    let data2 = this.getCopyData();
    if (this.history.length > 0 && JSON.stringify(this.history[this.history.length - 1]) === JSON.stringify(data2)) {
      return;
    }
    this.history = this.history.slice(0, this.activeHistoryIndex + 1);
    this.history.push(simpleDeepClone(data2));
    if (this.history.length > this.mindMap.opt.maxHistoryCount) {
      this.history.shift();
    }
    this.activeHistoryIndex = this.history.length - 1;
    this.mindMap.emit("data_change", this.removeDataUid(data2));
    this.mindMap.emit(
      "back_forward",
      this.activeHistoryIndex,
      this.history.length
    );
  }
  //  回退
  back(step = 1) {
    if (this.mindMap.opt.readonly) {
      return;
    }
    if (this.activeHistoryIndex - step >= 0) {
      this.activeHistoryIndex -= step;
      this.mindMap.emit(
        "back_forward",
        this.activeHistoryIndex,
        this.history.length
      );
      let data2 = simpleDeepClone(this.history[this.activeHistoryIndex]);
      this.mindMap.emit("data_change", this.removeDataUid(data2));
      return data2;
    }
  }
  //  前进
  forward(step = 1) {
    if (this.mindMap.opt.readonly) {
      return;
    }
    let len = this.history.length;
    if (this.activeHistoryIndex + step <= len - 1) {
      this.activeHistoryIndex += step;
      this.mindMap.emit("back_forward", this.activeHistoryIndex, this.history.length);
      let data2 = simpleDeepClone(this.history[this.activeHistoryIndex]);
      this.mindMap.emit("data_change", this.removeDataUid(data2));
      return data2;
    }
  }
  //  获取渲染树数据副本
  getCopyData() {
    return copyRenderTree({}, this.mindMap.renderer.renderTree, true);
  }
  // 移除节点数据中的uid
  removeDataUid(data2) {
    data2 = simpleDeepClone(data2);
    let walk2 = (root2) => {
      delete root2.data.uid;
      if (root2.children && root2.children.length > 0) {
        root2.children.forEach((item) => {
          walk2(item);
        });
      }
    };
    walk2(data2);
    return data2;
  }
};
var Command_default = Command;

// ../simple-mind-map/src/utils/BatchExecution.js
var BatchExecution = class {
  //  构造函数
  constructor() {
    this.has = {};
    this.queue = [];
    this.nextTick = nextTick(this.flush, this);
  }
  //  添加任务
  push(name, fn) {
    if (this.has[name]) {
      return;
    }
    this.has[name] = true;
    this.queue.push({
      name,
      fn
    });
    this.nextTick();
  }
  //   执行队列
  flush() {
    let fns = this.queue.slice(0);
    this.queue = [];
    fns.forEach(({ name, fn }) => {
      this.has[name] = false;
      fn();
    });
  }
};
var BatchExecution_default = BatchExecution;

// ../simple-mind-map/index.js
var defaultOpt = {
  // 是否只读
  readonly: false,
  // 布局
  layout: CONSTANTS.LAYOUT.LOGICAL_STRUCTURE,
  // 如果结构为鱼骨图，那么可以通过该选项控制倾斜角度
  fishboneDeg: 45,
  // 主题
  theme: "default",
  // 内置主题：default（默认主题）
  // 主题配置，会和所选择的主题进行合并
  themeConfig: {},
  // 放大缩小的增量比例
  scaleRatio: 0.1,
  // 最多显示几个标签
  maxTag: 5,
  // 导出图片时的内边距
  exportPadding: 20,
  // 展开收缩按钮尺寸
  expandBtnSize: 20,
  // 节点里图片和文字的间距
  imgTextMargin: 5,
  // 节点里各种文字信息的间距，如图标和文字的间距
  textContentMargin: 2,
  // 多选节点时鼠标移动到边缘时的画布移动偏移量
  selectTranslateStep: 3,
  // 多选节点时鼠标移动距边缘多少距离时开始偏移
  selectTranslateLimit: 20,
  // 自定义节点备注内容显示
  customNoteContentShow: null,
  /*
        {
            show(){},
            hide(){}
        }
    */
  // 是否开启节点自由拖拽
  enableFreeDrag: false,
  // 水印配置
  watermarkConfig: {
    text: "",
    lineSpacing: 100,
    textSpacing: 100,
    angle: 30,
    textStyle: {
      color: "#999",
      opacity: 0.5,
      fontSize: 14
    }
  },
  // 达到该宽度文本自动换行
  textAutoWrapWidth: 500,
  // 自定义鼠标滚轮事件处理
  // 可以传一个函数，回调参数为事件对象
  customHandleMousewheel: null,
  // 鼠标滚动的行为，如果customHandleMousewheel传了自定义函数，这个属性不生效
  mousewheelAction: CONSTANTS.MOUSE_WHEEL_ACTION.ZOOM,
  // zoom（放大缩小）、move（上下移动）
  // 当mousewheelAction设为move时，可以通过该属性控制鼠标滚动一下视图移动的步长，单位px
  mousewheelMoveStep: 100,
  // 默认插入的二级节点的文字
  defaultInsertSecondLevelNodeText: "\u4E8C\u7EA7\u8282\u70B9",
  // 默认插入的二级以下节点的文字
  defaultInsertBelowSecondLevelNodeText: "\u5206\u652F\u4E3B\u9898",
  // 展开收起按钮的颜色
  expandBtnStyle: {
    color: "#808080",
    fill: "#fff"
  },
  // 自定义展开收起按钮的图标
  expandBtnIcon: {
    open: "",
    // svg字符串
    close: ""
  },
  // 是否只有当鼠标在画布内才响应快捷键事件
  enableShortcutOnlyWhenMouseInSvg: true,
  // 是否开启节点动画过渡
  enableNodeTransitionMove: true,
  // 如果开启节点动画过渡，可以通过该属性设置过渡的时间，单位ms
  nodeTransitionMoveDuration: 300,
  // 初始根节点的位置
  initRootNodePosition: null,
  // 导出png、svg、pdf时的图形内边距
  exportPaddingX: 10,
  exportPaddingY: 10,
  // 节点文本编辑框的z-index
  nodeTextEditZIndex: 3e3,
  // 节点备注浮层的z-index
  nodeNoteTooltipZIndex: 3e3,
  // 是否在点击了画布外的区域时结束节点文本的编辑状态
  isEndNodeTextEditOnClickOuter: true,
  // 最大历史记录数
  maxHistoryCount: 1e3,
  // 是否一直显示节点的展开收起按钮，默认为鼠标移上去和激活时才显示
  alwaysShowExpandBtn: false,
  // 扩展节点可插入的图标
  iconList: [
    // {
    //   name: '',// 分组名称
    //   type: '',// 分组的值
    //   list: [// 分组下的图标列表
    //     {
    //       name: '',// 图标名称
    //       icon:''// 图标，可以传svg或图片
    //     }
    //   ]
    // }
  ],
  // 节点最大缓存数量
  maxNodeCacheCount: 1e3,
  // 关联线默认文字
  defaultAssociativeLineText: "\u5173\u8054",
  // 思维导图适应画布大小时的内边距
  fitPadding: 50,
  // 是否开启按住ctrl键多选节点功能
  enableCtrlKeyNodeSelection: true,
  // 设置为左键多选节点，右键拖动画布
  useLeftKeySelectionRightKeyDrag: false,
  // 节点即将进入编辑前的回调方法，如果该方法返回true以外的值，那么将取消编辑，函数可以返回一个值，或一个Promise，回调参数为节点实例
  beforeTextEdit: null
};
var MindMap2 = class {
  //  构造函数
  constructor(opt = {}) {
    this.opt = this.handleOpt((0, import_deepmerge33.default)(defaultOpt, opt));
    this.el = this.opt.el;
    this.elRect = this.el.getBoundingClientRect();
    this.width = this.elRect.width;
    this.height = this.elRect.height;
    this.svg = SVG().addTo(this.el).size(this.width, this.height);
    this.draw = this.svg.group();
    this.uid = 1;
    this.initTheme();
    this.event = new Event_default({
      mindMap: this
    });
    this.keyCommand = new KeyCommand({
      mindMap: this
    });
    this.command = new Command_default({
      mindMap: this
    });
    this.renderer = new Render_default({
      mindMap: this
    });
    this.view = new View_default({
      mindMap: this,
      draw: this.draw
    });
    this.batchExecution = new BatchExecution_default();
    MindMap2.pluginList.forEach((plugin) => {
      this.initPlugin(plugin);
    });
    this.render();
    setTimeout(() => {
      this.command.addHistory();
    }, 0);
  }
  //  配置参数处理
  handleOpt(opt) {
    if (!layoutValueList.includes(opt.layout)) {
      opt.layout = CONSTANTS.LAYOUT.LOGICAL_STRUCTURE;
    }
    opt.theme = opt.theme && themes_default[opt.theme] ? opt.theme : "default";
    return opt;
  }
  //  渲染，部分渲染
  render(callback, source = "") {
    this.batchExecution.push("render", () => {
      this.initTheme();
      this.renderer.reRender = false;
      this.renderer.render(callback, source);
    });
  }
  //  重新渲染
  reRender(callback, source = "") {
    this.batchExecution.push("render", () => {
      this.draw.clear();
      this.initTheme();
      this.renderer.reRender = true;
      this.renderer.render(callback, source);
    });
  }
  //  容器尺寸变化，调整尺寸
  resize() {
    this.elRect = this.el.getBoundingClientRect();
    this.width = this.elRect.width;
    this.height = this.elRect.height;
    this.svg.size(this.width, this.height);
  }
  //  监听事件
  on(event, fn) {
    this.event.on(event, fn);
  }
  //  触发事件
  emit(event, ...args) {
    this.event.emit(event, ...args);
  }
  //  解绑事件
  off(event, fn) {
    this.event.off(event, fn);
  }
  //  设置主题
  initTheme() {
    this.themeConfig = (0, import_deepmerge33.default)(themes_default[this.opt.theme], this.opt.themeConfig);
    Style_default.setBackgroundStyle(this.el, this.themeConfig);
  }
  //  设置主题
  setTheme(theme) {
    this.renderer.clearAllActive();
    this.opt.theme = theme;
    this.render(null, CONSTANTS.CHANGE_THEME);
  }
  //  获取当前主题
  getTheme() {
    return this.opt.theme;
  }
  //  设置主题配置
  setThemeConfig(config) {
    this.opt.themeConfig = config;
    let res = checkIsNodeSizeIndependenceConfig(config);
    this.render(null, res ? "" : CONSTANTS.CHANGE_THEME);
  }
  //  获取自定义主题配置
  getCustomThemeConfig() {
    return this.opt.themeConfig;
  }
  //  获取某个主题配置值
  getThemeConfig(prop) {
    return prop === void 0 ? this.themeConfig : this.themeConfig[prop];
  }
  // 获取配置
  getConfig(prop) {
    return prop === void 0 ? this.opt : this.opt[prop];
  }
  // 更新配置
  updateConfig(opt = {}) {
    this.opt = this.handleOpt(import_deepmerge33.default.all([defaultOpt, this.opt, opt]));
  }
  //  获取当前布局结构
  getLayout() {
    return this.opt.layout;
  }
  //  设置布局结构
  setLayout(layout) {
    if (!layoutValueList.includes(layout)) {
      layout = CONSTANTS.LAYOUT.LOGICAL_STRUCTURE;
    }
    this.opt.layout = layout;
    this.view.reset();
    this.renderer.setLayout();
    this.render();
  }
  //  执行命令
  execCommand(...args) {
    this.command.exec(...args);
  }
  //  动态设置思维导图数据，纯节点数据
  setData(data2) {
    this.execCommand("CLEAR_ACTIVE_NODE");
    this.command.clearHistory();
    this.command.addHistory();
    if (this.richText) {
      this.renderer.renderTree = this.richText.handleSetData(data2);
    } else {
      this.renderer.renderTree = data2;
    }
    this.reRender(() => {
    }, CONSTANTS.SET_DATA);
  }
  //  动态设置思维导图数据，包括节点数据、布局、主题、视图
  setFullData(data2) {
    if (data2.root) {
      this.setData(data2.root);
    }
    if (data2.layout) {
      this.setLayout(data2.layout);
    }
    if (data2.theme) {
      if (data2.theme.template) {
        this.setTheme(data2.theme.template);
      }
      if (data2.theme.config) {
        this.setThemeConfig(data2.theme.config);
      }
    }
    if (data2.view) {
      this.view.setTransformData(data2.view);
    }
  }
  //  获取思维导图数据，节点树、主题、布局等
  getData(withConfig) {
    let nodeData = this.command.removeDataUid(this.command.getCopyData());
    let data2 = {};
    if (withConfig) {
      data2 = {
        layout: this.getLayout(),
        root: nodeData,
        theme: {
          template: this.getTheme(),
          config: this.getCustomThemeConfig()
        },
        view: this.view.getTransformData()
      };
    } else {
      data2 = nodeData;
    }
    return simpleDeepClone(data2);
  }
  //  导出
  async export(...args) {
    let result = await this.doExport.export(...args);
    return result;
  }
  //  转换位置
  toPos(x3, y4) {
    return {
      x: x3 - this.elRect.left,
      y: y4 - this.elRect.top
    };
  }
  //  设置只读模式、编辑模式
  setMode(mode) {
    if (![CONSTANTS.MODE.READONLY, CONSTANTS.MODE.EDIT].includes(mode)) {
      return;
    }
    this.opt.readonly = mode === CONSTANTS.MODE.READONLY;
    if (this.opt.readonly) {
      this.renderer.clearAllActive();
    }
    this.emit("mode_change", mode);
  }
  // 获取svg数据
  getSvgData({ paddingX = 0, paddingY = 0 } = {}) {
    const svg2 = this.svg;
    const draw = this.draw;
    const origWidth = svg2.width();
    const origHeight = svg2.height();
    const origTransform = draw.transform();
    const elRect = this.el.getBoundingClientRect();
    draw.scale(1 / origTransform.scaleX, 1 / origTransform.scaleY);
    const rect = draw.rbox();
    rect.width += paddingX;
    rect.height += paddingY;
    draw.translate(paddingX / 2, paddingY / 2);
    svg2.size(rect.width, rect.height);
    draw.translate(-rect.x + elRect.left, -rect.y + elRect.top);
    let clone = svg2.clone();
    if ((rect.width > origWidth || rect.height > origHeight) && this.watermark && this.watermark.hasWatermark()) {
      this.width = rect.width;
      this.height = rect.height;
      this.watermark.draw();
      clone = svg2.clone();
      this.width = origWidth;
      this.height = origHeight;
      this.watermark.draw();
    }
    svg2.size(origWidth, origHeight);
    draw.transform(origTransform);
    return {
      svg: clone,
      // 思维导图图形的整体svg元素，包括：svg（画布容器）、g（实际的思维导图组）
      svgHTML: clone.svg(),
      // svg字符串
      rect: {
        ...rect,
        // 思维导图图形未缩放时的位置尺寸等信息
        ratio: rect.width / rect.height
        // 思维导图图形的宽高比
      },
      origWidth,
      // 画布宽度
      origHeight,
      // 画布高度
      scaleX: origTransform.scaleX,
      // 思维导图图形的水平缩放值
      scaleY: origTransform.scaleY
      // 思维导图图形的垂直缩放值
    };
  }
  // 添加插件
  addPlugin(plugin, opt) {
    let index3 = MindMap2.hasPlugin(plugin);
    if (index3 === -1) {
      MindMap2.usePlugin(plugin, opt);
      this.initPlugin(plugin);
    }
  }
  // 移除插件
  removePlugin(plugin) {
    let index3 = MindMap2.hasPlugin(plugin);
    if (index3 !== -1) {
      MindMap2.pluginList.splice(index3, 1);
      if (this[plugin.instanceName]) {
        if (this[plugin.instanceName].beforePluginRemove) {
          this[plugin.instanceName].beforePluginRemove();
        }
        delete this[plugin.instanceName];
      }
    }
  }
  // 实例化插件
  initPlugin(plugin) {
    this[plugin.instanceName] = new plugin({
      mindMap: this,
      pluginOpt: plugin.pluginOpt
    });
  }
  // 销毁
  destroy() {
    [...MindMap2.pluginList].forEach((plugin) => {
      this[plugin.instanceName] = null;
    });
    this.event.unbind();
    this.svg.remove();
    Style_default.removeBackgroundStyle(this.el);
    this.el = null;
  }
};
MindMap2.pluginList = [];
MindMap2.usePlugin = (plugin, opt = {}) => {
  plugin.pluginOpt = opt;
  MindMap2.pluginList.push(plugin);
  return MindMap2;
};
MindMap2.hasPlugin = (plugin) => {
  return MindMap2.pluginList.findIndex((item) => {
    return item === plugin;
  });
};
MindMap2.defineTheme = (name, config = {}) => {
  if (themes_default[name]) {
    return new Error("\u8BE5\u4E3B\u9898\u540D\u79F0\u5DF2\u5B58\u5728");
  }
  themes_default[name] = (0, import_deepmerge33.default)(default_default, config);
};
var simple_mind_map_default = MindMap2;

// ../simple-mind-map/src/plugins/MiniMap.js
var MiniMap = class {
  //  构造函数
  constructor(opt) {
    this.mindMap = opt.mindMap;
    this.isMousedown = false;
    this.mousedownPos = {
      x: 0,
      y: 0
    };
    this.startViewPos = {
      x: 0,
      y: 0
    };
  }
  //  计算小地图的渲染数据
  /**
   * boxWidth：小地图容器的宽度
   * boxHeight：小地图容器的高度
   */
  calculationMiniMap(boxWidth, boxHeight) {
    let { svgHTML, rect, origWidth, origHeight, scaleX, scaleY } = this.mindMap.getSvgData();
    let boxRatio = boxWidth / boxHeight;
    let actWidth = 0;
    let actHeight = 0;
    if (boxRatio > rect.ratio) {
      actHeight = boxHeight;
      actWidth = rect.ratio * actHeight;
    } else {
      actWidth = boxWidth;
      actHeight = actWidth / rect.ratio;
    }
    let miniMapBoxScale = actWidth / rect.width;
    let miniMapBoxLeft = (boxWidth - actWidth) / 2;
    let miniMapBoxTop = (boxHeight - actHeight) / 2;
    let _rectX = rect.x - (rect.width * scaleX - rect.width) / 2;
    let _rectX2 = rect.x2 + (rect.width * scaleX - rect.width) / 2;
    let _rectY = rect.y - (rect.height * scaleY - rect.height) / 2;
    let _rectY2 = rect.y2 + (rect.height * scaleY - rect.height) / 2;
    let _rectWidth = rect.width * scaleX;
    let _rectHeight = rect.height * scaleY;
    let viewBoxStyle = {
      left: 0,
      top: 0,
      right: 0,
      bottom: 0
    };
    viewBoxStyle.left = Math.max(0, -_rectX / _rectWidth * actWidth) + miniMapBoxLeft + "px";
    viewBoxStyle.right = Math.max(0, (_rectX2 - origWidth) / _rectWidth * actWidth) + miniMapBoxLeft + "px";
    viewBoxStyle.top = Math.max(0, -_rectY / _rectHeight * actHeight) + miniMapBoxTop + "px";
    viewBoxStyle.bottom = Math.max(0, (_rectY2 - origHeight) / _rectHeight * actHeight) + miniMapBoxTop + "px";
    return {
      svgHTML,
      // 小地图html
      viewBoxStyle,
      // 视图框的位置信息
      miniMapBoxScale,
      // 视图框的缩放值
      miniMapBoxLeft,
      // 视图框的left值
      miniMapBoxTop
      // 视图框的top值
    };
  }
  //  小地图鼠标按下事件
  onMousedown(e2) {
    this.isMousedown = true;
    this.mousedownPos = {
      x: e2.clientX,
      y: e2.clientY
    };
    let transformData = this.mindMap.view.getTransformData();
    this.startViewPos = {
      x: transformData.state.x,
      y: transformData.state.y
    };
  }
  //  小地图鼠标移动事件
  onMousemove(e2, sensitivityNum = 5) {
    if (!this.isMousedown) {
      return;
    }
    let ox = e2.clientX - this.mousedownPos.x;
    let oy = e2.clientY - this.mousedownPos.y;
    this.mindMap.view.translateXTo(ox * sensitivityNum + this.startViewPos.x);
    this.mindMap.view.translateYTo(oy * sensitivityNum + this.startViewPos.y);
  }
  //  小地图鼠标松开事件
  onMouseup() {
    this.isMousedown = false;
  }
};
MiniMap.instanceName = "miniMap";
var MiniMap_default = MiniMap;

// ../simple-mind-map/src/plugins/Watermark.js
var import_deepmerge34 = __toESM(require_cjs());
var Watermark = class {
  constructor(opt = {}) {
    this.mindMap = opt.mindMap;
    this.lineSpacing = 0;
    this.textSpacing = 0;
    this.angle = 0;
    this.text = "";
    this.textStyle = {};
    this.watermarkDraw = this.mindMap.svg.group().css({ "pointer-events": "none", "user-select": "none" });
    this.maxLong = Math.sqrt(
      Math.pow(this.mindMap.width, 2) + Math.pow(this.mindMap.height, 2)
    );
    this.updateWatermark(this.mindMap.opt.watermarkConfig || {});
  }
  // 获取是否存在水印
  hasWatermark() {
    return !!this.text.trim();
  }
  // 处理水印配置
  handleConfig({ text: text3, lineSpacing, textSpacing, angle, textStyle }) {
    this.text = text3 === void 0 ? "" : String(text3).trim();
    this.lineSpacing = typeof lineSpacing === "number" && lineSpacing > 0 ? lineSpacing : 100;
    this.textSpacing = typeof textSpacing === "number" && textSpacing > 0 ? textSpacing : 100;
    this.angle = typeof angle === "number" && angle >= 0 && angle <= 90 ? angle : 30;
    this.textStyle = Object.assign(this.textStyle, textStyle || {});
  }
  // 绘制水印
  // 非精确绘制，会绘制一些超出可视区域的水印
  draw() {
    this.watermarkDraw.clear();
    if (!this.hasWatermark()) {
      return;
    }
    let x3 = 0;
    while (x3 < this.mindMap.width) {
      this.drawText(x3);
      x3 += this.lineSpacing / Math.sin(degToRad(this.angle));
    }
    let yOffset = this.lineSpacing / Math.cos(degToRad(this.angle)) || this.lineSpacing;
    let y4 = yOffset;
    while (y4 < this.mindMap.height) {
      this.drawText(0, y4);
      y4 += yOffset;
    }
  }
  // 绘制文字
  drawText(x3, y4) {
    let long = Math.min(
      this.maxLong,
      (this.mindMap.width - x3) / Math.cos(degToRad(this.angle))
    );
    let g2 = new G();
    let bbox2 = null;
    let bboxWidth = 0;
    let textHeight = -1;
    while (bboxWidth < long) {
      let text3 = new Text2().text(this.text);
      g2.add(text3);
      text3.transform({
        translateX: bboxWidth
      });
      this.setTextStyle(text3);
      bbox2 = g2.bbox();
      if (textHeight === -1) {
        textHeight = bbox2.height;
      }
      bboxWidth = bbox2.width + this.textSpacing;
    }
    let params = {
      rotate: this.angle,
      origin: "top left",
      translateX: x3,
      translateY: textHeight
    };
    if (y4 !== void 0) {
      params.translateY = y4 + textHeight;
    }
    g2.transform(params);
    this.watermarkDraw.add(g2);
  }
  // 给文字设置样式
  setTextStyle(text3) {
    Object.keys(this.textStyle).forEach((item) => {
      let value = this.textStyle[item];
      if (item === "color") {
        text3.fill(value);
      } else {
        text3.css(camelCaseToHyphen(item), value);
      }
    });
  }
  // 更新水印
  updateWatermark(config) {
    this.mindMap.opt.watermarkConfig = (0, import_deepmerge34.default)(this.mindMap.opt.watermarkConfig, config);
    this.handleConfig(config);
    this.draw();
  }
};
Watermark.instanceName = "watermark";
var Watermark_default = Watermark;

// ../simple-mind-map/src/plugins/KeyboardNavigation.js
var KeyboardNavigation = class {
  //  构造函数
  constructor(opt) {
    this.opt = opt;
    this.mindMap = opt.mindMap;
    this.onKeyup = this.onKeyup.bind(this);
    this.mindMap.keyCommand.addShortcut(CONSTANTS.KEY_DIR.LEFT, () => {
      this.onKeyup(CONSTANTS.KEY_DIR.LEFT);
    });
    this.mindMap.keyCommand.addShortcut(CONSTANTS.KEY_DIR.UP, () => {
      this.onKeyup(CONSTANTS.KEY_DIR.UP);
    });
    this.mindMap.keyCommand.addShortcut(CONSTANTS.KEY_DIR.RIGHT, () => {
      this.onKeyup(CONSTANTS.KEY_DIR.RIGHT);
    });
    this.mindMap.keyCommand.addShortcut(CONSTANTS.KEY_DIR.DOWN, () => {
      this.onKeyup(CONSTANTS.KEY_DIR.DOWN);
    });
  }
  //  处理按键事件
  onKeyup(dir) {
    if (this.mindMap.renderer.activeNodeList.length > 0) {
      this.focus(dir);
    } else {
      let root2 = this.mindMap.renderer.root;
      this.mindMap.renderer.moveNodeToCenter(root2);
      root2.active();
    }
  }
  //  聚焦到下一个节点
  focus(dir) {
    let currentActiveNode = this.mindMap.renderer.activeNodeList[0];
    let currentActiveNodeRect = this.getNodeRect(currentActiveNode);
    let targetNode = null;
    let targetDis = Infinity;
    let checkNodeDis = (rect, node3) => {
      let dis = this.getDistance(currentActiveNodeRect, rect);
      if (dis < targetDis) {
        targetNode = node3;
        targetDis = dis;
      }
    };
    this.getFocusNodeByShadowAlgorithm({
      currentActiveNode,
      currentActiveNodeRect,
      dir,
      checkNodeDis
    });
    if (!targetNode) {
      this.getFocusNodeByAreaAlgorithm({
        currentActiveNode,
        currentActiveNodeRect,
        dir,
        checkNodeDis
      });
    }
    if (!targetNode) {
      this.getFocusNodeBySimpleAlgorithm({
        currentActiveNode,
        currentActiveNodeRect,
        dir,
        checkNodeDis
      });
    }
    if (targetNode) {
      this.mindMap.renderer.moveNodeToCenter(targetNode);
      targetNode.active();
    }
  }
  //  1.简单算法
  getFocusNodeBySimpleAlgorithm({
    currentActiveNode,
    currentActiveNodeRect,
    dir,
    checkNodeDis
  }) {
    bfsWalk(this.mindMap.renderer.root, (node3) => {
      if (node3 === currentActiveNode)
        return;
      let rect = this.getNodeRect(node3);
      let { left, top, right, bottom } = rect;
      let match = false;
      if (dir === CONSTANTS.KEY_DIR.LEFT) {
        match = right <= currentActiveNodeRect.left;
      } else if (dir === CONSTANTS.KEY_DIR.RIGHT) {
        match = left >= currentActiveNodeRect.right;
      } else if (dir === CONSTANTS.KEY_DIR.UP) {
        match = bottom <= currentActiveNodeRect.top;
      } else if (dir === CONSTANTS.KEY_DIR.DOWN) {
        match = top >= currentActiveNodeRect.bottom;
      }
      if (match) {
        checkNodeDis(rect, node3);
      }
    });
  }
  //  2.阴影算法
  getFocusNodeByShadowAlgorithm({
    currentActiveNode,
    currentActiveNodeRect,
    dir,
    checkNodeDis
  }) {
    bfsWalk(this.mindMap.renderer.root, (node3) => {
      if (node3 === currentActiveNode)
        return;
      let rect = this.getNodeRect(node3);
      let { left, top, right, bottom } = rect;
      let match = false;
      if (dir === CONSTANTS.KEY_DIR.LEFT) {
        match = left < currentActiveNodeRect.left && top < currentActiveNodeRect.bottom && bottom > currentActiveNodeRect.top;
      } else if (dir === CONSTANTS.KEY_DIR.RIGHT) {
        match = right > currentActiveNodeRect.right && top < currentActiveNodeRect.bottom && bottom > currentActiveNodeRect.top;
      } else if (dir === CONSTANTS.KEY_DIR.UP) {
        match = top < currentActiveNodeRect.top && left < currentActiveNodeRect.right && right > currentActiveNodeRect.left;
      } else if (dir === CONSTANTS.KEY_DIR.DOWN) {
        match = bottom > currentActiveNodeRect.bottom && left < currentActiveNodeRect.right && right > currentActiveNodeRect.left;
      }
      if (match) {
        checkNodeDis(rect, node3);
      }
    });
  }
  //  3.区域算法
  getFocusNodeByAreaAlgorithm({
    currentActiveNode,
    currentActiveNodeRect,
    dir,
    checkNodeDis
  }) {
    let cX = (currentActiveNodeRect.right + currentActiveNodeRect.left) / 2;
    let cY = (currentActiveNodeRect.bottom + currentActiveNodeRect.top) / 2;
    bfsWalk(this.mindMap.renderer.root, (node3) => {
      if (node3 === currentActiveNode)
        return;
      let rect = this.getNodeRect(node3);
      let { left, top, right, bottom } = rect;
      let ccX = (right + left) / 2;
      let ccY = (bottom + top) / 2;
      let offsetX = ccX - cX;
      let offsetY = ccY - cY;
      if (offsetX === 0 && offsetY === 0)
        return;
      let match = false;
      if (dir === CONSTANTS.KEY_DIR.LEFT) {
        match = offsetX <= 0 && offsetX <= offsetY && offsetX <= -offsetY;
      } else if (dir === CONSTANTS.KEY_DIR.RIGHT) {
        match = offsetX > 0 && offsetX >= -offsetY && offsetX >= offsetY;
      } else if (dir === CONSTANTS.KEY_DIR.UP) {
        match = offsetY <= 0 && offsetY < offsetX && offsetY < -offsetX;
      } else if (dir === CONSTANTS.KEY_DIR.DOWN) {
        match = offsetY > 0 && -offsetY < offsetX && offsetY > offsetX;
      }
      if (match) {
        checkNodeDis(rect, node3);
      }
    });
  }
  //  获取节点的位置信息
  getNodeRect(node3) {
    let { scaleX, scaleY, translateX, translateY } = this.mindMap.draw.transform();
    let { left, top, width: width2, height: height2 } = node3;
    return {
      right: (left + width2) * scaleX + translateX,
      bottom: (top + height2) * scaleY + translateY,
      left: left * scaleX + translateX,
      top: top * scaleY + translateY
    };
  }
  //  获取两个节点的距离
  getDistance(node1Rect, node2Rect) {
    let center1 = this.getCenter(node1Rect);
    let center2 = this.getCenter(node2Rect);
    return Math.sqrt(
      Math.pow(center1.x - center2.x, 2) + Math.pow(center1.y - center2.y, 2)
    );
  }
  //  获取节点的中心点
  getCenter({ left, right, top, bottom }) {
    return {
      x: (left + right) / 2,
      y: (top + bottom) / 2
    };
  }
};
KeyboardNavigation.instanceName = "keyboardNavigation";
var KeyboardNavigation_default = KeyboardNavigation;

// ../simple-mind-map/node_modules/jspdf/dist/jspdf.es.min.js
init_typeof();

// ../simple-mind-map/node_modules/fflate/esm/browser.js
var u8 = Uint8Array;
var u16 = Uint16Array;
var u32 = Uint32Array;
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, start) {
  var b2 = new u16(31);
  for (var i3 = 0; i3 < 31; ++i3) {
    b2[i3] = start += 1 << eb[i3 - 1];
  }
  var r2 = new u32(b2[30]);
  for (var i3 = 1; i3 < 30; ++i3) {
    for (var j2 = b2[i3]; j2 < b2[i3 + 1]; ++j2) {
      r2[j2] = j2 - b2[i3] << 5 | i3;
    }
  }
  return [b2, r2];
};
var _a = freb(fleb, 2);
var fl = _a[0];
var revfl = _a[1];
fl[28] = 258, revfl[258] = 28;
var _b = freb(fdeb, 0);
var fd = _b[0];
var revfd = _b[1];
var rev = new u16(32768);
for (i3 = 0; i3 < 32768; ++i3) {
  x3 = (i3 & 43690) >>> 1 | (i3 & 21845) << 1;
  x3 = (x3 & 52428) >>> 2 | (x3 & 13107) << 2;
  x3 = (x3 & 61680) >>> 4 | (x3 & 3855) << 4;
  rev[i3] = ((x3 & 65280) >>> 8 | (x3 & 255) << 8) >>> 1;
}
var x3;
var i3;
var hMap = function(cd, mb, r2) {
  var s3 = cd.length;
  var i3 = 0;
  var l3 = new u16(mb);
  for (; i3 < s3; ++i3)
    ++l3[cd[i3] - 1];
  var le2 = new u16(mb);
  for (i3 = 0; i3 < mb; ++i3) {
    le2[i3] = le2[i3 - 1] + l3[i3 - 1] << 1;
  }
  var co;
  if (r2) {
    co = new u16(1 << mb);
    var rvb = 15 - mb;
    for (i3 = 0; i3 < s3; ++i3) {
      if (cd[i3]) {
        var sv = i3 << 4 | cd[i3];
        var r_1 = mb - cd[i3];
        var v3 = le2[cd[i3] - 1]++ << r_1;
        for (var m4 = v3 | (1 << r_1) - 1; v3 <= m4; ++v3) {
          co[rev[v3] >>> rvb] = sv;
        }
      }
    }
  } else {
    co = new u16(s3);
    for (i3 = 0; i3 < s3; ++i3)
      co[i3] = rev[le2[cd[i3] - 1]++] >>> 15 - cd[i3];
  }
  return co;
};
var flt = new u8(288);
for (i3 = 0; i3 < 144; ++i3)
  flt[i3] = 8;
var i3;
for (i3 = 144; i3 < 256; ++i3)
  flt[i3] = 9;
var i3;
for (i3 = 256; i3 < 280; ++i3)
  flt[i3] = 7;
var i3;
for (i3 = 280; i3 < 288; ++i3)
  flt[i3] = 8;
var i3;
var fdt = new u8(32);
for (i3 = 0; i3 < 32; ++i3)
  fdt[i3] = 5;
var i3;
var flm = /* @__PURE__ */ hMap(flt, 9, 0);
var flrm = /* @__PURE__ */ hMap(flt, 9, 1);
var fdm = /* @__PURE__ */ hMap(fdt, 5, 0);
var fdrm = /* @__PURE__ */ hMap(fdt, 5, 1);
var max = function(a3) {
  var m4 = a3[0];
  for (var i3 = 1; i3 < a3.length; ++i3) {
    if (a3[i3] > m4)
      m4 = a3[i3];
  }
  return m4;
};
var bits = function(d2, p3, m4) {
  var o3 = p3 / 8 >> 0;
  return (d2[o3] | d2[o3 + 1] << 8) >>> (p3 & 7) & m4;
};
var bits16 = function(d2, p3) {
  var o3 = p3 / 8 >> 0;
  return (d2[o3] | d2[o3 + 1] << 8 | d2[o3 + 2] << 16) >>> (p3 & 7);
};
var shft = function(p3) {
  return (p3 / 8 >> 0) + (p3 & 7 && 1);
};
var slc = function(v3, s3, e2) {
  if (s3 == null || s3 < 0)
    s3 = 0;
  if (e2 == null || e2 > v3.length)
    e2 = v3.length;
  var n3 = new (v3 instanceof u16 ? u16 : v3 instanceof u32 ? u32 : u8)(e2 - s3);
  n3.set(v3.subarray(s3, e2));
  return n3;
};
var inflt = function(dat, buf, st2) {
  var sl = dat.length;
  var noBuf = !buf || st2;
  var noSt = !st2 || st2.i;
  if (!st2)
    st2 = {};
  if (!buf)
    buf = new u8(sl * 3);
  var cbuf = function(l4) {
    var bl = buf.length;
    if (l4 > bl) {
      var nbuf = new u8(Math.max(bl * 2, l4));
      nbuf.set(buf);
      buf = nbuf;
    }
  };
  var final = st2.f || 0, pos = st2.p || 0, bt2 = st2.b || 0, lm = st2.l, dm = st2.d, lbt = st2.m, dbt = st2.n;
  var tbts = sl * 8;
  do {
    if (!lm) {
      st2.f = final = bits(dat, pos, 1);
      var type = bits(dat, pos + 1, 3);
      pos += 3;
      if (!type) {
        var s3 = shft(pos) + 4, l3 = dat[s3 - 4] | dat[s3 - 3] << 8, t3 = s3 + l3;
        if (t3 > sl) {
          if (noSt)
            throw "unexpected EOF";
          break;
        }
        if (noBuf)
          cbuf(bt2 + l3);
        buf.set(dat.subarray(s3, t3), bt2);
        st2.b = bt2 += l3, st2.p = pos = t3 * 8;
        continue;
      } else if (type == 1)
        lm = flrm, dm = fdrm, lbt = 9, dbt = 5;
      else if (type == 2) {
        var hLit = bits(dat, pos, 31) + 257, hcLen = bits(dat, pos + 10, 15) + 4;
        var tl = hLit + bits(dat, pos + 5, 31) + 1;
        pos += 14;
        var ldt = new u8(tl);
        var clt = new u8(19);
        for (var i3 = 0; i3 < hcLen; ++i3) {
          clt[clim[i3]] = bits(dat, pos + i3 * 3, 7);
        }
        pos += hcLen * 3;
        var clb = max(clt), clbmsk = (1 << clb) - 1;
        if (!noSt && pos + tl * (clb + 7) > tbts)
          break;
        var clm = hMap(clt, clb, 1);
        for (var i3 = 0; i3 < tl; ) {
          var r2 = clm[bits(dat, pos, clbmsk)];
          pos += r2 & 15;
          var s3 = r2 >>> 4;
          if (s3 < 16) {
            ldt[i3++] = s3;
          } else {
            var c4 = 0, n3 = 0;
            if (s3 == 16)
              n3 = 3 + bits(dat, pos, 3), pos += 2, c4 = ldt[i3 - 1];
            else if (s3 == 17)
              n3 = 3 + bits(dat, pos, 7), pos += 3;
            else if (s3 == 18)
              n3 = 11 + bits(dat, pos, 127), pos += 7;
            while (n3--)
              ldt[i3++] = c4;
          }
        }
        var lt2 = ldt.subarray(0, hLit), dt2 = ldt.subarray(hLit);
        lbt = max(lt2);
        dbt = max(dt2);
        lm = hMap(lt2, lbt, 1);
        dm = hMap(dt2, dbt, 1);
      } else
        throw "invalid block type";
      if (pos > tbts)
        throw "unexpected EOF";
    }
    if (noBuf)
      cbuf(bt2 + 131072);
    var lms = (1 << lbt) - 1, dms = (1 << dbt) - 1;
    var mxa = lbt + dbt + 18;
    while (noSt || pos + mxa < tbts) {
      var c4 = lm[bits16(dat, pos) & lms], sym = c4 >>> 4;
      pos += c4 & 15;
      if (pos > tbts)
        throw "unexpected EOF";
      if (!c4)
        throw "invalid length/literal";
      if (sym < 256)
        buf[bt2++] = sym;
      else if (sym == 256) {
        lm = null;
        break;
      } else {
        var add = sym - 254;
        if (sym > 264) {
          var i3 = sym - 257, b2 = fleb[i3];
          add = bits(dat, pos, (1 << b2) - 1) + fl[i3];
          pos += b2;
        }
        var d2 = dm[bits16(dat, pos) & dms], dsym = d2 >>> 4;
        if (!d2)
          throw "invalid distance";
        pos += d2 & 15;
        var dt2 = fd[dsym];
        if (dsym > 3) {
          var b2 = fdeb[dsym];
          dt2 += bits16(dat, pos) & (1 << b2) - 1, pos += b2;
        }
        if (pos > tbts)
          throw "unexpected EOF";
        if (noBuf)
          cbuf(bt2 + 131072);
        var end = bt2 + add;
        for (; bt2 < end; bt2 += 4) {
          buf[bt2] = buf[bt2 - dt2];
          buf[bt2 + 1] = buf[bt2 + 1 - dt2];
          buf[bt2 + 2] = buf[bt2 + 2 - dt2];
          buf[bt2 + 3] = buf[bt2 + 3 - dt2];
        }
        bt2 = end;
      }
    }
    st2.l = lm, st2.p = pos, st2.b = bt2;
    if (lm)
      final = 1, st2.m = lbt, st2.d = dm, st2.n = dbt;
  } while (!final);
  return bt2 == buf.length ? buf : slc(buf, 0, bt2);
};
var wbits = function(d2, p3, v3) {
  v3 <<= p3 & 7;
  var o3 = p3 / 8 >> 0;
  d2[o3] |= v3;
  d2[o3 + 1] |= v3 >>> 8;
};
var wbits16 = function(d2, p3, v3) {
  v3 <<= p3 & 7;
  var o3 = p3 / 8 >> 0;
  d2[o3] |= v3;
  d2[o3 + 1] |= v3 >>> 8;
  d2[o3 + 2] |= v3 >>> 16;
};
var hTree = function(d2, mb) {
  var t3 = [];
  for (var i3 = 0; i3 < d2.length; ++i3) {
    if (d2[i3])
      t3.push({ s: i3, f: d2[i3] });
  }
  var s3 = t3.length;
  var t22 = t3.slice();
  if (!s3)
    return [new u8(0), 0];
  if (s3 == 1) {
    var v3 = new u8(t3[0].s + 1);
    v3[t3[0].s] = 1;
    return [v3, 1];
  }
  t3.sort(function(a3, b2) {
    return a3.f - b2.f;
  });
  t3.push({ s: -1, f: 25001 });
  var l3 = t3[0], r2 = t3[1], i0 = 0, i1 = 1, i22 = 2;
  t3[0] = { s: -1, f: l3.f + r2.f, l: l3, r: r2 };
  while (i1 != s3 - 1) {
    l3 = t3[t3[i0].f < t3[i22].f ? i0++ : i22++];
    r2 = t3[i0 != i1 && t3[i0].f < t3[i22].f ? i0++ : i22++];
    t3[i1++] = { s: -1, f: l3.f + r2.f, l: l3, r: r2 };
  }
  var maxSym = t22[0].s;
  for (var i3 = 1; i3 < s3; ++i3) {
    if (t22[i3].s > maxSym)
      maxSym = t22[i3].s;
  }
  var tr = new u16(maxSym + 1);
  var mbt = ln(t3[i1 - 1], tr, 0);
  if (mbt > mb) {
    var i3 = 0, dt2 = 0;
    var lft = mbt - mb, cst = 1 << lft;
    t22.sort(function(a3, b2) {
      return tr[b2.s] - tr[a3.s] || a3.f - b2.f;
    });
    for (; i3 < s3; ++i3) {
      var i2_1 = t22[i3].s;
      if (tr[i2_1] > mb) {
        dt2 += cst - (1 << mbt - tr[i2_1]);
        tr[i2_1] = mb;
      } else
        break;
    }
    dt2 >>>= lft;
    while (dt2 > 0) {
      var i2_2 = t22[i3].s;
      if (tr[i2_2] < mb)
        dt2 -= 1 << mb - tr[i2_2]++ - 1;
      else
        ++i3;
    }
    for (; i3 >= 0 && dt2; --i3) {
      var i2_3 = t22[i3].s;
      if (tr[i2_3] == mb) {
        --tr[i2_3];
        ++dt2;
      }
    }
    mbt = mb;
  }
  return [new u8(tr), mbt];
};
var ln = function(n3, l3, d2) {
  return n3.s == -1 ? Math.max(ln(n3.l, l3, d2 + 1), ln(n3.r, l3, d2 + 1)) : l3[n3.s] = d2;
};
var lc = function(c4) {
  var s3 = c4.length;
  while (s3 && !c4[--s3])
    ;
  var cl = new u16(++s3);
  var cli = 0, cln = c4[0], cls = 1;
  var w2 = function(v3) {
    cl[cli++] = v3;
  };
  for (var i3 = 1; i3 <= s3; ++i3) {
    if (c4[i3] == cln && i3 != s3)
      ++cls;
    else {
      if (!cln && cls > 2) {
        for (; cls > 138; cls -= 138)
          w2(32754);
        if (cls > 2) {
          w2(cls > 10 ? cls - 11 << 5 | 28690 : cls - 3 << 5 | 12305);
          cls = 0;
        }
      } else if (cls > 3) {
        w2(cln), --cls;
        for (; cls > 6; cls -= 6)
          w2(8304);
        if (cls > 2)
          w2(cls - 3 << 5 | 8208), cls = 0;
      }
      while (cls--)
        w2(cln);
      cls = 1;
      cln = c4[i3];
    }
  }
  return [cl.subarray(0, cli), s3];
};
var clen = function(cf, cl) {
  var l3 = 0;
  for (var i3 = 0; i3 < cl.length; ++i3)
    l3 += cf[i3] * cl[i3];
  return l3;
};
var wfblk = function(out, pos, dat) {
  var s3 = dat.length;
  var o3 = shft(pos + 2);
  out[o3] = s3 & 255;
  out[o3 + 1] = s3 >>> 8;
  out[o3 + 2] = out[o3] ^ 255;
  out[o3 + 3] = out[o3 + 1] ^ 255;
  for (var i3 = 0; i3 < s3; ++i3)
    out[o3 + i3 + 4] = dat[i3];
  return (o3 + 4 + s3) * 8;
};
var wblk = function(dat, out, final, syms, lf, df, eb, li, bs, bl, p3) {
  wbits(out, p3++, final);
  ++lf[256];
  var _a2 = hTree(lf, 15), dlt = _a2[0], mlb = _a2[1];
  var _b2 = hTree(df, 15), ddt = _b2[0], mdb = _b2[1];
  var _c = lc(dlt), lclt = _c[0], nlc = _c[1];
  var _d = lc(ddt), lcdt = _d[0], ndc = _d[1];
  var lcfreq = new u16(19);
  for (var i3 = 0; i3 < lclt.length; ++i3)
    lcfreq[lclt[i3] & 31]++;
  for (var i3 = 0; i3 < lcdt.length; ++i3)
    lcfreq[lcdt[i3] & 31]++;
  var _e = hTree(lcfreq, 7), lct = _e[0], mlcb = _e[1];
  var nlcc = 19;
  for (; nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc)
    ;
  var flen = bl + 5 << 3;
  var ftlen = clen(lf, flt) + clen(df, fdt) + eb;
  var dtlen = clen(lf, dlt) + clen(df, ddt) + eb + 14 + 3 * nlcc + clen(lcfreq, lct) + (2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18]);
  if (flen <= ftlen && flen <= dtlen)
    return wfblk(out, p3, dat.subarray(bs, bs + bl));
  var lm, ll, dm, dl;
  wbits(out, p3, 1 + (dtlen < ftlen)), p3 += 2;
  if (dtlen < ftlen) {
    lm = hMap(dlt, mlb, 0), ll = dlt, dm = hMap(ddt, mdb, 0), dl = ddt;
    var llm = hMap(lct, mlcb, 0);
    wbits(out, p3, nlc - 257);
    wbits(out, p3 + 5, ndc - 1);
    wbits(out, p3 + 10, nlcc - 4);
    p3 += 14;
    for (var i3 = 0; i3 < nlcc; ++i3)
      wbits(out, p3 + 3 * i3, lct[clim[i3]]);
    p3 += 3 * nlcc;
    var lcts = [lclt, lcdt];
    for (var it2 = 0; it2 < 2; ++it2) {
      var clct = lcts[it2];
      for (var i3 = 0; i3 < clct.length; ++i3) {
        var len = clct[i3] & 31;
        wbits(out, p3, llm[len]), p3 += lct[len];
        if (len > 15)
          wbits(out, p3, clct[i3] >>> 5 & 127), p3 += clct[i3] >>> 12;
      }
    }
  } else {
    lm = flm, ll = flt, dm = fdm, dl = fdt;
  }
  for (var i3 = 0; i3 < li; ++i3) {
    if (syms[i3] > 255) {
      var len = syms[i3] >>> 18 & 31;
      wbits16(out, p3, lm[len + 257]), p3 += ll[len + 257];
      if (len > 7)
        wbits(out, p3, syms[i3] >>> 23 & 31), p3 += fleb[len];
      var dst = syms[i3] & 31;
      wbits16(out, p3, dm[dst]), p3 += dl[dst];
      if (dst > 3)
        wbits16(out, p3, syms[i3] >>> 5 & 8191), p3 += fdeb[dst];
    } else {
      wbits16(out, p3, lm[syms[i3]]), p3 += ll[syms[i3]];
    }
  }
  wbits16(out, p3, lm[256]);
  return p3 + ll[256];
};
var deo = /* @__PURE__ */ new u32([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]);
var et = /* @__PURE__ */ new u8(0);
var dflt = function(dat, lvl, plvl, pre, post, lst) {
  var s3 = dat.length;
  var o3 = new u8(pre + s3 + 5 * (1 + Math.floor(s3 / 7e3)) + post);
  var w2 = o3.subarray(pre, o3.length - post);
  var pos = 0;
  if (!lvl || s3 < 8) {
    for (var i3 = 0; i3 <= s3; i3 += 65535) {
      var e2 = i3 + 65535;
      if (e2 < s3) {
        pos = wfblk(w2, pos, dat.subarray(i3, e2));
      } else {
        w2[i3] = lst;
        pos = wfblk(w2, pos, dat.subarray(i3, s3));
      }
    }
  } else {
    var opt = deo[lvl - 1];
    var n3 = opt >>> 13, c4 = opt & 8191;
    var msk_1 = (1 << plvl) - 1;
    var prev2 = new u16(32768), head = new u16(msk_1 + 1);
    var bs1_1 = Math.ceil(plvl / 3), bs2_1 = 2 * bs1_1;
    var hsh = function(i4) {
      return (dat[i4] ^ dat[i4 + 1] << bs1_1 ^ dat[i4 + 2] << bs2_1) & msk_1;
    };
    var syms = new u32(25e3);
    var lf = new u16(288), df = new u16(32);
    var lc_1 = 0, eb = 0, i3 = 0, li = 0, wi = 0, bs = 0;
    for (; i3 < s3; ++i3) {
      var hv = hsh(i3);
      var imod = i3 & 32767;
      var pimod = head[hv];
      prev2[imod] = pimod;
      head[hv] = imod;
      if (wi <= i3) {
        var rem = s3 - i3;
        if ((lc_1 > 7e3 || li > 24576) && rem > 423) {
          pos = wblk(dat, w2, 0, syms, lf, df, eb, li, bs, i3 - bs, pos);
          li = lc_1 = eb = 0, bs = i3;
          for (var j2 = 0; j2 < 286; ++j2)
            lf[j2] = 0;
          for (var j2 = 0; j2 < 30; ++j2)
            df[j2] = 0;
        }
        var l3 = 2, d2 = 0, ch_1 = c4, dif = imod - pimod & 32767;
        if (rem > 2 && hv == hsh(i3 - dif)) {
          var maxn = Math.min(n3, rem) - 1;
          var maxd = Math.min(32767, i3);
          var ml = Math.min(258, rem);
          while (dif <= maxd && --ch_1 && imod != pimod) {
            if (dat[i3 + l3] == dat[i3 + l3 - dif]) {
              var nl = 0;
              for (; nl < ml && dat[i3 + nl] == dat[i3 + nl - dif]; ++nl)
                ;
              if (nl > l3) {
                l3 = nl, d2 = dif;
                if (nl > maxn)
                  break;
                var mmd = Math.min(dif, nl - 2);
                var md = 0;
                for (var j2 = 0; j2 < mmd; ++j2) {
                  var ti = i3 - dif + j2 + 32768 & 32767;
                  var pti = prev2[ti];
                  var cd = ti - pti + 32768 & 32767;
                  if (cd > md)
                    md = cd, pimod = ti;
                }
              }
            }
            imod = pimod, pimod = prev2[imod];
            dif += imod - pimod + 32768 & 32767;
          }
        }
        if (d2) {
          syms[li++] = 268435456 | revfl[l3] << 18 | revfd[d2];
          var lin = revfl[l3] & 31, din = revfd[d2] & 31;
          eb += fleb[lin] + fdeb[din];
          ++lf[257 + lin];
          ++df[din];
          wi = i3 + l3;
          ++lc_1;
        } else {
          syms[li++] = dat[i3];
          ++lf[dat[i3]];
        }
      }
    }
    pos = wblk(dat, w2, lst, syms, lf, df, eb, li, bs, i3 - bs, pos);
    if (!lst)
      pos = wfblk(w2, pos, et);
  }
  return slc(o3, 0, pre + shft(pos) + post);
};
var adler = function() {
  var a3 = 1, b2 = 0;
  return {
    p: function(d2) {
      var n3 = a3, m4 = b2;
      var l3 = d2.length;
      for (var i3 = 0; i3 != l3; ) {
        var e2 = Math.min(i3 + 5552, l3);
        for (; i3 < e2; ++i3)
          n3 += d2[i3], m4 += n3;
        n3 %= 65521, m4 %= 65521;
      }
      a3 = n3, b2 = m4;
    },
    d: function() {
      return (a3 >>> 8 << 16 | (b2 & 255) << 8 | b2 >>> 8) + ((a3 & 255) << 23) * 2;
    }
  };
};
var dopt = function(dat, opt, pre, post, st2) {
  return dflt(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : 12 + opt.mem, pre, post, !st2);
};
var wbytes = function(d2, b2, v3) {
  for (; v3; ++b2)
    d2[b2] = v3, v3 >>>= 8;
};
var zlh = function(c4, o3) {
  var lv = o3.level, fl2 = lv == 0 ? 0 : lv < 6 ? 1 : lv == 9 ? 3 : 2;
  c4[0] = 120, c4[1] = fl2 << 6 | (fl2 ? 32 - 2 * fl2 : 1);
};
var zlv = function(d2) {
  if ((d2[0] & 15) != 8 || d2[0] >>> 4 > 7 || (d2[0] << 8 | d2[1]) % 31)
    throw "invalid zlib data";
  if (d2[1] & 32)
    throw "invalid zlib data: preset dictionaries not supported";
};
function zlibSync(data2, opts) {
  if (opts === void 0) {
    opts = {};
  }
  var a3 = adler();
  a3.p(data2);
  var d2 = dopt(data2, opts, 2, 4);
  return zlh(d2, opts), wbytes(d2, d2.length - 4, a3.d()), d2;
}
function unzlibSync(data2, out) {
  return inflt((zlv(data2), data2.subarray(2, -4)), out);
}

// ../simple-mind-map/node_modules/jspdf/dist/jspdf.es.min.js
var n2 = function() {
  return "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : this;
}();
function i2() {
  n2.console && "function" == typeof n2.console.log && n2.console.log.apply(n2.console, arguments);
}
var a2 = { log: i2, warn: function(t3) {
  n2.console && ("function" == typeof n2.console.warn ? n2.console.warn.apply(n2.console, arguments) : i2.call(null, arguments));
}, error: function(t3) {
  n2.console && ("function" == typeof n2.console.error ? n2.console.error.apply(n2.console, arguments) : i2(t3));
} };
function o2(t3, e2, r2) {
  var n3 = new XMLHttpRequest();
  n3.open("GET", t3), n3.responseType = "blob", n3.onload = function() {
    l2(n3.response, e2, r2);
  }, n3.onerror = function() {
    a2.error("could not download file");
  }, n3.send();
}
function s2(t3) {
  var e2 = new XMLHttpRequest();
  e2.open("HEAD", t3, false);
  try {
    e2.send();
  } catch (t4) {
  }
  return e2.status >= 200 && e2.status <= 299;
}
function c3(t3) {
  try {
    t3.dispatchEvent(new MouseEvent("click"));
  } catch (r2) {
    var e2 = document.createEvent("MouseEvents");
    e2.initMouseEvent("click", true, true, window, 0, 0, 0, 80, 20, false, false, false, false, 0, null), t3.dispatchEvent(e2);
  }
}
var u2;
var h2;
var l2 = n2.saveAs || ("object" !== ("undefined" == typeof window ? "undefined" : _typeof(window)) || window !== n2 ? function() {
} : "undefined" != typeof HTMLAnchorElement && "download" in HTMLAnchorElement.prototype ? function(t3, e2, r2) {
  var i3 = n2.URL || n2.webkitURL, a3 = document.createElement("a");
  e2 = e2 || t3.name || "download", a3.download = e2, a3.rel = "noopener", "string" == typeof t3 ? (a3.href = t3, a3.origin !== location.origin ? s2(a3.href) ? o2(t3, e2, r2) : c3(a3, a3.target = "_blank") : c3(a3)) : (a3.href = i3.createObjectURL(t3), setTimeout(function() {
    i3.revokeObjectURL(a3.href);
  }, 4e4), setTimeout(function() {
    c3(a3);
  }, 0));
} : "msSaveOrOpenBlob" in navigator ? function(e2, r2, n3) {
  if (r2 = r2 || e2.name || "download", "string" == typeof e2)
    if (s2(e2))
      o2(e2, r2, n3);
    else {
      var i3 = document.createElement("a");
      i3.href = e2, i3.target = "_blank", setTimeout(function() {
        c3(i3);
      });
    }
  else
    navigator.msSaveOrOpenBlob(function(e3, r3) {
      return void 0 === r3 ? r3 = { autoBom: false } : "object" !== _typeof(r3) && (a2.warn("Deprecated: Expected third argument to be a object"), r3 = { autoBom: !r3 }), r3.autoBom && /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e3.type) ? new Blob([String.fromCharCode(65279), e3], { type: e3.type }) : e3;
    }(e2, n3), r2);
} : function(e2, r2, i3, a3) {
  if ((a3 = a3 || open("", "_blank")) && (a3.document.title = a3.document.body.innerText = "downloading..."), "string" == typeof e2)
    return o2(e2, r2, i3);
  var s3 = "application/octet-stream" === e2.type, c4 = /constructor/i.test(n2.HTMLElement) || n2.safari, u3 = /CriOS\/[\d]+/.test(navigator.userAgent);
  if ((u3 || s3 && c4) && "object" === ("undefined" == typeof FileReader ? "undefined" : _typeof(FileReader))) {
    var h3 = new FileReader();
    h3.onloadend = function() {
      var t3 = h3.result;
      t3 = u3 ? t3 : t3.replace(/^data:[^;]*;/, "data:attachment/file;"), a3 ? a3.location.href = t3 : location = t3, a3 = null;
    }, h3.readAsDataURL(e2);
  } else {
    var l3 = n2.URL || n2.webkitURL, f3 = l3.createObjectURL(e2);
    a3 ? a3.location = f3 : location.href = f3, a3 = null, setTimeout(function() {
      l3.revokeObjectURL(f3);
    }, 4e4);
  }
});
function f2(t3) {
  var e2;
  t3 = t3 || "", this.ok = false, "#" == t3.charAt(0) && (t3 = t3.substr(1, 6));
  t3 = { aliceblue: "f0f8ff", antiquewhite: "faebd7", aqua: "00ffff", aquamarine: "7fffd4", azure: "f0ffff", beige: "f5f5dc", bisque: "ffe4c4", black: "000000", blanchedalmond: "ffebcd", blue: "0000ff", blueviolet: "8a2be2", brown: "a52a2a", burlywood: "deb887", cadetblue: "5f9ea0", chartreuse: "7fff00", chocolate: "d2691e", coral: "ff7f50", cornflowerblue: "6495ed", cornsilk: "fff8dc", crimson: "dc143c", cyan: "00ffff", darkblue: "00008b", darkcyan: "008b8b", darkgoldenrod: "b8860b", darkgray: "a9a9a9", darkgreen: "006400", darkkhaki: "bdb76b", darkmagenta: "8b008b", darkolivegreen: "556b2f", darkorange: "ff8c00", darkorchid: "9932cc", darkred: "8b0000", darksalmon: "e9967a", darkseagreen: "8fbc8f", darkslateblue: "483d8b", darkslategray: "2f4f4f", darkturquoise: "00ced1", darkviolet: "9400d3", deeppink: "ff1493", deepskyblue: "00bfff", dimgray: "696969", dodgerblue: "1e90ff", feldspar: "d19275", firebrick: "b22222", floralwhite: "fffaf0", forestgreen: "228b22", fuchsia: "ff00ff", gainsboro: "dcdcdc", ghostwhite: "f8f8ff", gold: "ffd700", goldenrod: "daa520", gray: "808080", green: "008000", greenyellow: "adff2f", honeydew: "f0fff0", hotpink: "ff69b4", indianred: "cd5c5c", indigo: "4b0082", ivory: "fffff0", khaki: "f0e68c", lavender: "e6e6fa", lavenderblush: "fff0f5", lawngreen: "7cfc00", lemonchiffon: "fffacd", lightblue: "add8e6", lightcoral: "f08080", lightcyan: "e0ffff", lightgoldenrodyellow: "fafad2", lightgrey: "d3d3d3", lightgreen: "90ee90", lightpink: "ffb6c1", lightsalmon: "ffa07a", lightseagreen: "20b2aa", lightskyblue: "87cefa", lightslateblue: "8470ff", lightslategray: "778899", lightsteelblue: "b0c4de", lightyellow: "ffffe0", lime: "00ff00", limegreen: "32cd32", linen: "faf0e6", magenta: "ff00ff", maroon: "800000", mediumaquamarine: "66cdaa", mediumblue: "0000cd", mediumorchid: "ba55d3", mediumpurple: "9370d8", mediumseagreen: "3cb371", mediumslateblue: "7b68ee", mediumspringgreen: "00fa9a", mediumturquoise: "48d1cc", mediumvioletred: "c71585", midnightblue: "191970", mintcream: "f5fffa", mistyrose: "ffe4e1", moccasin: "ffe4b5", navajowhite: "ffdead", navy: "000080", oldlace: "fdf5e6", olive: "808000", olivedrab: "6b8e23", orange: "ffa500", orangered: "ff4500", orchid: "da70d6", palegoldenrod: "eee8aa", palegreen: "98fb98", paleturquoise: "afeeee", palevioletred: "d87093", papayawhip: "ffefd5", peachpuff: "ffdab9", peru: "cd853f", pink: "ffc0cb", plum: "dda0dd", powderblue: "b0e0e6", purple: "800080", red: "ff0000", rosybrown: "bc8f8f", royalblue: "4169e1", saddlebrown: "8b4513", salmon: "fa8072", sandybrown: "f4a460", seagreen: "2e8b57", seashell: "fff5ee", sienna: "a0522d", silver: "c0c0c0", skyblue: "87ceeb", slateblue: "6a5acd", slategray: "708090", snow: "fffafa", springgreen: "00ff7f", steelblue: "4682b4", tan: "d2b48c", teal: "008080", thistle: "d8bfd8", tomato: "ff6347", turquoise: "40e0d0", violet: "ee82ee", violetred: "d02090", wheat: "f5deb3", white: "ffffff", whitesmoke: "f5f5f5", yellow: "ffff00", yellowgreen: "9acd32" }[t3 = (t3 = t3.replace(/ /g, "")).toLowerCase()] || t3;
  for (var r2 = [{ re: /^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/, example: ["rgb(123, 234, 45)", "rgb(255,234,245)"], process: function(t4) {
    return [parseInt(t4[1]), parseInt(t4[2]), parseInt(t4[3])];
  } }, { re: /^(\w{2})(\w{2})(\w{2})$/, example: ["#00ff00", "336699"], process: function(t4) {
    return [parseInt(t4[1], 16), parseInt(t4[2], 16), parseInt(t4[3], 16)];
  } }, { re: /^(\w{1})(\w{1})(\w{1})$/, example: ["#fb0", "f0f"], process: function(t4) {
    return [parseInt(t4[1] + t4[1], 16), parseInt(t4[2] + t4[2], 16), parseInt(t4[3] + t4[3], 16)];
  } }], n3 = 0; n3 < r2.length; n3++) {
    var i3 = r2[n3].re, a3 = r2[n3].process, o3 = i3.exec(t3);
    o3 && (e2 = a3(o3), this.r = e2[0], this.g = e2[1], this.b = e2[2], this.ok = true);
  }
  this.r = this.r < 0 || isNaN(this.r) ? 0 : this.r > 255 ? 255 : this.r, this.g = this.g < 0 || isNaN(this.g) ? 0 : this.g > 255 ? 255 : this.g, this.b = this.b < 0 || isNaN(this.b) ? 0 : this.b > 255 ? 255 : this.b, this.toRGB = function() {
    return "rgb(" + this.r + ", " + this.g + ", " + this.b + ")";
  }, this.toHex = function() {
    var t4 = this.r.toString(16), e3 = this.g.toString(16), r3 = this.b.toString(16);
    return 1 == t4.length && (t4 = "0" + t4), 1 == e3.length && (e3 = "0" + e3), 1 == r3.length && (r3 = "0" + r3), "#" + t4 + e3 + r3;
  };
}
function d(t3, e2) {
  var r2 = t3[0], n3 = t3[1], i3 = t3[2], a3 = t3[3];
  r2 = g(r2, n3, i3, a3, e2[0], 7, -680876936), a3 = g(a3, r2, n3, i3, e2[1], 12, -389564586), i3 = g(i3, a3, r2, n3, e2[2], 17, 606105819), n3 = g(n3, i3, a3, r2, e2[3], 22, -1044525330), r2 = g(r2, n3, i3, a3, e2[4], 7, -176418897), a3 = g(a3, r2, n3, i3, e2[5], 12, 1200080426), i3 = g(i3, a3, r2, n3, e2[6], 17, -1473231341), n3 = g(n3, i3, a3, r2, e2[7], 22, -45705983), r2 = g(r2, n3, i3, a3, e2[8], 7, 1770035416), a3 = g(a3, r2, n3, i3, e2[9], 12, -1958414417), i3 = g(i3, a3, r2, n3, e2[10], 17, -42063), n3 = g(n3, i3, a3, r2, e2[11], 22, -1990404162), r2 = g(r2, n3, i3, a3, e2[12], 7, 1804603682), a3 = g(a3, r2, n3, i3, e2[13], 12, -40341101), i3 = g(i3, a3, r2, n3, e2[14], 17, -1502002290), r2 = m3(r2, n3 = g(n3, i3, a3, r2, e2[15], 22, 1236535329), i3, a3, e2[1], 5, -165796510), a3 = m3(a3, r2, n3, i3, e2[6], 9, -1069501632), i3 = m3(i3, a3, r2, n3, e2[11], 14, 643717713), n3 = m3(n3, i3, a3, r2, e2[0], 20, -373897302), r2 = m3(r2, n3, i3, a3, e2[5], 5, -701558691), a3 = m3(a3, r2, n3, i3, e2[10], 9, 38016083), i3 = m3(i3, a3, r2, n3, e2[15], 14, -660478335), n3 = m3(n3, i3, a3, r2, e2[4], 20, -405537848), r2 = m3(r2, n3, i3, a3, e2[9], 5, 568446438), a3 = m3(a3, r2, n3, i3, e2[14], 9, -1019803690), i3 = m3(i3, a3, r2, n3, e2[3], 14, -187363961), n3 = m3(n3, i3, a3, r2, e2[8], 20, 1163531501), r2 = m3(r2, n3, i3, a3, e2[13], 5, -1444681467), a3 = m3(a3, r2, n3, i3, e2[2], 9, -51403784), i3 = m3(i3, a3, r2, n3, e2[7], 14, 1735328473), r2 = v2(r2, n3 = m3(n3, i3, a3, r2, e2[12], 20, -1926607734), i3, a3, e2[5], 4, -378558), a3 = v2(a3, r2, n3, i3, e2[8], 11, -2022574463), i3 = v2(i3, a3, r2, n3, e2[11], 16, 1839030562), n3 = v2(n3, i3, a3, r2, e2[14], 23, -35309556), r2 = v2(r2, n3, i3, a3, e2[1], 4, -1530992060), a3 = v2(a3, r2, n3, i3, e2[4], 11, 1272893353), i3 = v2(i3, a3, r2, n3, e2[7], 16, -155497632), n3 = v2(n3, i3, a3, r2, e2[10], 23, -1094730640), r2 = v2(r2, n3, i3, a3, e2[13], 4, 681279174), a3 = v2(a3, r2, n3, i3, e2[0], 11, -358537222), i3 = v2(i3, a3, r2, n3, e2[3], 16, -722521979), n3 = v2(n3, i3, a3, r2, e2[6], 23, 76029189), r2 = v2(r2, n3, i3, a3, e2[9], 4, -640364487), a3 = v2(a3, r2, n3, i3, e2[12], 11, -421815835), i3 = v2(i3, a3, r2, n3, e2[15], 16, 530742520), r2 = b(r2, n3 = v2(n3, i3, a3, r2, e2[2], 23, -995338651), i3, a3, e2[0], 6, -198630844), a3 = b(a3, r2, n3, i3, e2[7], 10, 1126891415), i3 = b(i3, a3, r2, n3, e2[14], 15, -1416354905), n3 = b(n3, i3, a3, r2, e2[5], 21, -57434055), r2 = b(r2, n3, i3, a3, e2[12], 6, 1700485571), a3 = b(a3, r2, n3, i3, e2[3], 10, -1894986606), i3 = b(i3, a3, r2, n3, e2[10], 15, -1051523), n3 = b(n3, i3, a3, r2, e2[1], 21, -2054922799), r2 = b(r2, n3, i3, a3, e2[8], 6, 1873313359), a3 = b(a3, r2, n3, i3, e2[15], 10, -30611744), i3 = b(i3, a3, r2, n3, e2[6], 15, -1560198380), n3 = b(n3, i3, a3, r2, e2[13], 21, 1309151649), r2 = b(r2, n3, i3, a3, e2[4], 6, -145523070), a3 = b(a3, r2, n3, i3, e2[11], 10, -1120210379), i3 = b(i3, a3, r2, n3, e2[2], 15, 718787259), n3 = b(n3, i3, a3, r2, e2[9], 21, -343485551), t3[0] = _2(r2, t3[0]), t3[1] = _2(n3, t3[1]), t3[2] = _2(i3, t3[2]), t3[3] = _2(a3, t3[3]);
}
function p2(t3, e2, r2, n3, i3, a3) {
  return e2 = _2(_2(e2, t3), _2(n3, a3)), _2(e2 << i3 | e2 >>> 32 - i3, r2);
}
function g(t3, e2, r2, n3, i3, a3, o3) {
  return p2(e2 & r2 | ~e2 & n3, t3, e2, i3, a3, o3);
}
function m3(t3, e2, r2, n3, i3, a3, o3) {
  return p2(e2 & n3 | r2 & ~n3, t3, e2, i3, a3, o3);
}
function v2(t3, e2, r2, n3, i3, a3, o3) {
  return p2(e2 ^ r2 ^ n3, t3, e2, i3, a3, o3);
}
function b(t3, e2, r2, n3, i3, a3, o3) {
  return p2(r2 ^ (e2 | ~n3), t3, e2, i3, a3, o3);
}
function y3(t3) {
  var e2, r2 = t3.length, n3 = [1732584193, -271733879, -1732584194, 271733878];
  for (e2 = 64; e2 <= t3.length; e2 += 64)
    d(n3, w(t3.substring(e2 - 64, e2)));
  t3 = t3.substring(e2 - 64);
  var i3 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
  for (e2 = 0; e2 < t3.length; e2++)
    i3[e2 >> 2] |= t3.charCodeAt(e2) << (e2 % 4 << 3);
  if (i3[e2 >> 2] |= 128 << (e2 % 4 << 3), e2 > 55)
    for (d(n3, i3), e2 = 0; e2 < 16; e2++)
      i3[e2] = 0;
  return i3[14] = 8 * r2, d(n3, i3), n3;
}
function w(t3) {
  var e2, r2 = [];
  for (e2 = 0; e2 < 64; e2 += 4)
    r2[e2 >> 2] = t3.charCodeAt(e2) + (t3.charCodeAt(e2 + 1) << 8) + (t3.charCodeAt(e2 + 2) << 16) + (t3.charCodeAt(e2 + 3) << 24);
  return r2;
}
u2 = n2.atob.bind(n2), h2 = n2.btoa.bind(n2);
var N2 = "0123456789abcdef".split("");
function L(t3) {
  for (var e2 = "", r2 = 0; r2 < 4; r2++)
    e2 += N2[t3 >> 8 * r2 + 4 & 15] + N2[t3 >> 8 * r2 & 15];
  return e2;
}
function A2(t3) {
  return String.fromCharCode((255 & t3) >> 0, (65280 & t3) >> 8, (16711680 & t3) >> 16, (4278190080 & t3) >> 24);
}
function x2(t3) {
  return y3(t3).map(A2).join("");
}
var S = "5d41402abc4b2a76b9719d911017c592" != function(t3) {
  for (var e2 = 0; e2 < t3.length; e2++)
    t3[e2] = L(t3[e2]);
  return t3.join("");
}(y3("hello"));
function _2(t3, e2) {
  if (S) {
    var r2 = (65535 & t3) + (65535 & e2);
    return (t3 >> 16) + (e2 >> 16) + (r2 >> 16) << 16 | 65535 & r2;
  }
  return t3 + e2 & 4294967295;
}
function P(t3, e2) {
  var r2, n3, i3, a3;
  if (t3 !== r2) {
    for (var o3 = (i3 = t3, a3 = 1 + (256 / t3.length >> 0), new Array(a3 + 1).join(i3)), s3 = [], c4 = 0; c4 < 256; c4++)
      s3[c4] = c4;
    var u3 = 0;
    for (c4 = 0; c4 < 256; c4++) {
      var h3 = s3[c4];
      u3 = (u3 + h3 + o3.charCodeAt(c4)) % 256, s3[c4] = s3[u3], s3[u3] = h3;
    }
    r2 = t3, n3 = s3;
  } else
    s3 = n3;
  var l3 = e2.length, f3 = 0, d2 = 0, p3 = "";
  for (c4 = 0; c4 < l3; c4++)
    d2 = (d2 + (h3 = s3[f3 = (f3 + 1) % 256])) % 256, s3[f3] = s3[d2], s3[d2] = h3, o3 = s3[(s3[f3] + s3[d2]) % 256], p3 += String.fromCharCode(e2.charCodeAt(c4) ^ o3);
  return p3;
}
var k = { print: 4, modify: 8, copy: 16, "annot-forms": 32 };
function I(t3, e2, r2, n3) {
  this.v = 1, this.r = 2;
  var i3 = 192;
  t3.forEach(function(t4) {
    if (void 0 !== k.perm)
      throw new Error("Invalid permission: " + t4);
    i3 += k[t4];
  }), this.padding = "(\xBFN^Nu\x8AAd\0NV\xFF\xFA\b..\0\xB6\xD0h>\x80/\f\xA9\xFEdSiz";
  var a3 = (e2 + this.padding).substr(0, 32), o3 = (r2 + this.padding).substr(0, 32);
  this.O = this.processOwnerPassword(a3, o3), this.P = -(1 + (255 ^ i3)), this.encryptionKey = x2(a3 + this.O + this.lsbFirstWord(this.P) + this.hexToBytes(n3)).substr(0, 5), this.U = P(this.encryptionKey, this.padding);
}
function F(t3) {
  if (/[^\u0000-\u00ff]/.test(t3))
    throw new Error("Invalid PDF Name Object: " + t3 + ", Only accept ASCII characters.");
  for (var e2 = "", r2 = t3.length, n3 = 0; n3 < r2; n3++) {
    var i3 = t3.charCodeAt(n3);
    if (i3 < 33 || 35 === i3 || 37 === i3 || 40 === i3 || 41 === i3 || 47 === i3 || 60 === i3 || 62 === i3 || 91 === i3 || 93 === i3 || 123 === i3 || 125 === i3 || i3 > 126)
      e2 += "#" + ("0" + i3.toString(16)).slice(-2);
    else
      e2 += t3[n3];
  }
  return e2;
}
function C(e2) {
  if ("object" !== _typeof(e2))
    throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");
  var r2 = {};
  this.subscribe = function(t3, e3, n3) {
    if (n3 = n3 || false, "string" != typeof t3 || "function" != typeof e3 || "boolean" != typeof n3)
      throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");
    r2.hasOwnProperty(t3) || (r2[t3] = {});
    var i3 = Math.random().toString(35);
    return r2[t3][i3] = [e3, !!n3], i3;
  }, this.unsubscribe = function(t3) {
    for (var e3 in r2)
      if (r2[e3][t3])
        return delete r2[e3][t3], 0 === Object.keys(r2[e3]).length && delete r2[e3], true;
    return false;
  }, this.publish = function(t3) {
    if (r2.hasOwnProperty(t3)) {
      var i3 = Array.prototype.slice.call(arguments, 1), o3 = [];
      for (var s3 in r2[t3]) {
        var c4 = r2[t3][s3];
        try {
          c4[0].apply(e2, i3);
        } catch (t4) {
          n2.console && a2.error("jsPDF PubSub Error", t4.message, t4);
        }
        c4[1] && o3.push(s3);
      }
      o3.length && o3.forEach(this.unsubscribe);
    }
  }, this.getTopics = function() {
    return r2;
  };
}
function j(t3) {
  if (!(this instanceof j))
    return new j(t3);
  var e2 = "opacity,stroke-opacity".split(",");
  for (var r2 in t3)
    t3.hasOwnProperty(r2) && e2.indexOf(r2) >= 0 && (this[r2] = t3[r2]);
  this.id = "", this.objectNumber = -1;
}
function O2(t3, e2) {
  this.gState = t3, this.matrix = e2, this.id = "", this.objectNumber = -1;
}
function B(t3, e2, r2, n3, i3) {
  if (!(this instanceof B))
    return new B(t3, e2, r2, n3, i3);
  this.type = "axial" === t3 ? 2 : 3, this.coords = e2, this.colors = r2, O2.call(this, n3, i3);
}
function M(t3, e2, r2, n3, i3) {
  if (!(this instanceof M))
    return new M(t3, e2, r2, n3, i3);
  this.boundingBox = t3, this.xStep = e2, this.yStep = r2, this.stream = "", this.cloneIndex = 0, O2.call(this, n3, i3);
}
function E(e2) {
  var r2, i3 = "string" == typeof arguments[0] ? arguments[0] : "p", o3 = arguments[1], s3 = arguments[2], c4 = arguments[3], u3 = [], d2 = 1, p3 = 16, g2 = "S", m4 = null;
  "object" === _typeof(e2 = e2 || {}) && (i3 = e2.orientation, o3 = e2.unit || o3, s3 = e2.format || s3, c4 = e2.compress || e2.compressPdf || c4, null !== (m4 = e2.encryption || null) && (m4.userPassword = m4.userPassword || "", m4.ownerPassword = m4.ownerPassword || "", m4.userPermissions = m4.userPermissions || []), d2 = "number" == typeof e2.userUnit ? Math.abs(e2.userUnit) : 1, void 0 !== e2.precision && (r2 = e2.precision), void 0 !== e2.floatPrecision && (p3 = e2.floatPrecision), g2 = e2.defaultPathOperation || "S"), u3 = e2.filters || (true === c4 ? ["FlateEncode"] : u3), o3 = o3 || "mm", i3 = ("" + (i3 || "P")).toLowerCase();
  var v3 = e2.putOnlyUsedFonts || false, b2 = {}, y4 = { internal: {}, __private__: {} };
  y4.__private__.PubSub = C;
  var w2 = "1.3", N3 = y4.__private__.getPdfVersion = function() {
    return w2;
  };
  y4.__private__.setPdfVersion = function(t3) {
    w2 = t3;
  };
  var L2 = { a0: [2383.94, 3370.39], a1: [1683.78, 2383.94], a2: [1190.55, 1683.78], a3: [841.89, 1190.55], a4: [595.28, 841.89], a5: [419.53, 595.28], a6: [297.64, 419.53], a7: [209.76, 297.64], a8: [147.4, 209.76], a9: [104.88, 147.4], a10: [73.7, 104.88], b0: [2834.65, 4008.19], b1: [2004.09, 2834.65], b2: [1417.32, 2004.09], b3: [1000.63, 1417.32], b4: [708.66, 1000.63], b5: [498.9, 708.66], b6: [354.33, 498.9], b7: [249.45, 354.33], b8: [175.75, 249.45], b9: [124.72, 175.75], b10: [87.87, 124.72], c0: [2599.37, 3676.54], c1: [1836.85, 2599.37], c2: [1298.27, 1836.85], c3: [918.43, 1298.27], c4: [649.13, 918.43], c5: [459.21, 649.13], c6: [323.15, 459.21], c7: [229.61, 323.15], c8: [161.57, 229.61], c9: [113.39, 161.57], c10: [79.37, 113.39], dl: [311.81, 623.62], letter: [612, 792], "government-letter": [576, 756], legal: [612, 1008], "junior-legal": [576, 360], ledger: [1224, 792], tabloid: [792, 1224], "credit-card": [153, 243] };
  y4.__private__.getPageFormats = function() {
    return L2;
  };
  var A3 = y4.__private__.getPageFormat = function(t3) {
    return L2[t3];
  };
  s3 = s3 || "a4";
  var x3 = { COMPAT: "compat", ADVANCED: "advanced" }, S2 = x3.COMPAT;
  function _3() {
    this.saveGraphicsState(), lt2(new Vt2(_t2, 0, 0, -_t2, 0, Rr() * _t2).toString() + " cm"), this.setFontSize(this.getFontSize() / _t2), g2 = "n", S2 = x3.ADVANCED;
  }
  function P2() {
    this.restoreGraphicsState(), g2 = "S", S2 = x3.COMPAT;
  }
  var k2 = y4.__private__.combineFontStyleAndFontWeight = function(t3, e3) {
    if ("bold" == t3 && "normal" == e3 || "bold" == t3 && 400 == e3 || "normal" == t3 && "italic" == e3 || "bold" == t3 && "italic" == e3)
      throw new Error("Invalid Combination of fontweight and fontstyle");
    return e3 && (t3 = 400 == e3 || "normal" === e3 ? "italic" === t3 ? "italic" : "normal" : 700 != e3 && "bold" !== e3 || "normal" !== t3 ? (700 == e3 ? "bold" : e3) + "" + t3 : "bold"), t3;
  };
  y4.advancedAPI = function(t3) {
    var e3 = S2 === x3.COMPAT;
    return e3 && _3.call(this), "function" != typeof t3 || (t3(this), e3 && P2.call(this)), this;
  }, y4.compatAPI = function(t3) {
    var e3 = S2 === x3.ADVANCED;
    return e3 && P2.call(this), "function" != typeof t3 || (t3(this), e3 && _3.call(this)), this;
  }, y4.isAdvancedAPI = function() {
    return S2 === x3.ADVANCED;
  };
  var O3, q2 = function(t3) {
    if (S2 !== x3.ADVANCED)
      throw new Error(t3 + " is only available in 'advanced' API mode. You need to call advancedAPI() first.");
  }, D2 = y4.roundToPrecision = y4.__private__.roundToPrecision = function(t3, e3) {
    var n3 = r2 || e3;
    if (isNaN(t3) || isNaN(n3))
      throw new Error("Invalid argument passed to jsPDF.roundToPrecision");
    return t3.toFixed(n3).replace(/0+$/, "");
  };
  O3 = y4.hpf = y4.__private__.hpf = "number" == typeof p3 ? function(t3) {
    if (isNaN(t3))
      throw new Error("Invalid argument passed to jsPDF.hpf");
    return D2(t3, p3);
  } : "smart" === p3 ? function(t3) {
    if (isNaN(t3))
      throw new Error("Invalid argument passed to jsPDF.hpf");
    return D2(t3, t3 > -1 && t3 < 1 ? 16 : 5);
  } : function(t3) {
    if (isNaN(t3))
      throw new Error("Invalid argument passed to jsPDF.hpf");
    return D2(t3, 16);
  };
  var R2 = y4.f2 = y4.__private__.f2 = function(t3) {
    if (isNaN(t3))
      throw new Error("Invalid argument passed to jsPDF.f2");
    return D2(t3, 2);
  }, T3 = y4.__private__.f3 = function(t3) {
    if (isNaN(t3))
      throw new Error("Invalid argument passed to jsPDF.f3");
    return D2(t3, 3);
  }, U2 = y4.scale = y4.__private__.scale = function(t3) {
    if (isNaN(t3))
      throw new Error("Invalid argument passed to jsPDF.scale");
    return S2 === x3.COMPAT ? t3 * _t2 : S2 === x3.ADVANCED ? t3 : void 0;
  }, z2 = function(t3) {
    return S2 === x3.COMPAT ? Rr() - t3 : S2 === x3.ADVANCED ? t3 : void 0;
  }, H2 = function(t3) {
    return U2(z2(t3));
  };
  y4.__private__.setPrecision = y4.setPrecision = function(t3) {
    "number" == typeof parseInt(t3, 10) && (r2 = parseInt(t3, 10));
  };
  var W2, V2 = "00000000000000000000000000000000", G3 = y4.__private__.getFileId = function() {
    return V2;
  }, Y2 = y4.__private__.setFileId = function(t3) {
    return V2 = void 0 !== t3 && /^[a-fA-F0-9]{32}$/.test(t3) ? t3.toUpperCase() : V2.split("").map(function() {
      return "ABCDEF0123456789".charAt(Math.floor(16 * Math.random()));
    }).join(""), null !== m4 && (Ye = new I(m4.userPermissions, m4.userPassword, m4.ownerPassword, V2)), V2;
  };
  y4.setFileId = function(t3) {
    return Y2(t3), this;
  }, y4.getFileId = function() {
    return G3();
  };
  var J2 = y4.__private__.convertDateToPDFDate = function(t3) {
    var e3 = t3.getTimezoneOffset(), r3 = e3 < 0 ? "+" : "-", n3 = Math.floor(Math.abs(e3 / 60)), i4 = Math.abs(e3 % 60), a3 = [r3, Q2(n3), "'", Q2(i4), "'"].join("");
    return ["D:", t3.getFullYear(), Q2(t3.getMonth() + 1), Q2(t3.getDate()), Q2(t3.getHours()), Q2(t3.getMinutes()), Q2(t3.getSeconds()), a3].join("");
  }, X2 = y4.__private__.convertPDFDateToDate = function(t3) {
    var e3 = parseInt(t3.substr(2, 4), 10), r3 = parseInt(t3.substr(6, 2), 10) - 1, n3 = parseInt(t3.substr(8, 2), 10), i4 = parseInt(t3.substr(10, 2), 10), a3 = parseInt(t3.substr(12, 2), 10), o4 = parseInt(t3.substr(14, 2), 10);
    return new Date(e3, r3, n3, i4, a3, o4, 0);
  }, K2 = y4.__private__.setCreationDate = function(t3) {
    var e3;
    if (void 0 === t3 && (t3 = /* @__PURE__ */ new Date()), t3 instanceof Date)
      e3 = J2(t3);
    else {
      if (!/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\+0[0-9]|\+1[0-4]|-0[0-9]|-1[0-1])'(0[0-9]|[1-5][0-9])'?$/.test(t3))
        throw new Error("Invalid argument passed to jsPDF.setCreationDate");
      e3 = t3;
    }
    return W2 = e3;
  }, Z2 = y4.__private__.getCreationDate = function(t3) {
    var e3 = W2;
    return "jsDate" === t3 && (e3 = X2(W2)), e3;
  };
  y4.setCreationDate = function(t3) {
    return K2(t3), this;
  }, y4.getCreationDate = function(t3) {
    return Z2(t3);
  };
  var $9, Q2 = y4.__private__.padd2 = function(t3) {
    return ("0" + parseInt(t3)).slice(-2);
  }, tt2 = y4.__private__.padd2Hex = function(t3) {
    return ("00" + (t3 = t3.toString())).substr(t3.length);
  }, et3 = 0, rt2 = [], nt2 = [], it2 = 0, at2 = [], ot2 = [], st2 = false, ct2 = nt2, ut2 = function() {
    et3 = 0, it2 = 0, nt2 = [], rt2 = [], at2 = [], Qt2 = Kt2(), te2 = Kt2();
  };
  y4.__private__.setCustomOutputDestination = function(t3) {
    st2 = true, ct2 = t3;
  };
  var ht2 = function(t3) {
    st2 || (ct2 = t3);
  };
  y4.__private__.resetCustomOutputDestination = function() {
    st2 = false, ct2 = nt2;
  };
  var lt2 = y4.__private__.out = function(t3) {
    return t3 = t3.toString(), it2 += t3.length + 1, ct2.push(t3), ct2;
  }, ft2 = y4.__private__.write = function(t3) {
    return lt2(1 === arguments.length ? t3.toString() : Array.prototype.join.call(arguments, " "));
  }, dt2 = y4.__private__.getArrayBuffer = function(t3) {
    for (var e3 = t3.length, r3 = new ArrayBuffer(e3), n3 = new Uint8Array(r3); e3--; )
      n3[e3] = t3.charCodeAt(e3);
    return r3;
  }, pt2 = [["Helvetica", "helvetica", "normal", "WinAnsiEncoding"], ["Helvetica-Bold", "helvetica", "bold", "WinAnsiEncoding"], ["Helvetica-Oblique", "helvetica", "italic", "WinAnsiEncoding"], ["Helvetica-BoldOblique", "helvetica", "bolditalic", "WinAnsiEncoding"], ["Courier", "courier", "normal", "WinAnsiEncoding"], ["Courier-Bold", "courier", "bold", "WinAnsiEncoding"], ["Courier-Oblique", "courier", "italic", "WinAnsiEncoding"], ["Courier-BoldOblique", "courier", "bolditalic", "WinAnsiEncoding"], ["Times-Roman", "times", "normal", "WinAnsiEncoding"], ["Times-Bold", "times", "bold", "WinAnsiEncoding"], ["Times-Italic", "times", "italic", "WinAnsiEncoding"], ["Times-BoldItalic", "times", "bolditalic", "WinAnsiEncoding"], ["ZapfDingbats", "zapfdingbats", "normal", null], ["Symbol", "symbol", "normal", null]];
  y4.__private__.getStandardFonts = function() {
    return pt2;
  };
  var gt2 = e2.fontSize || 16;
  y4.__private__.setFontSize = y4.setFontSize = function(t3) {
    return gt2 = S2 === x3.ADVANCED ? t3 / _t2 : t3, this;
  };
  var mt2, vt2 = y4.__private__.getFontSize = y4.getFontSize = function() {
    return S2 === x3.COMPAT ? gt2 : gt2 * _t2;
  }, bt2 = e2.R2L || false;
  y4.__private__.setR2L = y4.setR2L = function(t3) {
    return bt2 = t3, this;
  }, y4.__private__.getR2L = y4.getR2L = function() {
    return bt2;
  };
  var yt2, wt2 = y4.__private__.setZoomMode = function(t3) {
    var e3 = [void 0, null, "fullwidth", "fullheight", "fullpage", "original"];
    if (/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(t3))
      mt2 = t3;
    else if (isNaN(t3)) {
      if (-1 === e3.indexOf(t3))
        throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "' + t3 + '" is not recognized.');
      mt2 = t3;
    } else
      mt2 = parseInt(t3, 10);
  };
  y4.__private__.getZoomMode = function() {
    return mt2;
  };
  var Nt2, Lt2 = y4.__private__.setPageMode = function(t3) {
    if (-1 == [void 0, null, "UseNone", "UseOutlines", "UseThumbs", "FullScreen"].indexOf(t3))
      throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "' + t3 + '" is not recognized.');
    yt2 = t3;
  };
  y4.__private__.getPageMode = function() {
    return yt2;
  };
  var At2 = y4.__private__.setLayoutMode = function(t3) {
    if (-1 == [void 0, null, "continuous", "single", "twoleft", "tworight", "two"].indexOf(t3))
      throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "' + t3 + '" is not recognized.');
    Nt2 = t3;
  };
  y4.__private__.getLayoutMode = function() {
    return Nt2;
  }, y4.__private__.setDisplayMode = y4.setDisplayMode = function(t3, e3, r3) {
    return wt2(t3), At2(e3), Lt2(r3), this;
  };
  var xt2 = { title: "", subject: "", author: "", keywords: "", creator: "" };
  y4.__private__.getDocumentProperty = function(t3) {
    if (-1 === Object.keys(xt2).indexOf(t3))
      throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");
    return xt2[t3];
  }, y4.__private__.getDocumentProperties = function() {
    return xt2;
  }, y4.__private__.setDocumentProperties = y4.setProperties = y4.setDocumentProperties = function(t3) {
    for (var e3 in xt2)
      xt2.hasOwnProperty(e3) && t3[e3] && (xt2[e3] = t3[e3]);
    return this;
  }, y4.__private__.setDocumentProperty = function(t3, e3) {
    if (-1 === Object.keys(xt2).indexOf(t3))
      throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");
    return xt2[t3] = e3;
  };
  var St2, _t2, Pt2, kt2, It2, Ft2 = {}, Ct2 = {}, jt2 = [], Ot2 = {}, Bt2 = {}, Mt2 = {}, Et2 = {}, qt2 = null, Dt2 = 0, Rt2 = [], Tt2 = new C(y4), Ut2 = e2.hotfixes || [], zt2 = {}, Ht2 = {}, Wt2 = [], Vt2 = function t3(e3, r3, n3, i4, a3, o4) {
    if (!(this instanceof t3))
      return new t3(e3, r3, n3, i4, a3, o4);
    isNaN(e3) && (e3 = 1), isNaN(r3) && (r3 = 0), isNaN(n3) && (n3 = 0), isNaN(i4) && (i4 = 1), isNaN(a3) && (a3 = 0), isNaN(o4) && (o4 = 0), this._matrix = [e3, r3, n3, i4, a3, o4];
  };
  Object.defineProperty(Vt2.prototype, "sx", { get: function() {
    return this._matrix[0];
  }, set: function(t3) {
    this._matrix[0] = t3;
  } }), Object.defineProperty(Vt2.prototype, "shy", { get: function() {
    return this._matrix[1];
  }, set: function(t3) {
    this._matrix[1] = t3;
  } }), Object.defineProperty(Vt2.prototype, "shx", { get: function() {
    return this._matrix[2];
  }, set: function(t3) {
    this._matrix[2] = t3;
  } }), Object.defineProperty(Vt2.prototype, "sy", { get: function() {
    return this._matrix[3];
  }, set: function(t3) {
    this._matrix[3] = t3;
  } }), Object.defineProperty(Vt2.prototype, "tx", { get: function() {
    return this._matrix[4];
  }, set: function(t3) {
    this._matrix[4] = t3;
  } }), Object.defineProperty(Vt2.prototype, "ty", { get: function() {
    return this._matrix[5];
  }, set: function(t3) {
    this._matrix[5] = t3;
  } }), Object.defineProperty(Vt2.prototype, "a", { get: function() {
    return this._matrix[0];
  }, set: function(t3) {
    this._matrix[0] = t3;
  } }), Object.defineProperty(Vt2.prototype, "b", { get: function() {
    return this._matrix[1];
  }, set: function(t3) {
    this._matrix[1] = t3;
  } }), Object.defineProperty(Vt2.prototype, "c", { get: function() {
    return this._matrix[2];
  }, set: function(t3) {
    this._matrix[2] = t3;
  } }), Object.defineProperty(Vt2.prototype, "d", { get: function() {
    return this._matrix[3];
  }, set: function(t3) {
    this._matrix[3] = t3;
  } }), Object.defineProperty(Vt2.prototype, "e", { get: function() {
    return this._matrix[4];
  }, set: function(t3) {
    this._matrix[4] = t3;
  } }), Object.defineProperty(Vt2.prototype, "f", { get: function() {
    return this._matrix[5];
  }, set: function(t3) {
    this._matrix[5] = t3;
  } }), Object.defineProperty(Vt2.prototype, "rotation", { get: function() {
    return Math.atan2(this.shx, this.sx);
  } }), Object.defineProperty(Vt2.prototype, "scaleX", { get: function() {
    return this.decompose().scale.sx;
  } }), Object.defineProperty(Vt2.prototype, "scaleY", { get: function() {
    return this.decompose().scale.sy;
  } }), Object.defineProperty(Vt2.prototype, "isIdentity", { get: function() {
    return 1 === this.sx && (0 === this.shy && (0 === this.shx && (1 === this.sy && (0 === this.tx && 0 === this.ty))));
  } }), Vt2.prototype.join = function(t3) {
    return [this.sx, this.shy, this.shx, this.sy, this.tx, this.ty].map(O3).join(t3);
  }, Vt2.prototype.multiply = function(t3) {
    var e3 = t3.sx * this.sx + t3.shy * this.shx, r3 = t3.sx * this.shy + t3.shy * this.sy, n3 = t3.shx * this.sx + t3.sy * this.shx, i4 = t3.shx * this.shy + t3.sy * this.sy, a3 = t3.tx * this.sx + t3.ty * this.shx + this.tx, o4 = t3.tx * this.shy + t3.ty * this.sy + this.ty;
    return new Vt2(e3, r3, n3, i4, a3, o4);
  }, Vt2.prototype.decompose = function() {
    var t3 = this.sx, e3 = this.shy, r3 = this.shx, n3 = this.sy, i4 = this.tx, a3 = this.ty, o4 = Math.sqrt(t3 * t3 + e3 * e3), s4 = (t3 /= o4) * r3 + (e3 /= o4) * n3;
    r3 -= t3 * s4, n3 -= e3 * s4;
    var c5 = Math.sqrt(r3 * r3 + n3 * n3);
    return s4 /= c5, t3 * (n3 /= c5) < e3 * (r3 /= c5) && (t3 = -t3, e3 = -e3, s4 = -s4, o4 = -o4), { scale: new Vt2(o4, 0, 0, c5, 0, 0), translate: new Vt2(1, 0, 0, 1, i4, a3), rotate: new Vt2(t3, e3, -e3, t3, 0, 0), skew: new Vt2(1, 0, s4, 1, 0, 0) };
  }, Vt2.prototype.toString = function(t3) {
    return this.join(" ");
  }, Vt2.prototype.inversed = function() {
    var t3 = this.sx, e3 = this.shy, r3 = this.shx, n3 = this.sy, i4 = this.tx, a3 = this.ty, o4 = 1 / (t3 * n3 - e3 * r3), s4 = n3 * o4, c5 = -e3 * o4, u4 = -r3 * o4, h3 = t3 * o4;
    return new Vt2(s4, c5, u4, h3, -s4 * i4 - u4 * a3, -c5 * i4 - h3 * a3);
  }, Vt2.prototype.applyToPoint = function(t3) {
    var e3 = t3.x * this.sx + t3.y * this.shx + this.tx, r3 = t3.x * this.shy + t3.y * this.sy + this.ty;
    return new Cr(e3, r3);
  }, Vt2.prototype.applyToRectangle = function(t3) {
    var e3 = this.applyToPoint(t3), r3 = this.applyToPoint(new Cr(t3.x + t3.w, t3.y + t3.h));
    return new jr(e3.x, e3.y, r3.x - e3.x, r3.y - e3.y);
  }, Vt2.prototype.clone = function() {
    var t3 = this.sx, e3 = this.shy, r3 = this.shx, n3 = this.sy, i4 = this.tx, a3 = this.ty;
    return new Vt2(t3, e3, r3, n3, i4, a3);
  }, y4.Matrix = Vt2;
  var Gt2 = y4.matrixMult = function(t3, e3) {
    return e3.multiply(t3);
  }, Yt2 = new Vt2(1, 0, 0, 1, 0, 0);
  y4.unitMatrix = y4.identityMatrix = Yt2;
  var Jt2 = function(t3, e3) {
    if (!Bt2[t3]) {
      var r3 = (e3 instanceof B ? "Sh" : "P") + (Object.keys(Ot2).length + 1).toString(10);
      e3.id = r3, Bt2[t3] = r3, Ot2[r3] = e3, Tt2.publish("addPattern", e3);
    }
  };
  y4.ShadingPattern = B, y4.TilingPattern = M, y4.addShadingPattern = function(t3, e3) {
    return q2("addShadingPattern()"), Jt2(t3, e3), this;
  }, y4.beginTilingPattern = function(t3) {
    q2("beginTilingPattern()"), Br(t3.boundingBox[0], t3.boundingBox[1], t3.boundingBox[2] - t3.boundingBox[0], t3.boundingBox[3] - t3.boundingBox[1], t3.matrix);
  }, y4.endTilingPattern = function(t3, e3) {
    q2("endTilingPattern()"), e3.stream = ot2[$9].join("\n"), Jt2(t3, e3), Tt2.publish("endTilingPattern", e3), Wt2.pop().restore();
  };
  var Xt2 = y4.__private__.newObject = function() {
    var t3 = Kt2();
    return Zt2(t3, true), t3;
  }, Kt2 = y4.__private__.newObjectDeferred = function() {
    return et3++, rt2[et3] = function() {
      return it2;
    }, et3;
  }, Zt2 = function(t3, e3) {
    return e3 = "boolean" == typeof e3 && e3, rt2[t3] = it2, e3 && lt2(t3 + " 0 obj"), t3;
  }, $t2 = y4.__private__.newAdditionalObject = function() {
    var t3 = { objId: Kt2(), content: "" };
    return at2.push(t3), t3;
  }, Qt2 = Kt2(), te2 = Kt2(), ee2 = y4.__private__.decodeColorString = function(t3) {
    var e3 = t3.split(" ");
    if (2 !== e3.length || "g" !== e3[1] && "G" !== e3[1]) {
      if (5 === e3.length && ("k" === e3[4] || "K" === e3[4])) {
        e3 = [(1 - e3[0]) * (1 - e3[3]), (1 - e3[1]) * (1 - e3[3]), (1 - e3[2]) * (1 - e3[3]), "r"];
      }
    } else {
      var r3 = parseFloat(e3[0]);
      e3 = [r3, r3, r3, "r"];
    }
    for (var n3 = "#", i4 = 0; i4 < 3; i4++)
      n3 += ("0" + Math.floor(255 * parseFloat(e3[i4])).toString(16)).slice(-2);
    return n3;
  }, re2 = y4.__private__.encodeColorString = function(e3) {
    var r3;
    "string" == typeof e3 && (e3 = { ch1: e3 });
    var n3 = e3.ch1, i4 = e3.ch2, a3 = e3.ch3, o4 = e3.ch4, s4 = "draw" === e3.pdfColorType ? ["G", "RG", "K"] : ["g", "rg", "k"];
    if ("string" == typeof n3 && "#" !== n3.charAt(0)) {
      var c5 = new f2(n3);
      if (c5.ok)
        n3 = c5.toHex();
      else if (!/^\d*\.?\d*$/.test(n3))
        throw new Error('Invalid color "' + n3 + '" passed to jsPDF.encodeColorString.');
    }
    if ("string" == typeof n3 && /^#[0-9A-Fa-f]{3}$/.test(n3) && (n3 = "#" + n3[1] + n3[1] + n3[2] + n3[2] + n3[3] + n3[3]), "string" == typeof n3 && /^#[0-9A-Fa-f]{6}$/.test(n3)) {
      var u4 = parseInt(n3.substr(1), 16);
      n3 = u4 >> 16 & 255, i4 = u4 >> 8 & 255, a3 = 255 & u4;
    }
    if (void 0 === i4 || void 0 === o4 && n3 === i4 && i4 === a3)
      if ("string" == typeof n3)
        r3 = n3 + " " + s4[0];
      else
        switch (e3.precision) {
          case 2:
            r3 = R2(n3 / 255) + " " + s4[0];
            break;
          case 3:
          default:
            r3 = T3(n3 / 255) + " " + s4[0];
        }
    else if (void 0 === o4 || "object" === _typeof(o4)) {
      if (o4 && !isNaN(o4.a) && 0 === o4.a)
        return r3 = ["1.", "1.", "1.", s4[1]].join(" ");
      if ("string" == typeof n3)
        r3 = [n3, i4, a3, s4[1]].join(" ");
      else
        switch (e3.precision) {
          case 2:
            r3 = [R2(n3 / 255), R2(i4 / 255), R2(a3 / 255), s4[1]].join(" ");
            break;
          default:
          case 3:
            r3 = [T3(n3 / 255), T3(i4 / 255), T3(a3 / 255), s4[1]].join(" ");
        }
    } else if ("string" == typeof n3)
      r3 = [n3, i4, a3, o4, s4[2]].join(" ");
    else
      switch (e3.precision) {
        case 2:
          r3 = [R2(n3), R2(i4), R2(a3), R2(o4), s4[2]].join(" ");
          break;
        case 3:
        default:
          r3 = [T3(n3), T3(i4), T3(a3), T3(o4), s4[2]].join(" ");
      }
    return r3;
  }, ne2 = y4.__private__.getFilters = function() {
    return u3;
  }, ie2 = y4.__private__.putStream = function(t3) {
    var e3 = (t3 = t3 || {}).data || "", r3 = t3.filters || ne2(), n3 = t3.alreadyAppliedFilters || [], i4 = t3.addLength1 || false, a3 = e3.length, o4 = t3.objectId, s4 = function(t4) {
      return t4;
    };
    if (null !== m4 && void 0 === o4)
      throw new Error("ObjectId must be passed to putStream for file encryption");
    null !== m4 && (s4 = Ye.encryptor(o4, 0));
    var c5 = {};
    true === r3 && (r3 = ["FlateEncode"]);
    var u4 = t3.additionalKeyValues || [], h3 = (c5 = void 0 !== E.API.processDataByFilters ? E.API.processDataByFilters(e3, r3) : { data: e3, reverseChain: [] }).reverseChain + (Array.isArray(n3) ? n3.join(" ") : n3.toString());
    if (0 !== c5.data.length && (u4.push({ key: "Length", value: c5.data.length }), true === i4 && u4.push({ key: "Length1", value: a3 })), 0 != h3.length)
      if (h3.split("/").length - 1 == 1)
        u4.push({ key: "Filter", value: h3 });
      else {
        u4.push({ key: "Filter", value: "[" + h3 + "]" });
        for (var l3 = 0; l3 < u4.length; l3 += 1)
          if ("DecodeParms" === u4[l3].key) {
            for (var f3 = [], d3 = 0; d3 < c5.reverseChain.split("/").length - 1; d3 += 1)
              f3.push("null");
            f3.push(u4[l3].value), u4[l3].value = "[" + f3.join(" ") + "]";
          }
      }
    lt2("<<");
    for (var p4 = 0; p4 < u4.length; p4++)
      lt2("/" + u4[p4].key + " " + u4[p4].value);
    lt2(">>"), 0 !== c5.data.length && (lt2("stream"), lt2(s4(c5.data)), lt2("endstream"));
  }, ae2 = y4.__private__.putPage = function(t3) {
    var e3 = t3.number, r3 = t3.data, n3 = t3.objId, i4 = t3.contentsObjId;
    Zt2(n3, true), lt2("<</Type /Page"), lt2("/Parent " + t3.rootDictionaryObjId + " 0 R"), lt2("/Resources " + t3.resourceDictionaryObjId + " 0 R"), lt2("/MediaBox [" + parseFloat(O3(t3.mediaBox.bottomLeftX)) + " " + parseFloat(O3(t3.mediaBox.bottomLeftY)) + " " + O3(t3.mediaBox.topRightX) + " " + O3(t3.mediaBox.topRightY) + "]"), null !== t3.cropBox && lt2("/CropBox [" + O3(t3.cropBox.bottomLeftX) + " " + O3(t3.cropBox.bottomLeftY) + " " + O3(t3.cropBox.topRightX) + " " + O3(t3.cropBox.topRightY) + "]"), null !== t3.bleedBox && lt2("/BleedBox [" + O3(t3.bleedBox.bottomLeftX) + " " + O3(t3.bleedBox.bottomLeftY) + " " + O3(t3.bleedBox.topRightX) + " " + O3(t3.bleedBox.topRightY) + "]"), null !== t3.trimBox && lt2("/TrimBox [" + O3(t3.trimBox.bottomLeftX) + " " + O3(t3.trimBox.bottomLeftY) + " " + O3(t3.trimBox.topRightX) + " " + O3(t3.trimBox.topRightY) + "]"), null !== t3.artBox && lt2("/ArtBox [" + O3(t3.artBox.bottomLeftX) + " " + O3(t3.artBox.bottomLeftY) + " " + O3(t3.artBox.topRightX) + " " + O3(t3.artBox.topRightY) + "]"), "number" == typeof t3.userUnit && 1 !== t3.userUnit && lt2("/UserUnit " + t3.userUnit), Tt2.publish("putPage", { objId: n3, pageContext: Rt2[e3], pageNumber: e3, page: r3 }), lt2("/Contents " + i4 + " 0 R"), lt2(">>"), lt2("endobj");
    var a3 = r3.join("\n");
    return S2 === x3.ADVANCED && (a3 += "\nQ"), Zt2(i4, true), ie2({ data: a3, filters: ne2(), objectId: i4 }), lt2("endobj"), n3;
  }, oe2 = y4.__private__.putPages = function() {
    var t3, e3, r3 = [];
    for (t3 = 1; t3 <= Dt2; t3++)
      Rt2[t3].objId = Kt2(), Rt2[t3].contentsObjId = Kt2();
    for (t3 = 1; t3 <= Dt2; t3++)
      r3.push(ae2({ number: t3, data: ot2[t3], objId: Rt2[t3].objId, contentsObjId: Rt2[t3].contentsObjId, mediaBox: Rt2[t3].mediaBox, cropBox: Rt2[t3].cropBox, bleedBox: Rt2[t3].bleedBox, trimBox: Rt2[t3].trimBox, artBox: Rt2[t3].artBox, userUnit: Rt2[t3].userUnit, rootDictionaryObjId: Qt2, resourceDictionaryObjId: te2 }));
    Zt2(Qt2, true), lt2("<</Type /Pages");
    var n3 = "/Kids [";
    for (e3 = 0; e3 < Dt2; e3++)
      n3 += r3[e3] + " 0 R ";
    lt2(n3 + "]"), lt2("/Count " + Dt2), lt2(">>"), lt2("endobj"), Tt2.publish("postPutPages");
  }, se2 = function(t3) {
    Tt2.publish("putFont", { font: t3, out: lt2, newObject: Xt2, putStream: ie2 }), true !== t3.isAlreadyPutted && (t3.objectNumber = Xt2(), lt2("<<"), lt2("/Type /Font"), lt2("/BaseFont /" + F(t3.postScriptName)), lt2("/Subtype /Type1"), "string" == typeof t3.encoding && lt2("/Encoding /" + t3.encoding), lt2("/FirstChar 32"), lt2("/LastChar 255"), lt2(">>"), lt2("endobj"));
  }, ce2 = function() {
    for (var t3 in Ft2)
      Ft2.hasOwnProperty(t3) && (false === v3 || true === v3 && b2.hasOwnProperty(t3)) && se2(Ft2[t3]);
  }, ue2 = function(t3) {
    t3.objectNumber = Xt2();
    var e3 = [];
    e3.push({ key: "Type", value: "/XObject" }), e3.push({ key: "Subtype", value: "/Form" }), e3.push({ key: "BBox", value: "[" + [O3(t3.x), O3(t3.y), O3(t3.x + t3.width), O3(t3.y + t3.height)].join(" ") + "]" }), e3.push({ key: "Matrix", value: "[" + t3.matrix.toString() + "]" });
    var r3 = t3.pages[1].join("\n");
    ie2({ data: r3, additionalKeyValues: e3, objectId: t3.objectNumber }), lt2("endobj");
  }, he2 = function() {
    for (var t3 in zt2)
      zt2.hasOwnProperty(t3) && ue2(zt2[t3]);
  }, le2 = function(t3, e3) {
    var r3, n3 = [], i4 = 1 / (e3 - 1);
    for (r3 = 0; r3 < 1; r3 += i4)
      n3.push(r3);
    if (n3.push(1), 0 != t3[0].offset) {
      var a3 = { offset: 0, color: t3[0].color };
      t3.unshift(a3);
    }
    if (1 != t3[t3.length - 1].offset) {
      var o4 = { offset: 1, color: t3[t3.length - 1].color };
      t3.push(o4);
    }
    for (var s4 = "", c5 = 0, u4 = 0; u4 < n3.length; u4++) {
      for (r3 = n3[u4]; r3 > t3[c5 + 1].offset; )
        c5++;
      var h3 = t3[c5].offset, l3 = (r3 - h3) / (t3[c5 + 1].offset - h3), f3 = t3[c5].color, d3 = t3[c5 + 1].color;
      s4 += tt2(Math.round((1 - l3) * f3[0] + l3 * d3[0]).toString(16)) + tt2(Math.round((1 - l3) * f3[1] + l3 * d3[1]).toString(16)) + tt2(Math.round((1 - l3) * f3[2] + l3 * d3[2]).toString(16));
    }
    return s4.trim();
  }, fe2 = function(t3, e3) {
    e3 || (e3 = 21);
    var r3 = Xt2(), n3 = le2(t3.colors, e3), i4 = [];
    i4.push({ key: "FunctionType", value: "0" }), i4.push({ key: "Domain", value: "[0.0 1.0]" }), i4.push({ key: "Size", value: "[" + e3 + "]" }), i4.push({ key: "BitsPerSample", value: "8" }), i4.push({ key: "Range", value: "[0.0 1.0 0.0 1.0 0.0 1.0]" }), i4.push({ key: "Decode", value: "[0.0 1.0 0.0 1.0 0.0 1.0]" }), ie2({ data: n3, additionalKeyValues: i4, alreadyAppliedFilters: ["/ASCIIHexDecode"], objectId: r3 }), lt2("endobj"), t3.objectNumber = Xt2(), lt2("<< /ShadingType " + t3.type), lt2("/ColorSpace /DeviceRGB");
    var a3 = "/Coords [" + O3(parseFloat(t3.coords[0])) + " " + O3(parseFloat(t3.coords[1])) + " ";
    2 === t3.type ? a3 += O3(parseFloat(t3.coords[2])) + " " + O3(parseFloat(t3.coords[3])) : a3 += O3(parseFloat(t3.coords[2])) + " " + O3(parseFloat(t3.coords[3])) + " " + O3(parseFloat(t3.coords[4])) + " " + O3(parseFloat(t3.coords[5])), lt2(a3 += "]"), t3.matrix && lt2("/Matrix [" + t3.matrix.toString() + "]"), lt2("/Function " + r3 + " 0 R"), lt2("/Extend [true true]"), lt2(">>"), lt2("endobj");
  }, de2 = function(t3, e3) {
    var r3 = Kt2(), n3 = Xt2();
    e3.push({ resourcesOid: r3, objectOid: n3 }), t3.objectNumber = n3;
    var i4 = [];
    i4.push({ key: "Type", value: "/Pattern" }), i4.push({ key: "PatternType", value: "1" }), i4.push({ key: "PaintType", value: "1" }), i4.push({ key: "TilingType", value: "1" }), i4.push({ key: "BBox", value: "[" + t3.boundingBox.map(O3).join(" ") + "]" }), i4.push({ key: "XStep", value: O3(t3.xStep) }), i4.push({ key: "YStep", value: O3(t3.yStep) }), i4.push({ key: "Resources", value: r3 + " 0 R" }), t3.matrix && i4.push({ key: "Matrix", value: "[" + t3.matrix.toString() + "]" }), ie2({ data: t3.stream, additionalKeyValues: i4, objectId: t3.objectNumber }), lt2("endobj");
  }, pe2 = function(t3) {
    var e3;
    for (e3 in Ot2)
      Ot2.hasOwnProperty(e3) && (Ot2[e3] instanceof B ? fe2(Ot2[e3]) : Ot2[e3] instanceof M && de2(Ot2[e3], t3));
  }, ge2 = function(t3) {
    for (var e3 in t3.objectNumber = Xt2(), lt2("<<"), t3)
      switch (e3) {
        case "opacity":
          lt2("/ca " + R2(t3[e3]));
          break;
        case "stroke-opacity":
          lt2("/CA " + R2(t3[e3]));
      }
    lt2(">>"), lt2("endobj");
  }, me2 = function() {
    var t3;
    for (t3 in Mt2)
      Mt2.hasOwnProperty(t3) && ge2(Mt2[t3]);
  }, ve2 = function() {
    for (var t3 in lt2("/XObject <<"), zt2)
      zt2.hasOwnProperty(t3) && zt2[t3].objectNumber >= 0 && lt2("/" + t3 + " " + zt2[t3].objectNumber + " 0 R");
    Tt2.publish("putXobjectDict"), lt2(">>");
  }, be2 = function() {
    Ye.oid = Xt2(), lt2("<<"), lt2("/Filter /Standard"), lt2("/V " + Ye.v), lt2("/R " + Ye.r), lt2("/U <" + Ye.toHexString(Ye.U) + ">"), lt2("/O <" + Ye.toHexString(Ye.O) + ">"), lt2("/P " + Ye.P), lt2(">>"), lt2("endobj");
  }, ye2 = function() {
    for (var t3 in lt2("/Font <<"), Ft2)
      Ft2.hasOwnProperty(t3) && (false === v3 || true === v3 && b2.hasOwnProperty(t3)) && lt2("/" + t3 + " " + Ft2[t3].objectNumber + " 0 R");
    lt2(">>");
  }, we2 = function() {
    if (Object.keys(Ot2).length > 0) {
      for (var t3 in lt2("/Shading <<"), Ot2)
        Ot2.hasOwnProperty(t3) && Ot2[t3] instanceof B && Ot2[t3].objectNumber >= 0 && lt2("/" + t3 + " " + Ot2[t3].objectNumber + " 0 R");
      Tt2.publish("putShadingPatternDict"), lt2(">>");
    }
  }, Ne2 = function(t3) {
    if (Object.keys(Ot2).length > 0) {
      for (var e3 in lt2("/Pattern <<"), Ot2)
        Ot2.hasOwnProperty(e3) && Ot2[e3] instanceof y4.TilingPattern && Ot2[e3].objectNumber >= 0 && Ot2[e3].objectNumber < t3 && lt2("/" + e3 + " " + Ot2[e3].objectNumber + " 0 R");
      Tt2.publish("putTilingPatternDict"), lt2(">>");
    }
  }, Le2 = function() {
    if (Object.keys(Mt2).length > 0) {
      var t3;
      for (t3 in lt2("/ExtGState <<"), Mt2)
        Mt2.hasOwnProperty(t3) && Mt2[t3].objectNumber >= 0 && lt2("/" + t3 + " " + Mt2[t3].objectNumber + " 0 R");
      Tt2.publish("putGStateDict"), lt2(">>");
    }
  }, Ae = function(t3) {
    Zt2(t3.resourcesOid, true), lt2("<<"), lt2("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"), ye2(), we2(), Ne2(t3.objectOid), Le2(), ve2(), lt2(">>"), lt2("endobj");
  }, xe = function() {
    var t3 = [];
    ce2(), me2(), he2(), pe2(t3), Tt2.publish("putResources"), t3.forEach(Ae), Ae({ resourcesOid: te2, objectOid: Number.MAX_SAFE_INTEGER }), Tt2.publish("postPutResources");
  }, Se = function() {
    Tt2.publish("putAdditionalObjects");
    for (var t3 = 0; t3 < at2.length; t3++) {
      var e3 = at2[t3];
      Zt2(e3.objId, true), lt2(e3.content), lt2("endobj");
    }
    Tt2.publish("postPutAdditionalObjects");
  }, _e = function(t3) {
    Ct2[t3.fontName] = Ct2[t3.fontName] || {}, Ct2[t3.fontName][t3.fontStyle] = t3.id;
  }, Pe = function(t3, e3, r3, n3, i4) {
    var a3 = { id: "F" + (Object.keys(Ft2).length + 1).toString(10), postScriptName: t3, fontName: e3, fontStyle: r3, encoding: n3, isStandardFont: i4 || false, metadata: {} };
    return Tt2.publish("addFont", { font: a3, instance: this }), Ft2[a3.id] = a3, _e(a3), a3.id;
  }, ke = function(t3) {
    for (var e3 = 0, r3 = pt2.length; e3 < r3; e3++) {
      var n3 = Pe.call(this, t3[e3][0], t3[e3][1], t3[e3][2], pt2[e3][3], true);
      false === v3 && (b2[n3] = true);
      var i4 = t3[e3][0].split("-");
      _e({ id: n3, fontName: i4[0], fontStyle: i4[1] || "" });
    }
    Tt2.publish("addFonts", { fonts: Ft2, dictionary: Ct2 });
  }, Ie = function(t3) {
    return t3.foo = function() {
      try {
        return t3.apply(this, arguments);
      } catch (t4) {
        var e3 = t4.stack || "";
        ~e3.indexOf(" at ") && (e3 = e3.split(" at ")[1]);
        var r3 = "Error in function " + e3.split("\n")[0].split("<")[0] + ": " + t4.message;
        if (!n2.console)
          throw new Error(r3);
        n2.console.error(r3, t4), n2.alert && alert(r3);
      }
    }, t3.foo.bar = t3, t3.foo;
  }, Fe = function(t3, e3) {
    var r3, n3, i4, a3, o4, s4, c5, u4, h3;
    if (i4 = (e3 = e3 || {}).sourceEncoding || "Unicode", o4 = e3.outputEncoding, (e3.autoencode || o4) && Ft2[St2].metadata && Ft2[St2].metadata[i4] && Ft2[St2].metadata[i4].encoding && (a3 = Ft2[St2].metadata[i4].encoding, !o4 && Ft2[St2].encoding && (o4 = Ft2[St2].encoding), !o4 && a3.codePages && (o4 = a3.codePages[0]), "string" == typeof o4 && (o4 = a3[o4]), o4)) {
      for (c5 = false, s4 = [], r3 = 0, n3 = t3.length; r3 < n3; r3++)
        (u4 = o4[t3.charCodeAt(r3)]) ? s4.push(String.fromCharCode(u4)) : s4.push(t3[r3]), s4[r3].charCodeAt(0) >> 8 && (c5 = true);
      t3 = s4.join("");
    }
    for (r3 = t3.length; void 0 === c5 && 0 !== r3; )
      t3.charCodeAt(r3 - 1) >> 8 && (c5 = true), r3--;
    if (!c5)
      return t3;
    for (s4 = e3.noBOM ? [] : [254, 255], r3 = 0, n3 = t3.length; r3 < n3; r3++) {
      if ((h3 = (u4 = t3.charCodeAt(r3)) >> 8) >> 8)
        throw new Error("Character at position " + r3 + " of string '" + t3 + "' exceeds 16bits. Cannot be encoded into UCS-2 BE");
      s4.push(h3), s4.push(u4 - (h3 << 8));
    }
    return String.fromCharCode.apply(void 0, s4);
  }, Ce = y4.__private__.pdfEscape = y4.pdfEscape = function(t3, e3) {
    return Fe(t3, e3).replace(/\\/g, "\\\\").replace(/\(/g, "\\(").replace(/\)/g, "\\)");
  }, je = y4.__private__.beginPage = function(t3) {
    ot2[++Dt2] = [], Rt2[Dt2] = { objId: 0, contentsObjId: 0, userUnit: Number(d2), artBox: null, bleedBox: null, cropBox: null, trimBox: null, mediaBox: { bottomLeftX: 0, bottomLeftY: 0, topRightX: Number(t3[0]), topRightY: Number(t3[1]) } }, Me(Dt2), ht2(ot2[$9]);
  }, Oe = function(t3, e3) {
    var r3, n3, o4;
    switch (i3 = e3 || i3, "string" == typeof t3 && (r3 = A3(t3.toLowerCase()), Array.isArray(r3) && (n3 = r3[0], o4 = r3[1])), Array.isArray(t3) && (n3 = t3[0] * _t2, o4 = t3[1] * _t2), isNaN(n3) && (n3 = s3[0], o4 = s3[1]), (n3 > 14400 || o4 > 14400) && (a2.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"), n3 = Math.min(14400, n3), o4 = Math.min(14400, o4)), s3 = [n3, o4], i3.substr(0, 1)) {
      case "l":
        o4 > n3 && (s3 = [o4, n3]);
        break;
      case "p":
        n3 > o4 && (s3 = [o4, n3]);
    }
    je(s3), pr(fr), lt2(Lr), 0 !== kr && lt2(kr + " J"), 0 !== Ir && lt2(Ir + " j"), Tt2.publish("addPage", { pageNumber: Dt2 });
  }, Be = function(t3) {
    t3 > 0 && t3 <= Dt2 && (ot2.splice(t3, 1), Rt2.splice(t3, 1), Dt2--, $9 > Dt2 && ($9 = Dt2), this.setPage($9));
  }, Me = function(t3) {
    t3 > 0 && t3 <= Dt2 && ($9 = t3);
  }, Ee = y4.__private__.getNumberOfPages = y4.getNumberOfPages = function() {
    return ot2.length - 1;
  }, qe = function(t3, e3, r3) {
    var n3, i4 = void 0;
    return r3 = r3 || {}, t3 = void 0 !== t3 ? t3 : Ft2[St2].fontName, e3 = void 0 !== e3 ? e3 : Ft2[St2].fontStyle, n3 = t3.toLowerCase(), void 0 !== Ct2[n3] && void 0 !== Ct2[n3][e3] ? i4 = Ct2[n3][e3] : void 0 !== Ct2[t3] && void 0 !== Ct2[t3][e3] ? i4 = Ct2[t3][e3] : false === r3.disableWarning && a2.warn("Unable to look up font label for font '" + t3 + "', '" + e3 + "'. Refer to getFontList() for available fonts."), i4 || r3.noFallback || null == (i4 = Ct2.times[e3]) && (i4 = Ct2.times.normal), i4;
  }, De = y4.__private__.putInfo = function() {
    var t3 = Xt2(), e3 = function(t4) {
      return t4;
    };
    for (var r3 in null !== m4 && (e3 = Ye.encryptor(t3, 0)), lt2("<<"), lt2("/Producer (" + Ce(e3("jsPDF " + E.version)) + ")"), xt2)
      xt2.hasOwnProperty(r3) && xt2[r3] && lt2("/" + r3.substr(0, 1).toUpperCase() + r3.substr(1) + " (" + Ce(e3(xt2[r3])) + ")");
    lt2("/CreationDate (" + Ce(e3(W2)) + ")"), lt2(">>"), lt2("endobj");
  }, Re = y4.__private__.putCatalog = function(t3) {
    var e3 = (t3 = t3 || {}).rootDictionaryObjId || Qt2;
    switch (Xt2(), lt2("<<"), lt2("/Type /Catalog"), lt2("/Pages " + e3 + " 0 R"), mt2 || (mt2 = "fullwidth"), mt2) {
      case "fullwidth":
        lt2("/OpenAction [3 0 R /FitH null]");
        break;
      case "fullheight":
        lt2("/OpenAction [3 0 R /FitV null]");
        break;
      case "fullpage":
        lt2("/OpenAction [3 0 R /Fit]");
        break;
      case "original":
        lt2("/OpenAction [3 0 R /XYZ null null 1]");
        break;
      default:
        var r3 = "" + mt2;
        "%" === r3.substr(r3.length - 1) && (mt2 = parseInt(mt2) / 100), "number" == typeof mt2 && lt2("/OpenAction [3 0 R /XYZ null null " + R2(mt2) + "]");
    }
    switch (Nt2 || (Nt2 = "continuous"), Nt2) {
      case "continuous":
        lt2("/PageLayout /OneColumn");
        break;
      case "single":
        lt2("/PageLayout /SinglePage");
        break;
      case "two":
      case "twoleft":
        lt2("/PageLayout /TwoColumnLeft");
        break;
      case "tworight":
        lt2("/PageLayout /TwoColumnRight");
    }
    yt2 && lt2("/PageMode /" + yt2), Tt2.publish("putCatalog"), lt2(">>"), lt2("endobj");
  }, Te = y4.__private__.putTrailer = function() {
    lt2("trailer"), lt2("<<"), lt2("/Size " + (et3 + 1)), lt2("/Root " + et3 + " 0 R"), lt2("/Info " + (et3 - 1) + " 0 R"), null !== m4 && lt2("/Encrypt " + Ye.oid + " 0 R"), lt2("/ID [ <" + V2 + "> <" + V2 + "> ]"), lt2(">>");
  }, Ue = y4.__private__.putHeader = function() {
    lt2("%PDF-" + w2), lt2("%\xBA\xDF\xAC\xE0");
  }, ze = y4.__private__.putXRef = function() {
    var t3 = "0000000000";
    lt2("xref"), lt2("0 " + (et3 + 1)), lt2("0000000000 65535 f ");
    for (var e3 = 1; e3 <= et3; e3++) {
      "function" == typeof rt2[e3] ? lt2((t3 + rt2[e3]()).slice(-10) + " 00000 n ") : void 0 !== rt2[e3] ? lt2((t3 + rt2[e3]).slice(-10) + " 00000 n ") : lt2("0000000000 00000 n ");
    }
  }, He = y4.__private__.buildDocument = function() {
    ut2(), ht2(nt2), Tt2.publish("buildDocument"), Ue(), oe2(), Se(), xe(), null !== m4 && be2(), De(), Re();
    var t3 = it2;
    return ze(), Te(), lt2("startxref"), lt2("" + t3), lt2("%%EOF"), ht2(ot2[$9]), nt2.join("\n");
  }, We = y4.__private__.getBlob = function(t3) {
    return new Blob([dt2(t3)], { type: "application/pdf" });
  }, Ve = y4.output = y4.__private__.output = Ie(function(t3, e3) {
    switch ("string" == typeof (e3 = e3 || {}) ? e3 = { filename: e3 } : e3.filename = e3.filename || "generated.pdf", t3) {
      case void 0:
        return He();
      case "save":
        y4.save(e3.filename);
        break;
      case "arraybuffer":
        return dt2(He());
      case "blob":
        return We(He());
      case "bloburi":
      case "bloburl":
        if (void 0 !== n2.URL && "function" == typeof n2.URL.createObjectURL)
          return n2.URL && n2.URL.createObjectURL(We(He())) || void 0;
        a2.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");
        break;
      case "datauristring":
      case "dataurlstring":
        var r3 = "", i4 = He();
        try {
          r3 = h2(i4);
        } catch (t4) {
          r3 = h2(unescape(encodeURIComponent(i4)));
        }
        return "data:application/pdf;filename=" + e3.filename + ";base64," + r3;
      case "pdfobjectnewwindow":
        if ("[object Window]" === Object.prototype.toString.call(n2)) {
          var o4 = "https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js", s4 = ' integrity="sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==" crossorigin="anonymous"';
          e3.pdfObjectUrl && (o4 = e3.pdfObjectUrl, s4 = "");
          var c5 = '<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;}  </style><body><script src="' + o4 + '"' + s4 + '><\/script><script >PDFObject.embed("' + this.output("dataurlstring") + '", ' + JSON.stringify(e3) + ");<\/script></body></html>", u4 = n2.open();
          return null !== u4 && u4.document.write(c5), u4;
        }
        throw new Error("The option pdfobjectnewwindow just works in a browser-environment.");
      case "pdfjsnewwindow":
        if ("[object Window]" === Object.prototype.toString.call(n2)) {
          var l3 = '<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;}  </style><body><iframe id="pdfViewer" src="' + (e3.pdfJsUrl || "examples/PDF.js/web/viewer.html") + "?file=&downloadName=" + e3.filename + '" width="500px" height="400px" /></body></html>', f3 = n2.open();
          if (null !== f3) {
            f3.document.write(l3);
            var d3 = this;
            f3.document.documentElement.querySelector("#pdfViewer").onload = function() {
              f3.document.title = e3.filename, f3.document.documentElement.querySelector("#pdfViewer").contentWindow.PDFViewerApplication.open(d3.output("bloburl"));
            };
          }
          return f3;
        }
        throw new Error("The option pdfjsnewwindow just works in a browser-environment.");
      case "dataurlnewwindow":
        if ("[object Window]" !== Object.prototype.toString.call(n2))
          throw new Error("The option dataurlnewwindow just works in a browser-environment.");
        var p4 = '<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;}  </style><body><iframe src="' + this.output("datauristring", e3) + '"></iframe></body></html>', g3 = n2.open();
        if (null !== g3 && (g3.document.write(p4), g3.document.title = e3.filename), g3 || "undefined" == typeof safari)
          return g3;
        break;
      case "datauri":
      case "dataurl":
        return n2.document.location.href = this.output("datauristring", e3);
      default:
        return null;
    }
  }), Ge = function(t3) {
    return true === Array.isArray(Ut2) && Ut2.indexOf(t3) > -1;
  };
  switch (o3) {
    case "pt":
      _t2 = 1;
      break;
    case "mm":
      _t2 = 72 / 25.4;
      break;
    case "cm":
      _t2 = 72 / 2.54;
      break;
    case "in":
      _t2 = 72;
      break;
    case "px":
      _t2 = 1 == Ge("px_scaling") ? 0.75 : 96 / 72;
      break;
    case "pc":
    case "em":
      _t2 = 12;
      break;
    case "ex":
      _t2 = 6;
      break;
    default:
      if ("number" != typeof o3)
        throw new Error("Invalid unit: " + o3);
      _t2 = o3;
  }
  var Ye = null;
  K2(), Y2();
  var Je = function(t3) {
    return null !== m4 ? Ye.encryptor(t3, 0) : function(t4) {
      return t4;
    };
  }, Xe = y4.__private__.getPageInfo = y4.getPageInfo = function(t3) {
    if (isNaN(t3) || t3 % 1 != 0)
      throw new Error("Invalid argument passed to jsPDF.getPageInfo");
    return { objId: Rt2[t3].objId, pageNumber: t3, pageContext: Rt2[t3] };
  }, Ke = y4.__private__.getPageInfoByObjId = function(t3) {
    if (isNaN(t3) || t3 % 1 != 0)
      throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");
    for (var e3 in Rt2)
      if (Rt2[e3].objId === t3)
        break;
    return Xe(e3);
  }, Ze = y4.__private__.getCurrentPageInfo = y4.getCurrentPageInfo = function() {
    return { objId: Rt2[$9].objId, pageNumber: $9, pageContext: Rt2[$9] };
  };
  y4.addPage = function() {
    return Oe.apply(this, arguments), this;
  }, y4.setPage = function() {
    return Me.apply(this, arguments), ht2.call(this, ot2[$9]), this;
  }, y4.insertPage = function(t3) {
    return this.addPage(), this.movePage($9, t3), this;
  }, y4.movePage = function(t3, e3) {
    var r3, n3;
    if (t3 > e3) {
      r3 = ot2[t3], n3 = Rt2[t3];
      for (var i4 = t3; i4 > e3; i4--)
        ot2[i4] = ot2[i4 - 1], Rt2[i4] = Rt2[i4 - 1];
      ot2[e3] = r3, Rt2[e3] = n3, this.setPage(e3);
    } else if (t3 < e3) {
      r3 = ot2[t3], n3 = Rt2[t3];
      for (var a3 = t3; a3 < e3; a3++)
        ot2[a3] = ot2[a3 + 1], Rt2[a3] = Rt2[a3 + 1];
      ot2[e3] = r3, Rt2[e3] = n3, this.setPage(e3);
    }
    return this;
  }, y4.deletePage = function() {
    return Be.apply(this, arguments), this;
  }, y4.__private__.text = y4.text = function(e3, r3, n3, i4, a3) {
    var o4, s4, c5, u4, h3, l3, f3, d3, p4, g3 = (i4 = i4 || {}).scope || this;
    if ("number" == typeof e3 && "number" == typeof r3 && ("string" == typeof n3 || Array.isArray(n3))) {
      var m5 = n3;
      n3 = r3, r3 = e3, e3 = m5;
    }
    if (arguments[3] instanceof Vt2 == false ? (c5 = arguments[4], u4 = arguments[5], "object" === _typeof(f3 = arguments[3]) && null !== f3 || ("string" == typeof c5 && (u4 = c5, c5 = null), "string" == typeof f3 && (u4 = f3, f3 = null), "number" == typeof f3 && (c5 = f3, f3 = null), i4 = { flags: f3, angle: c5, align: u4 })) : (q2("The transform parameter of text() with a Matrix value"), p4 = a3), isNaN(r3) || isNaN(n3) || null == e3)
      throw new Error("Invalid arguments passed to jsPDF.text");
    if (0 === e3.length)
      return g3;
    var v5 = "", y5 = false, w3 = "number" == typeof i4.lineHeightFactor ? i4.lineHeightFactor : lr, N4 = g3.internal.scaleFactor;
    function L3(t3) {
      return t3 = t3.split("	").join(Array(i4.TabLen || 9).join(" ")), Ce(t3, f3);
    }
    function A4(t3) {
      for (var e4, r4 = t3.concat(), n4 = [], i5 = r4.length; i5--; )
        "string" == typeof (e4 = r4.shift()) ? n4.push(e4) : Array.isArray(t3) && (1 === e4.length || void 0 === e4[1] && void 0 === e4[2]) ? n4.push(e4[0]) : n4.push([e4[0], e4[1], e4[2]]);
      return n4;
    }
    function _4(t3, e4) {
      var r4;
      if ("string" == typeof t3)
        r4 = e4(t3)[0];
      else if (Array.isArray(t3)) {
        for (var n4, i5, a4 = t3.concat(), o5 = [], s5 = a4.length; s5--; )
          "string" == typeof (n4 = a4.shift()) ? o5.push(e4(n4)[0]) : Array.isArray(n4) && "string" == typeof n4[0] && (i5 = e4(n4[0], n4[1], n4[2]), o5.push([i5[0], i5[1], i5[2]]));
        r4 = o5;
      }
      return r4;
    }
    var P3 = false, k3 = true;
    if ("string" == typeof e3)
      P3 = true;
    else if (Array.isArray(e3)) {
      var I2 = e3.concat();
      s4 = [];
      for (var F2, C2 = I2.length; C2--; )
        ("string" != typeof (F2 = I2.shift()) || Array.isArray(F2) && "string" != typeof F2[0]) && (k3 = false);
      P3 = k3;
    }
    if (false === P3)
      throw new Error('Type of text must be string or Array. "' + e3 + '" is not recognized.');
    "string" == typeof e3 && (e3 = e3.match(/[\r?\n]/) ? e3.split(/\r\n|\r|\n/g) : [e3]);
    var j2 = gt2 / g3.internal.scaleFactor, B2 = j2 * (w3 - 1);
    switch (i4.baseline) {
      case "bottom":
        n3 -= B2;
        break;
      case "top":
        n3 += j2 - B2;
        break;
      case "hanging":
        n3 += j2 - 2 * B2;
        break;
      case "middle":
        n3 += j2 / 2 - B2;
    }
    if ((l3 = i4.maxWidth || 0) > 0 && ("string" == typeof e3 ? e3 = g3.splitTextToSize(e3, l3) : "[object Array]" === Object.prototype.toString.call(e3) && (e3 = e3.reduce(function(t3, e4) {
      return t3.concat(g3.splitTextToSize(e4, l3));
    }, []))), o4 = { text: e3, x: r3, y: n3, options: i4, mutex: { pdfEscape: Ce, activeFontKey: St2, fonts: Ft2, activeFontSize: gt2 } }, Tt2.publish("preProcessText", o4), e3 = o4.text, c5 = (i4 = o4.options).angle, p4 instanceof Vt2 == false && c5 && "number" == typeof c5) {
      c5 *= Math.PI / 180, 0 === i4.rotationDirection && (c5 = -c5), S2 === x3.ADVANCED && (c5 = -c5);
      var M2 = Math.cos(c5), E2 = Math.sin(c5);
      p4 = new Vt2(M2, E2, -E2, M2, 0, 0);
    } else
      c5 && c5 instanceof Vt2 && (p4 = c5);
    S2 !== x3.ADVANCED || p4 || (p4 = Yt2), void 0 !== (h3 = i4.charSpace || _r) && (v5 += O3(U2(h3)) + " Tc\n", this.setCharSpace(this.getCharSpace() || 0)), void 0 !== (d3 = i4.horizontalScale) && (v5 += O3(100 * d3) + " Tz\n");
    i4.lang;
    var D3 = -1, R3 = void 0 !== i4.renderingMode ? i4.renderingMode : i4.stroke, T4 = g3.internal.getCurrentPageInfo().pageContext;
    switch (R3) {
      case 0:
      case false:
      case "fill":
        D3 = 0;
        break;
      case 1:
      case true:
      case "stroke":
        D3 = 1;
        break;
      case 2:
      case "fillThenStroke":
        D3 = 2;
        break;
      case 3:
      case "invisible":
        D3 = 3;
        break;
      case 4:
      case "fillAndAddForClipping":
        D3 = 4;
        break;
      case 5:
      case "strokeAndAddPathForClipping":
        D3 = 5;
        break;
      case 6:
      case "fillThenStrokeAndAddToPathForClipping":
        D3 = 6;
        break;
      case 7:
      case "addToPathForClipping":
        D3 = 7;
    }
    var z3 = void 0 !== T4.usedRenderingMode ? T4.usedRenderingMode : -1;
    -1 !== D3 ? v5 += D3 + " Tr\n" : -1 !== z3 && (v5 += "0 Tr\n"), -1 !== D3 && (T4.usedRenderingMode = D3), u4 = i4.align || "left";
    var H3, W3 = gt2 * w3, V3 = g3.internal.pageSize.getWidth(), G4 = Ft2[St2];
    h3 = i4.charSpace || _r, l3 = i4.maxWidth || 0, f3 = Object.assign({ autoencode: true, noBOM: true }, i4.flags);
    var Y3 = [];
    if ("[object Array]" === Object.prototype.toString.call(e3)) {
      var J3;
      s4 = A4(e3), "left" !== u4 && (H3 = s4.map(function(t3) {
        return g3.getStringUnitWidth(t3, { font: G4, charSpace: h3, fontSize: gt2, doKerning: false }) * gt2 / N4;
      }));
      var X3, K3 = 0;
      if ("right" === u4) {
        r3 -= H3[0], e3 = [], C2 = s4.length;
        for (var Z3 = 0; Z3 < C2; Z3++)
          0 === Z3 ? (X3 = br(r3), J3 = yr(n3)) : (X3 = U2(K3 - H3[Z3]), J3 = -W3), e3.push([s4[Z3], X3, J3]), K3 = H3[Z3];
      } else if ("center" === u4) {
        r3 -= H3[0] / 2, e3 = [], C2 = s4.length;
        for (var $10 = 0; $10 < C2; $10++)
          0 === $10 ? (X3 = br(r3), J3 = yr(n3)) : (X3 = U2((K3 - H3[$10]) / 2), J3 = -W3), e3.push([s4[$10], X3, J3]), K3 = H3[$10];
      } else if ("left" === u4) {
        e3 = [], C2 = s4.length;
        for (var Q3 = 0; Q3 < C2; Q3++)
          e3.push(s4[Q3]);
      } else {
        if ("justify" !== u4)
          throw new Error('Unrecognized alignment option, use "left", "center", "right" or "justify".');
        e3 = [], C2 = s4.length, l3 = 0 !== l3 ? l3 : V3;
        for (var tt3 = 0; tt3 < C2; tt3++)
          J3 = 0 === tt3 ? yr(n3) : -W3, X3 = 0 === tt3 ? br(r3) : 0, tt3 < C2 - 1 ? Y3.push(O3(U2((l3 - H3[tt3]) / (s4[tt3].split(" ").length - 1)))) : Y3.push(0), e3.push([s4[tt3], X3, J3]);
      }
    }
    var et4 = "boolean" == typeof i4.R2L ? i4.R2L : bt2;
    true === et4 && (e3 = _4(e3, function(t3, e4, r4) {
      return [t3.split("").reverse().join(""), e4, r4];
    })), o4 = { text: e3, x: r3, y: n3, options: i4, mutex: { pdfEscape: Ce, activeFontKey: St2, fonts: Ft2, activeFontSize: gt2 } }, Tt2.publish("postProcessText", o4), e3 = o4.text, y5 = o4.mutex.isHex || false;
    var rt3 = Ft2[St2].encoding;
    "WinAnsiEncoding" !== rt3 && "StandardEncoding" !== rt3 || (e3 = _4(e3, function(t3, e4, r4) {
      return [L3(t3), e4, r4];
    })), s4 = A4(e3), e3 = [];
    for (var nt3, it3, at3, ot3 = 0, st3 = 1, ct3 = Array.isArray(s4[0]) ? st3 : ot3, ut3 = "", ht3 = function(t3, e4, r4) {
      var n4 = "";
      return r4 instanceof Vt2 ? (r4 = "number" == typeof i4.angle ? Gt2(r4, new Vt2(1, 0, 0, 1, t3, e4)) : Gt2(new Vt2(1, 0, 0, 1, t3, e4), r4), S2 === x3.ADVANCED && (r4 = Gt2(new Vt2(1, 0, 0, -1, 0, 0), r4)), n4 = r4.join(" ") + " Tm\n") : n4 = O3(t3) + " " + O3(e4) + " Td\n", n4;
    }, ft3 = 0; ft3 < s4.length; ft3++) {
      switch (ut3 = "", ct3) {
        case st3:
          at3 = (y5 ? "<" : "(") + s4[ft3][0] + (y5 ? ">" : ")"), nt3 = parseFloat(s4[ft3][1]), it3 = parseFloat(s4[ft3][2]);
          break;
        case ot3:
          at3 = (y5 ? "<" : "(") + s4[ft3] + (y5 ? ">" : ")"), nt3 = br(r3), it3 = yr(n3);
      }
      void 0 !== Y3 && void 0 !== Y3[ft3] && (ut3 = Y3[ft3] + " Tw\n"), 0 === ft3 ? e3.push(ut3 + ht3(nt3, it3, p4) + at3) : ct3 === ot3 ? e3.push(ut3 + at3) : ct3 === st3 && e3.push(ut3 + ht3(nt3, it3, p4) + at3);
    }
    e3 = ct3 === ot3 ? e3.join(" Tj\nT* ") : e3.join(" Tj\n"), e3 += " Tj\n";
    var dt3 = "BT\n/";
    return dt3 += St2 + " " + gt2 + " Tf\n", dt3 += O3(gt2 * w3) + " TL\n", dt3 += xr + "\n", dt3 += v5, dt3 += e3, lt2(dt3 += "ET"), b2[St2] = true, g3;
  };
  var $e = y4.__private__.clip = y4.clip = function(t3) {
    return lt2("evenodd" === t3 ? "W*" : "W"), this;
  };
  y4.clipEvenOdd = function() {
    return $e("evenodd");
  }, y4.__private__.discardPath = y4.discardPath = function() {
    return lt2("n"), this;
  };
  var Qe = y4.__private__.isValidStyle = function(t3) {
    var e3 = false;
    return -1 !== [void 0, null, "S", "D", "F", "DF", "FD", "f", "f*", "B", "B*", "n"].indexOf(t3) && (e3 = true), e3;
  };
  y4.__private__.setDefaultPathOperation = y4.setDefaultPathOperation = function(t3) {
    return Qe(t3) && (g2 = t3), this;
  };
  var tr = y4.__private__.getStyle = y4.getStyle = function(t3) {
    var e3 = g2;
    switch (t3) {
      case "D":
      case "S":
        e3 = "S";
        break;
      case "F":
        e3 = "f";
        break;
      case "FD":
      case "DF":
        e3 = "B";
        break;
      case "f":
      case "f*":
      case "B":
      case "B*":
        e3 = t3;
    }
    return e3;
  }, er = y4.close = function() {
    return lt2("h"), this;
  };
  y4.stroke = function() {
    return lt2("S"), this;
  }, y4.fill = function(t3) {
    return rr("f", t3), this;
  }, y4.fillEvenOdd = function(t3) {
    return rr("f*", t3), this;
  }, y4.fillStroke = function(t3) {
    return rr("B", t3), this;
  }, y4.fillStrokeEvenOdd = function(t3) {
    return rr("B*", t3), this;
  };
  var rr = function(e3, r3) {
    "object" === _typeof(r3) ? ar(r3, e3) : lt2(e3);
  }, nr = function(t3) {
    null === t3 || S2 === x3.ADVANCED && void 0 === t3 || (t3 = tr(t3), lt2(t3));
  };
  function ir(t3, e3, r3, n3, i4) {
    var a3 = new M(e3 || this.boundingBox, r3 || this.xStep, n3 || this.yStep, this.gState, i4 || this.matrix);
    a3.stream = this.stream;
    var o4 = t3 + "$$" + this.cloneIndex++ + "$$";
    return Jt2(o4, a3), a3;
  }
  var ar = function(t3, e3) {
    var r3 = Bt2[t3.key], n3 = Ot2[r3];
    if (n3 instanceof B)
      lt2("q"), lt2(or(e3)), n3.gState && y4.setGState(n3.gState), lt2(t3.matrix.toString() + " cm"), lt2("/" + r3 + " sh"), lt2("Q");
    else if (n3 instanceof M) {
      var i4 = new Vt2(1, 0, 0, -1, 0, Rr());
      t3.matrix && (i4 = i4.multiply(t3.matrix || Yt2), r3 = ir.call(n3, t3.key, t3.boundingBox, t3.xStep, t3.yStep, i4).id), lt2("q"), lt2("/Pattern cs"), lt2("/" + r3 + " scn"), n3.gState && y4.setGState(n3.gState), lt2(e3), lt2("Q");
    }
  }, or = function(t3) {
    switch (t3) {
      case "f":
      case "F":
        return "W n";
      case "f*":
        return "W* n";
      case "B":
        return "W S";
      case "B*":
        return "W* S";
      case "S":
        return "W S";
      case "n":
        return "W n";
    }
  }, sr = y4.moveTo = function(t3, e3) {
    return lt2(O3(U2(t3)) + " " + O3(H2(e3)) + " m"), this;
  }, cr = y4.lineTo = function(t3, e3) {
    return lt2(O3(U2(t3)) + " " + O3(H2(e3)) + " l"), this;
  }, ur = y4.curveTo = function(t3, e3, r3, n3, i4, a3) {
    return lt2([O3(U2(t3)), O3(H2(e3)), O3(U2(r3)), O3(H2(n3)), O3(U2(i4)), O3(H2(a3)), "c"].join(" ")), this;
  };
  y4.__private__.line = y4.line = function(t3, e3, r3, n3, i4) {
    if (isNaN(t3) || isNaN(e3) || isNaN(r3) || isNaN(n3) || !Qe(i4))
      throw new Error("Invalid arguments passed to jsPDF.line");
    return S2 === x3.COMPAT ? this.lines([[r3 - t3, n3 - e3]], t3, e3, [1, 1], i4 || "S") : this.lines([[r3 - t3, n3 - e3]], t3, e3, [1, 1]).stroke();
  }, y4.__private__.lines = y4.lines = function(t3, e3, r3, n3, i4, a3) {
    var o4, s4, c5, u4, h3, l3, f3, d3, p4, g3, m5, v5;
    if ("number" == typeof t3 && (v5 = r3, r3 = e3, e3 = t3, t3 = v5), n3 = n3 || [1, 1], a3 = a3 || false, isNaN(e3) || isNaN(r3) || !Array.isArray(t3) || !Array.isArray(n3) || !Qe(i4) || "boolean" != typeof a3)
      throw new Error("Invalid arguments passed to jsPDF.lines");
    for (sr(e3, r3), o4 = n3[0], s4 = n3[1], u4 = t3.length, g3 = e3, m5 = r3, c5 = 0; c5 < u4; c5++)
      2 === (h3 = t3[c5]).length ? (g3 = h3[0] * o4 + g3, m5 = h3[1] * s4 + m5, cr(g3, m5)) : (l3 = h3[0] * o4 + g3, f3 = h3[1] * s4 + m5, d3 = h3[2] * o4 + g3, p4 = h3[3] * s4 + m5, g3 = h3[4] * o4 + g3, m5 = h3[5] * s4 + m5, ur(l3, f3, d3, p4, g3, m5));
    return a3 && er(), nr(i4), this;
  }, y4.path = function(t3) {
    for (var e3 = 0; e3 < t3.length; e3++) {
      var r3 = t3[e3], n3 = r3.c;
      switch (r3.op) {
        case "m":
          sr(n3[0], n3[1]);
          break;
        case "l":
          cr(n3[0], n3[1]);
          break;
        case "c":
          ur.apply(this, n3);
          break;
        case "h":
          er();
      }
    }
    return this;
  }, y4.__private__.rect = y4.rect = function(t3, e3, r3, n3, i4) {
    if (isNaN(t3) || isNaN(e3) || isNaN(r3) || isNaN(n3) || !Qe(i4))
      throw new Error("Invalid arguments passed to jsPDF.rect");
    return S2 === x3.COMPAT && (n3 = -n3), lt2([O3(U2(t3)), O3(H2(e3)), O3(U2(r3)), O3(U2(n3)), "re"].join(" ")), nr(i4), this;
  }, y4.__private__.triangle = y4.triangle = function(t3, e3, r3, n3, i4, a3, o4) {
    if (isNaN(t3) || isNaN(e3) || isNaN(r3) || isNaN(n3) || isNaN(i4) || isNaN(a3) || !Qe(o4))
      throw new Error("Invalid arguments passed to jsPDF.triangle");
    return this.lines([[r3 - t3, n3 - e3], [i4 - r3, a3 - n3], [t3 - i4, e3 - a3]], t3, e3, [1, 1], o4, true), this;
  }, y4.__private__.roundedRect = y4.roundedRect = function(t3, e3, r3, n3, i4, a3, o4) {
    if (isNaN(t3) || isNaN(e3) || isNaN(r3) || isNaN(n3) || isNaN(i4) || isNaN(a3) || !Qe(o4))
      throw new Error("Invalid arguments passed to jsPDF.roundedRect");
    var s4 = 4 / 3 * (Math.SQRT2 - 1);
    return i4 = Math.min(i4, 0.5 * r3), a3 = Math.min(a3, 0.5 * n3), this.lines([[r3 - 2 * i4, 0], [i4 * s4, 0, i4, a3 - a3 * s4, i4, a3], [0, n3 - 2 * a3], [0, a3 * s4, -i4 * s4, a3, -i4, a3], [2 * i4 - r3, 0], [-i4 * s4, 0, -i4, -a3 * s4, -i4, -a3], [0, 2 * a3 - n3], [0, -a3 * s4, i4 * s4, -a3, i4, -a3]], t3 + i4, e3, [1, 1], o4, true), this;
  }, y4.__private__.ellipse = y4.ellipse = function(t3, e3, r3, n3, i4) {
    if (isNaN(t3) || isNaN(e3) || isNaN(r3) || isNaN(n3) || !Qe(i4))
      throw new Error("Invalid arguments passed to jsPDF.ellipse");
    var a3 = 4 / 3 * (Math.SQRT2 - 1) * r3, o4 = 4 / 3 * (Math.SQRT2 - 1) * n3;
    return sr(t3 + r3, e3), ur(t3 + r3, e3 - o4, t3 + a3, e3 - n3, t3, e3 - n3), ur(t3 - a3, e3 - n3, t3 - r3, e3 - o4, t3 - r3, e3), ur(t3 - r3, e3 + o4, t3 - a3, e3 + n3, t3, e3 + n3), ur(t3 + a3, e3 + n3, t3 + r3, e3 + o4, t3 + r3, e3), nr(i4), this;
  }, y4.__private__.circle = y4.circle = function(t3, e3, r3, n3) {
    if (isNaN(t3) || isNaN(e3) || isNaN(r3) || !Qe(n3))
      throw new Error("Invalid arguments passed to jsPDF.circle");
    return this.ellipse(t3, e3, r3, r3, n3);
  }, y4.setFont = function(t3, e3, r3) {
    return r3 && (e3 = k2(e3, r3)), St2 = qe(t3, e3, { disableWarning: false }), this;
  };
  var hr = y4.__private__.getFont = y4.getFont = function() {
    return Ft2[qe.apply(y4, arguments)];
  };
  y4.__private__.getFontList = y4.getFontList = function() {
    var t3, e3, r3 = {};
    for (t3 in Ct2)
      if (Ct2.hasOwnProperty(t3))
        for (e3 in r3[t3] = [], Ct2[t3])
          Ct2[t3].hasOwnProperty(e3) && r3[t3].push(e3);
    return r3;
  }, y4.addFont = function(t3, e3, r3, n3, i4) {
    var a3 = ["StandardEncoding", "MacRomanEncoding", "Identity-H", "WinAnsiEncoding"];
    return arguments[3] && -1 !== a3.indexOf(arguments[3]) ? i4 = arguments[3] : arguments[3] && -1 == a3.indexOf(arguments[3]) && (r3 = k2(r3, n3)), i4 = i4 || "Identity-H", Pe.call(this, t3, e3, r3, i4);
  };
  var lr, fr = e2.lineWidth || 0.200025, dr = y4.__private__.getLineWidth = y4.getLineWidth = function() {
    return fr;
  }, pr = y4.__private__.setLineWidth = y4.setLineWidth = function(t3) {
    return fr = t3, lt2(O3(U2(t3)) + " w"), this;
  };
  y4.__private__.setLineDash = E.API.setLineDash = E.API.setLineDashPattern = function(t3, e3) {
    if (t3 = t3 || [], e3 = e3 || 0, isNaN(e3) || !Array.isArray(t3))
      throw new Error("Invalid arguments passed to jsPDF.setLineDash");
    return t3 = t3.map(function(t4) {
      return O3(U2(t4));
    }).join(" "), e3 = O3(U2(e3)), lt2("[" + t3 + "] " + e3 + " d"), this;
  };
  var gr = y4.__private__.getLineHeight = y4.getLineHeight = function() {
    return gt2 * lr;
  };
  y4.__private__.getLineHeight = y4.getLineHeight = function() {
    return gt2 * lr;
  };
  var mr = y4.__private__.setLineHeightFactor = y4.setLineHeightFactor = function(t3) {
    return "number" == typeof (t3 = t3 || 1.15) && (lr = t3), this;
  }, vr = y4.__private__.getLineHeightFactor = y4.getLineHeightFactor = function() {
    return lr;
  };
  mr(e2.lineHeight);
  var br = y4.__private__.getHorizontalCoordinate = function(t3) {
    return U2(t3);
  }, yr = y4.__private__.getVerticalCoordinate = function(t3) {
    return S2 === x3.ADVANCED ? t3 : Rt2[$9].mediaBox.topRightY - Rt2[$9].mediaBox.bottomLeftY - U2(t3);
  }, wr = y4.__private__.getHorizontalCoordinateString = y4.getHorizontalCoordinateString = function(t3) {
    return O3(br(t3));
  }, Nr = y4.__private__.getVerticalCoordinateString = y4.getVerticalCoordinateString = function(t3) {
    return O3(yr(t3));
  }, Lr = e2.strokeColor || "0 G";
  y4.__private__.getStrokeColor = y4.getDrawColor = function() {
    return ee2(Lr);
  }, y4.__private__.setStrokeColor = y4.setDrawColor = function(t3, e3, r3, n3) {
    return Lr = re2({ ch1: t3, ch2: e3, ch3: r3, ch4: n3, pdfColorType: "draw", precision: 2 }), lt2(Lr), this;
  };
  var Ar = e2.fillColor || "0 g";
  y4.__private__.getFillColor = y4.getFillColor = function() {
    return ee2(Ar);
  }, y4.__private__.setFillColor = y4.setFillColor = function(t3, e3, r3, n3) {
    return Ar = re2({ ch1: t3, ch2: e3, ch3: r3, ch4: n3, pdfColorType: "fill", precision: 2 }), lt2(Ar), this;
  };
  var xr = e2.textColor || "0 g", Sr = y4.__private__.getTextColor = y4.getTextColor = function() {
    return ee2(xr);
  };
  y4.__private__.setTextColor = y4.setTextColor = function(t3, e3, r3, n3) {
    return xr = re2({ ch1: t3, ch2: e3, ch3: r3, ch4: n3, pdfColorType: "text", precision: 3 }), this;
  };
  var _r = e2.charSpace, Pr = y4.__private__.getCharSpace = y4.getCharSpace = function() {
    return parseFloat(_r || 0);
  };
  y4.__private__.setCharSpace = y4.setCharSpace = function(t3) {
    if (isNaN(t3))
      throw new Error("Invalid argument passed to jsPDF.setCharSpace");
    return _r = t3, this;
  };
  var kr = 0;
  y4.CapJoinStyles = { 0: 0, butt: 0, but: 0, miter: 0, 1: 1, round: 1, rounded: 1, circle: 1, 2: 2, projecting: 2, project: 2, square: 2, bevel: 2 }, y4.__private__.setLineCap = y4.setLineCap = function(t3) {
    var e3 = y4.CapJoinStyles[t3];
    if (void 0 === e3)
      throw new Error("Line cap style of '" + t3 + "' is not recognized. See or extend .CapJoinStyles property for valid styles");
    return kr = e3, lt2(e3 + " J"), this;
  };
  var Ir = 0;
  y4.__private__.setLineJoin = y4.setLineJoin = function(t3) {
    var e3 = y4.CapJoinStyles[t3];
    if (void 0 === e3)
      throw new Error("Line join style of '" + t3 + "' is not recognized. See or extend .CapJoinStyles property for valid styles");
    return Ir = e3, lt2(e3 + " j"), this;
  }, y4.__private__.setLineMiterLimit = y4.__private__.setMiterLimit = y4.setLineMiterLimit = y4.setMiterLimit = function(t3) {
    if (t3 = t3 || 0, isNaN(t3))
      throw new Error("Invalid argument passed to jsPDF.setLineMiterLimit");
    return lt2(O3(U2(t3)) + " M"), this;
  }, y4.GState = j, y4.setGState = function(t3) {
    (t3 = "string" == typeof t3 ? Mt2[Et2[t3]] : Fr(null, t3)).equals(qt2) || (lt2("/" + t3.id + " gs"), qt2 = t3);
  };
  var Fr = function(t3, e3) {
    if (!t3 || !Et2[t3]) {
      var r3 = false;
      for (var n3 in Mt2)
        if (Mt2.hasOwnProperty(n3) && Mt2[n3].equals(e3)) {
          r3 = true;
          break;
        }
      if (r3)
        e3 = Mt2[n3];
      else {
        var i4 = "GS" + (Object.keys(Mt2).length + 1).toString(10);
        Mt2[i4] = e3, e3.id = i4;
      }
      return t3 && (Et2[t3] = e3.id), Tt2.publish("addGState", e3), e3;
    }
  };
  y4.addGState = function(t3, e3) {
    return Fr(t3, e3), this;
  }, y4.saveGraphicsState = function() {
    return lt2("q"), jt2.push({ key: St2, size: gt2, color: xr }), this;
  }, y4.restoreGraphicsState = function() {
    lt2("Q");
    var t3 = jt2.pop();
    return St2 = t3.key, gt2 = t3.size, xr = t3.color, qt2 = null, this;
  }, y4.setCurrentTransformationMatrix = function(t3) {
    return lt2(t3.toString() + " cm"), this;
  }, y4.comment = function(t3) {
    return lt2("#" + t3), this;
  };
  var Cr = function(t3, e3) {
    var r3 = t3 || 0;
    Object.defineProperty(this, "x", { enumerable: true, get: function() {
      return r3;
    }, set: function(t4) {
      isNaN(t4) || (r3 = parseFloat(t4));
    } });
    var n3 = e3 || 0;
    Object.defineProperty(this, "y", { enumerable: true, get: function() {
      return n3;
    }, set: function(t4) {
      isNaN(t4) || (n3 = parseFloat(t4));
    } });
    var i4 = "pt";
    return Object.defineProperty(this, "type", { enumerable: true, get: function() {
      return i4;
    }, set: function(t4) {
      i4 = t4.toString();
    } }), this;
  }, jr = function(t3, e3, r3, n3) {
    Cr.call(this, t3, e3), this.type = "rect";
    var i4 = r3 || 0;
    Object.defineProperty(this, "w", { enumerable: true, get: function() {
      return i4;
    }, set: function(t4) {
      isNaN(t4) || (i4 = parseFloat(t4));
    } });
    var a3 = n3 || 0;
    return Object.defineProperty(this, "h", { enumerable: true, get: function() {
      return a3;
    }, set: function(t4) {
      isNaN(t4) || (a3 = parseFloat(t4));
    } }), this;
  }, Or = function() {
    this.page = Dt2, this.currentPage = $9, this.pages = ot2.slice(0), this.pagesContext = Rt2.slice(0), this.x = Pt2, this.y = kt2, this.matrix = It2, this.width = qr($9), this.height = Rr($9), this.outputDestination = ct2, this.id = "", this.objectNumber = -1;
  };
  Or.prototype.restore = function() {
    Dt2 = this.page, $9 = this.currentPage, Rt2 = this.pagesContext, ot2 = this.pages, Pt2 = this.x, kt2 = this.y, It2 = this.matrix, Dr($9, this.width), Tr($9, this.height), ct2 = this.outputDestination;
  };
  var Br = function(t3, e3, r3, n3, i4) {
    Wt2.push(new Or()), Dt2 = $9 = 0, ot2 = [], Pt2 = t3, kt2 = e3, It2 = i4, je([r3, n3]);
  }, Mr = function(t3) {
    if (Ht2[t3])
      Wt2.pop().restore();
    else {
      var e3 = new Or(), r3 = "Xo" + (Object.keys(zt2).length + 1).toString(10);
      e3.id = r3, Ht2[t3] = r3, zt2[r3] = e3, Tt2.publish("addFormObject", e3), Wt2.pop().restore();
    }
  };
  for (var Er in y4.beginFormObject = function(t3, e3, r3, n3, i4) {
    return Br(t3, e3, r3, n3, i4), this;
  }, y4.endFormObject = function(t3) {
    return Mr(t3), this;
  }, y4.doFormObject = function(t3, e3) {
    var r3 = zt2[Ht2[t3]];
    return lt2("q"), lt2(e3.toString() + " cm"), lt2("/" + r3.id + " Do"), lt2("Q"), this;
  }, y4.getFormObject = function(t3) {
    var e3 = zt2[Ht2[t3]];
    return { x: e3.x, y: e3.y, width: e3.width, height: e3.height, matrix: e3.matrix };
  }, y4.save = function(t3, e3) {
    return t3 = t3 || "generated.pdf", (e3 = e3 || {}).returnPromise = e3.returnPromise || false, false === e3.returnPromise ? (l2(We(He()), t3), "function" == typeof l2.unload && n2.setTimeout && setTimeout(l2.unload, 911), this) : new Promise(function(e4, r3) {
      try {
        var i4 = l2(We(He()), t3);
        "function" == typeof l2.unload && n2.setTimeout && setTimeout(l2.unload, 911), e4(i4);
      } catch (t4) {
        r3(t4.message);
      }
    });
  }, E.API)
    E.API.hasOwnProperty(Er) && ("events" === Er && E.API.events.length ? function(t3, e3) {
      var r3, n3, i4;
      for (i4 = e3.length - 1; -1 !== i4; i4--)
        r3 = e3[i4][0], n3 = e3[i4][1], t3.subscribe.apply(t3, [r3].concat("function" == typeof n3 ? [n3] : n3));
    }(Tt2, E.API.events) : y4[Er] = E.API[Er]);
  var qr = y4.getPageWidth = function(t3) {
    return (Rt2[t3 = t3 || $9].mediaBox.topRightX - Rt2[t3].mediaBox.bottomLeftX) / _t2;
  }, Dr = y4.setPageWidth = function(t3, e3) {
    Rt2[t3].mediaBox.topRightX = e3 * _t2 + Rt2[t3].mediaBox.bottomLeftX;
  }, Rr = y4.getPageHeight = function(t3) {
    return (Rt2[t3 = t3 || $9].mediaBox.topRightY - Rt2[t3].mediaBox.bottomLeftY) / _t2;
  }, Tr = y4.setPageHeight = function(t3, e3) {
    Rt2[t3].mediaBox.topRightY = e3 * _t2 + Rt2[t3].mediaBox.bottomLeftY;
  };
  return y4.internal = { pdfEscape: Ce, getStyle: tr, getFont: hr, getFontSize: vt2, getCharSpace: Pr, getTextColor: Sr, getLineHeight: gr, getLineHeightFactor: vr, getLineWidth: dr, write: ft2, getHorizontalCoordinate: br, getVerticalCoordinate: yr, getCoordinateString: wr, getVerticalCoordinateString: Nr, collections: {}, newObject: Xt2, newAdditionalObject: $t2, newObjectDeferred: Kt2, newObjectDeferredBegin: Zt2, getFilters: ne2, putStream: ie2, events: Tt2, scaleFactor: _t2, pageSize: { getWidth: function() {
    return qr($9);
  }, setWidth: function(t3) {
    Dr($9, t3);
  }, getHeight: function() {
    return Rr($9);
  }, setHeight: function(t3) {
    Tr($9, t3);
  } }, encryptionOptions: m4, encryption: Ye, getEncryptor: Je, output: Ve, getNumberOfPages: Ee, pages: ot2, out: lt2, f2: R2, f3: T3, getPageInfo: Xe, getPageInfoByObjId: Ke, getCurrentPageInfo: Ze, getPDFVersion: N3, Point: Cr, Rectangle: jr, Matrix: Vt2, hasHotfix: Ge }, Object.defineProperty(y4.internal.pageSize, "width", { get: function() {
    return qr($9);
  }, set: function(t3) {
    Dr($9, t3);
  }, enumerable: true, configurable: true }), Object.defineProperty(y4.internal.pageSize, "height", { get: function() {
    return Rr($9);
  }, set: function(t3) {
    Tr($9, t3);
  }, enumerable: true, configurable: true }), ke.call(y4, pt2), St2 = "F1", Oe(s3, i3), Tt2.publish("initialized"), y4;
}
I.prototype.lsbFirstWord = function(t3) {
  return String.fromCharCode(t3 >> 0 & 255, t3 >> 8 & 255, t3 >> 16 & 255, t3 >> 24 & 255);
}, I.prototype.toHexString = function(t3) {
  return t3.split("").map(function(t4) {
    return ("0" + (255 & t4.charCodeAt(0)).toString(16)).slice(-2);
  }).join("");
}, I.prototype.hexToBytes = function(t3) {
  for (var e2 = [], r2 = 0; r2 < t3.length; r2 += 2)
    e2.push(String.fromCharCode(parseInt(t3.substr(r2, 2), 16)));
  return e2.join("");
}, I.prototype.processOwnerPassword = function(t3, e2) {
  return P(x2(e2).substr(0, 5), t3);
}, I.prototype.encryptor = function(t3, e2) {
  var r2 = x2(this.encryptionKey + String.fromCharCode(255 & t3, t3 >> 8 & 255, t3 >> 16 & 255, 255 & e2, e2 >> 8 & 255)).substr(0, 10);
  return function(t4) {
    return P(r2, t4);
  };
}, j.prototype.equals = function(e2) {
  var r2, n3 = "id,objectNumber,equals";
  if (!e2 || _typeof(e2) !== _typeof(this))
    return false;
  var i3 = 0;
  for (r2 in this)
    if (!(n3.indexOf(r2) >= 0)) {
      if (this.hasOwnProperty(r2) && !e2.hasOwnProperty(r2))
        return false;
      if (this[r2] !== e2[r2])
        return false;
      i3++;
    }
  for (r2 in e2)
    e2.hasOwnProperty(r2) && n3.indexOf(r2) < 0 && i3--;
  return 0 === i3;
}, E.API = { events: [] }, E.version = "2.5.1";
var q = E.API;
var D = 1;
var R = function(t3) {
  return t3.replace(/\\/g, "\\\\").replace(/\(/g, "\\(").replace(/\)/g, "\\)");
};
var T2 = function(t3) {
  return t3.replace(/\\\\/g, "\\").replace(/\\\(/g, "(").replace(/\\\)/g, ")");
};
var U = function(t3) {
  return t3.toFixed(2);
};
var z = function(t3) {
  return t3.toFixed(5);
};
q.__acroform__ = {};
var H = function(t3, e2) {
  t3.prototype = Object.create(e2.prototype), t3.prototype.constructor = t3;
};
var W = function(t3) {
  return t3 * D;
};
var V = function(t3) {
  var e2 = new ut(), r2 = At.internal.getHeight(t3) || 0, n3 = At.internal.getWidth(t3) || 0;
  return e2.BBox = [0, 0, Number(U(n3)), Number(U(r2))], e2;
};
var G2 = q.__acroform__.setBit = function(t3, e2) {
  if (t3 = t3 || 0, e2 = e2 || 0, isNaN(t3) || isNaN(e2))
    throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBit");
  return t3 |= 1 << e2;
};
var Y = q.__acroform__.clearBit = function(t3, e2) {
  if (t3 = t3 || 0, e2 = e2 || 0, isNaN(t3) || isNaN(e2))
    throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBit");
  return t3 &= ~(1 << e2);
};
var J = q.__acroform__.getBit = function(t3, e2) {
  if (isNaN(t3) || isNaN(e2))
    throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBit");
  return 0 == (t3 & 1 << e2) ? 0 : 1;
};
var X = q.__acroform__.getBitForPdf = function(t3, e2) {
  if (isNaN(t3) || isNaN(e2))
    throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf");
  return J(t3, e2 - 1);
};
var K = q.__acroform__.setBitForPdf = function(t3, e2) {
  if (isNaN(t3) || isNaN(e2))
    throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf");
  return G2(t3, e2 - 1);
};
var Z = q.__acroform__.clearBitForPdf = function(t3, e2) {
  if (isNaN(t3) || isNaN(e2))
    throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf");
  return Y(t3, e2 - 1);
};
var $8 = q.__acroform__.calculateCoordinates = function(t3, e2) {
  var r2 = e2.internal.getHorizontalCoordinate, n3 = e2.internal.getVerticalCoordinate, i3 = t3[0], a3 = t3[1], o3 = t3[2], s3 = t3[3], c4 = {};
  return c4.lowerLeft_X = r2(i3) || 0, c4.lowerLeft_Y = n3(a3 + s3) || 0, c4.upperRight_X = r2(i3 + o3) || 0, c4.upperRight_Y = n3(a3) || 0, [Number(U(c4.lowerLeft_X)), Number(U(c4.lowerLeft_Y)), Number(U(c4.upperRight_X)), Number(U(c4.upperRight_Y))];
};
var Q = function(t3) {
  if (t3.appearanceStreamContent)
    return t3.appearanceStreamContent;
  if (t3.V || t3.DV) {
    var e2 = [], r2 = t3._V || t3.DV, n3 = tt(t3, r2), i3 = t3.scope.internal.getFont(t3.fontName, t3.fontStyle).id;
    e2.push("/Tx BMC"), e2.push("q"), e2.push("BT"), e2.push(t3.scope.__private__.encodeColorString(t3.color)), e2.push("/" + i3 + " " + U(n3.fontSize) + " Tf"), e2.push("1 0 0 1 0 0 Tm"), e2.push(n3.text), e2.push("ET"), e2.push("Q"), e2.push("EMC");
    var a3 = V(t3);
    return a3.scope = t3.scope, a3.stream = e2.join("\n"), a3;
  }
};
var tt = function(t3, e2) {
  var r2 = 0 === t3.fontSize ? t3.maxFontSize : t3.fontSize, n3 = { text: "", fontSize: "" }, i3 = (e2 = ")" == (e2 = "(" == e2.substr(0, 1) ? e2.substr(1) : e2).substr(e2.length - 1) ? e2.substr(0, e2.length - 1) : e2).split(" ");
  i3 = t3.multiline ? i3.map(function(t4) {
    return t4.split("\n");
  }) : i3.map(function(t4) {
    return [t4];
  });
  var a3 = r2, o3 = At.internal.getHeight(t3) || 0;
  o3 = o3 < 0 ? -o3 : o3;
  var s3 = At.internal.getWidth(t3) || 0;
  s3 = s3 < 0 ? -s3 : s3;
  var c4 = function(e3, r3, n4) {
    if (e3 + 1 < i3.length) {
      var a4 = r3 + " " + i3[e3 + 1][0];
      return et2(a4, t3, n4).width <= s3 - 4;
    }
    return false;
  };
  a3++;
  t:
    for (; a3 > 0; ) {
      e2 = "", a3--;
      var u3, h3, l3 = et2("3", t3, a3).height, f3 = t3.multiline ? o3 - a3 : (o3 - l3) / 2, d2 = f3 += 2, p3 = 0, g2 = 0, m4 = 0;
      if (a3 <= 0) {
        e2 = "(...) Tj\n", e2 += "% Width of Text: " + et2(e2, t3, a3 = 12).width + ", FieldWidth:" + s3 + "\n";
        break;
      }
      for (var v3 = "", b2 = 0, y4 = 0; y4 < i3.length; y4++)
        if (i3.hasOwnProperty(y4)) {
          var w2 = false;
          if (1 !== i3[y4].length && m4 !== i3[y4].length - 1) {
            if ((l3 + 2) * (b2 + 2) + 2 > o3)
              continue t;
            v3 += i3[y4][m4], w2 = true, g2 = y4, y4--;
          } else {
            v3 = " " == (v3 += i3[y4][m4] + " ").substr(v3.length - 1) ? v3.substr(0, v3.length - 1) : v3;
            var N3 = parseInt(y4), L2 = c4(N3, v3, a3), A3 = y4 >= i3.length - 1;
            if (L2 && !A3) {
              v3 += " ", m4 = 0;
              continue;
            }
            if (L2 || A3) {
              if (A3)
                g2 = N3;
              else if (t3.multiline && (l3 + 2) * (b2 + 2) + 2 > o3)
                continue t;
            } else {
              if (!t3.multiline)
                continue t;
              if ((l3 + 2) * (b2 + 2) + 2 > o3)
                continue t;
              g2 = N3;
            }
          }
          for (var x3 = "", S2 = p3; S2 <= g2; S2++) {
            var _3 = i3[S2];
            if (t3.multiline) {
              if (S2 === g2) {
                x3 += _3[m4] + " ", m4 = (m4 + 1) % _3.length;
                continue;
              }
              if (S2 === p3) {
                x3 += _3[_3.length - 1] + " ";
                continue;
              }
            }
            x3 += _3[0] + " ";
          }
          switch (x3 = " " == x3.substr(x3.length - 1) ? x3.substr(0, x3.length - 1) : x3, h3 = et2(x3, t3, a3).width, t3.textAlign) {
            case "right":
              u3 = s3 - h3 - 2;
              break;
            case "center":
              u3 = (s3 - h3) / 2;
              break;
            case "left":
            default:
              u3 = 2;
          }
          e2 += U(u3) + " " + U(d2) + " Td\n", e2 += "(" + R(x3) + ") Tj\n", e2 += -U(u3) + " 0 Td\n", d2 = -(a3 + 2), h3 = 0, p3 = w2 ? g2 : g2 + 1, b2++, v3 = "";
        } else
          ;
      break;
    }
  return n3.text = e2, n3.fontSize = a3, n3;
};
var et2 = function(t3, e2, r2) {
  var n3 = e2.scope.internal.getFont(e2.fontName, e2.fontStyle), i3 = e2.scope.getStringUnitWidth(t3, { font: n3, fontSize: parseFloat(r2), charSpace: 0 }) * parseFloat(r2);
  return { height: e2.scope.getStringUnitWidth("3", { font: n3, fontSize: parseFloat(r2), charSpace: 0 }) * parseFloat(r2) * 1.5, width: i3 };
};
var rt = { fields: [], xForms: [], acroFormDictionaryRoot: null, printedOut: false, internal: null, isInitialized: false };
var nt = function(t3, e2) {
  var r2 = { type: "reference", object: t3 };
  void 0 === e2.internal.getPageInfo(t3.page).pageContext.annotations.find(function(t4) {
    return t4.type === r2.type && t4.object === r2.object;
  }) && e2.internal.getPageInfo(t3.page).pageContext.annotations.push(r2);
};
var it = function(e2, r2) {
  for (var n3 in e2)
    if (e2.hasOwnProperty(n3)) {
      var i3 = n3, a3 = e2[n3];
      r2.internal.newObjectDeferredBegin(a3.objId, true), "object" === _typeof(a3) && "function" == typeof a3.putStream && a3.putStream(), delete e2[i3];
    }
};
var at = function(e2, r2) {
  if (r2.scope = e2, void 0 !== e2.internal && (void 0 === e2.internal.acroformPlugin || false === e2.internal.acroformPlugin.isInitialized)) {
    if (lt.FieldNum = 0, e2.internal.acroformPlugin = JSON.parse(JSON.stringify(rt)), e2.internal.acroformPlugin.acroFormDictionaryRoot)
      throw new Error("Exception while creating AcroformDictionary");
    D = e2.internal.scaleFactor, e2.internal.acroformPlugin.acroFormDictionaryRoot = new ht(), e2.internal.acroformPlugin.acroFormDictionaryRoot.scope = e2, e2.internal.acroformPlugin.acroFormDictionaryRoot._eventID = e2.internal.events.subscribe("postPutResources", function() {
      !function(t3) {
        t3.internal.events.unsubscribe(t3.internal.acroformPlugin.acroFormDictionaryRoot._eventID), delete t3.internal.acroformPlugin.acroFormDictionaryRoot._eventID, t3.internal.acroformPlugin.printedOut = true;
      }(e2);
    }), e2.internal.events.subscribe("buildDocument", function() {
      !function(t3) {
        t3.internal.acroformPlugin.acroFormDictionaryRoot.objId = void 0;
        var e3 = t3.internal.acroformPlugin.acroFormDictionaryRoot.Fields;
        for (var r3 in e3)
          if (e3.hasOwnProperty(r3)) {
            var n3 = e3[r3];
            n3.objId = void 0, n3.hasAnnotation && nt(n3, t3);
          }
      }(e2);
    }), e2.internal.events.subscribe("putCatalog", function() {
      !function(t3) {
        if (void 0 === t3.internal.acroformPlugin.acroFormDictionaryRoot)
          throw new Error("putCatalogCallback: Root missing.");
        t3.internal.write("/AcroForm " + t3.internal.acroformPlugin.acroFormDictionaryRoot.objId + " 0 R");
      }(e2);
    }), e2.internal.events.subscribe("postPutPages", function(r3) {
      !function(e3, r4) {
        var n3 = !e3;
        for (var i3 in e3 || (r4.internal.newObjectDeferredBegin(r4.internal.acroformPlugin.acroFormDictionaryRoot.objId, true), r4.internal.acroformPlugin.acroFormDictionaryRoot.putStream()), e3 = e3 || r4.internal.acroformPlugin.acroFormDictionaryRoot.Kids)
          if (e3.hasOwnProperty(i3)) {
            var a3 = e3[i3], o3 = [], s3 = a3.Rect;
            if (a3.Rect && (a3.Rect = $8(a3.Rect, r4)), r4.internal.newObjectDeferredBegin(a3.objId, true), a3.DA = At.createDefaultAppearanceStream(a3), "object" === _typeof(a3) && "function" == typeof a3.getKeyValueListForStream && (o3 = a3.getKeyValueListForStream()), a3.Rect = s3, a3.hasAppearanceStream && !a3.appearanceStreamContent) {
              var c4 = Q(a3);
              o3.push({ key: "AP", value: "<</N " + c4 + ">>" }), r4.internal.acroformPlugin.xForms.push(c4);
            }
            if (a3.appearanceStreamContent) {
              var u3 = "";
              for (var h3 in a3.appearanceStreamContent)
                if (a3.appearanceStreamContent.hasOwnProperty(h3)) {
                  var l3 = a3.appearanceStreamContent[h3];
                  if (u3 += "/" + h3 + " ", u3 += "<<", Object.keys(l3).length >= 1 || Array.isArray(l3)) {
                    for (var i3 in l3)
                      if (l3.hasOwnProperty(i3)) {
                        var f3 = l3[i3];
                        "function" == typeof f3 && (f3 = f3.call(r4, a3)), u3 += "/" + i3 + " " + f3 + " ", r4.internal.acroformPlugin.xForms.indexOf(f3) >= 0 || r4.internal.acroformPlugin.xForms.push(f3);
                      }
                  } else
                    "function" == typeof (f3 = l3) && (f3 = f3.call(r4, a3)), u3 += "/" + i3 + " " + f3, r4.internal.acroformPlugin.xForms.indexOf(f3) >= 0 || r4.internal.acroformPlugin.xForms.push(f3);
                  u3 += ">>";
                }
              o3.push({ key: "AP", value: "<<\n" + u3 + ">>" });
            }
            r4.internal.putStream({ additionalKeyValues: o3, objectId: a3.objId }), r4.internal.out("endobj");
          }
        n3 && it(r4.internal.acroformPlugin.xForms, r4);
      }(r3, e2);
    }), e2.internal.acroformPlugin.isInitialized = true;
  }
};
var ot = q.__acroform__.arrayToPdfArray = function(e2, r2, n3) {
  var i3 = function(t3) {
    return t3;
  };
  if (Array.isArray(e2)) {
    for (var a3 = "[", o3 = 0; o3 < e2.length; o3++)
      switch (0 !== o3 && (a3 += " "), _typeof(e2[o3])) {
        case "boolean":
        case "number":
        case "object":
          a3 += e2[o3].toString();
          break;
        case "string":
          "/" !== e2[o3].substr(0, 1) ? (void 0 !== r2 && n3 && (i3 = n3.internal.getEncryptor(r2)), a3 += "(" + R(i3(e2[o3].toString())) + ")") : a3 += e2[o3].toString();
      }
    return a3 += "]";
  }
  throw new Error("Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray");
};
var st = function(t3, e2, r2) {
  var n3 = function(t4) {
    return t4;
  };
  return void 0 !== e2 && r2 && (n3 = r2.internal.getEncryptor(e2)), (t3 = t3 || "").toString(), t3 = "(" + R(n3(t3)) + ")";
};
var ct = function() {
  this._objId = void 0, this._scope = void 0, Object.defineProperty(this, "objId", { get: function() {
    if (void 0 === this._objId) {
      if (void 0 === this.scope)
        return;
      this._objId = this.scope.internal.newObjectDeferred();
    }
    return this._objId;
  }, set: function(t3) {
    this._objId = t3;
  } }), Object.defineProperty(this, "scope", { value: this._scope, writable: true });
};
ct.prototype.toString = function() {
  return this.objId + " 0 R";
}, ct.prototype.putStream = function() {
  var t3 = this.getKeyValueListForStream();
  this.scope.internal.putStream({ data: this.stream, additionalKeyValues: t3, objectId: this.objId }), this.scope.internal.out("endobj");
}, ct.prototype.getKeyValueListForStream = function() {
  var t3 = [], e2 = Object.getOwnPropertyNames(this).filter(function(t4) {
    return "content" != t4 && "appearanceStreamContent" != t4 && "scope" != t4 && "objId" != t4 && "_" != t4.substring(0, 1);
  });
  for (var r2 in e2)
    if (false === Object.getOwnPropertyDescriptor(this, e2[r2]).configurable) {
      var n3 = e2[r2], i3 = this[n3];
      i3 && (Array.isArray(i3) ? t3.push({ key: n3, value: ot(i3, this.objId, this.scope) }) : i3 instanceof ct ? (i3.scope = this.scope, t3.push({ key: n3, value: i3.objId + " 0 R" })) : "function" != typeof i3 && t3.push({ key: n3, value: i3 }));
    }
  return t3;
};
var ut = function() {
  ct.call(this), Object.defineProperty(this, "Type", { value: "/XObject", configurable: false, writable: true }), Object.defineProperty(this, "Subtype", { value: "/Form", configurable: false, writable: true }), Object.defineProperty(this, "FormType", { value: 1, configurable: false, writable: true });
  var t3, e2 = [];
  Object.defineProperty(this, "BBox", { configurable: false, get: function() {
    return e2;
  }, set: function(t4) {
    e2 = t4;
  } }), Object.defineProperty(this, "Resources", { value: "2 0 R", configurable: false, writable: true }), Object.defineProperty(this, "stream", { enumerable: false, configurable: true, set: function(e3) {
    t3 = e3.trim();
  }, get: function() {
    return t3 || null;
  } });
};
H(ut, ct);
var ht = function() {
  ct.call(this);
  var t3, e2 = [];
  Object.defineProperty(this, "Kids", { enumerable: false, configurable: true, get: function() {
    return e2.length > 0 ? e2 : void 0;
  } }), Object.defineProperty(this, "Fields", { enumerable: false, configurable: false, get: function() {
    return e2;
  } }), Object.defineProperty(this, "DA", { enumerable: false, configurable: false, get: function() {
    if (t3) {
      var e3 = function(t4) {
        return t4;
      };
      return this.scope && (e3 = this.scope.internal.getEncryptor(this.objId)), "(" + R(e3(t3)) + ")";
    }
  }, set: function(e3) {
    t3 = e3;
  } });
};
H(ht, ct);
var lt = function t2() {
  ct.call(this);
  var e2 = 4;
  Object.defineProperty(this, "F", { enumerable: false, configurable: false, get: function() {
    return e2;
  }, set: function(t3) {
    if (isNaN(t3))
      throw new Error('Invalid value "' + t3 + '" for attribute F supplied.');
    e2 = t3;
  } }), Object.defineProperty(this, "showWhenPrinted", { enumerable: true, configurable: true, get: function() {
    return Boolean(X(e2, 3));
  }, set: function(t3) {
    true === Boolean(t3) ? this.F = K(e2, 3) : this.F = Z(e2, 3);
  } });
  var r2 = 0;
  Object.defineProperty(this, "Ff", { enumerable: false, configurable: false, get: function() {
    return r2;
  }, set: function(t3) {
    if (isNaN(t3))
      throw new Error('Invalid value "' + t3 + '" for attribute Ff supplied.');
    r2 = t3;
  } });
  var n3 = [];
  Object.defineProperty(this, "Rect", { enumerable: false, configurable: false, get: function() {
    if (0 !== n3.length)
      return n3;
  }, set: function(t3) {
    n3 = void 0 !== t3 ? t3 : [];
  } }), Object.defineProperty(this, "x", { enumerable: true, configurable: true, get: function() {
    return !n3 || isNaN(n3[0]) ? 0 : n3[0];
  }, set: function(t3) {
    n3[0] = t3;
  } }), Object.defineProperty(this, "y", { enumerable: true, configurable: true, get: function() {
    return !n3 || isNaN(n3[1]) ? 0 : n3[1];
  }, set: function(t3) {
    n3[1] = t3;
  } }), Object.defineProperty(this, "width", { enumerable: true, configurable: true, get: function() {
    return !n3 || isNaN(n3[2]) ? 0 : n3[2];
  }, set: function(t3) {
    n3[2] = t3;
  } }), Object.defineProperty(this, "height", { enumerable: true, configurable: true, get: function() {
    return !n3 || isNaN(n3[3]) ? 0 : n3[3];
  }, set: function(t3) {
    n3[3] = t3;
  } });
  var i3 = "";
  Object.defineProperty(this, "FT", { enumerable: true, configurable: false, get: function() {
    return i3;
  }, set: function(t3) {
    switch (t3) {
      case "/Btn":
      case "/Tx":
      case "/Ch":
      case "/Sig":
        i3 = t3;
        break;
      default:
        throw new Error('Invalid value "' + t3 + '" for attribute FT supplied.');
    }
  } });
  var a3 = null;
  Object.defineProperty(this, "T", { enumerable: true, configurable: false, get: function() {
    if (!a3 || a3.length < 1) {
      if (this instanceof yt)
        return;
      a3 = "FieldObject" + t2.FieldNum++;
    }
    var e3 = function(t3) {
      return t3;
    };
    return this.scope && (e3 = this.scope.internal.getEncryptor(this.objId)), "(" + R(e3(a3)) + ")";
  }, set: function(t3) {
    a3 = t3.toString();
  } }), Object.defineProperty(this, "fieldName", { configurable: true, enumerable: true, get: function() {
    return a3;
  }, set: function(t3) {
    a3 = t3;
  } });
  var o3 = "helvetica";
  Object.defineProperty(this, "fontName", { enumerable: true, configurable: true, get: function() {
    return o3;
  }, set: function(t3) {
    o3 = t3;
  } });
  var s3 = "normal";
  Object.defineProperty(this, "fontStyle", { enumerable: true, configurable: true, get: function() {
    return s3;
  }, set: function(t3) {
    s3 = t3;
  } });
  var c4 = 0;
  Object.defineProperty(this, "fontSize", { enumerable: true, configurable: true, get: function() {
    return c4;
  }, set: function(t3) {
    c4 = t3;
  } });
  var u3 = void 0;
  Object.defineProperty(this, "maxFontSize", { enumerable: true, configurable: true, get: function() {
    return void 0 === u3 ? 50 / D : u3;
  }, set: function(t3) {
    u3 = t3;
  } });
  var h3 = "black";
  Object.defineProperty(this, "color", { enumerable: true, configurable: true, get: function() {
    return h3;
  }, set: function(t3) {
    h3 = t3;
  } });
  var l3 = "/F1 0 Tf 0 g";
  Object.defineProperty(this, "DA", { enumerable: true, configurable: false, get: function() {
    if (!(!l3 || this instanceof yt || this instanceof Nt))
      return st(l3, this.objId, this.scope);
  }, set: function(t3) {
    t3 = t3.toString(), l3 = t3;
  } });
  var f3 = null;
  Object.defineProperty(this, "DV", { enumerable: false, configurable: false, get: function() {
    if (f3)
      return this instanceof mt == false ? st(f3, this.objId, this.scope) : f3;
  }, set: function(t3) {
    t3 = t3.toString(), f3 = this instanceof mt == false ? "(" === t3.substr(0, 1) ? T2(t3.substr(1, t3.length - 2)) : T2(t3) : t3;
  } }), Object.defineProperty(this, "defaultValue", { enumerable: true, configurable: true, get: function() {
    return this instanceof mt == true ? T2(f3.substr(1, f3.length - 1)) : f3;
  }, set: function(t3) {
    t3 = t3.toString(), f3 = this instanceof mt == true ? "/" + t3 : t3;
  } });
  var d2 = null;
  Object.defineProperty(this, "_V", { enumerable: false, configurable: false, get: function() {
    if (d2)
      return d2;
  }, set: function(t3) {
    this.V = t3;
  } }), Object.defineProperty(this, "V", { enumerable: false, configurable: false, get: function() {
    if (d2)
      return this instanceof mt == false ? st(d2, this.objId, this.scope) : d2;
  }, set: function(t3) {
    t3 = t3.toString(), d2 = this instanceof mt == false ? "(" === t3.substr(0, 1) ? T2(t3.substr(1, t3.length - 2)) : T2(t3) : t3;
  } }), Object.defineProperty(this, "value", { enumerable: true, configurable: true, get: function() {
    return this instanceof mt == true ? T2(d2.substr(1, d2.length - 1)) : d2;
  }, set: function(t3) {
    t3 = t3.toString(), d2 = this instanceof mt == true ? "/" + t3 : t3;
  } }), Object.defineProperty(this, "hasAnnotation", { enumerable: true, configurable: true, get: function() {
    return this.Rect;
  } }), Object.defineProperty(this, "Type", { enumerable: true, configurable: false, get: function() {
    return this.hasAnnotation ? "/Annot" : null;
  } }), Object.defineProperty(this, "Subtype", { enumerable: true, configurable: false, get: function() {
    return this.hasAnnotation ? "/Widget" : null;
  } });
  var p3, g2 = false;
  Object.defineProperty(this, "hasAppearanceStream", { enumerable: true, configurable: true, get: function() {
    return g2;
  }, set: function(t3) {
    t3 = Boolean(t3), g2 = t3;
  } }), Object.defineProperty(this, "page", { enumerable: true, configurable: true, get: function() {
    if (p3)
      return p3;
  }, set: function(t3) {
    p3 = t3;
  } }), Object.defineProperty(this, "readOnly", { enumerable: true, configurable: true, get: function() {
    return Boolean(X(this.Ff, 1));
  }, set: function(t3) {
    true === Boolean(t3) ? this.Ff = K(this.Ff, 1) : this.Ff = Z(this.Ff, 1);
  } }), Object.defineProperty(this, "required", { enumerable: true, configurable: true, get: function() {
    return Boolean(X(this.Ff, 2));
  }, set: function(t3) {
    true === Boolean(t3) ? this.Ff = K(this.Ff, 2) : this.Ff = Z(this.Ff, 2);
  } }), Object.defineProperty(this, "noExport", { enumerable: true, configurable: true, get: function() {
    return Boolean(X(this.Ff, 3));
  }, set: function(t3) {
    true === Boolean(t3) ? this.Ff = K(this.Ff, 3) : this.Ff = Z(this.Ff, 3);
  } });
  var m4 = null;
  Object.defineProperty(this, "Q", { enumerable: true, configurable: false, get: function() {
    if (null !== m4)
      return m4;
  }, set: function(t3) {
    if (-1 === [0, 1, 2].indexOf(t3))
      throw new Error('Invalid value "' + t3 + '" for attribute Q supplied.');
    m4 = t3;
  } }), Object.defineProperty(this, "textAlign", { get: function() {
    var t3;
    switch (m4) {
      case 0:
      default:
        t3 = "left";
        break;
      case 1:
        t3 = "center";
        break;
      case 2:
        t3 = "right";
    }
    return t3;
  }, configurable: true, enumerable: true, set: function(t3) {
    switch (t3) {
      case "right":
      case 2:
        m4 = 2;
        break;
      case "center":
      case 1:
        m4 = 1;
        break;
      case "left":
      case 0:
      default:
        m4 = 0;
    }
  } });
};
H(lt, ct);
var ft = function() {
  lt.call(this), this.FT = "/Ch", this.V = "()", this.fontName = "zapfdingbats";
  var t3 = 0;
  Object.defineProperty(this, "TI", { enumerable: true, configurable: false, get: function() {
    return t3;
  }, set: function(e3) {
    t3 = e3;
  } }), Object.defineProperty(this, "topIndex", { enumerable: true, configurable: true, get: function() {
    return t3;
  }, set: function(e3) {
    t3 = e3;
  } });
  var e2 = [];
  Object.defineProperty(this, "Opt", { enumerable: true, configurable: false, get: function() {
    return ot(e2, this.objId, this.scope);
  }, set: function(t4) {
    var r2, n3;
    n3 = [], "string" == typeof (r2 = t4) && (n3 = function(t5, e3, r3) {
      r3 || (r3 = 1);
      for (var n4, i3 = []; n4 = e3.exec(t5); )
        i3.push(n4[r3]);
      return i3;
    }(r2, /\((.*?)\)/g)), e2 = n3;
  } }), this.getOptions = function() {
    return e2;
  }, this.setOptions = function(t4) {
    e2 = t4, this.sort && e2.sort();
  }, this.addOption = function(t4) {
    t4 = (t4 = t4 || "").toString(), e2.push(t4), this.sort && e2.sort();
  }, this.removeOption = function(t4, r2) {
    for (r2 = r2 || false, t4 = (t4 = t4 || "").toString(); -1 !== e2.indexOf(t4) && (e2.splice(e2.indexOf(t4), 1), false !== r2); )
      ;
  }, Object.defineProperty(this, "combo", { enumerable: true, configurable: true, get: function() {
    return Boolean(X(this.Ff, 18));
  }, set: function(t4) {
    true === Boolean(t4) ? this.Ff = K(this.Ff, 18) : this.Ff = Z(this.Ff, 18);
  } }), Object.defineProperty(this, "edit", { enumerable: true, configurable: true, get: function() {
    return Boolean(X(this.Ff, 19));
  }, set: function(t4) {
    true === this.combo && (true === Boolean(t4) ? this.Ff = K(this.Ff, 19) : this.Ff = Z(this.Ff, 19));
  } }), Object.defineProperty(this, "sort", { enumerable: true, configurable: true, get: function() {
    return Boolean(X(this.Ff, 20));
  }, set: function(t4) {
    true === Boolean(t4) ? (this.Ff = K(this.Ff, 20), e2.sort()) : this.Ff = Z(this.Ff, 20);
  } }), Object.defineProperty(this, "multiSelect", { enumerable: true, configurable: true, get: function() {
    return Boolean(X(this.Ff, 22));
  }, set: function(t4) {
    true === Boolean(t4) ? this.Ff = K(this.Ff, 22) : this.Ff = Z(this.Ff, 22);
  } }), Object.defineProperty(this, "doNotSpellCheck", { enumerable: true, configurable: true, get: function() {
    return Boolean(X(this.Ff, 23));
  }, set: function(t4) {
    true === Boolean(t4) ? this.Ff = K(this.Ff, 23) : this.Ff = Z(this.Ff, 23);
  } }), Object.defineProperty(this, "commitOnSelChange", { enumerable: true, configurable: true, get: function() {
    return Boolean(X(this.Ff, 27));
  }, set: function(t4) {
    true === Boolean(t4) ? this.Ff = K(this.Ff, 27) : this.Ff = Z(this.Ff, 27);
  } }), this.hasAppearanceStream = false;
};
H(ft, lt);
var dt = function() {
  ft.call(this), this.fontName = "helvetica", this.combo = false;
};
H(dt, ft);
var pt = function() {
  dt.call(this), this.combo = true;
};
H(pt, dt);
var gt = function() {
  pt.call(this), this.edit = true;
};
H(gt, pt);
var mt = function() {
  lt.call(this), this.FT = "/Btn", Object.defineProperty(this, "noToggleToOff", { enumerable: true, configurable: true, get: function() {
    return Boolean(X(this.Ff, 15));
  }, set: function(t3) {
    true === Boolean(t3) ? this.Ff = K(this.Ff, 15) : this.Ff = Z(this.Ff, 15);
  } }), Object.defineProperty(this, "radio", { enumerable: true, configurable: true, get: function() {
    return Boolean(X(this.Ff, 16));
  }, set: function(t3) {
    true === Boolean(t3) ? this.Ff = K(this.Ff, 16) : this.Ff = Z(this.Ff, 16);
  } }), Object.defineProperty(this, "pushButton", { enumerable: true, configurable: true, get: function() {
    return Boolean(X(this.Ff, 17));
  }, set: function(t3) {
    true === Boolean(t3) ? this.Ff = K(this.Ff, 17) : this.Ff = Z(this.Ff, 17);
  } }), Object.defineProperty(this, "radioIsUnison", { enumerable: true, configurable: true, get: function() {
    return Boolean(X(this.Ff, 26));
  }, set: function(t3) {
    true === Boolean(t3) ? this.Ff = K(this.Ff, 26) : this.Ff = Z(this.Ff, 26);
  } });
  var e2, r2 = {};
  Object.defineProperty(this, "MK", { enumerable: false, configurable: false, get: function() {
    var t3 = function(t4) {
      return t4;
    };
    if (this.scope && (t3 = this.scope.internal.getEncryptor(this.objId)), 0 !== Object.keys(r2).length) {
      var e3, n3 = [];
      for (e3 in n3.push("<<"), r2)
        n3.push("/" + e3 + " (" + R(t3(r2[e3])) + ")");
      return n3.push(">>"), n3.join("\n");
    }
  }, set: function(e3) {
    "object" === _typeof(e3) && (r2 = e3);
  } }), Object.defineProperty(this, "caption", { enumerable: true, configurable: true, get: function() {
    return r2.CA || "";
  }, set: function(t3) {
    "string" == typeof t3 && (r2.CA = t3);
  } }), Object.defineProperty(this, "AS", { enumerable: false, configurable: false, get: function() {
    return e2;
  }, set: function(t3) {
    e2 = t3;
  } }), Object.defineProperty(this, "appearanceState", { enumerable: true, configurable: true, get: function() {
    return e2.substr(1, e2.length - 1);
  }, set: function(t3) {
    e2 = "/" + t3;
  } });
};
H(mt, lt);
var vt = function() {
  mt.call(this), this.pushButton = true;
};
H(vt, mt);
var bt = function() {
  mt.call(this), this.radio = true, this.pushButton = false;
  var t3 = [];
  Object.defineProperty(this, "Kids", { enumerable: true, configurable: false, get: function() {
    return t3;
  }, set: function(e2) {
    t3 = void 0 !== e2 ? e2 : [];
  } });
};
H(bt, mt);
var yt = function() {
  var e2, r2;
  lt.call(this), Object.defineProperty(this, "Parent", { enumerable: false, configurable: false, get: function() {
    return e2;
  }, set: function(t3) {
    e2 = t3;
  } }), Object.defineProperty(this, "optionName", { enumerable: false, configurable: true, get: function() {
    return r2;
  }, set: function(t3) {
    r2 = t3;
  } });
  var n3, i3 = {};
  Object.defineProperty(this, "MK", { enumerable: false, configurable: false, get: function() {
    var t3 = function(t4) {
      return t4;
    };
    this.scope && (t3 = this.scope.internal.getEncryptor(this.objId));
    var e3, r3 = [];
    for (e3 in r3.push("<<"), i3)
      r3.push("/" + e3 + " (" + R(t3(i3[e3])) + ")");
    return r3.push(">>"), r3.join("\n");
  }, set: function(e3) {
    "object" === _typeof(e3) && (i3 = e3);
  } }), Object.defineProperty(this, "caption", { enumerable: true, configurable: true, get: function() {
    return i3.CA || "";
  }, set: function(t3) {
    "string" == typeof t3 && (i3.CA = t3);
  } }), Object.defineProperty(this, "AS", { enumerable: false, configurable: false, get: function() {
    return n3;
  }, set: function(t3) {
    n3 = t3;
  } }), Object.defineProperty(this, "appearanceState", { enumerable: true, configurable: true, get: function() {
    return n3.substr(1, n3.length - 1);
  }, set: function(t3) {
    n3 = "/" + t3;
  } }), this.caption = "l", this.appearanceState = "Off", this._AppearanceType = At.RadioButton.Circle, this.appearanceStreamContent = this._AppearanceType.createAppearanceStream(this.optionName);
};
H(yt, lt), bt.prototype.setAppearance = function(t3) {
  if (!("createAppearanceStream" in t3) || !("getCA" in t3))
    throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");
  for (var e2 in this.Kids)
    if (this.Kids.hasOwnProperty(e2)) {
      var r2 = this.Kids[e2];
      r2.appearanceStreamContent = t3.createAppearanceStream(r2.optionName), r2.caption = t3.getCA();
    }
}, bt.prototype.createOption = function(t3) {
  var e2 = new yt();
  return e2.Parent = this, e2.optionName = t3, this.Kids.push(e2), xt.call(this.scope, e2), e2;
};
var wt = function() {
  mt.call(this), this.fontName = "zapfdingbats", this.caption = "3", this.appearanceState = "On", this.value = "On", this.textAlign = "center", this.appearanceStreamContent = At.CheckBox.createAppearanceStream();
};
H(wt, mt);
var Nt = function() {
  lt.call(this), this.FT = "/Tx", Object.defineProperty(this, "multiline", { enumerable: true, configurable: true, get: function() {
    return Boolean(X(this.Ff, 13));
  }, set: function(t4) {
    true === Boolean(t4) ? this.Ff = K(this.Ff, 13) : this.Ff = Z(this.Ff, 13);
  } }), Object.defineProperty(this, "fileSelect", { enumerable: true, configurable: true, get: function() {
    return Boolean(X(this.Ff, 21));
  }, set: function(t4) {
    true === Boolean(t4) ? this.Ff = K(this.Ff, 21) : this.Ff = Z(this.Ff, 21);
  } }), Object.defineProperty(this, "doNotSpellCheck", { enumerable: true, configurable: true, get: function() {
    return Boolean(X(this.Ff, 23));
  }, set: function(t4) {
    true === Boolean(t4) ? this.Ff = K(this.Ff, 23) : this.Ff = Z(this.Ff, 23);
  } }), Object.defineProperty(this, "doNotScroll", { enumerable: true, configurable: true, get: function() {
    return Boolean(X(this.Ff, 24));
  }, set: function(t4) {
    true === Boolean(t4) ? this.Ff = K(this.Ff, 24) : this.Ff = Z(this.Ff, 24);
  } }), Object.defineProperty(this, "comb", { enumerable: true, configurable: true, get: function() {
    return Boolean(X(this.Ff, 25));
  }, set: function(t4) {
    true === Boolean(t4) ? this.Ff = K(this.Ff, 25) : this.Ff = Z(this.Ff, 25);
  } }), Object.defineProperty(this, "richText", { enumerable: true, configurable: true, get: function() {
    return Boolean(X(this.Ff, 26));
  }, set: function(t4) {
    true === Boolean(t4) ? this.Ff = K(this.Ff, 26) : this.Ff = Z(this.Ff, 26);
  } });
  var t3 = null;
  Object.defineProperty(this, "MaxLen", { enumerable: true, configurable: false, get: function() {
    return t3;
  }, set: function(e2) {
    t3 = e2;
  } }), Object.defineProperty(this, "maxLength", { enumerable: true, configurable: true, get: function() {
    return t3;
  }, set: function(e2) {
    Number.isInteger(e2) && (t3 = e2);
  } }), Object.defineProperty(this, "hasAppearanceStream", { enumerable: true, configurable: true, get: function() {
    return this.V || this.DV;
  } });
};
H(Nt, lt);
var Lt = function() {
  Nt.call(this), Object.defineProperty(this, "password", { enumerable: true, configurable: true, get: function() {
    return Boolean(X(this.Ff, 14));
  }, set: function(t3) {
    true === Boolean(t3) ? this.Ff = K(this.Ff, 14) : this.Ff = Z(this.Ff, 14);
  } }), this.password = true;
};
H(Lt, Nt);
var At = { CheckBox: { createAppearanceStream: function() {
  return { N: { On: At.CheckBox.YesNormal }, D: { On: At.CheckBox.YesPushDown, Off: At.CheckBox.OffPushDown } };
}, YesPushDown: function(t3) {
  var e2 = V(t3);
  e2.scope = t3.scope;
  var r2 = [], n3 = t3.scope.internal.getFont(t3.fontName, t3.fontStyle).id, i3 = t3.scope.__private__.encodeColorString(t3.color), a3 = tt(t3, t3.caption);
  return r2.push("0.749023 g"), r2.push("0 0 " + U(At.internal.getWidth(t3)) + " " + U(At.internal.getHeight(t3)) + " re"), r2.push("f"), r2.push("BMC"), r2.push("q"), r2.push("0 0 1 rg"), r2.push("/" + n3 + " " + U(a3.fontSize) + " Tf " + i3), r2.push("BT"), r2.push(a3.text), r2.push("ET"), r2.push("Q"), r2.push("EMC"), e2.stream = r2.join("\n"), e2;
}, YesNormal: function(t3) {
  var e2 = V(t3);
  e2.scope = t3.scope;
  var r2 = t3.scope.internal.getFont(t3.fontName, t3.fontStyle).id, n3 = t3.scope.__private__.encodeColorString(t3.color), i3 = [], a3 = At.internal.getHeight(t3), o3 = At.internal.getWidth(t3), s3 = tt(t3, t3.caption);
  return i3.push("1 g"), i3.push("0 0 " + U(o3) + " " + U(a3) + " re"), i3.push("f"), i3.push("q"), i3.push("0 0 1 rg"), i3.push("0 0 " + U(o3 - 1) + " " + U(a3 - 1) + " re"), i3.push("W"), i3.push("n"), i3.push("0 g"), i3.push("BT"), i3.push("/" + r2 + " " + U(s3.fontSize) + " Tf " + n3), i3.push(s3.text), i3.push("ET"), i3.push("Q"), e2.stream = i3.join("\n"), e2;
}, OffPushDown: function(t3) {
  var e2 = V(t3);
  e2.scope = t3.scope;
  var r2 = [];
  return r2.push("0.749023 g"), r2.push("0 0 " + U(At.internal.getWidth(t3)) + " " + U(At.internal.getHeight(t3)) + " re"), r2.push("f"), e2.stream = r2.join("\n"), e2;
} }, RadioButton: { Circle: { createAppearanceStream: function(t3) {
  var e2 = { D: { Off: At.RadioButton.Circle.OffPushDown }, N: {} };
  return e2.N[t3] = At.RadioButton.Circle.YesNormal, e2.D[t3] = At.RadioButton.Circle.YesPushDown, e2;
}, getCA: function() {
  return "l";
}, YesNormal: function(t3) {
  var e2 = V(t3);
  e2.scope = t3.scope;
  var r2 = [], n3 = At.internal.getWidth(t3) <= At.internal.getHeight(t3) ? At.internal.getWidth(t3) / 4 : At.internal.getHeight(t3) / 4;
  n3 = Number((0.9 * n3).toFixed(5));
  var i3 = At.internal.Bezier_C, a3 = Number((n3 * i3).toFixed(5));
  return r2.push("q"), r2.push("1 0 0 1 " + z(At.internal.getWidth(t3) / 2) + " " + z(At.internal.getHeight(t3) / 2) + " cm"), r2.push(n3 + " 0 m"), r2.push(n3 + " " + a3 + " " + a3 + " " + n3 + " 0 " + n3 + " c"), r2.push("-" + a3 + " " + n3 + " -" + n3 + " " + a3 + " -" + n3 + " 0 c"), r2.push("-" + n3 + " -" + a3 + " -" + a3 + " -" + n3 + " 0 -" + n3 + " c"), r2.push(a3 + " -" + n3 + " " + n3 + " -" + a3 + " " + n3 + " 0 c"), r2.push("f"), r2.push("Q"), e2.stream = r2.join("\n"), e2;
}, YesPushDown: function(t3) {
  var e2 = V(t3);
  e2.scope = t3.scope;
  var r2 = [], n3 = At.internal.getWidth(t3) <= At.internal.getHeight(t3) ? At.internal.getWidth(t3) / 4 : At.internal.getHeight(t3) / 4;
  n3 = Number((0.9 * n3).toFixed(5));
  var i3 = Number((2 * n3).toFixed(5)), a3 = Number((i3 * At.internal.Bezier_C).toFixed(5)), o3 = Number((n3 * At.internal.Bezier_C).toFixed(5));
  return r2.push("0.749023 g"), r2.push("q"), r2.push("1 0 0 1 " + z(At.internal.getWidth(t3) / 2) + " " + z(At.internal.getHeight(t3) / 2) + " cm"), r2.push(i3 + " 0 m"), r2.push(i3 + " " + a3 + " " + a3 + " " + i3 + " 0 " + i3 + " c"), r2.push("-" + a3 + " " + i3 + " -" + i3 + " " + a3 + " -" + i3 + " 0 c"), r2.push("-" + i3 + " -" + a3 + " -" + a3 + " -" + i3 + " 0 -" + i3 + " c"), r2.push(a3 + " -" + i3 + " " + i3 + " -" + a3 + " " + i3 + " 0 c"), r2.push("f"), r2.push("Q"), r2.push("0 g"), r2.push("q"), r2.push("1 0 0 1 " + z(At.internal.getWidth(t3) / 2) + " " + z(At.internal.getHeight(t3) / 2) + " cm"), r2.push(n3 + " 0 m"), r2.push(n3 + " " + o3 + " " + o3 + " " + n3 + " 0 " + n3 + " c"), r2.push("-" + o3 + " " + n3 + " -" + n3 + " " + o3 + " -" + n3 + " 0 c"), r2.push("-" + n3 + " -" + o3 + " -" + o3 + " -" + n3 + " 0 -" + n3 + " c"), r2.push(o3 + " -" + n3 + " " + n3 + " -" + o3 + " " + n3 + " 0 c"), r2.push("f"), r2.push("Q"), e2.stream = r2.join("\n"), e2;
}, OffPushDown: function(t3) {
  var e2 = V(t3);
  e2.scope = t3.scope;
  var r2 = [], n3 = At.internal.getWidth(t3) <= At.internal.getHeight(t3) ? At.internal.getWidth(t3) / 4 : At.internal.getHeight(t3) / 4;
  n3 = Number((0.9 * n3).toFixed(5));
  var i3 = Number((2 * n3).toFixed(5)), a3 = Number((i3 * At.internal.Bezier_C).toFixed(5));
  return r2.push("0.749023 g"), r2.push("q"), r2.push("1 0 0 1 " + z(At.internal.getWidth(t3) / 2) + " " + z(At.internal.getHeight(t3) / 2) + " cm"), r2.push(i3 + " 0 m"), r2.push(i3 + " " + a3 + " " + a3 + " " + i3 + " 0 " + i3 + " c"), r2.push("-" + a3 + " " + i3 + " -" + i3 + " " + a3 + " -" + i3 + " 0 c"), r2.push("-" + i3 + " -" + a3 + " -" + a3 + " -" + i3 + " 0 -" + i3 + " c"), r2.push(a3 + " -" + i3 + " " + i3 + " -" + a3 + " " + i3 + " 0 c"), r2.push("f"), r2.push("Q"), e2.stream = r2.join("\n"), e2;
} }, Cross: { createAppearanceStream: function(t3) {
  var e2 = { D: { Off: At.RadioButton.Cross.OffPushDown }, N: {} };
  return e2.N[t3] = At.RadioButton.Cross.YesNormal, e2.D[t3] = At.RadioButton.Cross.YesPushDown, e2;
}, getCA: function() {
  return "8";
}, YesNormal: function(t3) {
  var e2 = V(t3);
  e2.scope = t3.scope;
  var r2 = [], n3 = At.internal.calculateCross(t3);
  return r2.push("q"), r2.push("1 1 " + U(At.internal.getWidth(t3) - 2) + " " + U(At.internal.getHeight(t3) - 2) + " re"), r2.push("W"), r2.push("n"), r2.push(U(n3.x1.x) + " " + U(n3.x1.y) + " m"), r2.push(U(n3.x2.x) + " " + U(n3.x2.y) + " l"), r2.push(U(n3.x4.x) + " " + U(n3.x4.y) + " m"), r2.push(U(n3.x3.x) + " " + U(n3.x3.y) + " l"), r2.push("s"), r2.push("Q"), e2.stream = r2.join("\n"), e2;
}, YesPushDown: function(t3) {
  var e2 = V(t3);
  e2.scope = t3.scope;
  var r2 = At.internal.calculateCross(t3), n3 = [];
  return n3.push("0.749023 g"), n3.push("0 0 " + U(At.internal.getWidth(t3)) + " " + U(At.internal.getHeight(t3)) + " re"), n3.push("f"), n3.push("q"), n3.push("1 1 " + U(At.internal.getWidth(t3) - 2) + " " + U(At.internal.getHeight(t3) - 2) + " re"), n3.push("W"), n3.push("n"), n3.push(U(r2.x1.x) + " " + U(r2.x1.y) + " m"), n3.push(U(r2.x2.x) + " " + U(r2.x2.y) + " l"), n3.push(U(r2.x4.x) + " " + U(r2.x4.y) + " m"), n3.push(U(r2.x3.x) + " " + U(r2.x3.y) + " l"), n3.push("s"), n3.push("Q"), e2.stream = n3.join("\n"), e2;
}, OffPushDown: function(t3) {
  var e2 = V(t3);
  e2.scope = t3.scope;
  var r2 = [];
  return r2.push("0.749023 g"), r2.push("0 0 " + U(At.internal.getWidth(t3)) + " " + U(At.internal.getHeight(t3)) + " re"), r2.push("f"), e2.stream = r2.join("\n"), e2;
} } }, createDefaultAppearanceStream: function(t3) {
  var e2 = t3.scope.internal.getFont(t3.fontName, t3.fontStyle).id, r2 = t3.scope.__private__.encodeColorString(t3.color);
  return "/" + e2 + " " + t3.fontSize + " Tf " + r2;
} };
At.internal = { Bezier_C: 0.551915024494, calculateCross: function(t3) {
  var e2 = At.internal.getWidth(t3), r2 = At.internal.getHeight(t3), n3 = Math.min(e2, r2);
  return { x1: { x: (e2 - n3) / 2, y: (r2 - n3) / 2 + n3 }, x2: { x: (e2 - n3) / 2 + n3, y: (r2 - n3) / 2 }, x3: { x: (e2 - n3) / 2, y: (r2 - n3) / 2 }, x4: { x: (e2 - n3) / 2 + n3, y: (r2 - n3) / 2 + n3 } };
} }, At.internal.getWidth = function(e2) {
  var r2 = 0;
  return "object" === _typeof(e2) && (r2 = W(e2.Rect[2])), r2;
}, At.internal.getHeight = function(e2) {
  var r2 = 0;
  return "object" === _typeof(e2) && (r2 = W(e2.Rect[3])), r2;
};
var xt = q.addField = function(t3) {
  if (at(this, t3), !(t3 instanceof lt))
    throw new Error("Invalid argument passed to jsPDF.addField.");
  var e2;
  return (e2 = t3).scope.internal.acroformPlugin.printedOut && (e2.scope.internal.acroformPlugin.printedOut = false, e2.scope.internal.acroformPlugin.acroFormDictionaryRoot = null), e2.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(e2), t3.page = t3.scope.internal.getCurrentPageInfo().pageNumber, this;
};
q.AcroFormChoiceField = ft, q.AcroFormListBox = dt, q.AcroFormComboBox = pt, q.AcroFormEditBox = gt, q.AcroFormButton = mt, q.AcroFormPushButton = vt, q.AcroFormRadioButton = bt, q.AcroFormCheckBox = wt, q.AcroFormTextField = Nt, q.AcroFormPasswordField = Lt, q.AcroFormAppearance = At, q.AcroForm = { ChoiceField: ft, ListBox: dt, ComboBox: pt, EditBox: gt, Button: mt, PushButton: vt, RadioButton: bt, CheckBox: wt, TextField: Nt, PasswordField: Lt, Appearance: At }, E.AcroForm = { ChoiceField: ft, ListBox: dt, ComboBox: pt, EditBox: gt, Button: mt, PushButton: vt, RadioButton: bt, CheckBox: wt, TextField: Nt, PasswordField: Lt, Appearance: At };
var St = E.AcroForm;
function _t(t3) {
  return t3.reduce(function(t4, e2, r2) {
    return t4[e2] = r2, t4;
  }, {});
}
!function(e2) {
  e2.__addimage__ = {};
  var r2 = "UNKNOWN", n3 = { PNG: [[137, 80, 78, 71]], TIFF: [[77, 77, 0, 42], [73, 73, 42, 0]], JPEG: [[255, 216, 255, 224, void 0, void 0, 74, 70, 73, 70, 0], [255, 216, 255, 225, void 0, void 0, 69, 120, 105, 102, 0, 0], [255, 216, 255, 219], [255, 216, 255, 238]], JPEG2000: [[0, 0, 0, 12, 106, 80, 32, 32]], GIF87a: [[71, 73, 70, 56, 55, 97]], GIF89a: [[71, 73, 70, 56, 57, 97]], WEBP: [[82, 73, 70, 70, void 0, void 0, void 0, void 0, 87, 69, 66, 80]], BMP: [[66, 77], [66, 65], [67, 73], [67, 80], [73, 67], [80, 84]] }, i3 = e2.__addimage__.getImageFileTypeByImageData = function(t3, e3) {
    var i4, a4, o4, s4, c5, u3 = r2;
    if ("RGBA" === (e3 = e3 || r2) || void 0 !== t3.data && t3.data instanceof Uint8ClampedArray && "height" in t3 && "width" in t3)
      return "RGBA";
    if (x3(t3))
      for (c5 in n3)
        for (o4 = n3[c5], i4 = 0; i4 < o4.length; i4 += 1) {
          for (s4 = true, a4 = 0; a4 < o4[i4].length; a4 += 1)
            if (void 0 !== o4[i4][a4] && o4[i4][a4] !== t3[a4]) {
              s4 = false;
              break;
            }
          if (true === s4) {
            u3 = c5;
            break;
          }
        }
    else
      for (c5 in n3)
        for (o4 = n3[c5], i4 = 0; i4 < o4.length; i4 += 1) {
          for (s4 = true, a4 = 0; a4 < o4[i4].length; a4 += 1)
            if (void 0 !== o4[i4][a4] && o4[i4][a4] !== t3.charCodeAt(a4)) {
              s4 = false;
              break;
            }
          if (true === s4) {
            u3 = c5;
            break;
          }
        }
    return u3 === r2 && e3 !== r2 && (u3 = e3), u3;
  }, a3 = function t3(e3) {
    for (var r3 = this.internal.write, n4 = this.internal.putStream, i4 = (0, this.internal.getFilters)(); -1 !== i4.indexOf("FlateEncode"); )
      i4.splice(i4.indexOf("FlateEncode"), 1);
    e3.objectId = this.internal.newObject();
    var a4 = [];
    if (a4.push({ key: "Type", value: "/XObject" }), a4.push({ key: "Subtype", value: "/Image" }), a4.push({ key: "Width", value: e3.width }), a4.push({ key: "Height", value: e3.height }), e3.colorSpace === b2.INDEXED ? a4.push({ key: "ColorSpace", value: "[/Indexed /DeviceRGB " + (e3.palette.length / 3 - 1) + " " + ("sMask" in e3 && void 0 !== e3.sMask ? e3.objectId + 2 : e3.objectId + 1) + " 0 R]" }) : (a4.push({ key: "ColorSpace", value: "/" + e3.colorSpace }), e3.colorSpace === b2.DEVICE_CMYK && a4.push({ key: "Decode", value: "[1 0 1 0 1 0 1 0]" })), a4.push({ key: "BitsPerComponent", value: e3.bitsPerComponent }), "decodeParameters" in e3 && void 0 !== e3.decodeParameters && a4.push({ key: "DecodeParms", value: "<<" + e3.decodeParameters + ">>" }), "transparency" in e3 && Array.isArray(e3.transparency)) {
      for (var o4 = "", s4 = 0, c5 = e3.transparency.length; s4 < c5; s4++)
        o4 += e3.transparency[s4] + " " + e3.transparency[s4] + " ";
      a4.push({ key: "Mask", value: "[" + o4 + "]" });
    }
    void 0 !== e3.sMask && a4.push({ key: "SMask", value: e3.objectId + 1 + " 0 R" });
    var u3 = void 0 !== e3.filter ? ["/" + e3.filter] : void 0;
    if (n4({ data: e3.data, additionalKeyValues: a4, alreadyAppliedFilters: u3, objectId: e3.objectId }), r3("endobj"), "sMask" in e3 && void 0 !== e3.sMask) {
      var h4 = "/Predictor " + e3.predictor + " /Colors 1 /BitsPerComponent " + e3.bitsPerComponent + " /Columns " + e3.width, l4 = { width: e3.width, height: e3.height, colorSpace: "DeviceGray", bitsPerComponent: e3.bitsPerComponent, decodeParameters: h4, data: e3.sMask };
      "filter" in e3 && (l4.filter = e3.filter), t3.call(this, l4);
    }
    if (e3.colorSpace === b2.INDEXED) {
      var f4 = this.internal.newObject();
      n4({ data: _3(new Uint8Array(e3.palette)), objectId: f4 }), r3("endobj");
    }
  }, o3 = function() {
    var t3 = this.internal.collections.addImage_images;
    for (var e3 in t3)
      a3.call(this, t3[e3]);
  }, s3 = function() {
    var t3, e3 = this.internal.collections.addImage_images, r3 = this.internal.write;
    for (var n4 in e3)
      r3("/I" + (t3 = e3[n4]).index, t3.objectId, "0", "R");
  }, c4 = function() {
    this.internal.collections.addImage_images || (this.internal.collections.addImage_images = {}, this.internal.events.subscribe("putResources", o3), this.internal.events.subscribe("putXobjectDict", s3));
  }, h3 = function() {
    var t3 = this.internal.collections.addImage_images;
    return c4.call(this), t3;
  }, l3 = function() {
    return Object.keys(this.internal.collections.addImage_images).length;
  }, f3 = function(t3) {
    return "function" == typeof e2["process" + t3.toUpperCase()];
  }, d2 = function(e3) {
    return "object" === _typeof(e3) && 1 === e3.nodeType;
  }, p3 = function(t3, r3) {
    if ("IMG" === t3.nodeName && t3.hasAttribute("src")) {
      var n4 = "" + t3.getAttribute("src");
      if (0 === n4.indexOf("data:image/"))
        return u2(unescape(n4).split("base64,").pop());
      var i4 = e2.loadFile(n4, true);
      if (void 0 !== i4)
        return i4;
    }
    if ("CANVAS" === t3.nodeName) {
      if (0 === t3.width || 0 === t3.height)
        throw new Error("Given canvas must have data. Canvas width: " + t3.width + ", height: " + t3.height);
      var a4;
      switch (r3) {
        case "PNG":
          a4 = "image/png";
          break;
        case "WEBP":
          a4 = "image/webp";
          break;
        case "JPEG":
        case "JPG":
        default:
          a4 = "image/jpeg";
      }
      return u2(t3.toDataURL(a4, 1).split("base64,").pop());
    }
  }, g2 = function(t3) {
    var e3 = this.internal.collections.addImage_images;
    if (e3) {
      for (var r3 in e3)
        if (t3 === e3[r3].alias)
          return e3[r3];
    }
  }, m4 = function(t3, e3, r3) {
    return t3 || e3 || (t3 = -96, e3 = -96), t3 < 0 && (t3 = -1 * r3.width * 72 / t3 / this.internal.scaleFactor), e3 < 0 && (e3 = -1 * r3.height * 72 / e3 / this.internal.scaleFactor), 0 === t3 && (t3 = e3 * r3.width / r3.height), 0 === e3 && (e3 = t3 * r3.height / r3.width), [t3, e3];
  }, v3 = function(t3, e3, r3, n4, i4, a4) {
    var o4 = m4.call(this, r3, n4, i4), s4 = this.internal.getCoordinateString, c5 = this.internal.getVerticalCoordinateString, u3 = h3.call(this);
    if (r3 = o4[0], n4 = o4[1], u3[i4.index] = i4, a4) {
      a4 *= Math.PI / 180;
      var l4 = Math.cos(a4), f4 = Math.sin(a4), d3 = function(t4) {
        return t4.toFixed(4);
      }, p4 = [d3(l4), d3(f4), d3(-1 * f4), d3(l4), 0, 0, "cm"];
    }
    this.internal.write("q"), a4 ? (this.internal.write([1, "0", "0", 1, s4(t3), c5(e3 + n4), "cm"].join(" ")), this.internal.write(p4.join(" ")), this.internal.write([s4(r3), "0", "0", s4(n4), "0", "0", "cm"].join(" "))) : this.internal.write([s4(r3), "0", "0", s4(n4), s4(t3), c5(e3 + n4), "cm"].join(" ")), this.isAdvancedAPI() && this.internal.write([1, 0, 0, -1, 0, 0, "cm"].join(" ")), this.internal.write("/I" + i4.index + " Do"), this.internal.write("Q");
  }, b2 = e2.color_spaces = { DEVICE_RGB: "DeviceRGB", DEVICE_GRAY: "DeviceGray", DEVICE_CMYK: "DeviceCMYK", CAL_GREY: "CalGray", CAL_RGB: "CalRGB", LAB: "Lab", ICC_BASED: "ICCBased", INDEXED: "Indexed", PATTERN: "Pattern", SEPARATION: "Separation", DEVICE_N: "DeviceN" };
  e2.decode = { DCT_DECODE: "DCTDecode", FLATE_DECODE: "FlateDecode", LZW_DECODE: "LZWDecode", JPX_DECODE: "JPXDecode", JBIG2_DECODE: "JBIG2Decode", ASCII85_DECODE: "ASCII85Decode", ASCII_HEX_DECODE: "ASCIIHexDecode", RUN_LENGTH_DECODE: "RunLengthDecode", CCITT_FAX_DECODE: "CCITTFaxDecode" };
  var y4 = e2.image_compression = { NONE: "NONE", FAST: "FAST", MEDIUM: "MEDIUM", SLOW: "SLOW" }, w2 = e2.__addimage__.sHashCode = function(t3) {
    var e3, r3, n4 = 0;
    if ("string" == typeof t3)
      for (r3 = t3.length, e3 = 0; e3 < r3; e3++)
        n4 = (n4 << 5) - n4 + t3.charCodeAt(e3), n4 |= 0;
    else if (x3(t3))
      for (r3 = t3.byteLength / 2, e3 = 0; e3 < r3; e3++)
        n4 = (n4 << 5) - n4 + t3[e3], n4 |= 0;
    return n4;
  }, N3 = e2.__addimage__.validateStringAsBase64 = function(t3) {
    (t3 = t3 || "").toString().trim();
    var e3 = true;
    return 0 === t3.length && (e3 = false), t3.length % 4 != 0 && (e3 = false), false === /^[A-Za-z0-9+/]+$/.test(t3.substr(0, t3.length - 2)) && (e3 = false), false === /^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(t3.substr(-2)) && (e3 = false), e3;
  }, L2 = e2.__addimage__.extractImageFromDataUrl = function(t3) {
    var e3 = (t3 = t3 || "").split("base64,"), r3 = null;
    if (2 === e3.length) {
      var n4 = /^data:(\w*\/\w*);*(charset=(?!charset=)[\w=-]*)*;*$/.exec(e3[0]);
      Array.isArray(n4) && (r3 = { mimeType: n4[1], charset: n4[2], data: e3[1] });
    }
    return r3;
  }, A3 = e2.__addimage__.supportsArrayBuffer = function() {
    return "undefined" != typeof ArrayBuffer && "undefined" != typeof Uint8Array;
  };
  e2.__addimage__.isArrayBuffer = function(t3) {
    return A3() && t3 instanceof ArrayBuffer;
  };
  var x3 = e2.__addimage__.isArrayBufferView = function(t3) {
    return A3() && "undefined" != typeof Uint32Array && (t3 instanceof Int8Array || t3 instanceof Uint8Array || "undefined" != typeof Uint8ClampedArray && t3 instanceof Uint8ClampedArray || t3 instanceof Int16Array || t3 instanceof Uint16Array || t3 instanceof Int32Array || t3 instanceof Uint32Array || t3 instanceof Float32Array || t3 instanceof Float64Array);
  }, S2 = e2.__addimage__.binaryStringToUint8Array = function(t3) {
    for (var e3 = t3.length, r3 = new Uint8Array(e3), n4 = 0; n4 < e3; n4++)
      r3[n4] = t3.charCodeAt(n4);
    return r3;
  }, _3 = e2.__addimage__.arrayBufferToBinaryString = function(t3) {
    for (var e3 = "", r3 = x3(t3) ? t3 : new Uint8Array(t3), n4 = 0; n4 < r3.length; n4 += 8192)
      e3 += String.fromCharCode.apply(null, r3.subarray(n4, n4 + 8192));
    return e3;
  };
  e2.addImage = function() {
    var e3, n4, i4, a4, o4, s4, u3, h4, l4;
    if ("number" == typeof arguments[1] ? (n4 = r2, i4 = arguments[1], a4 = arguments[2], o4 = arguments[3], s4 = arguments[4], u3 = arguments[5], h4 = arguments[6], l4 = arguments[7]) : (n4 = arguments[1], i4 = arguments[2], a4 = arguments[3], o4 = arguments[4], s4 = arguments[5], u3 = arguments[6], h4 = arguments[7], l4 = arguments[8]), "object" === _typeof(e3 = arguments[0]) && !d2(e3) && "imageData" in e3) {
      var f4 = e3;
      e3 = f4.imageData, n4 = f4.format || n4 || r2, i4 = f4.x || i4 || 0, a4 = f4.y || a4 || 0, o4 = f4.w || f4.width || o4, s4 = f4.h || f4.height || s4, u3 = f4.alias || u3, h4 = f4.compression || h4, l4 = f4.rotation || f4.angle || l4;
    }
    var p4 = this.internal.getFilters();
    if (void 0 === h4 && -1 !== p4.indexOf("FlateEncode") && (h4 = "SLOW"), isNaN(i4) || isNaN(a4))
      throw new Error("Invalid coordinates passed to jsPDF.addImage");
    c4.call(this);
    var g3 = P2.call(this, e3, n4, u3, h4);
    return v3.call(this, i4, a4, o4, s4, g3, l4), this;
  };
  var P2 = function(t3, n4, a4, o4) {
    var s4, c5, u3;
    if ("string" == typeof t3 && i3(t3) === r2) {
      t3 = unescape(t3);
      var h4 = k2(t3, false);
      ("" !== h4 || void 0 !== (h4 = e2.loadFile(t3, true))) && (t3 = h4);
    }
    if (d2(t3) && (t3 = p3(t3, n4)), n4 = i3(t3, n4), !f3(n4))
      throw new Error("addImage does not support files of type '" + n4 + "', please ensure that a plugin for '" + n4 + "' support is added.");
    if ((null == (u3 = a4) || 0 === u3.length) && (a4 = function(t4) {
      return "string" == typeof t4 || x3(t4) ? w2(t4) : x3(t4.data) ? w2(t4.data) : null;
    }(t3)), (s4 = g2.call(this, a4)) || (A3() && (t3 instanceof Uint8Array || "RGBA" === n4 || (c5 = t3, t3 = S2(t3))), s4 = this["process" + n4.toUpperCase()](t3, l3.call(this), a4, function(t4) {
      return t4 && "string" == typeof t4 && (t4 = t4.toUpperCase()), t4 in e2.image_compression ? t4 : y4.NONE;
    }(o4), c5)), !s4)
      throw new Error("An unknown error occurred whilst processing the image.");
    return s4;
  }, k2 = e2.__addimage__.convertBase64ToBinaryString = function(t3, e3) {
    var r3;
    e3 = "boolean" != typeof e3 || e3;
    var n4, i4 = "";
    if ("string" == typeof t3) {
      n4 = null !== (r3 = L2(t3)) ? r3.data : t3;
      try {
        i4 = u2(n4);
      } catch (t4) {
        if (e3)
          throw N3(n4) ? new Error("atob-Error in jsPDF.convertBase64ToBinaryString " + t4.message) : new Error("Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString ");
      }
    }
    return i4;
  };
  e2.getImageProperties = function(t3) {
    var n4, a4, o4 = "";
    if (d2(t3) && (t3 = p3(t3)), "string" == typeof t3 && i3(t3) === r2 && ("" === (o4 = k2(t3, false)) && (o4 = e2.loadFile(t3) || ""), t3 = o4), a4 = i3(t3), !f3(a4))
      throw new Error("addImage does not support files of type '" + a4 + "', please ensure that a plugin for '" + a4 + "' support is added.");
    if (!A3() || t3 instanceof Uint8Array || (t3 = S2(t3)), !(n4 = this["process" + a4.toUpperCase()](t3)))
      throw new Error("An unknown error occurred whilst processing the image");
    return n4.fileType = a4, n4;
  };
}(E.API), /**
 * @license
 * Copyright (c) 2014 Steven Spungin (TwelveTone LLC)  steven@twelvetone.tv
 *
 * Licensed under the MIT License.
 * http://opensource.org/licenses/mit-license
 */
function(t3) {
  var e2 = function(t4) {
    if (void 0 !== t4 && "" != t4)
      return true;
  };
  E.API.events.push(["addPage", function(t4) {
    this.internal.getPageInfo(t4.pageNumber).pageContext.annotations = [];
  }]), t3.events.push(["putPage", function(t4) {
    for (var r2, n3, i3, a3 = this.internal.getCoordinateString, o3 = this.internal.getVerticalCoordinateString, s3 = this.internal.getPageInfoByObjId(t4.objId), c4 = t4.pageContext.annotations, u3 = false, h3 = 0; h3 < c4.length && !u3; h3++)
      switch ((r2 = c4[h3]).type) {
        case "link":
          (e2(r2.options.url) || e2(r2.options.pageNumber)) && (u3 = true);
          break;
        case "reference":
        case "text":
        case "freetext":
          u3 = true;
      }
    if (0 != u3) {
      this.internal.write("/Annots [");
      for (var l3 = 0; l3 < c4.length; l3++) {
        r2 = c4[l3];
        var f3 = this.internal.pdfEscape, d2 = this.internal.getEncryptor(t4.objId);
        switch (r2.type) {
          case "reference":
            this.internal.write(" " + r2.object.objId + " 0 R ");
            break;
          case "text":
            var p3 = this.internal.newAdditionalObject(), g2 = this.internal.newAdditionalObject(), m4 = this.internal.getEncryptor(p3.objId), v3 = r2.title || "Note";
            i3 = "<</Type /Annot /Subtype /Text " + (n3 = "/Rect [" + a3(r2.bounds.x) + " " + o3(r2.bounds.y + r2.bounds.h) + " " + a3(r2.bounds.x + r2.bounds.w) + " " + o3(r2.bounds.y) + "] ") + "/Contents (" + f3(m4(r2.contents)) + ")", i3 += " /Popup " + g2.objId + " 0 R", i3 += " /P " + s3.objId + " 0 R", i3 += " /T (" + f3(m4(v3)) + ") >>", p3.content = i3;
            var b2 = p3.objId + " 0 R";
            i3 = "<</Type /Annot /Subtype /Popup " + (n3 = "/Rect [" + a3(r2.bounds.x + 30) + " " + o3(r2.bounds.y + r2.bounds.h) + " " + a3(r2.bounds.x + r2.bounds.w + 30) + " " + o3(r2.bounds.y) + "] ") + " /Parent " + b2, r2.open && (i3 += " /Open true"), i3 += " >>", g2.content = i3, this.internal.write(p3.objId, "0 R", g2.objId, "0 R");
            break;
          case "freetext":
            n3 = "/Rect [" + a3(r2.bounds.x) + " " + o3(r2.bounds.y) + " " + a3(r2.bounds.x + r2.bounds.w) + " " + o3(r2.bounds.y + r2.bounds.h) + "] ";
            var y4 = r2.color || "#000000";
            i3 = "<</Type /Annot /Subtype /FreeText " + n3 + "/Contents (" + f3(d2(r2.contents)) + ")", i3 += " /DS(font: Helvetica,sans-serif 12.0pt; text-align:left; color:#" + y4 + ")", i3 += " /Border [0 0 0]", i3 += " >>", this.internal.write(i3);
            break;
          case "link":
            if (r2.options.name) {
              var w2 = this.annotations._nameMap[r2.options.name];
              r2.options.pageNumber = w2.page, r2.options.top = w2.y;
            } else
              r2.options.top || (r2.options.top = 0);
            if (n3 = "/Rect [" + r2.finalBounds.x + " " + r2.finalBounds.y + " " + r2.finalBounds.w + " " + r2.finalBounds.h + "] ", i3 = "", r2.options.url)
              i3 = "<</Type /Annot /Subtype /Link " + n3 + "/Border [0 0 0] /A <</S /URI /URI (" + f3(d2(r2.options.url)) + ") >>";
            else if (r2.options.pageNumber) {
              switch (i3 = "<</Type /Annot /Subtype /Link " + n3 + "/Border [0 0 0] /Dest [" + this.internal.getPageInfo(r2.options.pageNumber).objId + " 0 R", r2.options.magFactor = r2.options.magFactor || "XYZ", r2.options.magFactor) {
                case "Fit":
                  i3 += " /Fit]";
                  break;
                case "FitH":
                  i3 += " /FitH " + r2.options.top + "]";
                  break;
                case "FitV":
                  r2.options.left = r2.options.left || 0, i3 += " /FitV " + r2.options.left + "]";
                  break;
                case "XYZ":
                default:
                  var N3 = o3(r2.options.top);
                  r2.options.left = r2.options.left || 0, void 0 === r2.options.zoom && (r2.options.zoom = 0), i3 += " /XYZ " + r2.options.left + " " + N3 + " " + r2.options.zoom + "]";
              }
            }
            "" != i3 && (i3 += " >>", this.internal.write(i3));
        }
      }
      this.internal.write("]");
    }
  }]), t3.createAnnotation = function(t4) {
    var e3 = this.internal.getCurrentPageInfo();
    switch (t4.type) {
      case "link":
        this.link(t4.bounds.x, t4.bounds.y, t4.bounds.w, t4.bounds.h, t4);
        break;
      case "text":
      case "freetext":
        e3.pageContext.annotations.push(t4);
    }
  }, t3.link = function(t4, e3, r2, n3, i3) {
    var a3 = this.internal.getCurrentPageInfo(), o3 = this.internal.getCoordinateString, s3 = this.internal.getVerticalCoordinateString;
    a3.pageContext.annotations.push({ finalBounds: { x: o3(t4), y: s3(e3), w: o3(t4 + r2), h: s3(e3 + n3) }, options: i3, type: "link" });
  }, t3.textWithLink = function(t4, e3, r2, n3) {
    var i3, a3, o3 = this.getTextWidth(t4), s3 = this.internal.getLineHeight() / this.internal.scaleFactor;
    if (void 0 !== n3.maxWidth) {
      a3 = n3.maxWidth;
      var c4 = this.splitTextToSize(t4, a3).length;
      i3 = Math.ceil(s3 * c4);
    } else
      a3 = o3, i3 = s3;
    return this.text(t4, e3, r2, n3), r2 += 0.2 * s3, "center" === n3.align && (e3 -= o3 / 2), "right" === n3.align && (e3 -= o3), this.link(e3, r2 - s3, a3, i3, n3), o3;
  }, t3.getTextWidth = function(t4) {
    var e3 = this.internal.getFontSize();
    return this.getStringUnitWidth(t4) * e3 / this.internal.scaleFactor;
  };
}(E.API), /**
 * @license
 * Copyright (c) 2017 Aras Abbasi
 *
 * Licensed under the MIT License.
 * http://opensource.org/licenses/mit-license
 */
function(t3) {
  var e2 = { 1569: [65152], 1570: [65153, 65154], 1571: [65155, 65156], 1572: [65157, 65158], 1573: [65159, 65160], 1574: [65161, 65162, 65163, 65164], 1575: [65165, 65166], 1576: [65167, 65168, 65169, 65170], 1577: [65171, 65172], 1578: [65173, 65174, 65175, 65176], 1579: [65177, 65178, 65179, 65180], 1580: [65181, 65182, 65183, 65184], 1581: [65185, 65186, 65187, 65188], 1582: [65189, 65190, 65191, 65192], 1583: [65193, 65194], 1584: [65195, 65196], 1585: [65197, 65198], 1586: [65199, 65200], 1587: [65201, 65202, 65203, 65204], 1588: [65205, 65206, 65207, 65208], 1589: [65209, 65210, 65211, 65212], 1590: [65213, 65214, 65215, 65216], 1591: [65217, 65218, 65219, 65220], 1592: [65221, 65222, 65223, 65224], 1593: [65225, 65226, 65227, 65228], 1594: [65229, 65230, 65231, 65232], 1601: [65233, 65234, 65235, 65236], 1602: [65237, 65238, 65239, 65240], 1603: [65241, 65242, 65243, 65244], 1604: [65245, 65246, 65247, 65248], 1605: [65249, 65250, 65251, 65252], 1606: [65253, 65254, 65255, 65256], 1607: [65257, 65258, 65259, 65260], 1608: [65261, 65262], 1609: [65263, 65264, 64488, 64489], 1610: [65265, 65266, 65267, 65268], 1649: [64336, 64337], 1655: [64477], 1657: [64358, 64359, 64360, 64361], 1658: [64350, 64351, 64352, 64353], 1659: [64338, 64339, 64340, 64341], 1662: [64342, 64343, 64344, 64345], 1663: [64354, 64355, 64356, 64357], 1664: [64346, 64347, 64348, 64349], 1667: [64374, 64375, 64376, 64377], 1668: [64370, 64371, 64372, 64373], 1670: [64378, 64379, 64380, 64381], 1671: [64382, 64383, 64384, 64385], 1672: [64392, 64393], 1676: [64388, 64389], 1677: [64386, 64387], 1678: [64390, 64391], 1681: [64396, 64397], 1688: [64394, 64395], 1700: [64362, 64363, 64364, 64365], 1702: [64366, 64367, 64368, 64369], 1705: [64398, 64399, 64400, 64401], 1709: [64467, 64468, 64469, 64470], 1711: [64402, 64403, 64404, 64405], 1713: [64410, 64411, 64412, 64413], 1715: [64406, 64407, 64408, 64409], 1722: [64414, 64415], 1723: [64416, 64417, 64418, 64419], 1726: [64426, 64427, 64428, 64429], 1728: [64420, 64421], 1729: [64422, 64423, 64424, 64425], 1733: [64480, 64481], 1734: [64473, 64474], 1735: [64471, 64472], 1736: [64475, 64476], 1737: [64482, 64483], 1739: [64478, 64479], 1740: [64508, 64509, 64510, 64511], 1744: [64484, 64485, 64486, 64487], 1746: [64430, 64431], 1747: [64432, 64433] }, r2 = { 65247: { 65154: 65269, 65156: 65271, 65160: 65273, 65166: 65275 }, 65248: { 65154: 65270, 65156: 65272, 65160: 65274, 65166: 65276 }, 65165: { 65247: { 65248: { 65258: 65010 } } }, 1617: { 1612: 64606, 1613: 64607, 1614: 64608, 1615: 64609, 1616: 64610 } }, n3 = { 1612: 64606, 1613: 64607, 1614: 64608, 1615: 64609, 1616: 64610 }, i3 = [1570, 1571, 1573, 1575];
  t3.__arabicParser__ = {};
  var a3 = t3.__arabicParser__.isInArabicSubstitutionA = function(t4) {
    return void 0 !== e2[t4.charCodeAt(0)];
  }, o3 = t3.__arabicParser__.isArabicLetter = function(t4) {
    return "string" == typeof t4 && /^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(t4);
  }, s3 = t3.__arabicParser__.isArabicEndLetter = function(t4) {
    return o3(t4) && a3(t4) && e2[t4.charCodeAt(0)].length <= 2;
  }, c4 = t3.__arabicParser__.isArabicAlfLetter = function(t4) {
    return o3(t4) && i3.indexOf(t4.charCodeAt(0)) >= 0;
  };
  t3.__arabicParser__.arabicLetterHasIsolatedForm = function(t4) {
    return o3(t4) && a3(t4) && e2[t4.charCodeAt(0)].length >= 1;
  };
  var u3 = t3.__arabicParser__.arabicLetterHasFinalForm = function(t4) {
    return o3(t4) && a3(t4) && e2[t4.charCodeAt(0)].length >= 2;
  };
  t3.__arabicParser__.arabicLetterHasInitialForm = function(t4) {
    return o3(t4) && a3(t4) && e2[t4.charCodeAt(0)].length >= 3;
  };
  var h3 = t3.__arabicParser__.arabicLetterHasMedialForm = function(t4) {
    return o3(t4) && a3(t4) && 4 == e2[t4.charCodeAt(0)].length;
  }, l3 = t3.__arabicParser__.resolveLigatures = function(t4) {
    var e3 = 0, n4 = r2, i4 = "", a4 = 0;
    for (e3 = 0; e3 < t4.length; e3 += 1)
      void 0 !== n4[t4.charCodeAt(e3)] ? (a4++, "number" == typeof (n4 = n4[t4.charCodeAt(e3)]) && (i4 += String.fromCharCode(n4), n4 = r2, a4 = 0), e3 === t4.length - 1 && (n4 = r2, i4 += t4.charAt(e3 - (a4 - 1)), e3 -= a4 - 1, a4 = 0)) : (n4 = r2, i4 += t4.charAt(e3 - a4), e3 -= a4, a4 = 0);
    return i4;
  };
  t3.__arabicParser__.isArabicDiacritic = function(t4) {
    return void 0 !== t4 && void 0 !== n3[t4.charCodeAt(0)];
  };
  var f3 = t3.__arabicParser__.getCorrectForm = function(t4, e3, r3) {
    return o3(t4) ? false === a3(t4) ? -1 : !u3(t4) || !o3(e3) && !o3(r3) || !o3(r3) && s3(e3) || s3(t4) && !o3(e3) || s3(t4) && c4(e3) || s3(t4) && s3(e3) ? 0 : h3(t4) && o3(e3) && !s3(e3) && o3(r3) && u3(r3) ? 3 : s3(t4) || !o3(r3) ? 1 : 2 : -1;
  }, d2 = function(t4) {
    var r3 = 0, n4 = 0, i4 = 0, a4 = "", s4 = "", c5 = "", u4 = (t4 = t4 || "").split("\\s+"), h4 = [];
    for (r3 = 0; r3 < u4.length; r3 += 1) {
      for (h4.push(""), n4 = 0; n4 < u4[r3].length; n4 += 1)
        a4 = u4[r3][n4], s4 = u4[r3][n4 - 1], c5 = u4[r3][n4 + 1], o3(a4) ? (i4 = f3(a4, s4, c5), h4[r3] += -1 !== i4 ? String.fromCharCode(e2[a4.charCodeAt(0)][i4]) : a4) : h4[r3] += a4;
      h4[r3] = l3(h4[r3]);
    }
    return h4.join(" ");
  }, p3 = t3.__arabicParser__.processArabic = t3.processArabic = function() {
    var t4, e3 = "string" == typeof arguments[0] ? arguments[0] : arguments[0].text, r3 = [];
    if (Array.isArray(e3)) {
      var n4 = 0;
      for (r3 = [], n4 = 0; n4 < e3.length; n4 += 1)
        Array.isArray(e3[n4]) ? r3.push([d2(e3[n4][0]), e3[n4][1], e3[n4][2]]) : r3.push([d2(e3[n4])]);
      t4 = r3;
    } else
      t4 = d2(e3);
    return "string" == typeof arguments[0] ? t4 : (arguments[0].text = t4, arguments[0]);
  };
  t3.events.push(["preProcessText", p3]);
}(E.API), E.API.autoPrint = function(t3) {
  var e2;
  switch ((t3 = t3 || {}).variant = t3.variant || "non-conform", t3.variant) {
    case "javascript":
      this.addJS("print({});");
      break;
    case "non-conform":
    default:
      this.internal.events.subscribe("postPutResources", function() {
        e2 = this.internal.newObject(), this.internal.out("<<"), this.internal.out("/S /Named"), this.internal.out("/Type /Action"), this.internal.out("/N /Print"), this.internal.out(">>"), this.internal.out("endobj");
      }), this.internal.events.subscribe("putCatalog", function() {
        this.internal.out("/OpenAction " + e2 + " 0 R");
      });
  }
  return this;
}, /**
 * @license
 * Copyright (c) 2014 Steven Spungin (TwelveTone LLC)  steven@twelvetone.tv
 *
 * Licensed under the MIT License.
 * http://opensource.org/licenses/mit-license
 */
function(t3) {
  var e2 = function() {
    var t4 = void 0;
    Object.defineProperty(this, "pdf", { get: function() {
      return t4;
    }, set: function(e4) {
      t4 = e4;
    } });
    var e3 = 150;
    Object.defineProperty(this, "width", { get: function() {
      return e3;
    }, set: function(t5) {
      e3 = isNaN(t5) || false === Number.isInteger(t5) || t5 < 0 ? 150 : t5, this.getContext("2d").pageWrapXEnabled && (this.getContext("2d").pageWrapX = e3 + 1);
    } });
    var r2 = 300;
    Object.defineProperty(this, "height", { get: function() {
      return r2;
    }, set: function(t5) {
      r2 = isNaN(t5) || false === Number.isInteger(t5) || t5 < 0 ? 300 : t5, this.getContext("2d").pageWrapYEnabled && (this.getContext("2d").pageWrapY = r2 + 1);
    } });
    var n3 = [];
    Object.defineProperty(this, "childNodes", { get: function() {
      return n3;
    }, set: function(t5) {
      n3 = t5;
    } });
    var i3 = {};
    Object.defineProperty(this, "style", { get: function() {
      return i3;
    }, set: function(t5) {
      i3 = t5;
    } }), Object.defineProperty(this, "parentNode", {});
  };
  e2.prototype.getContext = function(t4, e3) {
    var r2;
    if ("2d" !== (t4 = t4 || "2d"))
      return null;
    for (r2 in e3)
      this.pdf.context2d.hasOwnProperty(r2) && (this.pdf.context2d[r2] = e3[r2]);
    return this.pdf.context2d._canvas = this, this.pdf.context2d;
  }, e2.prototype.toDataURL = function() {
    throw new Error("toDataURL is not implemented.");
  }, t3.events.push(["initialized", function() {
    this.canvas = new e2(), this.canvas.pdf = this;
  }]);
}(E.API), function(e2) {
  var r2 = { left: 0, top: 0, bottom: 0, right: 0 }, n3 = false, i3 = function() {
    void 0 === this.internal.__cell__ && (this.internal.__cell__ = {}, this.internal.__cell__.padding = 3, this.internal.__cell__.headerFunction = void 0, this.internal.__cell__.margins = Object.assign({}, r2), this.internal.__cell__.margins.width = this.getPageWidth(), a3.call(this));
  }, a3 = function() {
    this.internal.__cell__.lastCell = new o3(), this.internal.__cell__.pages = 1;
  }, o3 = function() {
    var t3 = arguments[0];
    Object.defineProperty(this, "x", { enumerable: true, get: function() {
      return t3;
    }, set: function(e4) {
      t3 = e4;
    } });
    var e3 = arguments[1];
    Object.defineProperty(this, "y", { enumerable: true, get: function() {
      return e3;
    }, set: function(t4) {
      e3 = t4;
    } });
    var r3 = arguments[2];
    Object.defineProperty(this, "width", { enumerable: true, get: function() {
      return r3;
    }, set: function(t4) {
      r3 = t4;
    } });
    var n4 = arguments[3];
    Object.defineProperty(this, "height", { enumerable: true, get: function() {
      return n4;
    }, set: function(t4) {
      n4 = t4;
    } });
    var i4 = arguments[4];
    Object.defineProperty(this, "text", { enumerable: true, get: function() {
      return i4;
    }, set: function(t4) {
      i4 = t4;
    } });
    var a4 = arguments[5];
    Object.defineProperty(this, "lineNumber", { enumerable: true, get: function() {
      return a4;
    }, set: function(t4) {
      a4 = t4;
    } });
    var o4 = arguments[6];
    return Object.defineProperty(this, "align", { enumerable: true, get: function() {
      return o4;
    }, set: function(t4) {
      o4 = t4;
    } }), this;
  };
  o3.prototype.clone = function() {
    return new o3(this.x, this.y, this.width, this.height, this.text, this.lineNumber, this.align);
  }, o3.prototype.toArray = function() {
    return [this.x, this.y, this.width, this.height, this.text, this.lineNumber, this.align];
  }, e2.setHeaderFunction = function(t3) {
    return i3.call(this), this.internal.__cell__.headerFunction = "function" == typeof t3 ? t3 : void 0, this;
  }, e2.getTextDimensions = function(t3, e3) {
    i3.call(this);
    var r3 = (e3 = e3 || {}).fontSize || this.getFontSize(), n4 = e3.font || this.getFont(), a4 = e3.scaleFactor || this.internal.scaleFactor, o4 = 0, s4 = 0, c5 = 0, u3 = this;
    if (!Array.isArray(t3) && "string" != typeof t3) {
      if ("number" != typeof t3)
        throw new Error("getTextDimensions expects text-parameter to be of type String or type Number or an Array of Strings.");
      t3 = String(t3);
    }
    var h3 = e3.maxWidth;
    h3 > 0 ? "string" == typeof t3 ? t3 = this.splitTextToSize(t3, h3) : "[object Array]" === Object.prototype.toString.call(t3) && (t3 = t3.reduce(function(t4, e4) {
      return t4.concat(u3.splitTextToSize(e4, h3));
    }, [])) : t3 = Array.isArray(t3) ? t3 : [t3];
    for (var l3 = 0; l3 < t3.length; l3++)
      o4 < (c5 = this.getStringUnitWidth(t3[l3], { font: n4 }) * r3) && (o4 = c5);
    return 0 !== o4 && (s4 = t3.length), { w: o4 /= a4, h: Math.max((s4 * r3 * this.getLineHeightFactor() - r3 * (this.getLineHeightFactor() - 1)) / a4, 0) };
  }, e2.cellAddPage = function() {
    i3.call(this), this.addPage();
    var t3 = this.internal.__cell__.margins || r2;
    return this.internal.__cell__.lastCell = new o3(t3.left, t3.top, void 0, void 0), this.internal.__cell__.pages += 1, this;
  };
  var s3 = e2.cell = function() {
    var t3;
    t3 = arguments[0] instanceof o3 ? arguments[0] : new o3(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]), i3.call(this);
    var e3 = this.internal.__cell__.lastCell, a4 = this.internal.__cell__.padding, s4 = this.internal.__cell__.margins || r2, c5 = this.internal.__cell__.tableHeaderRow, u3 = this.internal.__cell__.printHeaders;
    return void 0 !== e3.lineNumber && (e3.lineNumber === t3.lineNumber ? (t3.x = (e3.x || 0) + (e3.width || 0), t3.y = e3.y || 0) : e3.y + e3.height + t3.height + s4.bottom > this.getPageHeight() ? (this.cellAddPage(), t3.y = s4.top, u3 && c5 && (this.printHeaderRow(t3.lineNumber, true), t3.y += c5[0].height)) : t3.y = e3.y + e3.height || t3.y), void 0 !== t3.text[0] && (this.rect(t3.x, t3.y, t3.width, t3.height, true === n3 ? "FD" : void 0), "right" === t3.align ? this.text(t3.text, t3.x + t3.width - a4, t3.y + a4, { align: "right", baseline: "top" }) : "center" === t3.align ? this.text(t3.text, t3.x + t3.width / 2, t3.y + a4, { align: "center", baseline: "top", maxWidth: t3.width - a4 - a4 }) : this.text(t3.text, t3.x + a4, t3.y + a4, { align: "left", baseline: "top", maxWidth: t3.width - a4 - a4 })), this.internal.__cell__.lastCell = t3, this;
  };
  e2.table = function(e3, n4, u3, h3, l3) {
    if (i3.call(this), !u3)
      throw new Error("No data for PDF table.");
    var f3, d2, p3, g2, m4 = [], v3 = [], b2 = [], y4 = {}, w2 = {}, N3 = [], L2 = [], A3 = (l3 = l3 || {}).autoSize || false, x3 = false !== l3.printHeaders, S2 = l3.css && void 0 !== l3.css["font-size"] ? 16 * l3.css["font-size"] : l3.fontSize || 12, _3 = l3.margins || Object.assign({ width: this.getPageWidth() }, r2), P2 = "number" == typeof l3.padding ? l3.padding : 3, k2 = l3.headerBackgroundColor || "#c8c8c8", I2 = l3.headerTextColor || "#000";
    if (a3.call(this), this.internal.__cell__.printHeaders = x3, this.internal.__cell__.margins = _3, this.internal.__cell__.table_font_size = S2, this.internal.__cell__.padding = P2, this.internal.__cell__.headerBackgroundColor = k2, this.internal.__cell__.headerTextColor = I2, this.setFontSize(S2), null == h3)
      v3 = m4 = Object.keys(u3[0]), b2 = m4.map(function() {
        return "left";
      });
    else if (Array.isArray(h3) && "object" === _typeof(h3[0]))
      for (m4 = h3.map(function(t3) {
        return t3.name;
      }), v3 = h3.map(function(t3) {
        return t3.prompt || t3.name || "";
      }), b2 = h3.map(function(t3) {
        return t3.align || "left";
      }), f3 = 0; f3 < h3.length; f3 += 1)
        w2[h3[f3].name] = h3[f3].width * (19.049976 / 25.4);
    else
      Array.isArray(h3) && "string" == typeof h3[0] && (v3 = m4 = h3, b2 = m4.map(function() {
        return "left";
      }));
    if (A3 || Array.isArray(h3) && "string" == typeof h3[0])
      for (f3 = 0; f3 < m4.length; f3 += 1) {
        for (y4[g2 = m4[f3]] = u3.map(function(t3) {
          return t3[g2];
        }), this.setFont(void 0, "bold"), N3.push(this.getTextDimensions(v3[f3], { fontSize: this.internal.__cell__.table_font_size, scaleFactor: this.internal.scaleFactor }).w), d2 = y4[g2], this.setFont(void 0, "normal"), p3 = 0; p3 < d2.length; p3 += 1)
          N3.push(this.getTextDimensions(d2[p3], { fontSize: this.internal.__cell__.table_font_size, scaleFactor: this.internal.scaleFactor }).w);
        w2[g2] = Math.max.apply(null, N3) + P2 + P2, N3 = [];
      }
    if (x3) {
      var F2 = {};
      for (f3 = 0; f3 < m4.length; f3 += 1)
        F2[m4[f3]] = {}, F2[m4[f3]].text = v3[f3], F2[m4[f3]].align = b2[f3];
      var C2 = c4.call(this, F2, w2);
      L2 = m4.map(function(t3) {
        return new o3(e3, n4, w2[t3], C2, F2[t3].text, void 0, F2[t3].align);
      }), this.setTableHeaderRow(L2), this.printHeaderRow(1, false);
    }
    var j2 = h3.reduce(function(t3, e4) {
      return t3[e4.name] = e4.align, t3;
    }, {});
    for (f3 = 0; f3 < u3.length; f3 += 1) {
      "rowStart" in l3 && l3.rowStart instanceof Function && l3.rowStart({ row: f3, data: u3[f3] }, this);
      var O3 = c4.call(this, u3[f3], w2);
      for (p3 = 0; p3 < m4.length; p3 += 1) {
        var B2 = u3[f3][m4[p3]];
        "cellStart" in l3 && l3.cellStart instanceof Function && l3.cellStart({ row: f3, col: p3, data: B2 }, this), s3.call(this, new o3(e3, n4, w2[m4[p3]], O3, B2, f3 + 2, j2[m4[p3]]));
      }
    }
    return this.internal.__cell__.table_x = e3, this.internal.__cell__.table_y = n4, this;
  };
  var c4 = function(t3, e3) {
    var r3 = this.internal.__cell__.padding, n4 = this.internal.__cell__.table_font_size, i4 = this.internal.scaleFactor;
    return Object.keys(t3).map(function(n5) {
      var i5 = t3[n5];
      return this.splitTextToSize(i5.hasOwnProperty("text") ? i5.text : i5, e3[n5] - r3 - r3);
    }, this).map(function(t4) {
      return this.getLineHeightFactor() * t4.length * n4 / i4 + r3 + r3;
    }, this).reduce(function(t4, e4) {
      return Math.max(t4, e4);
    }, 0);
  };
  e2.setTableHeaderRow = function(t3) {
    i3.call(this), this.internal.__cell__.tableHeaderRow = t3;
  }, e2.printHeaderRow = function(t3, e3) {
    if (i3.call(this), !this.internal.__cell__.tableHeaderRow)
      throw new Error("Property tableHeaderRow does not exist.");
    var r3;
    if (n3 = true, "function" == typeof this.internal.__cell__.headerFunction) {
      var a4 = this.internal.__cell__.headerFunction(this, this.internal.__cell__.pages);
      this.internal.__cell__.lastCell = new o3(a4[0], a4[1], a4[2], a4[3], void 0, -1);
    }
    this.setFont(void 0, "bold");
    for (var c5 = [], u3 = 0; u3 < this.internal.__cell__.tableHeaderRow.length; u3 += 1) {
      r3 = this.internal.__cell__.tableHeaderRow[u3].clone(), e3 && (r3.y = this.internal.__cell__.margins.top || 0, c5.push(r3)), r3.lineNumber = t3;
      var h3 = this.getTextColor();
      this.setTextColor(this.internal.__cell__.headerTextColor), this.setFillColor(this.internal.__cell__.headerBackgroundColor), s3.call(this, r3), this.setTextColor(h3);
    }
    c5.length > 0 && this.setTableHeaderRow(c5), this.setFont(void 0, "normal"), n3 = false;
  };
}(E.API);
var Pt = { italic: ["italic", "oblique", "normal"], oblique: ["oblique", "italic", "normal"], normal: ["normal", "oblique", "italic"] };
var kt = ["ultra-condensed", "extra-condensed", "condensed", "semi-condensed", "normal", "semi-expanded", "expanded", "extra-expanded", "ultra-expanded"];
var It = _t(kt);
var Ft = [100, 200, 300, 400, 500, 600, 700, 800, 900];
var Ct = _t(Ft);
function jt(t3) {
  var e2 = t3.family.replace(/"|'/g, "").toLowerCase(), r2 = function(t4) {
    return Pt[t4 = t4 || "normal"] ? t4 : "normal";
  }(t3.style), n3 = function(t4) {
    if (!t4)
      return 400;
    if ("number" == typeof t4)
      return t4 >= 100 && t4 <= 900 && t4 % 100 == 0 ? t4 : 400;
    if (/^\d00$/.test(t4))
      return parseInt(t4);
    switch (t4) {
      case "bold":
        return 700;
      case "normal":
      default:
        return 400;
    }
  }(t3.weight), i3 = function(t4) {
    return "number" == typeof It[t4 = t4 || "normal"] ? t4 : "normal";
  }(t3.stretch);
  return { family: e2, style: r2, weight: n3, stretch: i3, src: t3.src || [], ref: t3.ref || { name: e2, style: [i3, r2, n3].join(" ") } };
}
function Ot(t3, e2, r2, n3) {
  var i3;
  for (i3 = r2; i3 >= 0 && i3 < e2.length; i3 += n3)
    if (t3[e2[i3]])
      return t3[e2[i3]];
  for (i3 = r2; i3 >= 0 && i3 < e2.length; i3 -= n3)
    if (t3[e2[i3]])
      return t3[e2[i3]];
}
var Bt = { "sans-serif": "helvetica", fixed: "courier", monospace: "courier", terminal: "courier", cursive: "times", fantasy: "times", serif: "times" };
var Mt = { caption: "times", icon: "times", menu: "times", "message-box": "times", "small-caption": "times", "status-bar": "times" };
function Et(t3) {
  return [t3.stretch, t3.style, t3.weight, t3.family].join(" ");
}
function qt(t3, e2, r2) {
  for (var n3 = (r2 = r2 || {}).defaultFontFamily || "times", i3 = Object.assign({}, Bt, r2.genericFontFamilies || {}), a3 = null, o3 = null, s3 = 0; s3 < e2.length; ++s3)
    if (i3[(a3 = jt(e2[s3])).family] && (a3.family = i3[a3.family]), t3.hasOwnProperty(a3.family)) {
      o3 = t3[a3.family];
      break;
    }
  if (!(o3 = o3 || t3[n3]))
    throw new Error("Could not find a font-family for the rule '" + Et(a3) + "' and default family '" + n3 + "'.");
  if (o3 = function(t4, e3) {
    if (e3[t4])
      return e3[t4];
    var r3 = It[t4], n4 = r3 <= It.normal ? -1 : 1, i4 = Ot(e3, kt, r3, n4);
    if (!i4)
      throw new Error("Could not find a matching font-stretch value for " + t4);
    return i4;
  }(a3.stretch, o3), o3 = function(t4, e3) {
    if (e3[t4])
      return e3[t4];
    for (var r3 = Pt[t4], n4 = 0; n4 < r3.length; ++n4)
      if (e3[r3[n4]])
        return e3[r3[n4]];
    throw new Error("Could not find a matching font-style for " + t4);
  }(a3.style, o3), !(o3 = function(t4, e3) {
    if (e3[t4])
      return e3[t4];
    if (400 === t4 && e3[500])
      return e3[500];
    if (500 === t4 && e3[400])
      return e3[400];
    var r3 = Ct[t4], n4 = Ot(e3, Ft, r3, t4 < 400 ? -1 : 1);
    if (!n4)
      throw new Error("Could not find a matching font-weight for value " + t4);
    return n4;
  }(a3.weight, o3)))
    throw new Error("Failed to resolve a font for the rule '" + Et(a3) + "'.");
  return o3;
}
function Dt(t3) {
  return t3.trimLeft();
}
function Rt(t3, e2) {
  for (var r2 = 0; r2 < t3.length; ) {
    if (t3.charAt(r2) === e2)
      return [t3.substring(0, r2), t3.substring(r2 + 1)];
    r2 += 1;
  }
  return null;
}
function Tt(t3) {
  var e2 = t3.match(/^(-[a-z_]|[a-z_])[a-z0-9_-]*/i);
  return null === e2 ? null : [e2[0], t3.substring(e2[0].length)];
}
var Ut;
var zt;
var Ht;
var Wt = ["times"];
!function(e2) {
  var r2, n3, i3, o3, s3, c4, u3, h3, l3, d2 = function(t3) {
    return t3 = t3 || {}, this.isStrokeTransparent = t3.isStrokeTransparent || false, this.strokeOpacity = t3.strokeOpacity || 1, this.strokeStyle = t3.strokeStyle || "#000000", this.fillStyle = t3.fillStyle || "#000000", this.isFillTransparent = t3.isFillTransparent || false, this.fillOpacity = t3.fillOpacity || 1, this.font = t3.font || "10px sans-serif", this.textBaseline = t3.textBaseline || "alphabetic", this.textAlign = t3.textAlign || "left", this.lineWidth = t3.lineWidth || 1, this.lineJoin = t3.lineJoin || "miter", this.lineCap = t3.lineCap || "butt", this.path = t3.path || [], this.transform = void 0 !== t3.transform ? t3.transform.clone() : new h3(), this.globalCompositeOperation = t3.globalCompositeOperation || "normal", this.globalAlpha = t3.globalAlpha || 1, this.clip_path = t3.clip_path || [], this.currentPoint = t3.currentPoint || new c4(), this.miterLimit = t3.miterLimit || 10, this.lastPoint = t3.lastPoint || new c4(), this.lineDashOffset = t3.lineDashOffset || 0, this.lineDash = t3.lineDash || [], this.margin = t3.margin || [0, 0, 0, 0], this.prevPageLastElemOffset = t3.prevPageLastElemOffset || 0, this.ignoreClearRect = "boolean" != typeof t3.ignoreClearRect || t3.ignoreClearRect, this;
  };
  e2.events.push(["initialized", function() {
    this.context2d = new p3(this), r2 = this.internal.f2, n3 = this.internal.getCoordinateString, i3 = this.internal.getVerticalCoordinateString, o3 = this.internal.getHorizontalCoordinate, s3 = this.internal.getVerticalCoordinate, c4 = this.internal.Point, u3 = this.internal.Rectangle, h3 = this.internal.Matrix, l3 = new d2();
  }]);
  var p3 = function(t3) {
    Object.defineProperty(this, "canvas", { get: function() {
      return { parentNode: false, style: false };
    } });
    var e3 = t3;
    Object.defineProperty(this, "pdf", { get: function() {
      return e3;
    } });
    var r3 = false;
    Object.defineProperty(this, "pageWrapXEnabled", { get: function() {
      return r3;
    }, set: function(t4) {
      r3 = Boolean(t4);
    } });
    var n4 = false;
    Object.defineProperty(this, "pageWrapYEnabled", { get: function() {
      return n4;
    }, set: function(t4) {
      n4 = Boolean(t4);
    } });
    var i4 = 0;
    Object.defineProperty(this, "posX", { get: function() {
      return i4;
    }, set: function(t4) {
      isNaN(t4) || (i4 = t4);
    } });
    var a3 = 0;
    Object.defineProperty(this, "posY", { get: function() {
      return a3;
    }, set: function(t4) {
      isNaN(t4) || (a3 = t4);
    } }), Object.defineProperty(this, "margin", { get: function() {
      return l3.margin;
    }, set: function(t4) {
      var e4;
      "number" == typeof t4 ? e4 = [t4, t4, t4, t4] : ((e4 = new Array(4))[0] = t4[0], e4[1] = t4.length >= 2 ? t4[1] : e4[0], e4[2] = t4.length >= 3 ? t4[2] : e4[0], e4[3] = t4.length >= 4 ? t4[3] : e4[1]), l3.margin = e4;
    } });
    var o4 = false;
    Object.defineProperty(this, "autoPaging", { get: function() {
      return o4;
    }, set: function(t4) {
      o4 = t4;
    } });
    var s4 = 0;
    Object.defineProperty(this, "lastBreak", { get: function() {
      return s4;
    }, set: function(t4) {
      s4 = t4;
    } });
    var c5 = [];
    Object.defineProperty(this, "pageBreaks", { get: function() {
      return c5;
    }, set: function(t4) {
      c5 = t4;
    } }), Object.defineProperty(this, "ctx", { get: function() {
      return l3;
    }, set: function(t4) {
      t4 instanceof d2 && (l3 = t4);
    } }), Object.defineProperty(this, "path", { get: function() {
      return l3.path;
    }, set: function(t4) {
      l3.path = t4;
    } });
    var u4 = [];
    Object.defineProperty(this, "ctxStack", { get: function() {
      return u4;
    }, set: function(t4) {
      u4 = t4;
    } }), Object.defineProperty(this, "fillStyle", { get: function() {
      return this.ctx.fillStyle;
    }, set: function(t4) {
      var e4;
      e4 = g2(t4), this.ctx.fillStyle = e4.style, this.ctx.isFillTransparent = 0 === e4.a, this.ctx.fillOpacity = e4.a, this.pdf.setFillColor(e4.r, e4.g, e4.b, { a: e4.a }), this.pdf.setTextColor(e4.r, e4.g, e4.b, { a: e4.a });
    } }), Object.defineProperty(this, "strokeStyle", { get: function() {
      return this.ctx.strokeStyle;
    }, set: function(t4) {
      var e4 = g2(t4);
      this.ctx.strokeStyle = e4.style, this.ctx.isStrokeTransparent = 0 === e4.a, this.ctx.strokeOpacity = e4.a, 0 === e4.a ? this.pdf.setDrawColor(255, 255, 255) : (e4.a, this.pdf.setDrawColor(e4.r, e4.g, e4.b));
    } }), Object.defineProperty(this, "lineCap", { get: function() {
      return this.ctx.lineCap;
    }, set: function(t4) {
      -1 !== ["butt", "round", "square"].indexOf(t4) && (this.ctx.lineCap = t4, this.pdf.setLineCap(t4));
    } }), Object.defineProperty(this, "lineWidth", { get: function() {
      return this.ctx.lineWidth;
    }, set: function(t4) {
      isNaN(t4) || (this.ctx.lineWidth = t4, this.pdf.setLineWidth(t4));
    } }), Object.defineProperty(this, "lineJoin", { get: function() {
      return this.ctx.lineJoin;
    }, set: function(t4) {
      -1 !== ["bevel", "round", "miter"].indexOf(t4) && (this.ctx.lineJoin = t4, this.pdf.setLineJoin(t4));
    } }), Object.defineProperty(this, "miterLimit", { get: function() {
      return this.ctx.miterLimit;
    }, set: function(t4) {
      isNaN(t4) || (this.ctx.miterLimit = t4, this.pdf.setMiterLimit(t4));
    } }), Object.defineProperty(this, "textBaseline", { get: function() {
      return this.ctx.textBaseline;
    }, set: function(t4) {
      this.ctx.textBaseline = t4;
    } }), Object.defineProperty(this, "textAlign", { get: function() {
      return this.ctx.textAlign;
    }, set: function(t4) {
      -1 !== ["right", "end", "center", "left", "start"].indexOf(t4) && (this.ctx.textAlign = t4);
    } });
    var h4 = null;
    function f3(t4, e4) {
      if (null === h4) {
        var r4 = function(t5) {
          var e5 = [];
          return Object.keys(t5).forEach(function(r5) {
            t5[r5].forEach(function(t6) {
              var n5 = null;
              switch (t6) {
                case "bold":
                  n5 = { family: r5, weight: "bold" };
                  break;
                case "italic":
                  n5 = { family: r5, style: "italic" };
                  break;
                case "bolditalic":
                  n5 = { family: r5, weight: "bold", style: "italic" };
                  break;
                case "":
                case "normal":
                  n5 = { family: r5 };
              }
              null !== n5 && (n5.ref = { name: r5, style: t6 }, e5.push(n5));
            });
          }), e5;
        }(t4.getFontList());
        h4 = function(t5) {
          for (var e5 = {}, r5 = 0; r5 < t5.length; ++r5) {
            var n5 = jt(t5[r5]), i5 = n5.family, a4 = n5.stretch, o5 = n5.style, s5 = n5.weight;
            e5[i5] = e5[i5] || {}, e5[i5][a4] = e5[i5][a4] || {}, e5[i5][a4][o5] = e5[i5][a4][o5] || {}, e5[i5][a4][o5][s5] = n5;
          }
          return e5;
        }(r4.concat(e4));
      }
      return h4;
    }
    var p4 = null;
    Object.defineProperty(this, "fontFaces", { get: function() {
      return p4;
    }, set: function(t4) {
      h4 = null, p4 = t4;
    } }), Object.defineProperty(this, "font", { get: function() {
      return this.ctx.font;
    }, set: function(t4) {
      var e4;
      if (this.ctx.font = t4, null !== (e4 = /^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-_,\"\'\sa-z]+?)\s*$/i.exec(t4))) {
        var r4 = e4[1], n5 = (e4[2], e4[3]), i5 = e4[4], a4 = (e4[5], e4[6]), o5 = /^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(i5)[2];
        i5 = "px" === o5 ? Math.floor(parseFloat(i5) * this.pdf.internal.scaleFactor) : "em" === o5 ? Math.floor(parseFloat(i5) * this.pdf.getFontSize()) : Math.floor(parseFloat(i5) * this.pdf.internal.scaleFactor), this.pdf.setFontSize(i5);
        var s5 = function(t5) {
          var e5, r5, n6 = [], i6 = t5.trim();
          if ("" === i6)
            return Wt;
          if (i6 in Mt)
            return [Mt[i6]];
          for (; "" !== i6; ) {
            switch (r5 = null, e5 = (i6 = Dt(i6)).charAt(0)) {
              case '"':
              case "'":
                r5 = Rt(i6.substring(1), e5);
                break;
              default:
                r5 = Tt(i6);
            }
            if (null === r5)
              return Wt;
            if (n6.push(r5[0]), "" !== (i6 = Dt(r5[1])) && "," !== i6.charAt(0))
              return Wt;
            i6 = i6.replace(/^,/, "");
          }
          return n6;
        }(a4);
        if (this.fontFaces) {
          var c6 = qt(f3(this.pdf, this.fontFaces), s5.map(function(t5) {
            return { family: t5, stretch: "normal", weight: n5, style: r4 };
          }));
          this.pdf.setFont(c6.ref.name, c6.ref.style);
        } else {
          var u5 = "";
          ("bold" === n5 || parseInt(n5, 10) >= 700 || "bold" === r4) && (u5 = "bold"), "italic" === r4 && (u5 += "italic"), 0 === u5.length && (u5 = "normal");
          for (var h5 = "", l4 = { arial: "Helvetica", Arial: "Helvetica", verdana: "Helvetica", Verdana: "Helvetica", helvetica: "Helvetica", Helvetica: "Helvetica", "sans-serif": "Helvetica", fixed: "Courier", monospace: "Courier", terminal: "Courier", cursive: "Times", fantasy: "Times", serif: "Times" }, d3 = 0; d3 < s5.length; d3++) {
            if (void 0 !== this.pdf.internal.getFont(s5[d3], u5, { noFallback: true, disableWarning: true })) {
              h5 = s5[d3];
              break;
            }
            if ("bolditalic" === u5 && void 0 !== this.pdf.internal.getFont(s5[d3], "bold", { noFallback: true, disableWarning: true }))
              h5 = s5[d3], u5 = "bold";
            else if (void 0 !== this.pdf.internal.getFont(s5[d3], "normal", { noFallback: true, disableWarning: true })) {
              h5 = s5[d3], u5 = "normal";
              break;
            }
          }
          if ("" === h5) {
            for (var p5 = 0; p5 < s5.length; p5++)
              if (l4[s5[p5]]) {
                h5 = l4[s5[p5]];
                break;
              }
          }
          h5 = "" === h5 ? "Times" : h5, this.pdf.setFont(h5, u5);
        }
      }
    } }), Object.defineProperty(this, "globalCompositeOperation", { get: function() {
      return this.ctx.globalCompositeOperation;
    }, set: function(t4) {
      this.ctx.globalCompositeOperation = t4;
    } }), Object.defineProperty(this, "globalAlpha", { get: function() {
      return this.ctx.globalAlpha;
    }, set: function(t4) {
      this.ctx.globalAlpha = t4;
    } }), Object.defineProperty(this, "lineDashOffset", { get: function() {
      return this.ctx.lineDashOffset;
    }, set: function(t4) {
      this.ctx.lineDashOffset = t4, T3.call(this);
    } }), Object.defineProperty(this, "lineDash", { get: function() {
      return this.ctx.lineDash;
    }, set: function(t4) {
      this.ctx.lineDash = t4, T3.call(this);
    } }), Object.defineProperty(this, "ignoreClearRect", { get: function() {
      return this.ctx.ignoreClearRect;
    }, set: function(t4) {
      this.ctx.ignoreClearRect = Boolean(t4);
    } });
  };
  p3.prototype.setLineDash = function(t3) {
    this.lineDash = t3;
  }, p3.prototype.getLineDash = function() {
    return this.lineDash.length % 2 ? this.lineDash.concat(this.lineDash) : this.lineDash.slice();
  }, p3.prototype.fill = function() {
    A3.call(this, "fill", false);
  }, p3.prototype.stroke = function() {
    A3.call(this, "stroke", false);
  }, p3.prototype.beginPath = function() {
    this.path = [{ type: "begin" }];
  }, p3.prototype.moveTo = function(t3, e3) {
    if (isNaN(t3) || isNaN(e3))
      throw a2.error("jsPDF.context2d.moveTo: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.moveTo");
    var r3 = this.ctx.transform.applyToPoint(new c4(t3, e3));
    this.path.push({ type: "mt", x: r3.x, y: r3.y }), this.ctx.lastPoint = new c4(t3, e3);
  }, p3.prototype.closePath = function() {
    var e3 = new c4(0, 0), r3 = 0;
    for (r3 = this.path.length - 1; -1 !== r3; r3--)
      if ("begin" === this.path[r3].type && "object" === _typeof(this.path[r3 + 1]) && "number" == typeof this.path[r3 + 1].x) {
        e3 = new c4(this.path[r3 + 1].x, this.path[r3 + 1].y);
        break;
      }
    this.path.push({ type: "close" }), this.ctx.lastPoint = new c4(e3.x, e3.y);
  }, p3.prototype.lineTo = function(t3, e3) {
    if (isNaN(t3) || isNaN(e3))
      throw a2.error("jsPDF.context2d.lineTo: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.lineTo");
    var r3 = this.ctx.transform.applyToPoint(new c4(t3, e3));
    this.path.push({ type: "lt", x: r3.x, y: r3.y }), this.ctx.lastPoint = new c4(r3.x, r3.y);
  }, p3.prototype.clip = function() {
    this.ctx.clip_path = JSON.parse(JSON.stringify(this.path)), A3.call(this, null, true);
  }, p3.prototype.quadraticCurveTo = function(t3, e3, r3, n4) {
    if (isNaN(r3) || isNaN(n4) || isNaN(t3) || isNaN(e3))
      throw a2.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");
    var i4 = this.ctx.transform.applyToPoint(new c4(r3, n4)), o4 = this.ctx.transform.applyToPoint(new c4(t3, e3));
    this.path.push({ type: "qct", x1: o4.x, y1: o4.y, x: i4.x, y: i4.y }), this.ctx.lastPoint = new c4(i4.x, i4.y);
  }, p3.prototype.bezierCurveTo = function(t3, e3, r3, n4, i4, o4) {
    if (isNaN(i4) || isNaN(o4) || isNaN(t3) || isNaN(e3) || isNaN(r3) || isNaN(n4))
      throw a2.error("jsPDF.context2d.bezierCurveTo: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");
    var s4 = this.ctx.transform.applyToPoint(new c4(i4, o4)), u4 = this.ctx.transform.applyToPoint(new c4(t3, e3)), h4 = this.ctx.transform.applyToPoint(new c4(r3, n4));
    this.path.push({ type: "bct", x1: u4.x, y1: u4.y, x2: h4.x, y2: h4.y, x: s4.x, y: s4.y }), this.ctx.lastPoint = new c4(s4.x, s4.y);
  }, p3.prototype.arc = function(t3, e3, r3, n4, i4, o4) {
    if (isNaN(t3) || isNaN(e3) || isNaN(r3) || isNaN(n4) || isNaN(i4))
      throw a2.error("jsPDF.context2d.arc: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.arc");
    if (o4 = Boolean(o4), !this.ctx.transform.isIdentity) {
      var s4 = this.ctx.transform.applyToPoint(new c4(t3, e3));
      t3 = s4.x, e3 = s4.y;
      var u4 = this.ctx.transform.applyToPoint(new c4(0, r3)), h4 = this.ctx.transform.applyToPoint(new c4(0, 0));
      r3 = Math.sqrt(Math.pow(u4.x - h4.x, 2) + Math.pow(u4.y - h4.y, 2));
    }
    Math.abs(i4 - n4) >= 2 * Math.PI && (n4 = 0, i4 = 2 * Math.PI), this.path.push({ type: "arc", x: t3, y: e3, radius: r3, startAngle: n4, endAngle: i4, counterclockwise: o4 });
  }, p3.prototype.arcTo = function(t3, e3, r3, n4, i4) {
    throw new Error("arcTo not implemented.");
  }, p3.prototype.rect = function(t3, e3, r3, n4) {
    if (isNaN(t3) || isNaN(e3) || isNaN(r3) || isNaN(n4))
      throw a2.error("jsPDF.context2d.rect: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.rect");
    this.moveTo(t3, e3), this.lineTo(t3 + r3, e3), this.lineTo(t3 + r3, e3 + n4), this.lineTo(t3, e3 + n4), this.lineTo(t3, e3), this.lineTo(t3 + r3, e3), this.lineTo(t3, e3);
  }, p3.prototype.fillRect = function(t3, e3, r3, n4) {
    if (isNaN(t3) || isNaN(e3) || isNaN(r3) || isNaN(n4))
      throw a2.error("jsPDF.context2d.fillRect: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.fillRect");
    if (!m4.call(this)) {
      var i4 = {};
      "butt" !== this.lineCap && (i4.lineCap = this.lineCap, this.lineCap = "butt"), "miter" !== this.lineJoin && (i4.lineJoin = this.lineJoin, this.lineJoin = "miter"), this.beginPath(), this.rect(t3, e3, r3, n4), this.fill(), i4.hasOwnProperty("lineCap") && (this.lineCap = i4.lineCap), i4.hasOwnProperty("lineJoin") && (this.lineJoin = i4.lineJoin);
    }
  }, p3.prototype.strokeRect = function(t3, e3, r3, n4) {
    if (isNaN(t3) || isNaN(e3) || isNaN(r3) || isNaN(n4))
      throw a2.error("jsPDF.context2d.strokeRect: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");
    v3.call(this) || (this.beginPath(), this.rect(t3, e3, r3, n4), this.stroke());
  }, p3.prototype.clearRect = function(t3, e3, r3, n4) {
    if (isNaN(t3) || isNaN(e3) || isNaN(r3) || isNaN(n4))
      throw a2.error("jsPDF.context2d.clearRect: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.clearRect");
    this.ignoreClearRect || (this.fillStyle = "#ffffff", this.fillRect(t3, e3, r3, n4));
  }, p3.prototype.save = function(t3) {
    t3 = "boolean" != typeof t3 || t3;
    for (var e3 = this.pdf.internal.getCurrentPageInfo().pageNumber, r3 = 0; r3 < this.pdf.internal.getNumberOfPages(); r3++)
      this.pdf.setPage(r3 + 1), this.pdf.internal.out("q");
    if (this.pdf.setPage(e3), t3) {
      this.ctx.fontSize = this.pdf.internal.getFontSize();
      var n4 = new d2(this.ctx);
      this.ctxStack.push(this.ctx), this.ctx = n4;
    }
  }, p3.prototype.restore = function(t3) {
    t3 = "boolean" != typeof t3 || t3;
    for (var e3 = this.pdf.internal.getCurrentPageInfo().pageNumber, r3 = 0; r3 < this.pdf.internal.getNumberOfPages(); r3++)
      this.pdf.setPage(r3 + 1), this.pdf.internal.out("Q");
    this.pdf.setPage(e3), t3 && 0 !== this.ctxStack.length && (this.ctx = this.ctxStack.pop(), this.fillStyle = this.ctx.fillStyle, this.strokeStyle = this.ctx.strokeStyle, this.font = this.ctx.font, this.lineCap = this.ctx.lineCap, this.lineWidth = this.ctx.lineWidth, this.lineJoin = this.ctx.lineJoin, this.lineDash = this.ctx.lineDash, this.lineDashOffset = this.ctx.lineDashOffset);
  }, p3.prototype.toDataURL = function() {
    throw new Error("toDataUrl not implemented.");
  };
  var g2 = function(t3) {
    var e3, r3, n4, i4;
    if (true === t3.isCanvasGradient && (t3 = t3.getColor()), !t3)
      return { r: 0, g: 0, b: 0, a: 0, style: t3 };
    if (/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/.test(t3))
      e3 = 0, r3 = 0, n4 = 0, i4 = 0;
    else {
      var a3 = /rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(t3);
      if (null !== a3)
        e3 = parseInt(a3[1]), r3 = parseInt(a3[2]), n4 = parseInt(a3[3]), i4 = 1;
      else if (null !== (a3 = /rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/.exec(t3)))
        e3 = parseInt(a3[1]), r3 = parseInt(a3[2]), n4 = parseInt(a3[3]), i4 = parseFloat(a3[4]);
      else {
        if (i4 = 1, "string" == typeof t3 && "#" !== t3.charAt(0)) {
          var o4 = new f2(t3);
          t3 = o4.ok ? o4.toHex() : "#000000";
        }
        4 === t3.length ? (e3 = t3.substring(1, 2), e3 += e3, r3 = t3.substring(2, 3), r3 += r3, n4 = t3.substring(3, 4), n4 += n4) : (e3 = t3.substring(1, 3), r3 = t3.substring(3, 5), n4 = t3.substring(5, 7)), e3 = parseInt(e3, 16), r3 = parseInt(r3, 16), n4 = parseInt(n4, 16);
      }
    }
    return { r: e3, g: r3, b: n4, a: i4, style: t3 };
  }, m4 = function() {
    return this.ctx.isFillTransparent || 0 == this.globalAlpha;
  }, v3 = function() {
    return Boolean(this.ctx.isStrokeTransparent || 0 == this.globalAlpha);
  };
  p3.prototype.fillText = function(t3, e3, r3, n4) {
    if (isNaN(e3) || isNaN(r3) || "string" != typeof t3)
      throw a2.error("jsPDF.context2d.fillText: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.fillText");
    if (n4 = isNaN(n4) ? void 0 : n4, !m4.call(this)) {
      var i4 = q2(this.ctx.transform.rotation), o4 = this.ctx.transform.scaleX;
      C2.call(this, { text: t3, x: e3, y: r3, scale: o4, angle: i4, align: this.textAlign, maxWidth: n4 });
    }
  }, p3.prototype.strokeText = function(t3, e3, r3, n4) {
    if (isNaN(e3) || isNaN(r3) || "string" != typeof t3)
      throw a2.error("jsPDF.context2d.strokeText: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.strokeText");
    if (!v3.call(this)) {
      n4 = isNaN(n4) ? void 0 : n4;
      var i4 = q2(this.ctx.transform.rotation), o4 = this.ctx.transform.scaleX;
      C2.call(this, { text: t3, x: e3, y: r3, scale: o4, renderingMode: "stroke", angle: i4, align: this.textAlign, maxWidth: n4 });
    }
  }, p3.prototype.measureText = function(t3) {
    if ("string" != typeof t3)
      throw a2.error("jsPDF.context2d.measureText: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.measureText");
    var e3 = this.pdf, r3 = this.pdf.internal.scaleFactor, n4 = e3.internal.getFontSize(), i4 = e3.getStringUnitWidth(t3) * n4 / e3.internal.scaleFactor, o4 = function(t4) {
      var e4 = (t4 = t4 || {}).width || 0;
      return Object.defineProperty(this, "width", { get: function() {
        return e4;
      } }), this;
    };
    return new o4({ width: i4 *= Math.round(96 * r3 / 72 * 1e4) / 1e4 });
  }, p3.prototype.scale = function(t3, e3) {
    if (isNaN(t3) || isNaN(e3))
      throw a2.error("jsPDF.context2d.scale: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.scale");
    var r3 = new h3(t3, 0, 0, e3, 0, 0);
    this.ctx.transform = this.ctx.transform.multiply(r3);
  }, p3.prototype.rotate = function(t3) {
    if (isNaN(t3))
      throw a2.error("jsPDF.context2d.rotate: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.rotate");
    var e3 = new h3(Math.cos(t3), Math.sin(t3), -Math.sin(t3), Math.cos(t3), 0, 0);
    this.ctx.transform = this.ctx.transform.multiply(e3);
  }, p3.prototype.translate = function(t3, e3) {
    if (isNaN(t3) || isNaN(e3))
      throw a2.error("jsPDF.context2d.translate: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.translate");
    var r3 = new h3(1, 0, 0, 1, t3, e3);
    this.ctx.transform = this.ctx.transform.multiply(r3);
  }, p3.prototype.transform = function(t3, e3, r3, n4, i4, o4) {
    if (isNaN(t3) || isNaN(e3) || isNaN(r3) || isNaN(n4) || isNaN(i4) || isNaN(o4))
      throw a2.error("jsPDF.context2d.transform: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.transform");
    var s4 = new h3(t3, e3, r3, n4, i4, o4);
    this.ctx.transform = this.ctx.transform.multiply(s4);
  }, p3.prototype.setTransform = function(t3, e3, r3, n4, i4, a3) {
    t3 = isNaN(t3) ? 1 : t3, e3 = isNaN(e3) ? 0 : e3, r3 = isNaN(r3) ? 0 : r3, n4 = isNaN(n4) ? 1 : n4, i4 = isNaN(i4) ? 0 : i4, a3 = isNaN(a3) ? 0 : a3, this.ctx.transform = new h3(t3, e3, r3, n4, i4, a3);
  };
  var b2 = function() {
    return this.margin[0] > 0 || this.margin[1] > 0 || this.margin[2] > 0 || this.margin[3] > 0;
  };
  p3.prototype.drawImage = function(t3, e3, r3, n4, i4, a3, o4, s4, c5) {
    var l4 = this.pdf.getImageProperties(t3), f3 = 1, d3 = 1, p4 = 1, g3 = 1;
    void 0 !== n4 && void 0 !== s4 && (p4 = s4 / n4, g3 = c5 / i4, f3 = l4.width / n4 * s4 / n4, d3 = l4.height / i4 * c5 / i4), void 0 === a3 && (a3 = e3, o4 = r3, e3 = 0, r3 = 0), void 0 !== n4 && void 0 === s4 && (s4 = n4, c5 = i4), void 0 === n4 && void 0 === s4 && (s4 = l4.width, c5 = l4.height);
    for (var m5, v5 = this.ctx.transform.decompose(), w3 = q2(v5.rotate.shx), A4 = new h3(), S3 = (A4 = (A4 = (A4 = A4.multiply(v5.translate)).multiply(v5.skew)).multiply(v5.scale)).applyToRectangle(new u3(a3 - e3 * p4, o4 - r3 * g3, n4 * f3, i4 * d3)), _4 = y4.call(this, S3), P3 = [], k3 = 0; k3 < _4.length; k3 += 1)
      -1 === P3.indexOf(_4[k3]) && P3.push(_4[k3]);
    if (L2(P3), this.autoPaging)
      for (var I3 = P3[0], F3 = P3[P3.length - 1], C3 = I3; C3 < F3 + 1; C3++) {
        this.pdf.setPage(C3);
        var j3 = this.pdf.internal.pageSize.width - this.margin[3] - this.margin[1], O4 = 1 === C3 ? this.posY + this.margin[0] : this.margin[0], B3 = this.pdf.internal.pageSize.height - this.posY - this.margin[0] - this.margin[2], M3 = this.pdf.internal.pageSize.height - this.margin[0] - this.margin[2], E3 = 1 === C3 ? 0 : B3 + (C3 - 2) * M3;
        if (0 !== this.ctx.clip_path.length) {
          var D3 = this.path;
          m5 = JSON.parse(JSON.stringify(this.ctx.clip_path)), this.path = N3(m5, this.posX + this.margin[3], -E3 + O4 + this.ctx.prevPageLastElemOffset), x3.call(this, "fill", true), this.path = D3;
        }
        var R3 = JSON.parse(JSON.stringify(S3));
        R3 = N3([R3], this.posX + this.margin[3], -E3 + O4 + this.ctx.prevPageLastElemOffset)[0];
        var T4 = (C3 > I3 || C3 < F3) && b2.call(this);
        T4 && (this.pdf.saveGraphicsState(), this.pdf.rect(this.margin[3], this.margin[0], j3, M3, null).clip().discardPath()), this.pdf.addImage(t3, "JPEG", R3.x, R3.y, R3.w, R3.h, null, null, w3), T4 && this.pdf.restoreGraphicsState();
      }
    else
      this.pdf.addImage(t3, "JPEG", S3.x, S3.y, S3.w, S3.h, null, null, w3);
  };
  var y4 = function(t3, e3, r3) {
    var n4 = [];
    e3 = e3 || this.pdf.internal.pageSize.width, r3 = r3 || this.pdf.internal.pageSize.height - this.margin[0] - this.margin[2];
    var i4 = this.posY + this.ctx.prevPageLastElemOffset;
    switch (t3.type) {
      default:
      case "mt":
      case "lt":
        n4.push(Math.floor((t3.y + i4) / r3) + 1);
        break;
      case "arc":
        n4.push(Math.floor((t3.y + i4 - t3.radius) / r3) + 1), n4.push(Math.floor((t3.y + i4 + t3.radius) / r3) + 1);
        break;
      case "qct":
        var a3 = D2(this.ctx.lastPoint.x, this.ctx.lastPoint.y, t3.x1, t3.y1, t3.x, t3.y);
        n4.push(Math.floor((a3.y + i4) / r3) + 1), n4.push(Math.floor((a3.y + a3.h + i4) / r3) + 1);
        break;
      case "bct":
        var o4 = R2(this.ctx.lastPoint.x, this.ctx.lastPoint.y, t3.x1, t3.y1, t3.x2, t3.y2, t3.x, t3.y);
        n4.push(Math.floor((o4.y + i4) / r3) + 1), n4.push(Math.floor((o4.y + o4.h + i4) / r3) + 1);
        break;
      case "rect":
        n4.push(Math.floor((t3.y + i4) / r3) + 1), n4.push(Math.floor((t3.y + t3.h + i4) / r3) + 1);
    }
    for (var s4 = 0; s4 < n4.length; s4 += 1)
      for (; this.pdf.internal.getNumberOfPages() < n4[s4]; )
        w2.call(this);
    return n4;
  }, w2 = function() {
    var t3 = this.fillStyle, e3 = this.strokeStyle, r3 = this.font, n4 = this.lineCap, i4 = this.lineWidth, a3 = this.lineJoin;
    this.pdf.addPage(), this.fillStyle = t3, this.strokeStyle = e3, this.font = r3, this.lineCap = n4, this.lineWidth = i4, this.lineJoin = a3;
  }, N3 = function(t3, e3, r3) {
    for (var n4 = 0; n4 < t3.length; n4++)
      switch (t3[n4].type) {
        case "bct":
          t3[n4].x2 += e3, t3[n4].y2 += r3;
        case "qct":
          t3[n4].x1 += e3, t3[n4].y1 += r3;
        case "mt":
        case "lt":
        case "arc":
        default:
          t3[n4].x += e3, t3[n4].y += r3;
      }
    return t3;
  }, L2 = function(t3) {
    return t3.sort(function(t4, e3) {
      return t4 - e3;
    });
  }, A3 = function(t3, e3) {
    for (var r3, n4, i4 = this.fillStyle, a3 = this.strokeStyle, o4 = this.lineCap, s4 = this.lineWidth, c5 = Math.abs(s4 * this.ctx.transform.scaleX), u4 = this.lineJoin, h4 = JSON.parse(JSON.stringify(this.path)), l4 = JSON.parse(JSON.stringify(this.path)), f3 = [], d3 = 0; d3 < l4.length; d3++)
      if (void 0 !== l4[d3].x)
        for (var p4 = y4.call(this, l4[d3]), g3 = 0; g3 < p4.length; g3 += 1)
          -1 === f3.indexOf(p4[g3]) && f3.push(p4[g3]);
    for (var m5 = 0; m5 < f3.length; m5++)
      for (; this.pdf.internal.getNumberOfPages() < f3[m5]; )
        w2.call(this);
    if (L2(f3), this.autoPaging)
      for (var v5 = f3[0], A4 = f3[f3.length - 1], S3 = v5; S3 < A4 + 1; S3++) {
        this.pdf.setPage(S3), this.fillStyle = i4, this.strokeStyle = a3, this.lineCap = o4, this.lineWidth = c5, this.lineJoin = u4;
        var _4 = this.pdf.internal.pageSize.width - this.margin[3] - this.margin[1], P3 = 1 === S3 ? this.posY + this.margin[0] : this.margin[0], k3 = this.pdf.internal.pageSize.height - this.posY - this.margin[0] - this.margin[2], I3 = this.pdf.internal.pageSize.height - this.margin[0] - this.margin[2], F3 = 1 === S3 ? 0 : k3 + (S3 - 2) * I3;
        if (0 !== this.ctx.clip_path.length) {
          var C3 = this.path;
          r3 = JSON.parse(JSON.stringify(this.ctx.clip_path)), this.path = N3(r3, this.posX + this.margin[3], -F3 + P3 + this.ctx.prevPageLastElemOffset), x3.call(this, t3, true), this.path = C3;
        }
        if (n4 = JSON.parse(JSON.stringify(h4)), this.path = N3(n4, this.posX + this.margin[3], -F3 + P3 + this.ctx.prevPageLastElemOffset), false === e3 || 0 === S3) {
          var j3 = (S3 > v5 || S3 < A4) && b2.call(this);
          j3 && (this.pdf.saveGraphicsState(), this.pdf.rect(this.margin[3], this.margin[0], _4, I3, null).clip().discardPath()), x3.call(this, t3, e3), j3 && this.pdf.restoreGraphicsState();
        }
        this.lineWidth = s4;
      }
    else
      this.lineWidth = c5, x3.call(this, t3, e3), this.lineWidth = s4;
    this.path = h4;
  }, x3 = function(t3, e3) {
    if (("stroke" !== t3 || e3 || !v3.call(this)) && ("stroke" === t3 || e3 || !m4.call(this))) {
      for (var r3, n4, i4 = [], a3 = this.path, o4 = 0; o4 < a3.length; o4++) {
        var s4 = a3[o4];
        switch (s4.type) {
          case "begin":
            i4.push({ begin: true });
            break;
          case "close":
            i4.push({ close: true });
            break;
          case "mt":
            i4.push({ start: s4, deltas: [], abs: [] });
            break;
          case "lt":
            var c5 = i4.length;
            if (a3[o4 - 1] && !isNaN(a3[o4 - 1].x) && (r3 = [s4.x - a3[o4 - 1].x, s4.y - a3[o4 - 1].y], c5 > 0)) {
              for (; c5 >= 0; c5--)
                if (true !== i4[c5 - 1].close && true !== i4[c5 - 1].begin) {
                  i4[c5 - 1].deltas.push(r3), i4[c5 - 1].abs.push(s4);
                  break;
                }
            }
            break;
          case "bct":
            r3 = [s4.x1 - a3[o4 - 1].x, s4.y1 - a3[o4 - 1].y, s4.x2 - a3[o4 - 1].x, s4.y2 - a3[o4 - 1].y, s4.x - a3[o4 - 1].x, s4.y - a3[o4 - 1].y], i4[i4.length - 1].deltas.push(r3);
            break;
          case "qct":
            var u4 = a3[o4 - 1].x + 2 / 3 * (s4.x1 - a3[o4 - 1].x), h4 = a3[o4 - 1].y + 2 / 3 * (s4.y1 - a3[o4 - 1].y), l4 = s4.x + 2 / 3 * (s4.x1 - s4.x), f3 = s4.y + 2 / 3 * (s4.y1 - s4.y), d3 = s4.x, p4 = s4.y;
            r3 = [u4 - a3[o4 - 1].x, h4 - a3[o4 - 1].y, l4 - a3[o4 - 1].x, f3 - a3[o4 - 1].y, d3 - a3[o4 - 1].x, p4 - a3[o4 - 1].y], i4[i4.length - 1].deltas.push(r3);
            break;
          case "arc":
            i4.push({ deltas: [], abs: [], arc: true }), Array.isArray(i4[i4.length - 1].abs) && i4[i4.length - 1].abs.push(s4);
        }
      }
      n4 = e3 ? null : "stroke" === t3 ? "stroke" : "fill";
      for (var g3 = false, b3 = 0; b3 < i4.length; b3++)
        if (i4[b3].arc)
          for (var y5 = i4[b3].abs, w3 = 0; w3 < y5.length; w3++) {
            var N4 = y5[w3];
            "arc" === N4.type ? P2.call(this, N4.x, N4.y, N4.radius, N4.startAngle, N4.endAngle, N4.counterclockwise, void 0, e3, !g3) : j2.call(this, N4.x, N4.y), g3 = true;
          }
        else if (true === i4[b3].close)
          this.pdf.internal.out("h"), g3 = false;
        else if (true !== i4[b3].begin) {
          var L3 = i4[b3].start.x, A4 = i4[b3].start.y;
          O3.call(this, i4[b3].deltas, L3, A4), g3 = true;
        }
      n4 && k2.call(this, n4), e3 && I2.call(this);
    }
  }, S2 = function(t3) {
    var e3 = this.pdf.internal.getFontSize() / this.pdf.internal.scaleFactor, r3 = e3 * (this.pdf.internal.getLineHeightFactor() - 1);
    switch (this.ctx.textBaseline) {
      case "bottom":
        return t3 - r3;
      case "top":
        return t3 + e3 - r3;
      case "hanging":
        return t3 + e3 - 2 * r3;
      case "middle":
        return t3 + e3 / 2 - r3;
      case "ideographic":
        return t3;
      case "alphabetic":
      default:
        return t3;
    }
  }, _3 = function(t3) {
    return t3 + this.pdf.internal.getFontSize() / this.pdf.internal.scaleFactor * (this.pdf.internal.getLineHeightFactor() - 1);
  };
  p3.prototype.createLinearGradient = function() {
    var t3 = function() {
    };
    return t3.colorStops = [], t3.addColorStop = function(t4, e3) {
      this.colorStops.push([t4, e3]);
    }, t3.getColor = function() {
      return 0 === this.colorStops.length ? "#000000" : this.colorStops[0][1];
    }, t3.isCanvasGradient = true, t3;
  }, p3.prototype.createPattern = function() {
    return this.createLinearGradient();
  }, p3.prototype.createRadialGradient = function() {
    return this.createLinearGradient();
  };
  var P2 = function(t3, e3, r3, n4, i4, a3, o4, s4, c5) {
    for (var u4 = M2.call(this, r3, n4, i4, a3), h4 = 0; h4 < u4.length; h4++) {
      var l4 = u4[h4];
      0 === h4 && (c5 ? F2.call(this, l4.x1 + t3, l4.y1 + e3) : j2.call(this, l4.x1 + t3, l4.y1 + e3)), B2.call(this, t3, e3, l4.x2, l4.y2, l4.x3, l4.y3, l4.x4, l4.y4);
    }
    s4 ? I2.call(this) : k2.call(this, o4);
  }, k2 = function(t3) {
    switch (t3) {
      case "stroke":
        this.pdf.internal.out("S");
        break;
      case "fill":
        this.pdf.internal.out("f");
    }
  }, I2 = function() {
    this.pdf.clip(), this.pdf.discardPath();
  }, F2 = function(t3, e3) {
    this.pdf.internal.out(n3(t3) + " " + i3(e3) + " m");
  }, C2 = function(t3) {
    var e3;
    switch (t3.align) {
      case "right":
      case "end":
        e3 = "right";
        break;
      case "center":
        e3 = "center";
        break;
      case "left":
      case "start":
      default:
        e3 = "left";
    }
    var r3 = this.pdf.getTextDimensions(t3.text), n4 = S2.call(this, t3.y), i4 = _3.call(this, n4) - r3.h, a3 = this.ctx.transform.applyToPoint(new c4(t3.x, n4)), o4 = this.ctx.transform.decompose(), s4 = new h3();
    s4 = (s4 = (s4 = s4.multiply(o4.translate)).multiply(o4.skew)).multiply(o4.scale);
    for (var l4, f3, d3, p4 = this.ctx.transform.applyToRectangle(new u3(t3.x, n4, r3.w, r3.h)), g3 = s4.applyToRectangle(new u3(t3.x, i4, r3.w, r3.h)), m5 = y4.call(this, g3), v5 = [], w3 = 0; w3 < m5.length; w3 += 1)
      -1 === v5.indexOf(m5[w3]) && v5.push(m5[w3]);
    if (L2(v5), this.autoPaging)
      for (var A4 = v5[0], P3 = v5[v5.length - 1], k3 = A4; k3 < P3 + 1; k3++) {
        this.pdf.setPage(k3);
        var I3 = 1 === k3 ? this.posY + this.margin[0] : this.margin[0], F3 = this.pdf.internal.pageSize.height - this.posY - this.margin[0] - this.margin[2], C3 = this.pdf.internal.pageSize.height - this.margin[2], j3 = C3 - this.margin[0], O4 = this.pdf.internal.pageSize.width - this.margin[1], B3 = O4 - this.margin[3], M3 = 1 === k3 ? 0 : F3 + (k3 - 2) * j3;
        if (0 !== this.ctx.clip_path.length) {
          var E3 = this.path;
          l4 = JSON.parse(JSON.stringify(this.ctx.clip_path)), this.path = N3(l4, this.posX + this.margin[3], -1 * M3 + I3), x3.call(this, "fill", true), this.path = E3;
        }
        var q3 = N3([JSON.parse(JSON.stringify(g3))], this.posX + this.margin[3], -M3 + I3 + this.ctx.prevPageLastElemOffset)[0];
        t3.scale >= 0.01 && (f3 = this.pdf.internal.getFontSize(), this.pdf.setFontSize(f3 * t3.scale), d3 = this.lineWidth, this.lineWidth = d3 * t3.scale);
        var D3 = "text" !== this.autoPaging;
        if (D3 || q3.y + q3.h <= C3) {
          if (D3 || q3.y >= I3 && q3.x <= O4) {
            var R3 = D3 ? t3.text : this.pdf.splitTextToSize(t3.text, t3.maxWidth || O4 - q3.x)[0], T4 = N3([JSON.parse(JSON.stringify(p4))], this.posX + this.margin[3], -M3 + I3 + this.ctx.prevPageLastElemOffset)[0], U2 = D3 && (k3 > A4 || k3 < P3) && b2.call(this);
            U2 && (this.pdf.saveGraphicsState(), this.pdf.rect(this.margin[3], this.margin[0], B3, j3, null).clip().discardPath()), this.pdf.text(R3, T4.x, T4.y, { angle: t3.angle, align: e3, renderingMode: t3.renderingMode }), U2 && this.pdf.restoreGraphicsState();
          }
        } else
          q3.y < C3 && (this.ctx.prevPageLastElemOffset += C3 - q3.y);
        t3.scale >= 0.01 && (this.pdf.setFontSize(f3), this.lineWidth = d3);
      }
    else
      t3.scale >= 0.01 && (f3 = this.pdf.internal.getFontSize(), this.pdf.setFontSize(f3 * t3.scale), d3 = this.lineWidth, this.lineWidth = d3 * t3.scale), this.pdf.text(t3.text, a3.x + this.posX, a3.y + this.posY, { angle: t3.angle, align: e3, renderingMode: t3.renderingMode, maxWidth: t3.maxWidth }), t3.scale >= 0.01 && (this.pdf.setFontSize(f3), this.lineWidth = d3);
  }, j2 = function(t3, e3, r3, a3) {
    r3 = r3 || 0, a3 = a3 || 0, this.pdf.internal.out(n3(t3 + r3) + " " + i3(e3 + a3) + " l");
  }, O3 = function(t3, e3, r3) {
    return this.pdf.lines(t3, e3, r3, null, null);
  }, B2 = function(t3, e3, n4, i4, a3, c5, u4, h4) {
    this.pdf.internal.out([r2(o3(n4 + t3)), r2(s3(i4 + e3)), r2(o3(a3 + t3)), r2(s3(c5 + e3)), r2(o3(u4 + t3)), r2(s3(h4 + e3)), "c"].join(" "));
  }, M2 = function(t3, e3, r3, n4) {
    for (var i4 = 2 * Math.PI, a3 = Math.PI / 2; e3 > r3; )
      e3 -= i4;
    var o4 = Math.abs(r3 - e3);
    o4 < i4 && n4 && (o4 = i4 - o4);
    for (var s4 = [], c5 = n4 ? -1 : 1, u4 = e3; o4 > 1e-5; ) {
      var h4 = u4 + c5 * Math.min(o4, a3);
      s4.push(E2.call(this, t3, u4, h4)), o4 -= Math.abs(h4 - u4), u4 = h4;
    }
    return s4;
  }, E2 = function(t3, e3, r3) {
    var n4 = (r3 - e3) / 2, i4 = t3 * Math.cos(n4), a3 = t3 * Math.sin(n4), o4 = i4, s4 = -a3, c5 = o4 * o4 + s4 * s4, u4 = c5 + o4 * i4 + s4 * a3, h4 = 4 / 3 * (Math.sqrt(2 * c5 * u4) - u4) / (o4 * a3 - s4 * i4), l4 = o4 - h4 * s4, f3 = s4 + h4 * o4, d3 = l4, p4 = -f3, g3 = n4 + e3, m5 = Math.cos(g3), v5 = Math.sin(g3);
    return { x1: t3 * Math.cos(e3), y1: t3 * Math.sin(e3), x2: l4 * m5 - f3 * v5, y2: l4 * v5 + f3 * m5, x3: d3 * m5 - p4 * v5, y3: d3 * v5 + p4 * m5, x4: t3 * Math.cos(r3), y4: t3 * Math.sin(r3) };
  }, q2 = function(t3) {
    return 180 * t3 / Math.PI;
  }, D2 = function(t3, e3, r3, n4, i4, a3) {
    var o4 = t3 + 0.5 * (r3 - t3), s4 = e3 + 0.5 * (n4 - e3), c5 = i4 + 0.5 * (r3 - i4), h4 = a3 + 0.5 * (n4 - a3), l4 = Math.min(t3, i4, o4, c5), f3 = Math.max(t3, i4, o4, c5), d3 = Math.min(e3, a3, s4, h4), p4 = Math.max(e3, a3, s4, h4);
    return new u3(l4, d3, f3 - l4, p4 - d3);
  }, R2 = function(t3, e3, r3, n4, i4, a3, o4, s4) {
    var c5, h4, l4, f3, d3, p4, g3, m5, v5, b3, y5, w3, N4, L3, A4 = r3 - t3, x4 = n4 - e3, S3 = i4 - r3, _4 = a3 - n4, P3 = o4 - i4, k3 = s4 - a3;
    for (h4 = 0; h4 < 41; h4++)
      v5 = (g3 = (l4 = t3 + (c5 = h4 / 40) * A4) + c5 * ((d3 = r3 + c5 * S3) - l4)) + c5 * (d3 + c5 * (i4 + c5 * P3 - d3) - g3), b3 = (m5 = (f3 = e3 + c5 * x4) + c5 * ((p4 = n4 + c5 * _4) - f3)) + c5 * (p4 + c5 * (a3 + c5 * k3 - p4) - m5), 0 == h4 ? (y5 = v5, w3 = b3, N4 = v5, L3 = b3) : (y5 = Math.min(y5, v5), w3 = Math.min(w3, b3), N4 = Math.max(N4, v5), L3 = Math.max(L3, b3));
    return new u3(Math.round(y5), Math.round(w3), Math.round(N4 - y5), Math.round(L3 - w3));
  }, T3 = function() {
    if (this.prevLineDash || this.ctx.lineDash.length || this.ctx.lineDashOffset) {
      var t3, e3, r3 = (t3 = this.ctx.lineDash, e3 = this.ctx.lineDashOffset, JSON.stringify({ lineDash: t3, lineDashOffset: e3 }));
      this.prevLineDash !== r3 && (this.pdf.setLineDash(this.ctx.lineDash, this.ctx.lineDashOffset), this.prevLineDash = r3);
    }
  };
}(E.API), /**
 * @license
 * jsPDF filters PlugIn
 * Copyright (c) 2014 Aras Abbasi
 *
 * Licensed under the MIT License.
 * http://opensource.org/licenses/mit-license
 */
function(t3) {
  var r2 = function(t4) {
    var e2, r3, n4, i4, a4, o3, s3, c4, u3, h3;
    for (/[^\x00-\xFF]/.test(t4), r3 = [], n4 = 0, i4 = (t4 += e2 = "\0\0\0\0".slice(t4.length % 4 || 4)).length; i4 > n4; n4 += 4)
      0 !== (a4 = (t4.charCodeAt(n4) << 24) + (t4.charCodeAt(n4 + 1) << 16) + (t4.charCodeAt(n4 + 2) << 8) + t4.charCodeAt(n4 + 3)) ? (o3 = (a4 = ((a4 = ((a4 = ((a4 = (a4 - (h3 = a4 % 85)) / 85) - (u3 = a4 % 85)) / 85) - (c4 = a4 % 85)) / 85) - (s3 = a4 % 85)) / 85) % 85, r3.push(o3 + 33, s3 + 33, c4 + 33, u3 + 33, h3 + 33)) : r3.push(122);
    return function(t5, e3) {
      for (var r4 = e3; r4 > 0; r4--)
        t5.pop();
    }(r3, e2.length), String.fromCharCode.apply(String, r3) + "~>";
  }, n3 = function(t4) {
    var e2, r3, n4, i4, a4, o3 = String, s3 = "length", c4 = 255, u3 = "charCodeAt", h3 = "slice", l3 = "replace";
    for (t4[h3](-2), t4 = t4[h3](0, -2)[l3](/\s/g, "")[l3]("z", "!!!!!"), n4 = [], i4 = 0, a4 = (t4 += e2 = "uuuuu"[h3](t4[s3] % 5 || 5))[s3]; a4 > i4; i4 += 5)
      r3 = 52200625 * (t4[u3](i4) - 33) + 614125 * (t4[u3](i4 + 1) - 33) + 7225 * (t4[u3](i4 + 2) - 33) + 85 * (t4[u3](i4 + 3) - 33) + (t4[u3](i4 + 4) - 33), n4.push(c4 & r3 >> 24, c4 & r3 >> 16, c4 & r3 >> 8, c4 & r3);
    return function(t5, e3) {
      for (var r4 = e3; r4 > 0; r4--)
        t5.pop();
    }(n4, e2[s3]), o3.fromCharCode.apply(o3, n4);
  }, i3 = function(t4) {
    var e2 = new RegExp(/^([0-9A-Fa-f]{2})+$/);
    if (-1 !== (t4 = t4.replace(/\s/g, "")).indexOf(">") && (t4 = t4.substr(0, t4.indexOf(">"))), t4.length % 2 && (t4 += "0"), false === e2.test(t4))
      return "";
    for (var r3 = "", n4 = 0; n4 < t4.length; n4 += 2)
      r3 += String.fromCharCode("0x" + (t4[n4] + t4[n4 + 1]));
    return r3;
  }, a3 = function(t4) {
    for (var r3 = new Uint8Array(t4.length), n4 = t4.length; n4--; )
      r3[n4] = t4.charCodeAt(n4);
    return t4 = (r3 = zlibSync(r3)).reduce(function(t5, e2) {
      return t5 + String.fromCharCode(e2);
    }, "");
  };
  t3.processDataByFilters = function(t4, e2) {
    var o3 = 0, s3 = t4 || "", c4 = [];
    for ("string" == typeof (e2 = e2 || []) && (e2 = [e2]), o3 = 0; o3 < e2.length; o3 += 1)
      switch (e2[o3]) {
        case "ASCII85Decode":
        case "/ASCII85Decode":
          s3 = n3(s3), c4.push("/ASCII85Encode");
          break;
        case "ASCII85Encode":
        case "/ASCII85Encode":
          s3 = r2(s3), c4.push("/ASCII85Decode");
          break;
        case "ASCIIHexDecode":
        case "/ASCIIHexDecode":
          s3 = i3(s3), c4.push("/ASCIIHexEncode");
          break;
        case "ASCIIHexEncode":
        case "/ASCIIHexEncode":
          s3 = s3.split("").map(function(t5) {
            return ("0" + t5.charCodeAt().toString(16)).slice(-2);
          }).join("") + ">", c4.push("/ASCIIHexDecode");
          break;
        case "FlateEncode":
        case "/FlateEncode":
          s3 = a3(s3), c4.push("/FlateDecode");
          break;
        default:
          throw new Error('The filter: "' + e2[o3] + '" is not implemented');
      }
    return { data: s3, reverseChain: c4.reverse().join(" ") };
  };
}(E.API), /**
 * @license
 * jsPDF fileloading PlugIn
 * Copyright (c) 2018 Aras Abbasi (aras.abbasi@gmail.com)
 *
 * Licensed under the MIT License.
 * http://opensource.org/licenses/mit-license
 */
function(t3) {
  t3.loadFile = function(t4, e2, r2) {
    return function(t5, e3, r3) {
      e3 = false !== e3, r3 = "function" == typeof r3 ? r3 : function() {
      };
      var n3 = void 0;
      try {
        n3 = function(t6, e4, r4) {
          var n4 = new XMLHttpRequest(), i3 = 0, a3 = function(t7) {
            var e5 = t7.length, r5 = [], n5 = String.fromCharCode;
            for (i3 = 0; i3 < e5; i3 += 1)
              r5.push(n5(255 & t7.charCodeAt(i3)));
            return r5.join("");
          };
          if (n4.open("GET", t6, !e4), n4.overrideMimeType("text/plain; charset=x-user-defined"), false === e4 && (n4.onload = function() {
            200 === n4.status ? r4(a3(this.responseText)) : r4(void 0);
          }), n4.send(null), e4 && 200 === n4.status)
            return a3(n4.responseText);
        }(t5, e3, r3);
      } catch (t6) {
      }
      return n3;
    }(t4, e2, r2);
  }, t3.loadImageFile = t3.loadFile;
}(E.API), function(e2) {
  function r2() {
    return (n2.html2canvas ? Promise.resolve(n2.html2canvas) : Promise.resolve().then(() => __toESM(require_html2canvas()))).catch(function(t3) {
      return Promise.reject(new Error("Could not load html2canvas: " + t3));
    }).then(function(t3) {
      return t3.default ? t3.default : t3;
    });
  }
  function i3() {
    return (n2.DOMPurify ? Promise.resolve(n2.DOMPurify) : Promise.resolve().then(() => __toESM(require_purify()))).catch(function(t3) {
      return Promise.reject(new Error("Could not load dompurify: " + t3));
    }).then(function(t3) {
      return t3.default ? t3.default : t3;
    });
  }
  var a3 = function(e3) {
    var r3 = _typeof(e3);
    return "undefined" === r3 ? "undefined" : "string" === r3 || e3 instanceof String ? "string" : "number" === r3 || e3 instanceof Number ? "number" : "function" === r3 || e3 instanceof Function ? "function" : e3 && e3.constructor === Array ? "array" : e3 && 1 === e3.nodeType ? "element" : "object" === r3 ? "object" : "unknown";
  }, o3 = function(t3, e3) {
    var r3 = document.createElement(t3);
    for (var n3 in e3.className && (r3.className = e3.className), e3.innerHTML && e3.dompurify && (r3.innerHTML = e3.dompurify.sanitize(e3.innerHTML)), e3.style)
      r3.style[n3] = e3.style[n3];
    return r3;
  }, s3 = function t3(e3) {
    var r3 = Object.assign(t3.convert(Promise.resolve()), JSON.parse(JSON.stringify(t3.template))), n3 = t3.convert(Promise.resolve(), r3);
    return n3 = (n3 = n3.setProgress(1, t3, 1, [t3])).set(e3);
  };
  (s3.prototype = Object.create(Promise.prototype)).constructor = s3, s3.convert = function(t3, e3) {
    return t3.__proto__ = e3 || s3.prototype, t3;
  }, s3.template = { prop: { src: null, container: null, overlay: null, canvas: null, img: null, pdf: null, pageSize: null, callback: function() {
  } }, progress: { val: 0, state: null, n: 0, stack: [] }, opt: { filename: "file.pdf", margin: [0, 0, 0, 0], enableLinks: true, x: 0, y: 0, html2canvas: {}, jsPDF: {}, backgroundColor: "transparent" } }, s3.prototype.from = function(t3, e3) {
    return this.then(function() {
      switch (e3 = e3 || function(t4) {
        switch (a3(t4)) {
          case "string":
            return "string";
          case "element":
            return "canvas" === t4.nodeName.toLowerCase() ? "canvas" : "element";
          default:
            return "unknown";
        }
      }(t3)) {
        case "string":
          return this.then(i3).then(function(e4) {
            return this.set({ src: o3("div", { innerHTML: t3, dompurify: e4 }) });
          });
        case "element":
          return this.set({ src: t3 });
        case "canvas":
          return this.set({ canvas: t3 });
        case "img":
          return this.set({ img: t3 });
        default:
          return this.error("Unknown source type.");
      }
    });
  }, s3.prototype.to = function(t3) {
    switch (t3) {
      case "container":
        return this.toContainer();
      case "canvas":
        return this.toCanvas();
      case "img":
        return this.toImg();
      case "pdf":
        return this.toPdf();
      default:
        return this.error("Invalid target.");
    }
  }, s3.prototype.toContainer = function() {
    return this.thenList([function() {
      return this.prop.src || this.error("Cannot duplicate - no source HTML.");
    }, function() {
      return this.prop.pageSize || this.setPageSize();
    }]).then(function() {
      var t3 = { position: "relative", display: "inline-block", width: ("number" != typeof this.opt.width || isNaN(this.opt.width) || "number" != typeof this.opt.windowWidth || isNaN(this.opt.windowWidth) ? Math.max(this.prop.src.clientWidth, this.prop.src.scrollWidth, this.prop.src.offsetWidth) : this.opt.windowWidth) + "px", left: 0, right: 0, top: 0, margin: "auto", backgroundColor: this.opt.backgroundColor }, e3 = function t4(e4, r3) {
        for (var n3 = 3 === e4.nodeType ? document.createTextNode(e4.nodeValue) : e4.cloneNode(false), i4 = e4.firstChild; i4; i4 = i4.nextSibling)
          true !== r3 && 1 === i4.nodeType && "SCRIPT" === i4.nodeName || n3.appendChild(t4(i4, r3));
        return 1 === e4.nodeType && ("CANVAS" === e4.nodeName ? (n3.width = e4.width, n3.height = e4.height, n3.getContext("2d").drawImage(e4, 0, 0)) : "TEXTAREA" !== e4.nodeName && "SELECT" !== e4.nodeName || (n3.value = e4.value), n3.addEventListener("load", function() {
          n3.scrollTop = e4.scrollTop, n3.scrollLeft = e4.scrollLeft;
        }, true)), n3;
      }(this.prop.src, this.opt.html2canvas.javascriptEnabled);
      "BODY" === e3.tagName && (t3.height = Math.max(document.body.scrollHeight, document.body.offsetHeight, document.documentElement.clientHeight, document.documentElement.scrollHeight, document.documentElement.offsetHeight) + "px"), this.prop.overlay = o3("div", { className: "html2pdf__overlay", style: { position: "fixed", overflow: "hidden", zIndex: 1e3, left: "-100000px", right: 0, bottom: 0, top: 0 } }), this.prop.container = o3("div", { className: "html2pdf__container", style: t3 }), this.prop.container.appendChild(e3), this.prop.container.firstChild.appendChild(o3("div", { style: { clear: "both", border: "0 none transparent", margin: 0, padding: 0, height: 0 } })), this.prop.container.style.float = "none", this.prop.overlay.appendChild(this.prop.container), document.body.appendChild(this.prop.overlay), this.prop.container.firstChild.style.position = "relative", this.prop.container.height = Math.max(this.prop.container.firstChild.clientHeight, this.prop.container.firstChild.scrollHeight, this.prop.container.firstChild.offsetHeight) + "px";
    });
  }, s3.prototype.toCanvas = function() {
    var t3 = [function() {
      return document.body.contains(this.prop.container) || this.toContainer();
    }];
    return this.thenList(t3).then(r2).then(function(t4) {
      var e3 = Object.assign({}, this.opt.html2canvas);
      return delete e3.onrendered, t4(this.prop.container, e3);
    }).then(function(t4) {
      (this.opt.html2canvas.onrendered || function() {
      })(t4), this.prop.canvas = t4, document.body.removeChild(this.prop.overlay);
    });
  }, s3.prototype.toContext2d = function() {
    var t3 = [function() {
      return document.body.contains(this.prop.container) || this.toContainer();
    }];
    return this.thenList(t3).then(r2).then(function(t4) {
      var e3 = this.opt.jsPDF, r3 = this.opt.fontFaces, n3 = "number" != typeof this.opt.width || isNaN(this.opt.width) || "number" != typeof this.opt.windowWidth || isNaN(this.opt.windowWidth) ? 1 : this.opt.width / this.opt.windowWidth, i4 = Object.assign({ async: true, allowTaint: true, scale: n3, scrollX: this.opt.scrollX || 0, scrollY: this.opt.scrollY || 0, backgroundColor: "#ffffff", imageTimeout: 15e3, logging: true, proxy: null, removeContainer: true, foreignObjectRendering: false, useCORS: false }, this.opt.html2canvas);
      if (delete i4.onrendered, e3.context2d.autoPaging = void 0 === this.opt.autoPaging || this.opt.autoPaging, e3.context2d.posX = this.opt.x, e3.context2d.posY = this.opt.y, e3.context2d.margin = this.opt.margin, e3.context2d.fontFaces = r3, r3)
        for (var a4 = 0; a4 < r3.length; ++a4) {
          var o4 = r3[a4], s4 = o4.src.find(function(t5) {
            return "truetype" === t5.format;
          });
          s4 && e3.addFont(s4.url, o4.ref.name, o4.ref.style);
        }
      return i4.windowHeight = i4.windowHeight || 0, i4.windowHeight = 0 == i4.windowHeight ? Math.max(this.prop.container.clientHeight, this.prop.container.scrollHeight, this.prop.container.offsetHeight) : i4.windowHeight, e3.context2d.save(true), t4(this.prop.container, i4);
    }).then(function(t4) {
      this.opt.jsPDF.context2d.restore(true), (this.opt.html2canvas.onrendered || function() {
      })(t4), this.prop.canvas = t4, document.body.removeChild(this.prop.overlay);
    });
  }, s3.prototype.toImg = function() {
    return this.thenList([function() {
      return this.prop.canvas || this.toCanvas();
    }]).then(function() {
      var t3 = this.prop.canvas.toDataURL("image/" + this.opt.image.type, this.opt.image.quality);
      this.prop.img = document.createElement("img"), this.prop.img.src = t3;
    });
  }, s3.prototype.toPdf = function() {
    return this.thenList([function() {
      return this.toContext2d();
    }]).then(function() {
      this.prop.pdf = this.prop.pdf || this.opt.jsPDF;
    });
  }, s3.prototype.output = function(t3, e3, r3) {
    return "img" === (r3 = r3 || "pdf").toLowerCase() || "image" === r3.toLowerCase() ? this.outputImg(t3, e3) : this.outputPdf(t3, e3);
  }, s3.prototype.outputPdf = function(t3, e3) {
    return this.thenList([function() {
      return this.prop.pdf || this.toPdf();
    }]).then(function() {
      return this.prop.pdf.output(t3, e3);
    });
  }, s3.prototype.outputImg = function(t3) {
    return this.thenList([function() {
      return this.prop.img || this.toImg();
    }]).then(function() {
      switch (t3) {
        case void 0:
        case "img":
          return this.prop.img;
        case "datauristring":
        case "dataurlstring":
          return this.prop.img.src;
        case "datauri":
        case "dataurl":
          return document.location.href = this.prop.img.src;
        default:
          throw 'Image output type "' + t3 + '" is not supported.';
      }
    });
  }, s3.prototype.save = function(t3) {
    return this.thenList([function() {
      return this.prop.pdf || this.toPdf();
    }]).set(t3 ? { filename: t3 } : null).then(function() {
      this.prop.pdf.save(this.opt.filename);
    });
  }, s3.prototype.doCallback = function() {
    return this.thenList([function() {
      return this.prop.pdf || this.toPdf();
    }]).then(function() {
      this.prop.callback(this.prop.pdf);
    });
  }, s3.prototype.set = function(t3) {
    if ("object" !== a3(t3))
      return this;
    var e3 = Object.keys(t3 || {}).map(function(e4) {
      if (e4 in s3.template.prop)
        return function() {
          this.prop[e4] = t3[e4];
        };
      switch (e4) {
        case "margin":
          return this.setMargin.bind(this, t3.margin);
        case "jsPDF":
          return function() {
            return this.opt.jsPDF = t3.jsPDF, this.setPageSize();
          };
        case "pageSize":
          return this.setPageSize.bind(this, t3.pageSize);
        default:
          return function() {
            this.opt[e4] = t3[e4];
          };
      }
    }, this);
    return this.then(function() {
      return this.thenList(e3);
    });
  }, s3.prototype.get = function(t3, e3) {
    return this.then(function() {
      var r3 = t3 in s3.template.prop ? this.prop[t3] : this.opt[t3];
      return e3 ? e3(r3) : r3;
    });
  }, s3.prototype.setMargin = function(t3) {
    return this.then(function() {
      switch (a3(t3)) {
        case "number":
          t3 = [t3, t3, t3, t3];
        case "array":
          if (2 === t3.length && (t3 = [t3[0], t3[1], t3[0], t3[1]]), 4 === t3.length)
            break;
        default:
          return this.error("Invalid margin array.");
      }
      this.opt.margin = t3;
    }).then(this.setPageSize);
  }, s3.prototype.setPageSize = function(t3) {
    function e3(t4, e4) {
      return Math.floor(t4 * e4 / 72 * 96);
    }
    return this.then(function() {
      (t3 = t3 || E.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner") || (t3.inner = { width: t3.width - this.opt.margin[1] - this.opt.margin[3], height: t3.height - this.opt.margin[0] - this.opt.margin[2] }, t3.inner.px = { width: e3(t3.inner.width, t3.k), height: e3(t3.inner.height, t3.k) }, t3.inner.ratio = t3.inner.height / t3.inner.width), this.prop.pageSize = t3;
    });
  }, s3.prototype.setProgress = function(t3, e3, r3, n3) {
    return null != t3 && (this.progress.val = t3), null != e3 && (this.progress.state = e3), null != r3 && (this.progress.n = r3), null != n3 && (this.progress.stack = n3), this.progress.ratio = this.progress.val / this.progress.state, this;
  }, s3.prototype.updateProgress = function(t3, e3, r3, n3) {
    return this.setProgress(t3 ? this.progress.val + t3 : null, e3 || null, r3 ? this.progress.n + r3 : null, n3 ? this.progress.stack.concat(n3) : null);
  }, s3.prototype.then = function(t3, e3) {
    var r3 = this;
    return this.thenCore(t3, e3, function(t4, e4) {
      return r3.updateProgress(null, null, 1, [t4]), Promise.prototype.then.call(this, function(e5) {
        return r3.updateProgress(null, t4), e5;
      }).then(t4, e4).then(function(t5) {
        return r3.updateProgress(1), t5;
      });
    });
  }, s3.prototype.thenCore = function(t3, e3, r3) {
    r3 = r3 || Promise.prototype.then;
    t3 && (t3 = t3.bind(this)), e3 && (e3 = e3.bind(this));
    var n3 = -1 !== Promise.toString().indexOf("[native code]") && "Promise" === Promise.name ? this : s3.convert(Object.assign({}, this), Promise.prototype), i4 = r3.call(n3, t3, e3);
    return s3.convert(i4, this.__proto__);
  }, s3.prototype.thenExternal = function(t3, e3) {
    return Promise.prototype.then.call(this, t3, e3);
  }, s3.prototype.thenList = function(t3) {
    var e3 = this;
    return t3.forEach(function(t4) {
      e3 = e3.thenCore(t4);
    }), e3;
  }, s3.prototype.catch = function(t3) {
    t3 && (t3 = t3.bind(this));
    var e3 = Promise.prototype.catch.call(this, t3);
    return s3.convert(e3, this);
  }, s3.prototype.catchExternal = function(t3) {
    return Promise.prototype.catch.call(this, t3);
  }, s3.prototype.error = function(t3) {
    return this.then(function() {
      throw new Error(t3);
    });
  }, s3.prototype.using = s3.prototype.set, s3.prototype.saveAs = s3.prototype.save, s3.prototype.export = s3.prototype.output, s3.prototype.run = s3.prototype.then, E.getPageSize = function(e3, r3, n3) {
    if ("object" === _typeof(e3)) {
      var i4 = e3;
      e3 = i4.orientation, r3 = i4.unit || r3, n3 = i4.format || n3;
    }
    r3 = r3 || "mm", n3 = n3 || "a4", e3 = ("" + (e3 || "P")).toLowerCase();
    var a4, o4 = ("" + n3).toLowerCase(), s4 = { a0: [2383.94, 3370.39], a1: [1683.78, 2383.94], a2: [1190.55, 1683.78], a3: [841.89, 1190.55], a4: [595.28, 841.89], a5: [419.53, 595.28], a6: [297.64, 419.53], a7: [209.76, 297.64], a8: [147.4, 209.76], a9: [104.88, 147.4], a10: [73.7, 104.88], b0: [2834.65, 4008.19], b1: [2004.09, 2834.65], b2: [1417.32, 2004.09], b3: [1000.63, 1417.32], b4: [708.66, 1000.63], b5: [498.9, 708.66], b6: [354.33, 498.9], b7: [249.45, 354.33], b8: [175.75, 249.45], b9: [124.72, 175.75], b10: [87.87, 124.72], c0: [2599.37, 3676.54], c1: [1836.85, 2599.37], c2: [1298.27, 1836.85], c3: [918.43, 1298.27], c4: [649.13, 918.43], c5: [459.21, 649.13], c6: [323.15, 459.21], c7: [229.61, 323.15], c8: [161.57, 229.61], c9: [113.39, 161.57], c10: [79.37, 113.39], dl: [311.81, 623.62], letter: [612, 792], "government-letter": [576, 756], legal: [612, 1008], "junior-legal": [576, 360], ledger: [1224, 792], tabloid: [792, 1224], "credit-card": [153, 243] };
    switch (r3) {
      case "pt":
        a4 = 1;
        break;
      case "mm":
        a4 = 72 / 25.4;
        break;
      case "cm":
        a4 = 72 / 2.54;
        break;
      case "in":
        a4 = 72;
        break;
      case "px":
        a4 = 0.75;
        break;
      case "pc":
      case "em":
        a4 = 12;
        break;
      case "ex":
        a4 = 6;
        break;
      default:
        throw "Invalid unit: " + r3;
    }
    var c4, u3 = 0, h3 = 0;
    if (s4.hasOwnProperty(o4))
      u3 = s4[o4][1] / a4, h3 = s4[o4][0] / a4;
    else
      try {
        u3 = n3[1], h3 = n3[0];
      } catch (t3) {
        throw new Error("Invalid format: " + n3);
      }
    if ("p" === e3 || "portrait" === e3)
      e3 = "p", h3 > u3 && (c4 = h3, h3 = u3, u3 = c4);
    else {
      if ("l" !== e3 && "landscape" !== e3)
        throw "Invalid orientation: " + e3;
      e3 = "l", u3 > h3 && (c4 = h3, h3 = u3, u3 = c4);
    }
    return { width: h3, height: u3, unit: r3, k: a4, orientation: e3 };
  }, e2.html = function(t3, e3) {
    (e3 = e3 || {}).callback = e3.callback || function() {
    }, e3.html2canvas = e3.html2canvas || {}, e3.html2canvas.canvas = e3.html2canvas.canvas || this.canvas, e3.jsPDF = e3.jsPDF || this, e3.fontFaces = e3.fontFaces ? e3.fontFaces.map(jt) : null;
    var r3 = new s3(e3);
    return e3.worker ? r3 : r3.from(t3).doCallback();
  };
}(E.API), E.API.addJS = function(t3) {
  return Ht = t3, this.internal.events.subscribe("postPutResources", function() {
    Ut = this.internal.newObject(), this.internal.out("<<"), this.internal.out("/Names [(EmbeddedJS) " + (Ut + 1) + " 0 R]"), this.internal.out(">>"), this.internal.out("endobj"), zt = this.internal.newObject(), this.internal.out("<<"), this.internal.out("/S /JavaScript"), this.internal.out("/JS (" + Ht + ")"), this.internal.out(">>"), this.internal.out("endobj");
  }), this.internal.events.subscribe("putCatalog", function() {
    void 0 !== Ut && void 0 !== zt && this.internal.out("/Names <</JavaScript " + Ut + " 0 R>>");
  }), this;
}, /**
 * @license
 * Copyright (c) 2014 Steven Spungin (TwelveTone LLC)  steven@twelvetone.tv
 *
 * Licensed under the MIT License.
 * http://opensource.org/licenses/mit-license
 */
function(t3) {
  var e2;
  t3.events.push(["postPutResources", function() {
    var t4 = this, r2 = /^(\d+) 0 obj$/;
    if (this.outline.root.children.length > 0)
      for (var n3 = t4.outline.render().split(/\r\n/), i3 = 0; i3 < n3.length; i3++) {
        var a3 = n3[i3], o3 = r2.exec(a3);
        if (null != o3) {
          var s3 = o3[1];
          t4.internal.newObjectDeferredBegin(s3, false);
        }
        t4.internal.write(a3);
      }
    if (this.outline.createNamedDestinations) {
      var c4 = this.internal.pages.length, u3 = [];
      for (i3 = 0; i3 < c4; i3++) {
        var h3 = t4.internal.newObject();
        u3.push(h3);
        var l3 = t4.internal.getPageInfo(i3 + 1);
        t4.internal.write("<< /D[" + l3.objId + " 0 R /XYZ null null null]>> endobj");
      }
      var f3 = t4.internal.newObject();
      t4.internal.write("<< /Names [ ");
      for (i3 = 0; i3 < u3.length; i3++)
        t4.internal.write("(page_" + (i3 + 1) + ")" + u3[i3] + " 0 R");
      t4.internal.write(" ] >>", "endobj"), e2 = t4.internal.newObject(), t4.internal.write("<< /Dests " + f3 + " 0 R"), t4.internal.write(">>", "endobj");
    }
  }]), t3.events.push(["putCatalog", function() {
    this.outline.root.children.length > 0 && (this.internal.write("/Outlines", this.outline.makeRef(this.outline.root)), this.outline.createNamedDestinations && this.internal.write("/Names " + e2 + " 0 R"));
  }]), t3.events.push(["initialized", function() {
    var t4 = this;
    t4.outline = { createNamedDestinations: false, root: { children: [] } }, t4.outline.add = function(t5, e3, r2) {
      var n3 = { title: e3, options: r2, children: [] };
      return null == t5 && (t5 = this.root), t5.children.push(n3), n3;
    }, t4.outline.render = function() {
      return this.ctx = {}, this.ctx.val = "", this.ctx.pdf = t4, this.genIds_r(this.root), this.renderRoot(this.root), this.renderItems(this.root), this.ctx.val;
    }, t4.outline.genIds_r = function(e3) {
      e3.id = t4.internal.newObjectDeferred();
      for (var r2 = 0; r2 < e3.children.length; r2++)
        this.genIds_r(e3.children[r2]);
    }, t4.outline.renderRoot = function(t5) {
      this.objStart(t5), this.line("/Type /Outlines"), t5.children.length > 0 && (this.line("/First " + this.makeRef(t5.children[0])), this.line("/Last " + this.makeRef(t5.children[t5.children.length - 1]))), this.line("/Count " + this.count_r({ count: 0 }, t5)), this.objEnd();
    }, t4.outline.renderItems = function(e3) {
      for (var r2 = this.ctx.pdf.internal.getVerticalCoordinateString, n3 = 0; n3 < e3.children.length; n3++) {
        var i3 = e3.children[n3];
        this.objStart(i3), this.line("/Title " + this.makeString(i3.title)), this.line("/Parent " + this.makeRef(e3)), n3 > 0 && this.line("/Prev " + this.makeRef(e3.children[n3 - 1])), n3 < e3.children.length - 1 && this.line("/Next " + this.makeRef(e3.children[n3 + 1])), i3.children.length > 0 && (this.line("/First " + this.makeRef(i3.children[0])), this.line("/Last " + this.makeRef(i3.children[i3.children.length - 1])));
        var a3 = this.count = this.count_r({ count: 0 }, i3);
        if (a3 > 0 && this.line("/Count " + a3), i3.options && i3.options.pageNumber) {
          var o3 = t4.internal.getPageInfo(i3.options.pageNumber);
          this.line("/Dest [" + o3.objId + " 0 R /XYZ 0 " + r2(0) + " 0]");
        }
        this.objEnd();
      }
      for (var s3 = 0; s3 < e3.children.length; s3++)
        this.renderItems(e3.children[s3]);
    }, t4.outline.line = function(t5) {
      this.ctx.val += t5 + "\r\n";
    }, t4.outline.makeRef = function(t5) {
      return t5.id + " 0 R";
    }, t4.outline.makeString = function(e3) {
      return "(" + t4.internal.pdfEscape(e3) + ")";
    }, t4.outline.objStart = function(t5) {
      this.ctx.val += "\r\n" + t5.id + " 0 obj\r\n<<\r\n";
    }, t4.outline.objEnd = function() {
      this.ctx.val += ">> \r\nendobj\r\n";
    }, t4.outline.count_r = function(t5, e3) {
      for (var r2 = 0; r2 < e3.children.length; r2++)
        t5.count++, this.count_r(t5, e3.children[r2]);
      return t5.count;
    };
  }]);
}(E.API), /**
 * @license
 *
 * Licensed under the MIT License.
 * http://opensource.org/licenses/mit-license
 */
function(t3) {
  var e2 = [192, 193, 194, 195, 196, 197, 198, 199];
  t3.processJPEG = function(t4, r2, n3, i3, a3, o3) {
    var s3, c4 = this.decode.DCT_DECODE, u3 = null;
    if ("string" == typeof t4 || this.__addimage__.isArrayBuffer(t4) || this.__addimage__.isArrayBufferView(t4)) {
      switch (t4 = a3 || t4, t4 = this.__addimage__.isArrayBuffer(t4) ? new Uint8Array(t4) : t4, (s3 = function(t5) {
        for (var r3, n4 = 256 * t5.charCodeAt(4) + t5.charCodeAt(5), i4 = t5.length, a4 = { width: 0, height: 0, numcomponents: 1 }, o4 = 4; o4 < i4; o4 += 2) {
          if (o4 += n4, -1 !== e2.indexOf(t5.charCodeAt(o4 + 1))) {
            r3 = 256 * t5.charCodeAt(o4 + 5) + t5.charCodeAt(o4 + 6), a4 = { width: 256 * t5.charCodeAt(o4 + 7) + t5.charCodeAt(o4 + 8), height: r3, numcomponents: t5.charCodeAt(o4 + 9) };
            break;
          }
          n4 = 256 * t5.charCodeAt(o4 + 2) + t5.charCodeAt(o4 + 3);
        }
        return a4;
      }(t4 = this.__addimage__.isArrayBufferView(t4) ? this.__addimage__.arrayBufferToBinaryString(t4) : t4)).numcomponents) {
        case 1:
          o3 = this.color_spaces.DEVICE_GRAY;
          break;
        case 4:
          o3 = this.color_spaces.DEVICE_CMYK;
          break;
        case 3:
          o3 = this.color_spaces.DEVICE_RGB;
      }
      u3 = { data: t4, width: s3.width, height: s3.height, colorSpace: o3, bitsPerComponent: 8, filter: c4, index: r2, alias: n3 };
    }
    return u3;
  };
}(E.API);
var Vt;
var Gt;
var Yt;
var Jt;
var Xt;
var Kt = function() {
  var t3, e2, i3;
  function a3(t4) {
    var e3, r2, n3, i4, a4, o4, s3, c4, u3, h3, l3, f3, d2, p3;
    for (this.data = t4, this.pos = 8, this.palette = [], this.imgData = [], this.transparency = {}, this.animation = null, this.text = {}, o4 = null; ; ) {
      switch (e3 = this.readUInt32(), u3 = function() {
        var t5, e4;
        for (e4 = [], t5 = 0; t5 < 4; ++t5)
          e4.push(String.fromCharCode(this.data[this.pos++]));
        return e4;
      }.call(this).join("")) {
        case "IHDR":
          this.width = this.readUInt32(), this.height = this.readUInt32(), this.bits = this.data[this.pos++], this.colorType = this.data[this.pos++], this.compressionMethod = this.data[this.pos++], this.filterMethod = this.data[this.pos++], this.interlaceMethod = this.data[this.pos++];
          break;
        case "acTL":
          this.animation = { numFrames: this.readUInt32(), numPlays: this.readUInt32() || 1 / 0, frames: [] };
          break;
        case "PLTE":
          this.palette = this.read(e3);
          break;
        case "fcTL":
          o4 && this.animation.frames.push(o4), this.pos += 4, o4 = { width: this.readUInt32(), height: this.readUInt32(), xOffset: this.readUInt32(), yOffset: this.readUInt32() }, a4 = this.readUInt16(), i4 = this.readUInt16() || 100, o4.delay = 1e3 * a4 / i4, o4.disposeOp = this.data[this.pos++], o4.blendOp = this.data[this.pos++], o4.data = [];
          break;
        case "IDAT":
        case "fdAT":
          for ("fdAT" === u3 && (this.pos += 4, e3 -= 4), t4 = (null != o4 ? o4.data : void 0) || this.imgData, f3 = 0; 0 <= e3 ? f3 < e3 : f3 > e3; 0 <= e3 ? ++f3 : --f3)
            t4.push(this.data[this.pos++]);
          break;
        case "tRNS":
          switch (this.transparency = {}, this.colorType) {
            case 3:
              if (n3 = this.palette.length / 3, this.transparency.indexed = this.read(e3), this.transparency.indexed.length > n3)
                throw new Error("More transparent colors than palette size");
              if ((h3 = n3 - this.transparency.indexed.length) > 0)
                for (d2 = 0; 0 <= h3 ? d2 < h3 : d2 > h3; 0 <= h3 ? ++d2 : --d2)
                  this.transparency.indexed.push(255);
              break;
            case 0:
              this.transparency.grayscale = this.read(e3)[0];
              break;
            case 2:
              this.transparency.rgb = this.read(e3);
          }
          break;
        case "tEXt":
          s3 = (l3 = this.read(e3)).indexOf(0), c4 = String.fromCharCode.apply(String, l3.slice(0, s3)), this.text[c4] = String.fromCharCode.apply(String, l3.slice(s3 + 1));
          break;
        case "IEND":
          return o4 && this.animation.frames.push(o4), this.colors = function() {
            switch (this.colorType) {
              case 0:
              case 3:
              case 4:
                return 1;
              case 2:
              case 6:
                return 3;
            }
          }.call(this), this.hasAlphaChannel = 4 === (p3 = this.colorType) || 6 === p3, r2 = this.colors + (this.hasAlphaChannel ? 1 : 0), this.pixelBitlength = this.bits * r2, this.colorSpace = function() {
            switch (this.colors) {
              case 1:
                return "DeviceGray";
              case 3:
                return "DeviceRGB";
            }
          }.call(this), void (this.imgData = new Uint8Array(this.imgData));
        default:
          this.pos += e3;
      }
      if (this.pos += 4, this.pos > this.data.length)
        throw new Error("Incomplete or corrupt PNG file");
    }
  }
  a3.prototype.read = function(t4) {
    var e3, r2;
    for (r2 = [], e3 = 0; 0 <= t4 ? e3 < t4 : e3 > t4; 0 <= t4 ? ++e3 : --e3)
      r2.push(this.data[this.pos++]);
    return r2;
  }, a3.prototype.readUInt32 = function() {
    return this.data[this.pos++] << 24 | this.data[this.pos++] << 16 | this.data[this.pos++] << 8 | this.data[this.pos++];
  }, a3.prototype.readUInt16 = function() {
    return this.data[this.pos++] << 8 | this.data[this.pos++];
  }, a3.prototype.decodePixels = function(t4) {
    var e3 = this.pixelBitlength / 8, n3 = new Uint8Array(this.width * this.height * e3), i4 = 0, a4 = this;
    if (null == t4 && (t4 = this.imgData), 0 === t4.length)
      return new Uint8Array(0);
    function o4(r2, o5, s3, c4) {
      var u3, h3, l3, f3, d2, p3, g2, m4, v3, b2, y4, w2, N3, L2, A3, x3, S2, _3, P2, k2, I2, F2 = Math.ceil((a4.width - r2) / s3), C2 = Math.ceil((a4.height - o5) / c4), j2 = a4.width == F2 && a4.height == C2;
      for (L2 = e3 * F2, w2 = j2 ? n3 : new Uint8Array(L2 * C2), p3 = t4.length, N3 = 0, h3 = 0; N3 < C2 && i4 < p3; ) {
        switch (t4[i4++]) {
          case 0:
            for (f3 = S2 = 0; S2 < L2; f3 = S2 += 1)
              w2[h3++] = t4[i4++];
            break;
          case 1:
            for (f3 = _3 = 0; _3 < L2; f3 = _3 += 1)
              u3 = t4[i4++], d2 = f3 < e3 ? 0 : w2[h3 - e3], w2[h3++] = (u3 + d2) % 256;
            break;
          case 2:
            for (f3 = P2 = 0; P2 < L2; f3 = P2 += 1)
              u3 = t4[i4++], l3 = (f3 - f3 % e3) / e3, A3 = N3 && w2[(N3 - 1) * L2 + l3 * e3 + f3 % e3], w2[h3++] = (A3 + u3) % 256;
            break;
          case 3:
            for (f3 = k2 = 0; k2 < L2; f3 = k2 += 1)
              u3 = t4[i4++], l3 = (f3 - f3 % e3) / e3, d2 = f3 < e3 ? 0 : w2[h3 - e3], A3 = N3 && w2[(N3 - 1) * L2 + l3 * e3 + f3 % e3], w2[h3++] = (u3 + Math.floor((d2 + A3) / 2)) % 256;
            break;
          case 4:
            for (f3 = I2 = 0; I2 < L2; f3 = I2 += 1)
              u3 = t4[i4++], l3 = (f3 - f3 % e3) / e3, d2 = f3 < e3 ? 0 : w2[h3 - e3], 0 === N3 ? A3 = x3 = 0 : (A3 = w2[(N3 - 1) * L2 + l3 * e3 + f3 % e3], x3 = l3 && w2[(N3 - 1) * L2 + (l3 - 1) * e3 + f3 % e3]), g2 = d2 + A3 - x3, m4 = Math.abs(g2 - d2), b2 = Math.abs(g2 - A3), y4 = Math.abs(g2 - x3), v3 = m4 <= b2 && m4 <= y4 ? d2 : b2 <= y4 ? A3 : x3, w2[h3++] = (u3 + v3) % 256;
            break;
          default:
            throw new Error("Invalid filter algorithm: " + t4[i4 - 1]);
        }
        if (!j2) {
          var O3 = ((o5 + N3 * c4) * a4.width + r2) * e3, B2 = N3 * L2;
          for (f3 = 0; f3 < F2; f3 += 1) {
            for (var M2 = 0; M2 < e3; M2 += 1)
              n3[O3++] = w2[B2++];
            O3 += (s3 - 1) * e3;
          }
        }
        N3++;
      }
    }
    return t4 = unzlibSync(t4), 1 == a4.interlaceMethod ? (o4(0, 0, 8, 8), o4(4, 0, 8, 8), o4(0, 4, 4, 8), o4(2, 0, 4, 4), o4(0, 2, 2, 4), o4(1, 0, 2, 2), o4(0, 1, 1, 2)) : o4(0, 0, 1, 1), n3;
  }, a3.prototype.decodePalette = function() {
    var t4, e3, r2, n3, i4, a4, o4, s3, c4;
    for (r2 = this.palette, a4 = this.transparency.indexed || [], i4 = new Uint8Array((a4.length || 0) + r2.length), n3 = 0, t4 = 0, e3 = o4 = 0, s3 = r2.length; o4 < s3; e3 = o4 += 3)
      i4[n3++] = r2[e3], i4[n3++] = r2[e3 + 1], i4[n3++] = r2[e3 + 2], i4[n3++] = null != (c4 = a4[t4++]) ? c4 : 255;
    return i4;
  }, a3.prototype.copyToImageData = function(t4, e3) {
    var r2, n3, i4, a4, o4, s3, c4, u3, h3, l3, f3;
    if (n3 = this.colors, h3 = null, r2 = this.hasAlphaChannel, this.palette.length && (h3 = null != (f3 = this._decodedPalette) ? f3 : this._decodedPalette = this.decodePalette(), n3 = 4, r2 = true), u3 = (i4 = t4.data || t4).length, o4 = h3 || e3, a4 = s3 = 0, 1 === n3)
      for (; a4 < u3; )
        c4 = h3 ? 4 * e3[a4 / 4] : s3, l3 = o4[c4++], i4[a4++] = l3, i4[a4++] = l3, i4[a4++] = l3, i4[a4++] = r2 ? o4[c4++] : 255, s3 = c4;
    else
      for (; a4 < u3; )
        c4 = h3 ? 4 * e3[a4 / 4] : s3, i4[a4++] = o4[c4++], i4[a4++] = o4[c4++], i4[a4++] = o4[c4++], i4[a4++] = r2 ? o4[c4++] : 255, s3 = c4;
  }, a3.prototype.decode = function() {
    var t4;
    return t4 = new Uint8Array(this.width * this.height * 4), this.copyToImageData(t4, this.decodePixels()), t4;
  };
  var o3 = function() {
    if ("[object Window]" === Object.prototype.toString.call(n2)) {
      try {
        e2 = n2.document.createElement("canvas"), i3 = e2.getContext("2d");
      } catch (t4) {
        return false;
      }
      return true;
    }
    return false;
  };
  return o3(), t3 = function(t4) {
    var r2;
    if (true === o3())
      return i3.width = t4.width, i3.height = t4.height, i3.clearRect(0, 0, t4.width, t4.height), i3.putImageData(t4, 0, 0), (r2 = new Image()).src = e2.toDataURL(), r2;
    throw new Error("This method requires a Browser with Canvas-capability.");
  }, a3.prototype.decodeFrames = function(e3) {
    var r2, n3, i4, a4, o4, s3, c4, u3;
    if (this.animation) {
      for (u3 = [], n3 = o4 = 0, s3 = (c4 = this.animation.frames).length; o4 < s3; n3 = ++o4)
        r2 = c4[n3], i4 = e3.createImageData(r2.width, r2.height), a4 = this.decodePixels(new Uint8Array(r2.data)), this.copyToImageData(i4, a4), r2.imageData = i4, u3.push(r2.image = t3(i4));
      return u3;
    }
  }, a3.prototype.renderFrame = function(t4, e3) {
    var r2, n3, i4;
    return r2 = (n3 = this.animation.frames)[e3], i4 = n3[e3 - 1], 0 === e3 && t4.clearRect(0, 0, this.width, this.height), 1 === (null != i4 ? i4.disposeOp : void 0) ? t4.clearRect(i4.xOffset, i4.yOffset, i4.width, i4.height) : 2 === (null != i4 ? i4.disposeOp : void 0) && t4.putImageData(i4.imageData, i4.xOffset, i4.yOffset), 0 === r2.blendOp && t4.clearRect(r2.xOffset, r2.yOffset, r2.width, r2.height), t4.drawImage(r2.image, r2.xOffset, r2.yOffset);
  }, a3.prototype.animate = function(t4) {
    var e3, r2, n3, i4, a4, o4, s3 = this;
    return r2 = 0, o4 = this.animation, i4 = o4.numFrames, n3 = o4.frames, a4 = o4.numPlays, (e3 = function() {
      var o5, c4;
      if (o5 = r2++ % i4, c4 = n3[o5], s3.renderFrame(t4, o5), i4 > 1 && r2 / i4 < a4)
        return s3.animation._timeout = setTimeout(e3, c4.delay);
    })();
  }, a3.prototype.stopAnimation = function() {
    var t4;
    return clearTimeout(null != (t4 = this.animation) ? t4._timeout : void 0);
  }, a3.prototype.render = function(t4) {
    var e3, r2;
    return t4._png && t4._png.stopAnimation(), t4._png = this, t4.width = this.width, t4.height = this.height, e3 = t4.getContext("2d"), this.animation ? (this.decodeFrames(e3), this.animate(e3)) : (r2 = e3.createImageData(this.width, this.height), this.copyToImageData(r2, this.decodePixels()), e3.putImageData(r2, 0, 0));
  }, a3;
}();
function Zt(t3) {
  var e2 = 0;
  if (71 !== t3[e2++] || 73 !== t3[e2++] || 70 !== t3[e2++] || 56 !== t3[e2++] || 56 != (t3[e2++] + 1 & 253) || 97 !== t3[e2++])
    throw new Error("Invalid GIF 87a/89a header.");
  var r2 = t3[e2++] | t3[e2++] << 8, n3 = t3[e2++] | t3[e2++] << 8, i3 = t3[e2++], a3 = i3 >> 7, o3 = 1 << (7 & i3) + 1;
  t3[e2++];
  t3[e2++];
  var s3 = null, c4 = null;
  a3 && (s3 = e2, c4 = o3, e2 += 3 * o3);
  var u3 = true, h3 = [], l3 = 0, f3 = null, d2 = 0, p3 = null;
  for (this.width = r2, this.height = n3; u3 && e2 < t3.length; )
    switch (t3[e2++]) {
      case 33:
        switch (t3[e2++]) {
          case 255:
            if (11 !== t3[e2] || 78 == t3[e2 + 1] && 69 == t3[e2 + 2] && 84 == t3[e2 + 3] && 83 == t3[e2 + 4] && 67 == t3[e2 + 5] && 65 == t3[e2 + 6] && 80 == t3[e2 + 7] && 69 == t3[e2 + 8] && 50 == t3[e2 + 9] && 46 == t3[e2 + 10] && 48 == t3[e2 + 11] && 3 == t3[e2 + 12] && 1 == t3[e2 + 13] && 0 == t3[e2 + 16])
              e2 += 14, p3 = t3[e2++] | t3[e2++] << 8, e2++;
            else
              for (e2 += 12; ; ) {
                if (!((P2 = t3[e2++]) >= 0))
                  throw Error("Invalid block size");
                if (0 === P2)
                  break;
                e2 += P2;
              }
            break;
          case 249:
            if (4 !== t3[e2++] || 0 !== t3[e2 + 4])
              throw new Error("Invalid graphics extension block.");
            var g2 = t3[e2++];
            l3 = t3[e2++] | t3[e2++] << 8, f3 = t3[e2++], 0 == (1 & g2) && (f3 = null), d2 = g2 >> 2 & 7, e2++;
            break;
          case 254:
            for (; ; ) {
              if (!((P2 = t3[e2++]) >= 0))
                throw Error("Invalid block size");
              if (0 === P2)
                break;
              e2 += P2;
            }
            break;
          default:
            throw new Error("Unknown graphic control label: 0x" + t3[e2 - 1].toString(16));
        }
        break;
      case 44:
        var m4 = t3[e2++] | t3[e2++] << 8, v3 = t3[e2++] | t3[e2++] << 8, b2 = t3[e2++] | t3[e2++] << 8, y4 = t3[e2++] | t3[e2++] << 8, w2 = t3[e2++], N3 = w2 >> 6 & 1, L2 = 1 << (7 & w2) + 1, A3 = s3, x3 = c4, S2 = false;
        if (w2 >> 7) {
          S2 = true;
          A3 = e2, x3 = L2, e2 += 3 * L2;
        }
        var _3 = e2;
        for (e2++; ; ) {
          var P2;
          if (!((P2 = t3[e2++]) >= 0))
            throw Error("Invalid block size");
          if (0 === P2)
            break;
          e2 += P2;
        }
        h3.push({ x: m4, y: v3, width: b2, height: y4, has_local_palette: S2, palette_offset: A3, palette_size: x3, data_offset: _3, data_length: e2 - _3, transparent_index: f3, interlaced: !!N3, delay: l3, disposal: d2 });
        break;
      case 59:
        u3 = false;
        break;
      default:
        throw new Error("Unknown gif block: 0x" + t3[e2 - 1].toString(16));
    }
  this.numFrames = function() {
    return h3.length;
  }, this.loopCount = function() {
    return p3;
  }, this.frameInfo = function(t4) {
    if (t4 < 0 || t4 >= h3.length)
      throw new Error("Frame index out of range.");
    return h3[t4];
  }, this.decodeAndBlitFrameBGRA = function(e3, n4) {
    var i4 = this.frameInfo(e3), a4 = i4.width * i4.height, o4 = new Uint8Array(a4);
    $t(t3, i4.data_offset, o4, a4);
    var s4 = i4.palette_offset, c5 = i4.transparent_index;
    null === c5 && (c5 = 256);
    var u4 = i4.width, h4 = r2 - u4, l4 = u4, f4 = 4 * (i4.y * r2 + i4.x), d3 = 4 * ((i4.y + i4.height) * r2 + i4.x), p4 = f4, g3 = 4 * h4;
    true === i4.interlaced && (g3 += 4 * r2 * 7);
    for (var m5 = 8, v5 = 0, b3 = o4.length; v5 < b3; ++v5) {
      var y5 = o4[v5];
      if (0 === l4 && (l4 = u4, (p4 += g3) >= d3 && (g3 = 4 * h4 + 4 * r2 * (m5 - 1), p4 = f4 + (u4 + h4) * (m5 << 1), m5 >>= 1)), y5 === c5)
        p4 += 4;
      else {
        var w3 = t3[s4 + 3 * y5], N4 = t3[s4 + 3 * y5 + 1], L3 = t3[s4 + 3 * y5 + 2];
        n4[p4++] = L3, n4[p4++] = N4, n4[p4++] = w3, n4[p4++] = 255;
      }
      --l4;
    }
  }, this.decodeAndBlitFrameRGBA = function(e3, n4) {
    var i4 = this.frameInfo(e3), a4 = i4.width * i4.height, o4 = new Uint8Array(a4);
    $t(t3, i4.data_offset, o4, a4);
    var s4 = i4.palette_offset, c5 = i4.transparent_index;
    null === c5 && (c5 = 256);
    var u4 = i4.width, h4 = r2 - u4, l4 = u4, f4 = 4 * (i4.y * r2 + i4.x), d3 = 4 * ((i4.y + i4.height) * r2 + i4.x), p4 = f4, g3 = 4 * h4;
    true === i4.interlaced && (g3 += 4 * r2 * 7);
    for (var m5 = 8, v5 = 0, b3 = o4.length; v5 < b3; ++v5) {
      var y5 = o4[v5];
      if (0 === l4 && (l4 = u4, (p4 += g3) >= d3 && (g3 = 4 * h4 + 4 * r2 * (m5 - 1), p4 = f4 + (u4 + h4) * (m5 << 1), m5 >>= 1)), y5 === c5)
        p4 += 4;
      else {
        var w3 = t3[s4 + 3 * y5], N4 = t3[s4 + 3 * y5 + 1], L3 = t3[s4 + 3 * y5 + 2];
        n4[p4++] = w3, n4[p4++] = N4, n4[p4++] = L3, n4[p4++] = 255;
      }
      --l4;
    }
  };
}
function $t(t3, e2, r2, n3) {
  for (var i3 = t3[e2++], o3 = 1 << i3, s3 = o3 + 1, c4 = s3 + 1, u3 = i3 + 1, h3 = (1 << u3) - 1, l3 = 0, f3 = 0, d2 = 0, p3 = t3[e2++], g2 = new Int32Array(4096), m4 = null; ; ) {
    for (; l3 < 16 && 0 !== p3; )
      f3 |= t3[e2++] << l3, l3 += 8, 1 === p3 ? p3 = t3[e2++] : --p3;
    if (l3 < u3)
      break;
    var v3 = f3 & h3;
    if (f3 >>= u3, l3 -= u3, v3 !== o3) {
      if (v3 === s3)
        break;
      for (var b2 = v3 < c4 ? v3 : m4, y4 = 0, w2 = b2; w2 > o3; )
        w2 = g2[w2] >> 8, ++y4;
      var N3 = w2;
      if (d2 + y4 + (b2 !== v3 ? 1 : 0) > n3)
        return void a2.log("Warning, gif stream longer than expected.");
      r2[d2++] = N3;
      var L2 = d2 += y4;
      for (b2 !== v3 && (r2[d2++] = N3), w2 = b2; y4--; )
        w2 = g2[w2], r2[--L2] = 255 & w2, w2 >>= 8;
      null !== m4 && c4 < 4096 && (g2[c4++] = m4 << 8 | N3, c4 >= h3 + 1 && u3 < 12 && (++u3, h3 = h3 << 1 | 1)), m4 = v3;
    } else
      c4 = s3 + 1, h3 = (1 << (u3 = i3 + 1)) - 1, m4 = null;
  }
  return d2 !== n3 && a2.log("Warning, gif stream shorter than expected."), r2;
}
function Qt(t3) {
  var e2, r2, n3, i3, a3, o3 = Math.floor, s3 = new Array(64), c4 = new Array(64), u3 = new Array(64), h3 = new Array(64), l3 = new Array(65535), f3 = new Array(65535), d2 = new Array(64), p3 = new Array(64), g2 = [], m4 = 0, v3 = 7, b2 = new Array(64), y4 = new Array(64), w2 = new Array(64), N3 = new Array(256), L2 = new Array(2048), A3 = [0, 1, 5, 6, 14, 15, 27, 28, 2, 4, 7, 13, 16, 26, 29, 42, 3, 8, 12, 17, 25, 30, 41, 43, 9, 11, 18, 24, 31, 40, 44, 53, 10, 19, 23, 32, 39, 45, 52, 54, 20, 22, 33, 38, 46, 51, 55, 60, 21, 34, 37, 47, 50, 56, 59, 61, 35, 36, 48, 49, 57, 58, 62, 63], x3 = [0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0], S2 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], _3 = [0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 125], P2 = [1, 2, 3, 0, 4, 17, 5, 18, 33, 49, 65, 6, 19, 81, 97, 7, 34, 113, 20, 50, 129, 145, 161, 8, 35, 66, 177, 193, 21, 82, 209, 240, 36, 51, 98, 114, 130, 9, 10, 22, 23, 24, 25, 26, 37, 38, 39, 40, 41, 42, 52, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250], k2 = [0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0], I2 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], F2 = [0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 119], C2 = [0, 1, 2, 3, 17, 4, 5, 33, 49, 6, 18, 65, 81, 7, 97, 113, 19, 34, 50, 129, 8, 20, 66, 145, 161, 177, 193, 9, 35, 51, 82, 240, 21, 98, 114, 209, 10, 22, 36, 52, 225, 37, 241, 23, 24, 25, 26, 38, 39, 40, 41, 42, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 130, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 226, 227, 228, 229, 230, 231, 232, 233, 234, 242, 243, 244, 245, 246, 247, 248, 249, 250];
  function j2(t4, e3) {
    for (var r3 = 0, n4 = 0, i4 = new Array(), a4 = 1; a4 <= 16; a4++) {
      for (var o4 = 1; o4 <= t4[a4]; o4++)
        i4[e3[n4]] = [], i4[e3[n4]][0] = r3, i4[e3[n4]][1] = a4, n4++, r3++;
      r3 *= 2;
    }
    return i4;
  }
  function O3(t4) {
    for (var e3 = t4[0], r3 = t4[1] - 1; r3 >= 0; )
      e3 & 1 << r3 && (m4 |= 1 << v3), r3--, --v3 < 0 && (255 == m4 ? (B2(255), B2(0)) : B2(m4), v3 = 7, m4 = 0);
  }
  function B2(t4) {
    g2.push(t4);
  }
  function M2(t4) {
    B2(t4 >> 8 & 255), B2(255 & t4);
  }
  function E2(t4, e3, r3, n4, i4) {
    for (var a4, o4 = i4[0], s4 = i4[240], c5 = function(t5, e4) {
      var r4, n5, i5, a5, o5, s5, c6, u5, h5, l4, f4 = 0;
      for (h5 = 0; h5 < 8; ++h5) {
        r4 = t5[f4], n5 = t5[f4 + 1], i5 = t5[f4 + 2], a5 = t5[f4 + 3], o5 = t5[f4 + 4], s5 = t5[f4 + 5], c6 = t5[f4 + 6];
        var p4 = r4 + (u5 = t5[f4 + 7]), g4 = r4 - u5, m6 = n5 + c6, v6 = n5 - c6, b4 = i5 + s5, y6 = i5 - s5, w4 = a5 + o5, N4 = a5 - o5, L3 = p4 + w4, A4 = p4 - w4, x4 = m6 + b4, S3 = m6 - b4;
        t5[f4] = L3 + x4, t5[f4 + 4] = L3 - x4;
        var _4 = 0.707106781 * (S3 + A4);
        t5[f4 + 2] = A4 + _4, t5[f4 + 6] = A4 - _4;
        var P3 = 0.382683433 * ((L3 = N4 + y6) - (S3 = v6 + g4)), k3 = 0.5411961 * L3 + P3, I3 = 1.306562965 * S3 + P3, F3 = 0.707106781 * (x4 = y6 + v6), C3 = g4 + F3, j3 = g4 - F3;
        t5[f4 + 5] = j3 + k3, t5[f4 + 3] = j3 - k3, t5[f4 + 1] = C3 + I3, t5[f4 + 7] = C3 - I3, f4 += 8;
      }
      for (f4 = 0, h5 = 0; h5 < 8; ++h5) {
        r4 = t5[f4], n5 = t5[f4 + 8], i5 = t5[f4 + 16], a5 = t5[f4 + 24], o5 = t5[f4 + 32], s5 = t5[f4 + 40], c6 = t5[f4 + 48];
        var O4 = r4 + (u5 = t5[f4 + 56]), B3 = r4 - u5, M3 = n5 + c6, E3 = n5 - c6, q3 = i5 + s5, D2 = i5 - s5, R2 = a5 + o5, T3 = a5 - o5, U2 = O4 + R2, z2 = O4 - R2, H2 = M3 + q3, W2 = M3 - q3;
        t5[f4] = U2 + H2, t5[f4 + 32] = U2 - H2;
        var V2 = 0.707106781 * (W2 + z2);
        t5[f4 + 16] = z2 + V2, t5[f4 + 48] = z2 - V2;
        var G3 = 0.382683433 * ((U2 = T3 + D2) - (W2 = E3 + B3)), Y2 = 0.5411961 * U2 + G3, J2 = 1.306562965 * W2 + G3, X2 = 0.707106781 * (H2 = D2 + E3), K2 = B3 + X2, Z2 = B3 - X2;
        t5[f4 + 40] = Z2 + Y2, t5[f4 + 24] = Z2 - Y2, t5[f4 + 8] = K2 + J2, t5[f4 + 56] = K2 - J2, f4++;
      }
      for (h5 = 0; h5 < 64; ++h5)
        l4 = t5[h5] * e4[h5], d2[h5] = l4 > 0 ? l4 + 0.5 | 0 : l4 - 0.5 | 0;
      return d2;
    }(t4, e3), u4 = 0; u4 < 64; ++u4)
      p3[A3[u4]] = c5[u4];
    var h4 = p3[0] - r3;
    r3 = p3[0], 0 == h4 ? O3(n4[0]) : (O3(n4[f3[a4 = 32767 + h4]]), O3(l3[a4]));
    for (var g3 = 63; g3 > 0 && 0 == p3[g3]; )
      g3--;
    if (0 == g3)
      return O3(o4), r3;
    for (var m5, v5 = 1; v5 <= g3; ) {
      for (var b3 = v5; 0 == p3[v5] && v5 <= g3; )
        ++v5;
      var y5 = v5 - b3;
      if (y5 >= 16) {
        m5 = y5 >> 4;
        for (var w3 = 1; w3 <= m5; ++w3)
          O3(s4);
        y5 &= 15;
      }
      a4 = 32767 + p3[v5], O3(i4[(y5 << 4) + f3[a4]]), O3(l3[a4]), v5++;
    }
    return 63 != g3 && O3(o4), r3;
  }
  function q2(t4) {
    (t4 = Math.min(Math.max(t4, 1), 100), a3 != t4) && (!function(t5) {
      for (var e3 = [16, 11, 10, 16, 24, 40, 51, 61, 12, 12, 14, 19, 26, 58, 60, 55, 14, 13, 16, 24, 40, 57, 69, 56, 14, 17, 22, 29, 51, 87, 80, 62, 18, 22, 37, 56, 68, 109, 103, 77, 24, 35, 55, 64, 81, 104, 113, 92, 49, 64, 78, 87, 103, 121, 120, 101, 72, 92, 95, 98, 112, 100, 103, 99], r3 = 0; r3 < 64; r3++) {
        var n4 = o3((e3[r3] * t5 + 50) / 100);
        n4 = Math.min(Math.max(n4, 1), 255), s3[A3[r3]] = n4;
      }
      for (var i4 = [17, 18, 24, 47, 99, 99, 99, 99, 18, 21, 26, 66, 99, 99, 99, 99, 24, 26, 56, 99, 99, 99, 99, 99, 47, 66, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99], a4 = 0; a4 < 64; a4++) {
        var l4 = o3((i4[a4] * t5 + 50) / 100);
        l4 = Math.min(Math.max(l4, 1), 255), c4[A3[a4]] = l4;
      }
      for (var f4 = [1, 1.387039845, 1.306562965, 1.175875602, 1, 0.785694958, 0.5411961, 0.275899379], d3 = 0, p4 = 0; p4 < 8; p4++)
        for (var g3 = 0; g3 < 8; g3++)
          u3[d3] = 1 / (s3[A3[d3]] * f4[p4] * f4[g3] * 8), h3[d3] = 1 / (c4[A3[d3]] * f4[p4] * f4[g3] * 8), d3++;
    }(t4 < 50 ? Math.floor(5e3 / t4) : Math.floor(200 - 2 * t4)), a3 = t4);
  }
  this.encode = function(t4, a4) {
    a4 && q2(a4), g2 = new Array(), m4 = 0, v3 = 7, M2(65496), M2(65504), M2(16), B2(74), B2(70), B2(73), B2(70), B2(0), B2(1), B2(1), B2(0), M2(1), M2(1), B2(0), B2(0), function() {
      M2(65499), M2(132), B2(0);
      for (var t5 = 0; t5 < 64; t5++)
        B2(s3[t5]);
      B2(1);
      for (var e3 = 0; e3 < 64; e3++)
        B2(c4[e3]);
    }(), function(t5, e3) {
      M2(65472), M2(17), B2(8), M2(e3), M2(t5), B2(3), B2(1), B2(17), B2(0), B2(2), B2(17), B2(1), B2(3), B2(17), B2(1);
    }(t4.width, t4.height), function() {
      M2(65476), M2(418), B2(0);
      for (var t5 = 0; t5 < 16; t5++)
        B2(x3[t5 + 1]);
      for (var e3 = 0; e3 <= 11; e3++)
        B2(S2[e3]);
      B2(16);
      for (var r3 = 0; r3 < 16; r3++)
        B2(_3[r3 + 1]);
      for (var n4 = 0; n4 <= 161; n4++)
        B2(P2[n4]);
      B2(1);
      for (var i4 = 0; i4 < 16; i4++)
        B2(k2[i4 + 1]);
      for (var a5 = 0; a5 <= 11; a5++)
        B2(I2[a5]);
      B2(17);
      for (var o5 = 0; o5 < 16; o5++)
        B2(F2[o5 + 1]);
      for (var s4 = 0; s4 <= 161; s4++)
        B2(C2[s4]);
    }(), M2(65498), M2(12), B2(3), B2(1), B2(0), B2(2), B2(17), B2(3), B2(17), B2(0), B2(63), B2(0);
    var o4 = 0, l4 = 0, f4 = 0;
    m4 = 0, v3 = 7, this.encode.displayName = "_encode_";
    for (var d3, p4, N4, A4, j3, D2, R2, T3, U2, z2 = t4.data, H2 = t4.width, W2 = t4.height, V2 = 4 * H2, G3 = 0; G3 < W2; ) {
      for (d3 = 0; d3 < V2; ) {
        for (j3 = V2 * G3 + d3, R2 = -1, T3 = 0, U2 = 0; U2 < 64; U2++)
          D2 = j3 + (T3 = U2 >> 3) * V2 + (R2 = 4 * (7 & U2)), G3 + T3 >= W2 && (D2 -= V2 * (G3 + 1 + T3 - W2)), d3 + R2 >= V2 && (D2 -= d3 + R2 - V2 + 4), p4 = z2[D2++], N4 = z2[D2++], A4 = z2[D2++], b2[U2] = (L2[p4] + L2[N4 + 256 >> 0] + L2[A4 + 512 >> 0] >> 16) - 128, y4[U2] = (L2[p4 + 768 >> 0] + L2[N4 + 1024 >> 0] + L2[A4 + 1280 >> 0] >> 16) - 128, w2[U2] = (L2[p4 + 1280 >> 0] + L2[N4 + 1536 >> 0] + L2[A4 + 1792 >> 0] >> 16) - 128;
        o4 = E2(b2, u3, o4, e2, n3), l4 = E2(y4, h3, l4, r2, i3), f4 = E2(w2, h3, f4, r2, i3), d3 += 32;
      }
      G3 += 8;
    }
    if (v3 >= 0) {
      var Y2 = [];
      Y2[1] = v3 + 1, Y2[0] = (1 << v3 + 1) - 1, O3(Y2);
    }
    return M2(65497), new Uint8Array(g2);
  }, t3 = t3 || 50, function() {
    for (var t4 = String.fromCharCode, e3 = 0; e3 < 256; e3++)
      N3[e3] = t4(e3);
  }(), e2 = j2(x3, S2), r2 = j2(k2, I2), n3 = j2(_3, P2), i3 = j2(F2, C2), function() {
    for (var t4 = 1, e3 = 2, r3 = 1; r3 <= 15; r3++) {
      for (var n4 = t4; n4 < e3; n4++)
        f3[32767 + n4] = r3, l3[32767 + n4] = [], l3[32767 + n4][1] = r3, l3[32767 + n4][0] = n4;
      for (var i4 = -(e3 - 1); i4 <= -t4; i4++)
        f3[32767 + i4] = r3, l3[32767 + i4] = [], l3[32767 + i4][1] = r3, l3[32767 + i4][0] = e3 - 1 + i4;
      t4 <<= 1, e3 <<= 1;
    }
  }(), function() {
    for (var t4 = 0; t4 < 256; t4++)
      L2[t4] = 19595 * t4, L2[t4 + 256 >> 0] = 38470 * t4, L2[t4 + 512 >> 0] = 7471 * t4 + 32768, L2[t4 + 768 >> 0] = -11059 * t4, L2[t4 + 1024 >> 0] = -21709 * t4, L2[t4 + 1280 >> 0] = 32768 * t4 + 8421375, L2[t4 + 1536 >> 0] = -27439 * t4, L2[t4 + 1792 >> 0] = -5329 * t4;
  }(), q2(t3);
}
function te(t3, e2) {
  if (this.pos = 0, this.buffer = t3, this.datav = new DataView(t3.buffer), this.is_with_alpha = !!e2, this.bottom_up = true, this.flag = String.fromCharCode(this.buffer[0]) + String.fromCharCode(this.buffer[1]), this.pos += 2, -1 === ["BM", "BA", "CI", "CP", "IC", "PT"].indexOf(this.flag))
    throw new Error("Invalid BMP File");
  this.parseHeader(), this.parseBGR();
}
function ee(t3) {
  function e2(t4) {
    if (!t4)
      throw Error("assert :P");
  }
  function r2(t4, e3, r3) {
    for (var n4 = 0; 4 > n4; n4++)
      if (t4[e3 + n4] != r3.charCodeAt(n4))
        return true;
    return false;
  }
  function n3(t4, e3, r3, n4, i4) {
    for (var a4 = 0; a4 < i4; a4++)
      t4[e3 + a4] = r3[n4 + a4];
  }
  function i3(t4, e3, r3, n4) {
    for (var i4 = 0; i4 < n4; i4++)
      t4[e3 + i4] = r3;
  }
  function a3(t4) {
    return new Int32Array(t4);
  }
  function o3(t4, e3) {
    for (var r3 = [], n4 = 0; n4 < t4; n4++)
      r3.push(new e3());
    return r3;
  }
  function s3(t4, e3) {
    var r3 = [];
    return function t5(r4, n4, i4) {
      for (var a4 = i4[n4], o4 = 0; o4 < a4 && (r4.push(i4.length > n4 + 1 ? [] : new e3()), !(i4.length < n4 + 1)); o4++)
        t5(r4[o4], n4 + 1, i4);
    }(r3, 0, t4), r3;
  }
  var c4 = function() {
    var t4 = this;
    function c5(t5, e3) {
      for (var r3 = 1 << e3 - 1 >>> 0; t5 & r3; )
        r3 >>>= 1;
      return r3 ? (t5 & r3 - 1) + r3 : t5;
    }
    function u4(t5, r3, n4, i4, a4) {
      e2(!(i4 % n4));
      do {
        t5[r3 + (i4 -= n4)] = a4;
      } while (0 < i4);
    }
    function h4(t5, r3, n4, i4, o4) {
      if (e2(2328 >= o4), 512 >= o4)
        var s4 = a3(512);
      else if (null == (s4 = a3(o4)))
        return 0;
      return function(t6, r4, n5, i5, o5, s5) {
        var h5, f5, d4 = r4, p5 = 1 << n5, g4 = a3(16), m6 = a3(16);
        for (e2(0 != o5), e2(null != i5), e2(null != t6), e2(0 < n5), f5 = 0; f5 < o5; ++f5) {
          if (15 < i5[f5])
            return 0;
          ++g4[i5[f5]];
        }
        if (g4[0] == o5)
          return 0;
        for (m6[1] = 0, h5 = 1; 15 > h5; ++h5) {
          if (g4[h5] > 1 << h5)
            return 0;
          m6[h5 + 1] = m6[h5] + g4[h5];
        }
        for (f5 = 0; f5 < o5; ++f5)
          h5 = i5[f5], 0 < i5[f5] && (s5[m6[h5]++] = f5);
        if (1 == m6[15])
          return (i5 = new l4()).g = 0, i5.value = s5[0], u4(t6, d4, 1, p5, i5), p5;
        var v6, b4 = -1, y6 = p5 - 1, w4 = 0, N5 = 1, L4 = 1, A5 = 1 << n5;
        for (f5 = 0, h5 = 1, o5 = 2; h5 <= n5; ++h5, o5 <<= 1) {
          if (N5 += L4 <<= 1, 0 > (L4 -= g4[h5]))
            return 0;
          for (; 0 < g4[h5]; --g4[h5])
            (i5 = new l4()).g = h5, i5.value = s5[f5++], u4(t6, d4 + w4, o5, A5, i5), w4 = c5(w4, h5);
        }
        for (h5 = n5 + 1, o5 = 2; 15 >= h5; ++h5, o5 <<= 1) {
          if (N5 += L4 <<= 1, 0 > (L4 -= g4[h5]))
            return 0;
          for (; 0 < g4[h5]; --g4[h5]) {
            if (i5 = new l4(), (w4 & y6) != b4) {
              for (d4 += A5, v6 = 1 << (b4 = h5) - n5; 15 > b4 && !(0 >= (v6 -= g4[b4])); )
                ++b4, v6 <<= 1;
              p5 += A5 = 1 << (v6 = b4 - n5), t6[r4 + (b4 = w4 & y6)].g = v6 + n5, t6[r4 + b4].value = d4 - r4 - b4;
            }
            i5.g = h5 - n5, i5.value = s5[f5++], u4(t6, d4 + (w4 >> n5), o5, A5, i5), w4 = c5(w4, h5);
          }
        }
        return N5 != 2 * m6[15] - 1 ? 0 : p5;
      }(t5, r3, n4, i4, o4, s4);
    }
    function l4() {
      this.value = this.g = 0;
    }
    function f4() {
      this.value = this.g = 0;
    }
    function d3() {
      this.G = o3(5, l4), this.H = a3(5), this.jc = this.Qb = this.qb = this.nd = 0, this.pd = o3(Dr, f4);
    }
    function p4(t5, r3, n4, i4) {
      e2(null != t5), e2(null != r3), e2(2147483648 > i4), t5.Ca = 254, t5.I = 0, t5.b = -8, t5.Ka = 0, t5.oa = r3, t5.pa = n4, t5.Jd = r3, t5.Yc = n4 + i4, t5.Zc = 4 <= i4 ? n4 + i4 - 4 + 1 : n4, _3(t5);
    }
    function g3(t5, e3) {
      for (var r3 = 0; 0 < e3--; )
        r3 |= k2(t5, 128) << e3;
      return r3;
    }
    function m5(t5, e3) {
      var r3 = g3(t5, e3);
      return P2(t5) ? -r3 : r3;
    }
    function v5(t5, r3, n4, i4) {
      var a4, o4 = 0;
      for (e2(null != t5), e2(null != r3), e2(4294967288 > i4), t5.Sb = i4, t5.Ra = 0, t5.u = 0, t5.h = 0, 4 < i4 && (i4 = 4), a4 = 0; a4 < i4; ++a4)
        o4 += r3[n4 + a4] << 8 * a4;
      t5.Ra = o4, t5.bb = i4, t5.oa = r3, t5.pa = n4;
    }
    function b3(t5) {
      for (; 8 <= t5.u && t5.bb < t5.Sb; )
        t5.Ra >>>= 8, t5.Ra += t5.oa[t5.pa + t5.bb] << Ur - 8 >>> 0, ++t5.bb, t5.u -= 8;
      A4(t5) && (t5.h = 1, t5.u = 0);
    }
    function y5(t5, r3) {
      if (e2(0 <= r3), !t5.h && r3 <= Tr) {
        var n4 = L3(t5) & Rr[r3];
        return t5.u += r3, b3(t5), n4;
      }
      return t5.h = 1, t5.u = 0;
    }
    function w3() {
      this.b = this.Ca = this.I = 0, this.oa = [], this.pa = 0, this.Jd = [], this.Yc = 0, this.Zc = [], this.Ka = 0;
    }
    function N4() {
      this.Ra = 0, this.oa = [], this.h = this.u = this.bb = this.Sb = this.pa = 0;
    }
    function L3(t5) {
      return t5.Ra >>> (t5.u & Ur - 1) >>> 0;
    }
    function A4(t5) {
      return e2(t5.bb <= t5.Sb), t5.h || t5.bb == t5.Sb && t5.u > Ur;
    }
    function x3(t5, e3) {
      t5.u = e3, t5.h = A4(t5);
    }
    function S2(t5) {
      t5.u >= zr && (e2(t5.u >= zr), b3(t5));
    }
    function _3(t5) {
      e2(null != t5 && null != t5.oa), t5.pa < t5.Zc ? (t5.I = (t5.oa[t5.pa++] | t5.I << 8) >>> 0, t5.b += 8) : (e2(null != t5 && null != t5.oa), t5.pa < t5.Yc ? (t5.b += 8, t5.I = t5.oa[t5.pa++] | t5.I << 8) : t5.Ka ? t5.b = 0 : (t5.I <<= 8, t5.b += 8, t5.Ka = 1));
    }
    function P2(t5) {
      return g3(t5, 1);
    }
    function k2(t5, e3) {
      var r3 = t5.Ca;
      0 > t5.b && _3(t5);
      var n4 = t5.b, i4 = r3 * e3 >>> 8, a4 = (t5.I >>> n4 > i4) + 0;
      for (a4 ? (r3 -= i4, t5.I -= i4 + 1 << n4 >>> 0) : r3 = i4 + 1, n4 = r3, i4 = 0; 256 <= n4; )
        i4 += 8, n4 >>= 8;
      return n4 = 7 ^ i4 + Hr[n4], t5.b -= n4, t5.Ca = (r3 << n4) - 1, a4;
    }
    function I2(t5, e3, r3) {
      t5[e3 + 0] = r3 >> 24 & 255, t5[e3 + 1] = r3 >> 16 & 255, t5[e3 + 2] = r3 >> 8 & 255, t5[e3 + 3] = r3 >> 0 & 255;
    }
    function F2(t5, e3) {
      return t5[e3 + 0] << 0 | t5[e3 + 1] << 8;
    }
    function C2(t5, e3) {
      return F2(t5, e3) | t5[e3 + 2] << 16;
    }
    function j2(t5, e3) {
      return F2(t5, e3) | F2(t5, e3 + 2) << 16;
    }
    function O3(t5, r3) {
      var n4 = 1 << r3;
      return e2(null != t5), e2(0 < r3), t5.X = a3(n4), null == t5.X ? 0 : (t5.Mb = 32 - r3, t5.Xa = r3, 1);
    }
    function B2(t5, r3) {
      e2(null != t5), e2(null != r3), e2(t5.Xa == r3.Xa), n3(r3.X, 0, t5.X, 0, 1 << r3.Xa);
    }
    function M2() {
      this.X = [], this.Xa = this.Mb = 0;
    }
    function E2(t5, r3, n4, i4) {
      e2(null != n4), e2(null != i4);
      var a4 = n4[0], o4 = i4[0];
      return 0 == a4 && (a4 = (t5 * o4 + r3 / 2) / r3), 0 == o4 && (o4 = (r3 * a4 + t5 / 2) / t5), 0 >= a4 || 0 >= o4 ? 0 : (n4[0] = a4, i4[0] = o4, 1);
    }
    function q2(t5, e3) {
      return t5 + (1 << e3) - 1 >>> e3;
    }
    function D2(t5, e3) {
      return ((4278255360 & t5) + (4278255360 & e3) >>> 0 & 4278255360) + ((16711935 & t5) + (16711935 & e3) >>> 0 & 16711935) >>> 0;
    }
    function R2(e3, r3) {
      t4[r3] = function(r4, n4, i4, a4, o4, s4, c6) {
        var u5;
        for (u5 = 0; u5 < o4; ++u5) {
          var h5 = t4[e3](s4[c6 + u5 - 1], i4, a4 + u5);
          s4[c6 + u5] = D2(r4[n4 + u5], h5);
        }
      };
    }
    function T3() {
      this.ud = this.hd = this.jd = 0;
    }
    function U2(t5, e3) {
      return ((4278124286 & (t5 ^ e3)) >>> 1) + (t5 & e3) >>> 0;
    }
    function z2(t5) {
      return 0 <= t5 && 256 > t5 ? t5 : 0 > t5 ? 0 : 255 < t5 ? 255 : void 0;
    }
    function H2(t5, e3) {
      return z2(t5 + (t5 - e3 + 0.5 >> 1));
    }
    function W2(t5, e3, r3) {
      return Math.abs(e3 - r3) - Math.abs(t5 - r3);
    }
    function V2(t5, e3, r3, n4, i4, a4, o4) {
      for (n4 = a4[o4 - 1], r3 = 0; r3 < i4; ++r3)
        a4[o4 + r3] = n4 = D2(t5[e3 + r3], n4);
    }
    function G3(t5, e3, r3, n4, i4) {
      var a4;
      for (a4 = 0; a4 < r3; ++a4) {
        var o4 = t5[e3 + a4], s4 = o4 >> 8 & 255, c6 = 16711935 & (c6 = (c6 = 16711935 & o4) + ((s4 << 16) + s4));
        n4[i4 + a4] = (4278255360 & o4) + c6 >>> 0;
      }
    }
    function Y2(t5, e3) {
      e3.jd = t5 >> 0 & 255, e3.hd = t5 >> 8 & 255, e3.ud = t5 >> 16 & 255;
    }
    function J2(t5, e3, r3, n4, i4, a4) {
      var o4;
      for (o4 = 0; o4 < n4; ++o4) {
        var s4 = e3[r3 + o4], c6 = s4 >>> 8, u5 = s4, h5 = 255 & (h5 = (h5 = s4 >>> 16) + ((t5.jd << 24 >> 24) * (c6 << 24 >> 24) >>> 5));
        u5 = 255 & (u5 = (u5 = u5 + ((t5.hd << 24 >> 24) * (c6 << 24 >> 24) >>> 5)) + ((t5.ud << 24 >> 24) * (h5 << 24 >> 24) >>> 5));
        i4[a4 + o4] = (4278255360 & s4) + (h5 << 16) + u5;
      }
    }
    function X2(e3, r3, n4, i4, a4) {
      t4[r3] = function(t5, e4, r4, n5, o4, s4, c6, u5, h5) {
        for (n5 = c6; n5 < u5; ++n5)
          for (c6 = 0; c6 < h5; ++c6)
            o4[s4++] = a4(r4[i4(t5[e4++])]);
      }, t4[e3] = function(e4, r4, o4, s4, c6, u5, h5) {
        var l5 = 8 >> e4.b, f5 = e4.Ea, d4 = e4.K[0], p5 = e4.w;
        if (8 > l5)
          for (e4 = (1 << e4.b) - 1, p5 = (1 << l5) - 1; r4 < o4; ++r4) {
            var g4, m6 = 0;
            for (g4 = 0; g4 < f5; ++g4)
              g4 & e4 || (m6 = i4(s4[c6++])), u5[h5++] = a4(d4[m6 & p5]), m6 >>= l5;
          }
        else
          t4["VP8LMapColor" + n4](s4, c6, d4, p5, u5, h5, r4, o4, f5);
      };
    }
    function K2(t5, e3, r3, n4, i4) {
      for (r3 = e3 + r3; e3 < r3; ) {
        var a4 = t5[e3++];
        n4[i4++] = a4 >> 16 & 255, n4[i4++] = a4 >> 8 & 255, n4[i4++] = a4 >> 0 & 255;
      }
    }
    function Z2(t5, e3, r3, n4, i4) {
      for (r3 = e3 + r3; e3 < r3; ) {
        var a4 = t5[e3++];
        n4[i4++] = a4 >> 16 & 255, n4[i4++] = a4 >> 8 & 255, n4[i4++] = a4 >> 0 & 255, n4[i4++] = a4 >> 24 & 255;
      }
    }
    function $9(t5, e3, r3, n4, i4) {
      for (r3 = e3 + r3; e3 < r3; ) {
        var a4 = (o4 = t5[e3++]) >> 16 & 240 | o4 >> 12 & 15, o4 = o4 >> 0 & 240 | o4 >> 28 & 15;
        n4[i4++] = a4, n4[i4++] = o4;
      }
    }
    function Q2(t5, e3, r3, n4, i4) {
      for (r3 = e3 + r3; e3 < r3; ) {
        var a4 = (o4 = t5[e3++]) >> 16 & 248 | o4 >> 13 & 7, o4 = o4 >> 5 & 224 | o4 >> 3 & 31;
        n4[i4++] = a4, n4[i4++] = o4;
      }
    }
    function tt2(t5, e3, r3, n4, i4) {
      for (r3 = e3 + r3; e3 < r3; ) {
        var a4 = t5[e3++];
        n4[i4++] = a4 >> 0 & 255, n4[i4++] = a4 >> 8 & 255, n4[i4++] = a4 >> 16 & 255;
      }
    }
    function et3(t5, e3, r3, i4, a4, o4) {
      if (0 == o4)
        for (r3 = e3 + r3; e3 < r3; )
          I2(i4, ((o4 = t5[e3++])[0] >> 24 | o4[1] >> 8 & 65280 | o4[2] << 8 & 16711680 | o4[3] << 24) >>> 0), a4 += 32;
      else
        n3(i4, a4, t5, e3, r3);
    }
    function rt2(e3, r3) {
      t4[r3][0] = t4[e3 + "0"], t4[r3][1] = t4[e3 + "1"], t4[r3][2] = t4[e3 + "2"], t4[r3][3] = t4[e3 + "3"], t4[r3][4] = t4[e3 + "4"], t4[r3][5] = t4[e3 + "5"], t4[r3][6] = t4[e3 + "6"], t4[r3][7] = t4[e3 + "7"], t4[r3][8] = t4[e3 + "8"], t4[r3][9] = t4[e3 + "9"], t4[r3][10] = t4[e3 + "10"], t4[r3][11] = t4[e3 + "11"], t4[r3][12] = t4[e3 + "12"], t4[r3][13] = t4[e3 + "13"], t4[r3][14] = t4[e3 + "0"], t4[r3][15] = t4[e3 + "0"];
    }
    function nt2(t5) {
      return t5 == Hn || t5 == Wn || t5 == Vn || t5 == Gn;
    }
    function it2() {
      this.eb = [], this.size = this.A = this.fb = 0;
    }
    function at2() {
      this.y = [], this.f = [], this.ea = [], this.F = [], this.Tc = this.Ed = this.Cd = this.Fd = this.lb = this.Db = this.Ab = this.fa = this.J = this.W = this.N = this.O = 0;
    }
    function ot2() {
      this.Rd = this.height = this.width = this.S = 0, this.f = {}, this.f.RGBA = new it2(), this.f.kb = new at2(), this.sd = null;
    }
    function st2() {
      this.width = [0], this.height = [0], this.Pd = [0], this.Qd = [0], this.format = [0];
    }
    function ct2() {
      this.Id = this.fd = this.Md = this.hb = this.ib = this.da = this.bd = this.cd = this.j = this.v = this.Da = this.Sd = this.ob = 0;
    }
    function ut2(t5) {
      return alert("todo:WebPSamplerProcessPlane"), t5.T;
    }
    function ht2(t5, e3) {
      var r3 = t5.T, i4 = e3.ba.f.RGBA, a4 = i4.eb, o4 = i4.fb + t5.ka * i4.A, s4 = vi[e3.ba.S], c6 = t5.y, u5 = t5.O, h5 = t5.f, l5 = t5.N, f5 = t5.ea, d4 = t5.W, p5 = e3.cc, g4 = e3.dc, m6 = e3.Mc, v6 = e3.Nc, b4 = t5.ka, y6 = t5.ka + t5.T, w4 = t5.U, N5 = w4 + 1 >> 1;
      for (0 == b4 ? s4(c6, u5, null, null, h5, l5, f5, d4, h5, l5, f5, d4, a4, o4, null, null, w4) : (s4(e3.ec, e3.fc, c6, u5, p5, g4, m6, v6, h5, l5, f5, d4, a4, o4 - i4.A, a4, o4, w4), ++r3); b4 + 2 < y6; b4 += 2)
        p5 = h5, g4 = l5, m6 = f5, v6 = d4, l5 += t5.Rc, d4 += t5.Rc, o4 += 2 * i4.A, s4(c6, (u5 += 2 * t5.fa) - t5.fa, c6, u5, p5, g4, m6, v6, h5, l5, f5, d4, a4, o4 - i4.A, a4, o4, w4);
      return u5 += t5.fa, t5.j + y6 < t5.o ? (n3(e3.ec, e3.fc, c6, u5, w4), n3(e3.cc, e3.dc, h5, l5, N5), n3(e3.Mc, e3.Nc, f5, d4, N5), r3--) : 1 & y6 || s4(c6, u5, null, null, h5, l5, f5, d4, h5, l5, f5, d4, a4, o4 + i4.A, null, null, w4), r3;
    }
    function lt2(t5, r3, n4) {
      var i4 = t5.F, a4 = [t5.J];
      if (null != i4) {
        var o4 = t5.U, s4 = r3.ba.S, c6 = s4 == Tn || s4 == Vn;
        r3 = r3.ba.f.RGBA;
        var u5 = [0], h5 = t5.ka;
        u5[0] = t5.T, t5.Kb && (0 == h5 ? --u5[0] : (--h5, a4[0] -= t5.width), t5.j + t5.ka + t5.T == t5.o && (u5[0] = t5.o - t5.j - h5));
        var l5 = r3.eb;
        h5 = r3.fb + h5 * r3.A;
        t5 = Sn(i4, a4[0], t5.width, o4, u5, l5, h5 + (c6 ? 0 : 3), r3.A), e2(n4 == u5), t5 && nt2(s4) && An(l5, h5, c6, o4, u5, r3.A);
      }
      return 0;
    }
    function ft2(t5) {
      var e3 = t5.ma, r3 = e3.ba.S, n4 = 11 > r3, i4 = r3 == qn || r3 == Rn || r3 == Tn || r3 == Un || 12 == r3 || nt2(r3);
      if (e3.memory = null, e3.Ib = null, e3.Jb = null, e3.Nd = null, !Mr(e3.Oa, t5, i4 ? 11 : 12))
        return 0;
      if (i4 && nt2(r3) && br(), t5.da)
        alert("todo:use_scaling");
      else {
        if (n4) {
          if (e3.Ib = ut2, t5.Kb) {
            if (r3 = t5.U + 1 >> 1, e3.memory = a3(t5.U + 2 * r3), null == e3.memory)
              return 0;
            e3.ec = e3.memory, e3.fc = 0, e3.cc = e3.ec, e3.dc = e3.fc + t5.U, e3.Mc = e3.cc, e3.Nc = e3.dc + r3, e3.Ib = ht2, br();
          }
        } else
          alert("todo:EmitYUV");
        i4 && (e3.Jb = lt2, n4 && mr());
      }
      if (n4 && !Ci) {
        for (t5 = 0; 256 > t5; ++t5)
          ji[t5] = 89858 * (t5 - 128) + _i >> Si, Mi[t5] = -22014 * (t5 - 128) + _i, Bi[t5] = -45773 * (t5 - 128), Oi[t5] = 113618 * (t5 - 128) + _i >> Si;
        for (t5 = Pi; t5 < ki; ++t5)
          e3 = 76283 * (t5 - 16) + _i >> Si, Ei[t5 - Pi] = Vt2(e3, 255), qi[t5 - Pi] = Vt2(e3 + 8 >> 4, 15);
        Ci = 1;
      }
      return 1;
    }
    function dt2(t5) {
      var r3 = t5.ma, n4 = t5.U, i4 = t5.T;
      return e2(!(1 & t5.ka)), 0 >= n4 || 0 >= i4 ? 0 : (n4 = r3.Ib(t5, r3), null != r3.Jb && r3.Jb(t5, r3, n4), r3.Dc += n4, 1);
    }
    function pt2(t5) {
      t5.ma.memory = null;
    }
    function gt2(t5, e3, r3, n4) {
      return 47 != y5(t5, 8) ? 0 : (e3[0] = y5(t5, 14) + 1, r3[0] = y5(t5, 14) + 1, n4[0] = y5(t5, 1), 0 != y5(t5, 3) ? 0 : !t5.h);
    }
    function mt2(t5, e3) {
      if (4 > t5)
        return t5 + 1;
      var r3 = t5 - 2 >> 1;
      return (2 + (1 & t5) << r3) + y5(e3, r3) + 1;
    }
    function vt2(t5, e3) {
      return 120 < e3 ? e3 - 120 : 1 <= (r3 = ((r3 = $n[e3 - 1]) >> 4) * t5 + (8 - (15 & r3))) ? r3 : 1;
      var r3;
    }
    function bt2(t5, e3, r3) {
      var n4 = L3(r3), i4 = t5[e3 += 255 & n4].g - 8;
      return 0 < i4 && (x3(r3, r3.u + 8), n4 = L3(r3), e3 += t5[e3].value, e3 += n4 & (1 << i4) - 1), x3(r3, r3.u + t5[e3].g), t5[e3].value;
    }
    function yt2(t5, r3, n4) {
      return n4.g += t5.g, n4.value += t5.value << r3 >>> 0, e2(8 >= n4.g), t5.g;
    }
    function wt2(t5, r3, n4) {
      var i4 = t5.xc;
      return e2((r3 = 0 == i4 ? 0 : t5.vc[t5.md * (n4 >> i4) + (r3 >> i4)]) < t5.Wb), t5.Ya[r3];
    }
    function Nt2(t5, r3, i4, a4) {
      var o4 = t5.ab, s4 = t5.c * r3, c6 = t5.C;
      r3 = c6 + r3;
      var u5 = i4, h5 = a4;
      for (a4 = t5.Ta, i4 = t5.Ua; 0 < o4--; ) {
        var l5 = t5.gc[o4], f5 = c6, d4 = r3, p5 = u5, g4 = h5, m6 = (h5 = a4, u5 = i4, l5.Ea);
        switch (e2(f5 < d4), e2(d4 <= l5.nc), l5.hc) {
          case 2:
            Gr(p5, g4, (d4 - f5) * m6, h5, u5);
            break;
          case 0:
            var v6 = f5, b4 = d4, y6 = h5, w4 = u5, N5 = (_4 = l5).Ea;
            0 == v6 && (Wr(p5, g4, null, null, 1, y6, w4), V2(p5, g4 + 1, 0, 0, N5 - 1, y6, w4 + 1), g4 += N5, w4 += N5, ++v6);
            for (var L4 = 1 << _4.b, A5 = L4 - 1, x4 = q2(N5, _4.b), S3 = _4.K, _4 = _4.w + (v6 >> _4.b) * x4; v6 < b4; ) {
              var P3 = S3, k3 = _4, I3 = 1;
              for (Vr(p5, g4, y6, w4 - N5, 1, y6, w4); I3 < N5; ) {
                var F3 = (I3 & ~A5) + L4;
                F3 > N5 && (F3 = N5), (0, Zr[P3[k3++] >> 8 & 15])(p5, g4 + +I3, y6, w4 + I3 - N5, F3 - I3, y6, w4 + I3), I3 = F3;
              }
              g4 += N5, w4 += N5, ++v6 & A5 || (_4 += x4);
            }
            d4 != l5.nc && n3(h5, u5 - m6, h5, u5 + (d4 - f5 - 1) * m6, m6);
            break;
          case 1:
            for (m6 = p5, b4 = g4, N5 = (p5 = l5.Ea) - (w4 = p5 & ~(y6 = (g4 = 1 << l5.b) - 1)), v6 = q2(p5, l5.b), L4 = l5.K, l5 = l5.w + (f5 >> l5.b) * v6; f5 < d4; ) {
              for (A5 = L4, x4 = l5, S3 = new T3(), _4 = b4 + w4, P3 = b4 + p5; b4 < _4; )
                Y2(A5[x4++], S3), $r(S3, m6, b4, g4, h5, u5), b4 += g4, u5 += g4;
              b4 < P3 && (Y2(A5[x4++], S3), $r(S3, m6, b4, N5, h5, u5), b4 += N5, u5 += N5), ++f5 & y6 || (l5 += v6);
            }
            break;
          case 3:
            if (p5 == h5 && g4 == u5 && 0 < l5.b) {
              for (b4 = h5, p5 = m6 = u5 + (d4 - f5) * m6 - (w4 = (d4 - f5) * q2(l5.Ea, l5.b)), g4 = h5, y6 = u5, v6 = [], w4 = (N5 = w4) - 1; 0 <= w4; --w4)
                v6[w4] = g4[y6 + w4];
              for (w4 = N5 - 1; 0 <= w4; --w4)
                b4[p5 + w4] = v6[w4];
              Yr(l5, f5, d4, h5, m6, h5, u5);
            } else
              Yr(l5, f5, d4, p5, g4, h5, u5);
        }
        u5 = a4, h5 = i4;
      }
      h5 != i4 && n3(a4, i4, u5, h5, s4);
    }
    function Lt2(t5, r3) {
      var n4 = t5.V, i4 = t5.Ba + t5.c * t5.C, a4 = r3 - t5.C;
      if (e2(r3 <= t5.l.o), e2(16 >= a4), 0 < a4) {
        var o4 = t5.l, s4 = t5.Ta, c6 = t5.Ua, u5 = o4.width;
        if (Nt2(t5, a4, n4, i4), a4 = c6 = [c6], e2((n4 = t5.C) < (i4 = r3)), e2(o4.v < o4.va), i4 > o4.o && (i4 = o4.o), n4 < o4.j) {
          var h5 = o4.j - n4;
          n4 = o4.j;
          a4[0] += h5 * u5;
        }
        if (n4 >= i4 ? n4 = 0 : (a4[0] += 4 * o4.v, o4.ka = n4 - o4.j, o4.U = o4.va - o4.v, o4.T = i4 - n4, n4 = 1), n4) {
          if (c6 = c6[0], 11 > (n4 = t5.ca).S) {
            var l5 = n4.f.RGBA, f5 = (i4 = n4.S, a4 = o4.U, o4 = o4.T, h5 = l5.eb, l5.A), d4 = o4;
            for (l5 = l5.fb + t5.Ma * l5.A; 0 < d4--; ) {
              var p5 = s4, g4 = c6, m6 = a4, v6 = h5, b4 = l5;
              switch (i4) {
                case En:
                  Qr(p5, g4, m6, v6, b4);
                  break;
                case qn:
                  tn(p5, g4, m6, v6, b4);
                  break;
                case Hn:
                  tn(p5, g4, m6, v6, b4), An(v6, b4, 0, m6, 1, 0);
                  break;
                case Dn:
                  nn(p5, g4, m6, v6, b4);
                  break;
                case Rn:
                  et3(p5, g4, m6, v6, b4, 1);
                  break;
                case Wn:
                  et3(p5, g4, m6, v6, b4, 1), An(v6, b4, 0, m6, 1, 0);
                  break;
                case Tn:
                  et3(p5, g4, m6, v6, b4, 0);
                  break;
                case Vn:
                  et3(p5, g4, m6, v6, b4, 0), An(v6, b4, 1, m6, 1, 0);
                  break;
                case Un:
                  en(p5, g4, m6, v6, b4);
                  break;
                case Gn:
                  en(p5, g4, m6, v6, b4), xn(v6, b4, m6, 1, 0);
                  break;
                case zn:
                  rn(p5, g4, m6, v6, b4);
                  break;
                default:
                  e2(0);
              }
              c6 += u5, l5 += f5;
            }
            t5.Ma += o4;
          } else
            alert("todo:EmitRescaledRowsYUVA");
          e2(t5.Ma <= n4.height);
        }
      }
      t5.C = r3, e2(t5.C <= t5.i);
    }
    function At2(t5) {
      var e3;
      if (0 < t5.ua)
        return 0;
      for (e3 = 0; e3 < t5.Wb; ++e3) {
        var r3 = t5.Ya[e3].G, n4 = t5.Ya[e3].H;
        if (0 < r3[1][n4[1] + 0].g || 0 < r3[2][n4[2] + 0].g || 0 < r3[3][n4[3] + 0].g)
          return 0;
      }
      return 1;
    }
    function xt2(t5, r3, n4, i4, a4, o4) {
      if (0 != t5.Z) {
        var s4 = t5.qd, c6 = t5.rd;
        for (e2(null != mi[t5.Z]); r3 < n4; ++r3)
          mi[t5.Z](s4, c6, i4, a4, i4, a4, o4), s4 = i4, c6 = a4, a4 += o4;
        t5.qd = s4, t5.rd = c6;
      }
    }
    function St2(t5, r3) {
      var n4 = t5.l.ma, i4 = 0 == n4.Z || 1 == n4.Z ? t5.l.j : t5.C;
      i4 = t5.C < i4 ? i4 : t5.C;
      if (e2(r3 <= t5.l.o), r3 > i4) {
        var a4 = t5.l.width, o4 = n4.ca, s4 = n4.tb + a4 * i4, c6 = t5.V, u5 = t5.Ba + t5.c * i4, h5 = t5.gc;
        e2(1 == t5.ab), e2(3 == h5[0].hc), Xr(h5[0], i4, r3, c6, u5, o4, s4), xt2(n4, i4, r3, o4, s4, a4);
      }
      t5.C = t5.Ma = r3;
    }
    function _t2(t5, r3, n4, i4, a4, o4, s4) {
      var c6 = t5.$ / i4, u5 = t5.$ % i4, h5 = t5.m, l5 = t5.s, f5 = n4 + t5.$, d4 = f5;
      a4 = n4 + i4 * a4;
      var p5 = n4 + i4 * o4, g4 = 280 + l5.ua, m6 = t5.Pb ? c6 : 16777216, v6 = 0 < l5.ua ? l5.Wa : null, b4 = l5.wc, y6 = f5 < p5 ? wt2(l5, u5, c6) : null;
      e2(t5.C < o4), e2(p5 <= a4);
      var w4 = false;
      t:
        for (; ; ) {
          for (; w4 || f5 < p5; ) {
            var N5 = 0;
            if (c6 >= m6) {
              var _4 = f5 - n4;
              e2((m6 = t5).Pb), m6.wd = m6.m, m6.xd = _4, 0 < m6.s.ua && B2(m6.s.Wa, m6.s.vb), m6 = c6 + ti;
            }
            if (u5 & b4 || (y6 = wt2(l5, u5, c6)), e2(null != y6), y6.Qb && (r3[f5] = y6.qb, w4 = true), !w4)
              if (S2(h5), y6.jc) {
                N5 = h5, _4 = r3;
                var P3 = f5, k3 = y6.pd[L3(N5) & Dr - 1];
                e2(y6.jc), 256 > k3.g ? (x3(N5, N5.u + k3.g), _4[P3] = k3.value, N5 = 0) : (x3(N5, N5.u + k3.g - 256), e2(256 <= k3.value), N5 = k3.value), 0 == N5 && (w4 = true);
              } else
                N5 = bt2(y6.G[0], y6.H[0], h5);
            if (h5.h)
              break;
            if (w4 || 256 > N5) {
              if (!w4)
                if (y6.nd)
                  r3[f5] = (y6.qb | N5 << 8) >>> 0;
                else {
                  if (S2(h5), w4 = bt2(y6.G[1], y6.H[1], h5), S2(h5), _4 = bt2(y6.G[2], y6.H[2], h5), P3 = bt2(y6.G[3], y6.H[3], h5), h5.h)
                    break;
                  r3[f5] = (P3 << 24 | w4 << 16 | N5 << 8 | _4) >>> 0;
                }
              if (w4 = false, ++f5, ++u5 >= i4 && (u5 = 0, ++c6, null != s4 && c6 <= o4 && !(c6 % 16) && s4(t5, c6), null != v6))
                for (; d4 < f5; )
                  N5 = r3[d4++], v6.X[(506832829 * N5 & 4294967295) >>> v6.Mb] = N5;
            } else if (280 > N5) {
              if (N5 = mt2(N5 - 256, h5), _4 = bt2(y6.G[4], y6.H[4], h5), S2(h5), _4 = vt2(i4, _4 = mt2(_4, h5)), h5.h)
                break;
              if (f5 - n4 < _4 || a4 - f5 < N5)
                break t;
              for (P3 = 0; P3 < N5; ++P3)
                r3[f5 + P3] = r3[f5 + P3 - _4];
              for (f5 += N5, u5 += N5; u5 >= i4; )
                u5 -= i4, ++c6, null != s4 && c6 <= o4 && !(c6 % 16) && s4(t5, c6);
              if (e2(f5 <= a4), u5 & b4 && (y6 = wt2(l5, u5, c6)), null != v6)
                for (; d4 < f5; )
                  N5 = r3[d4++], v6.X[(506832829 * N5 & 4294967295) >>> v6.Mb] = N5;
            } else {
              if (!(N5 < g4))
                break t;
              for (w4 = N5 - 280, e2(null != v6); d4 < f5; )
                N5 = r3[d4++], v6.X[(506832829 * N5 & 4294967295) >>> v6.Mb] = N5;
              N5 = f5, e2(!(w4 >>> (_4 = v6).Xa)), r3[N5] = _4.X[w4], w4 = true;
            }
            w4 || e2(h5.h == A4(h5));
          }
          if (t5.Pb && h5.h && f5 < a4)
            e2(t5.m.h), t5.a = 5, t5.m = t5.wd, t5.$ = t5.xd, 0 < t5.s.ua && B2(t5.s.vb, t5.s.Wa);
          else {
            if (h5.h)
              break t;
            null != s4 && s4(t5, c6 > o4 ? o4 : c6), t5.a = 0, t5.$ = f5 - n4;
          }
          return 1;
        }
      return t5.a = 3, 0;
    }
    function Pt2(t5) {
      e2(null != t5), t5.vc = null, t5.yc = null, t5.Ya = null;
      var r3 = t5.Wa;
      null != r3 && (r3.X = null), t5.vb = null, e2(null != t5);
    }
    function kt2() {
      var e3 = new or();
      return null == e3 ? null : (e3.a = 0, e3.xb = gi, rt2("Predictor", "VP8LPredictors"), rt2("Predictor", "VP8LPredictors_C"), rt2("PredictorAdd", "VP8LPredictorsAdd"), rt2("PredictorAdd", "VP8LPredictorsAdd_C"), Gr = G3, $r = J2, Qr = K2, tn = Z2, en = $9, rn = Q2, nn = tt2, t4.VP8LMapColor32b = Jr, t4.VP8LMapColor8b = Kr, e3);
    }
    function It2(t5, r3, n4, s4, c6) {
      var u5 = 1, f5 = [t5], p5 = [r3], g4 = s4.m, m6 = s4.s, v6 = null, b4 = 0;
      t:
        for (; ; ) {
          if (n4)
            for (; u5 && y5(g4, 1); ) {
              var w4 = f5, N5 = p5, A5 = s4, _4 = 1, P3 = A5.m, k3 = A5.gc[A5.ab], I3 = y5(P3, 2);
              if (A5.Oc & 1 << I3)
                u5 = 0;
              else {
                switch (A5.Oc |= 1 << I3, k3.hc = I3, k3.Ea = w4[0], k3.nc = N5[0], k3.K = [null], ++A5.ab, e2(4 >= A5.ab), I3) {
                  case 0:
                  case 1:
                    k3.b = y5(P3, 3) + 2, _4 = It2(q2(k3.Ea, k3.b), q2(k3.nc, k3.b), 0, A5, k3.K), k3.K = k3.K[0];
                    break;
                  case 3:
                    var F3, C3 = y5(P3, 8) + 1, j3 = 16 < C3 ? 0 : 4 < C3 ? 1 : 2 < C3 ? 2 : 3;
                    if (w4[0] = q2(k3.Ea, j3), k3.b = j3, F3 = _4 = It2(C3, 1, 0, A5, k3.K)) {
                      var B3, M3 = C3, E3 = k3, R3 = 1 << (8 >> E3.b), T4 = a3(R3);
                      if (null == T4)
                        F3 = 0;
                      else {
                        var U3 = E3.K[0], z3 = E3.w;
                        for (T4[0] = E3.K[0][0], B3 = 1; B3 < 1 * M3; ++B3)
                          T4[B3] = D2(U3[z3 + B3], T4[B3 - 1]);
                        for (; B3 < 4 * R3; ++B3)
                          T4[B3] = 0;
                        E3.K[0] = null, E3.K[0] = T4, F3 = 1;
                      }
                    }
                    _4 = F3;
                    break;
                  case 2:
                    break;
                  default:
                    e2(0);
                }
                u5 = _4;
              }
            }
          if (f5 = f5[0], p5 = p5[0], u5 && y5(g4, 1) && !(u5 = 1 <= (b4 = y5(g4, 4)) && 11 >= b4)) {
            s4.a = 3;
            break t;
          }
          var H3;
          if (H3 = u5)
            e: {
              var W3, V3, G4, Y3 = s4, J3 = f5, X3 = p5, K3 = b4, Z3 = n4, $10 = Y3.m, Q3 = Y3.s, tt3 = [null], et4 = 1, rt3 = 0, nt3 = Qn[K3];
              r:
                for (; ; ) {
                  if (Z3 && y5($10, 1)) {
                    var it3 = y5($10, 3) + 2, at3 = q2(J3, it3), ot3 = q2(X3, it3), st3 = at3 * ot3;
                    if (!It2(at3, ot3, 0, Y3, tt3))
                      break r;
                    for (tt3 = tt3[0], Q3.xc = it3, W3 = 0; W3 < st3; ++W3) {
                      var ct3 = tt3[W3] >> 8 & 65535;
                      tt3[W3] = ct3, ct3 >= et4 && (et4 = ct3 + 1);
                    }
                  }
                  if ($10.h)
                    break r;
                  for (V3 = 0; 5 > V3; ++V3) {
                    var ut3 = Xn[V3];
                    !V3 && 0 < K3 && (ut3 += 1 << K3), rt3 < ut3 && (rt3 = ut3);
                  }
                  var ht3 = o3(et4 * nt3, l4), lt3 = et4, ft3 = o3(lt3, d3);
                  if (null == ft3)
                    var dt3 = null;
                  else
                    e2(65536 >= lt3), dt3 = ft3;
                  var pt3 = a3(rt3);
                  if (null == dt3 || null == pt3 || null == ht3) {
                    Y3.a = 1;
                    break r;
                  }
                  var gt3 = ht3;
                  for (W3 = G4 = 0; W3 < et4; ++W3) {
                    var mt3 = dt3[W3], vt3 = mt3.G, bt3 = mt3.H, wt3 = 0, Nt3 = 1, Lt3 = 0;
                    for (V3 = 0; 5 > V3; ++V3) {
                      ut3 = Xn[V3], vt3[V3] = gt3, bt3[V3] = G4, !V3 && 0 < K3 && (ut3 += 1 << K3);
                      n: {
                        var At3, xt3 = ut3, St3 = Y3, kt3 = pt3, Ft3 = gt3, Ct3 = G4, jt3 = 0, Ot3 = St3.m, Bt3 = y5(Ot3, 1);
                        if (i3(kt3, 0, 0, xt3), Bt3) {
                          var Mt3 = y5(Ot3, 1) + 1, Et3 = y5(Ot3, 1), qt3 = y5(Ot3, 0 == Et3 ? 1 : 8);
                          kt3[qt3] = 1, 2 == Mt3 && (kt3[qt3 = y5(Ot3, 8)] = 1);
                          var Dt3 = 1;
                        } else {
                          var Rt3 = a3(19), Tt3 = y5(Ot3, 4) + 4;
                          if (19 < Tt3) {
                            St3.a = 3;
                            var Ut3 = 0;
                            break n;
                          }
                          for (At3 = 0; At3 < Tt3; ++At3)
                            Rt3[Zn[At3]] = y5(Ot3, 3);
                          var zt3 = void 0, Ht3 = void 0, Wt3 = St3, Vt3 = Rt3, Gt3 = xt3, Yt3 = kt3, Jt3 = 0, Xt3 = Wt3.m, Kt3 = 8, Zt3 = o3(128, l4);
                          i:
                            for (; h4(Zt3, 0, 7, Vt3, 19); ) {
                              if (y5(Xt3, 1)) {
                                var $t3 = 2 + 2 * y5(Xt3, 3);
                                if ((zt3 = 2 + y5(Xt3, $t3)) > Gt3)
                                  break i;
                              } else
                                zt3 = Gt3;
                              for (Ht3 = 0; Ht3 < Gt3 && zt3--; ) {
                                S2(Xt3);
                                var Qt3 = Zt3[0 + (127 & L3(Xt3))];
                                x3(Xt3, Xt3.u + Qt3.g);
                                var te3 = Qt3.value;
                                if (16 > te3)
                                  Yt3[Ht3++] = te3, 0 != te3 && (Kt3 = te3);
                                else {
                                  var ee3 = 16 == te3, re3 = te3 - 16, ne3 = Jn[re3], ie3 = y5(Xt3, Yn[re3]) + ne3;
                                  if (Ht3 + ie3 > Gt3)
                                    break i;
                                  for (var ae3 = ee3 ? Kt3 : 0; 0 < ie3--; )
                                    Yt3[Ht3++] = ae3;
                                }
                              }
                              Jt3 = 1;
                              break i;
                            }
                          Jt3 || (Wt3.a = 3), Dt3 = Jt3;
                        }
                        (Dt3 = Dt3 && !Ot3.h) && (jt3 = h4(Ft3, Ct3, 8, kt3, xt3)), Dt3 && 0 != jt3 ? Ut3 = jt3 : (St3.a = 3, Ut3 = 0);
                      }
                      if (0 == Ut3)
                        break r;
                      if (Nt3 && 1 == Kn[V3] && (Nt3 = 0 == gt3[G4].g), wt3 += gt3[G4].g, G4 += Ut3, 3 >= V3) {
                        var oe3, se3 = pt3[0];
                        for (oe3 = 1; oe3 < ut3; ++oe3)
                          pt3[oe3] > se3 && (se3 = pt3[oe3]);
                        Lt3 += se3;
                      }
                    }
                    if (mt3.nd = Nt3, mt3.Qb = 0, Nt3 && (mt3.qb = (vt3[3][bt3[3] + 0].value << 24 | vt3[1][bt3[1] + 0].value << 16 | vt3[2][bt3[2] + 0].value) >>> 0, 0 == wt3 && 256 > vt3[0][bt3[0] + 0].value && (mt3.Qb = 1, mt3.qb += vt3[0][bt3[0] + 0].value << 8)), mt3.jc = !mt3.Qb && 6 > Lt3, mt3.jc) {
                      var ce3, ue3 = mt3;
                      for (ce3 = 0; ce3 < Dr; ++ce3) {
                        var he3 = ce3, le3 = ue3.pd[he3], fe3 = ue3.G[0][ue3.H[0] + he3];
                        256 <= fe3.value ? (le3.g = fe3.g + 256, le3.value = fe3.value) : (le3.g = 0, le3.value = 0, he3 >>= yt2(fe3, 8, le3), he3 >>= yt2(ue3.G[1][ue3.H[1] + he3], 16, le3), he3 >>= yt2(ue3.G[2][ue3.H[2] + he3], 0, le3), yt2(ue3.G[3][ue3.H[3] + he3], 24, le3));
                      }
                    }
                  }
                  Q3.vc = tt3, Q3.Wb = et4, Q3.Ya = dt3, Q3.yc = ht3, H3 = 1;
                  break e;
                }
              H3 = 0;
            }
          if (!(u5 = H3)) {
            s4.a = 3;
            break t;
          }
          if (0 < b4) {
            if (m6.ua = 1 << b4, !O3(m6.Wa, b4)) {
              s4.a = 1, u5 = 0;
              break t;
            }
          } else
            m6.ua = 0;
          var de3 = s4, pe3 = f5, ge3 = p5, me3 = de3.s, ve3 = me3.xc;
          if (de3.c = pe3, de3.i = ge3, me3.md = q2(pe3, ve3), me3.wc = 0 == ve3 ? -1 : (1 << ve3) - 1, n4) {
            s4.xb = pi;
            break t;
          }
          if (null == (v6 = a3(f5 * p5))) {
            s4.a = 1, u5 = 0;
            break t;
          }
          u5 = (u5 = _t2(s4, v6, 0, f5, p5, p5, null)) && !g4.h;
          break t;
        }
      return u5 ? (null != c6 ? c6[0] = v6 : (e2(null == v6), e2(n4)), s4.$ = 0, n4 || Pt2(m6)) : Pt2(m6), u5;
    }
    function Ft2(t5, r3) {
      var n4 = t5.c * t5.i, i4 = n4 + r3 + 16 * r3;
      return e2(t5.c <= r3), t5.V = a3(i4), null == t5.V ? (t5.Ta = null, t5.Ua = 0, t5.a = 1, 0) : (t5.Ta = t5.V, t5.Ua = t5.Ba + n4 + r3, 1);
    }
    function Ct2(t5, r3) {
      var n4 = t5.C, i4 = r3 - n4, a4 = t5.V, o4 = t5.Ba + t5.c * n4;
      for (e2(r3 <= t5.l.o); 0 < i4; ) {
        var s4 = 16 < i4 ? 16 : i4, c6 = t5.l.ma, u5 = t5.l.width, h5 = u5 * s4, l5 = c6.ca, f5 = c6.tb + u5 * n4, d4 = t5.Ta, p5 = t5.Ua;
        Nt2(t5, s4, a4, o4), _n(d4, p5, l5, f5, h5), xt2(c6, n4, n4 + s4, l5, f5, u5), i4 -= s4, a4 += s4 * t5.c, n4 += s4;
      }
      e2(n4 == r3), t5.C = t5.Ma = r3;
    }
    function jt2() {
      this.ub = this.yd = this.td = this.Rb = 0;
    }
    function Ot2() {
      this.Kd = this.Ld = this.Ud = this.Td = this.i = this.c = 0;
    }
    function Bt2() {
      this.Fb = this.Bb = this.Cb = 0, this.Zb = a3(4), this.Lb = a3(4);
    }
    function Mt2() {
      this.Yb = function() {
        var t5 = [];
        return function t6(e3, r3, n4) {
          for (var i4 = n4[r3], a4 = 0; a4 < i4 && (e3.push(n4.length > r3 + 1 ? [] : 0), !(n4.length < r3 + 1)); a4++)
            t6(e3[a4], r3 + 1, n4);
        }(t5, 0, [3, 11]), t5;
      }();
    }
    function Et2() {
      this.jb = a3(3), this.Wc = s3([4, 8], Mt2), this.Xc = s3([4, 17], Mt2);
    }
    function qt2() {
      this.Pc = this.wb = this.Tb = this.zd = 0, this.vd = new a3(4), this.od = new a3(4);
    }
    function Dt2() {
      this.ld = this.La = this.dd = this.tc = 0;
    }
    function Rt2() {
      this.Na = this.la = 0;
    }
    function Tt2() {
      this.Sc = [0, 0], this.Eb = [0, 0], this.Qc = [0, 0], this.ia = this.lc = 0;
    }
    function Ut2() {
      this.ad = a3(384), this.Za = 0, this.Ob = a3(16), this.$b = this.Ad = this.ia = this.Gc = this.Hc = this.Dd = 0;
    }
    function zt2() {
      this.uc = this.M = this.Nb = 0, this.wa = Array(new Dt2()), this.Y = 0, this.ya = Array(new Ut2()), this.aa = 0, this.l = new Gt2();
    }
    function Ht2() {
      this.y = a3(16), this.f = a3(8), this.ea = a3(8);
    }
    function Wt2() {
      this.cb = this.a = 0, this.sc = "", this.m = new w3(), this.Od = new jt2(), this.Kc = new Ot2(), this.ed = new qt2(), this.Qa = new Bt2(), this.Ic = this.$c = this.Aa = 0, this.D = new zt2(), this.Xb = this.Va = this.Hb = this.zb = this.yb = this.Ub = this.za = 0, this.Jc = o3(8, w3), this.ia = 0, this.pb = o3(4, Tt2), this.Pa = new Et2(), this.Bd = this.kc = 0, this.Ac = [], this.Bc = 0, this.zc = [0, 0, 0, 0], this.Gd = Array(new Ht2()), this.Hd = 0, this.rb = Array(new Rt2()), this.sb = 0, this.wa = Array(new Dt2()), this.Y = 0, this.oc = [], this.pc = 0, this.sa = [], this.ta = 0, this.qa = [], this.ra = 0, this.Ha = [], this.B = this.R = this.Ia = 0, this.Ec = [], this.M = this.ja = this.Vb = this.Fc = 0, this.ya = Array(new Ut2()), this.L = this.aa = 0, this.gd = s3([4, 2], Dt2), this.ga = null, this.Fa = [], this.Cc = this.qc = this.P = 0, this.Gb = [], this.Uc = 0, this.mb = [], this.nb = 0, this.rc = [], this.Ga = this.Vc = 0;
    }
    function Vt2(t5, e3) {
      return 0 > t5 ? 0 : t5 > e3 ? e3 : t5;
    }
    function Gt2() {
      this.T = this.U = this.ka = this.height = this.width = 0, this.y = [], this.f = [], this.ea = [], this.Rc = this.fa = this.W = this.N = this.O = 0, this.ma = "void", this.put = "VP8IoPutHook", this.ac = "VP8IoSetupHook", this.bc = "VP8IoTeardownHook", this.ha = this.Kb = 0, this.data = [], this.hb = this.ib = this.da = this.o = this.j = this.va = this.v = this.Da = this.ob = this.w = 0, this.F = [], this.J = 0;
    }
    function Yt2() {
      var t5 = new Wt2();
      return null != t5 && (t5.a = 0, t5.sc = "OK", t5.cb = 0, t5.Xb = 0, ni || (ni = Zt2)), t5;
    }
    function Jt2(t5, e3, r3) {
      return 0 == t5.a && (t5.a = e3, t5.sc = r3, t5.cb = 0), 0;
    }
    function Xt2(t5, e3, r3) {
      return 3 <= r3 && 157 == t5[e3 + 0] && 1 == t5[e3 + 1] && 42 == t5[e3 + 2];
    }
    function Kt2(t5, r3) {
      if (null == t5)
        return 0;
      if (t5.a = 0, t5.sc = "OK", null == r3)
        return Jt2(t5, 2, "null VP8Io passed to VP8GetHeaders()");
      var n4 = r3.data, a4 = r3.w, o4 = r3.ha;
      if (4 > o4)
        return Jt2(t5, 7, "Truncated header.");
      var s4 = n4[a4 + 0] | n4[a4 + 1] << 8 | n4[a4 + 2] << 16, c6 = t5.Od;
      if (c6.Rb = !(1 & s4), c6.td = s4 >> 1 & 7, c6.yd = s4 >> 4 & 1, c6.ub = s4 >> 5, 3 < c6.td)
        return Jt2(t5, 3, "Incorrect keyframe parameters.");
      if (!c6.yd)
        return Jt2(t5, 4, "Frame not displayable.");
      a4 += 3, o4 -= 3;
      var u5 = t5.Kc;
      if (c6.Rb) {
        if (7 > o4)
          return Jt2(t5, 7, "cannot parse picture header");
        if (!Xt2(n4, a4, o4))
          return Jt2(t5, 3, "Bad code word");
        u5.c = 16383 & (n4[a4 + 4] << 8 | n4[a4 + 3]), u5.Td = n4[a4 + 4] >> 6, u5.i = 16383 & (n4[a4 + 6] << 8 | n4[a4 + 5]), u5.Ud = n4[a4 + 6] >> 6, a4 += 7, o4 -= 7, t5.za = u5.c + 15 >> 4, t5.Ub = u5.i + 15 >> 4, r3.width = u5.c, r3.height = u5.i, r3.Da = 0, r3.j = 0, r3.v = 0, r3.va = r3.width, r3.o = r3.height, r3.da = 0, r3.ib = r3.width, r3.hb = r3.height, r3.U = r3.width, r3.T = r3.height, i3((s4 = t5.Pa).jb, 0, 255, s4.jb.length), e2(null != (s4 = t5.Qa)), s4.Cb = 0, s4.Bb = 0, s4.Fb = 1, i3(s4.Zb, 0, 0, s4.Zb.length), i3(s4.Lb, 0, 0, s4.Lb);
      }
      if (c6.ub > o4)
        return Jt2(t5, 7, "bad partition length");
      p4(s4 = t5.m, n4, a4, c6.ub), a4 += c6.ub, o4 -= c6.ub, c6.Rb && (u5.Ld = P2(s4), u5.Kd = P2(s4)), u5 = t5.Qa;
      var h5, l5 = t5.Pa;
      if (e2(null != s4), e2(null != u5), u5.Cb = P2(s4), u5.Cb) {
        if (u5.Bb = P2(s4), P2(s4)) {
          for (u5.Fb = P2(s4), h5 = 0; 4 > h5; ++h5)
            u5.Zb[h5] = P2(s4) ? m5(s4, 7) : 0;
          for (h5 = 0; 4 > h5; ++h5)
            u5.Lb[h5] = P2(s4) ? m5(s4, 6) : 0;
        }
        if (u5.Bb)
          for (h5 = 0; 3 > h5; ++h5)
            l5.jb[h5] = P2(s4) ? g3(s4, 8) : 255;
      } else
        u5.Bb = 0;
      if (s4.Ka)
        return Jt2(t5, 3, "cannot parse segment header");
      if ((u5 = t5.ed).zd = P2(s4), u5.Tb = g3(s4, 6), u5.wb = g3(s4, 3), u5.Pc = P2(s4), u5.Pc && P2(s4)) {
        for (l5 = 0; 4 > l5; ++l5)
          P2(s4) && (u5.vd[l5] = m5(s4, 6));
        for (l5 = 0; 4 > l5; ++l5)
          P2(s4) && (u5.od[l5] = m5(s4, 6));
      }
      if (t5.L = 0 == u5.Tb ? 0 : u5.zd ? 1 : 2, s4.Ka)
        return Jt2(t5, 3, "cannot parse filter header");
      var f5 = o4;
      if (o4 = h5 = a4, a4 = h5 + f5, u5 = f5, t5.Xb = (1 << g3(t5.m, 2)) - 1, f5 < 3 * (l5 = t5.Xb))
        n4 = 7;
      else {
        for (h5 += 3 * l5, u5 -= 3 * l5, f5 = 0; f5 < l5; ++f5) {
          var d4 = n4[o4 + 0] | n4[o4 + 1] << 8 | n4[o4 + 2] << 16;
          d4 > u5 && (d4 = u5), p4(t5.Jc[+f5], n4, h5, d4), h5 += d4, u5 -= d4, o4 += 3;
        }
        p4(t5.Jc[+l5], n4, h5, u5), n4 = h5 < a4 ? 0 : 5;
      }
      if (0 != n4)
        return Jt2(t5, n4, "cannot parse partitions");
      for (n4 = g3(h5 = t5.m, 7), o4 = P2(h5) ? m5(h5, 4) : 0, a4 = P2(h5) ? m5(h5, 4) : 0, u5 = P2(h5) ? m5(h5, 4) : 0, l5 = P2(h5) ? m5(h5, 4) : 0, h5 = P2(h5) ? m5(h5, 4) : 0, f5 = t5.Qa, d4 = 0; 4 > d4; ++d4) {
        if (f5.Cb) {
          var v6 = f5.Zb[d4];
          f5.Fb || (v6 += n4);
        } else {
          if (0 < d4) {
            t5.pb[d4] = t5.pb[0];
            continue;
          }
          v6 = n4;
        }
        var b4 = t5.pb[d4];
        b4.Sc[0] = ei[Vt2(v6 + o4, 127)], b4.Sc[1] = ri[Vt2(v6 + 0, 127)], b4.Eb[0] = 2 * ei[Vt2(v6 + a4, 127)], b4.Eb[1] = 101581 * ri[Vt2(v6 + u5, 127)] >> 16, 8 > b4.Eb[1] && (b4.Eb[1] = 8), b4.Qc[0] = ei[Vt2(v6 + l5, 117)], b4.Qc[1] = ri[Vt2(v6 + h5, 127)], b4.lc = v6 + h5;
      }
      if (!c6.Rb)
        return Jt2(t5, 4, "Not a key frame.");
      for (P2(s4), c6 = t5.Pa, n4 = 0; 4 > n4; ++n4) {
        for (o4 = 0; 8 > o4; ++o4)
          for (a4 = 0; 3 > a4; ++a4)
            for (u5 = 0; 11 > u5; ++u5)
              l5 = k2(s4, ui[n4][o4][a4][u5]) ? g3(s4, 8) : si[n4][o4][a4][u5], c6.Wc[n4][o4].Yb[a4][u5] = l5;
        for (o4 = 0; 17 > o4; ++o4)
          c6.Xc[n4][o4] = c6.Wc[n4][hi[o4]];
      }
      return t5.kc = P2(s4), t5.kc && (t5.Bd = g3(s4, 8)), t5.cb = 1;
    }
    function Zt2(t5, e3, r3, n4, i4, a4, o4) {
      var s4 = e3[i4].Yb[r3];
      for (r3 = 0; 16 > i4; ++i4) {
        if (!k2(t5, s4[r3 + 0]))
          return i4;
        for (; !k2(t5, s4[r3 + 1]); )
          if (s4 = e3[++i4].Yb[0], r3 = 0, 16 == i4)
            return 16;
        var c6 = e3[i4 + 1].Yb;
        if (k2(t5, s4[r3 + 2])) {
          var u5 = t5, h5 = 0;
          if (k2(u5, (f5 = s4)[(l5 = r3) + 3]))
            if (k2(u5, f5[l5 + 6])) {
              for (s4 = 0, l5 = 2 * (h5 = k2(u5, f5[l5 + 8])) + (f5 = k2(u5, f5[l5 + 9 + h5])), h5 = 0, f5 = ii[l5]; f5[s4]; ++s4)
                h5 += h5 + k2(u5, f5[s4]);
              h5 += 3 + (8 << l5);
            } else
              k2(u5, f5[l5 + 7]) ? (h5 = 7 + 2 * k2(u5, 165), h5 += k2(u5, 145)) : h5 = 5 + k2(u5, 159);
          else
            h5 = k2(u5, f5[l5 + 4]) ? 3 + k2(u5, f5[l5 + 5]) : 2;
          s4 = c6[2];
        } else
          h5 = 1, s4 = c6[1];
        c6 = o4 + ai[i4], 0 > (u5 = t5).b && _3(u5);
        var l5, f5 = u5.b, d4 = (l5 = u5.Ca >> 1) - (u5.I >> f5) >> 31;
        --u5.b, u5.Ca += d4, u5.Ca |= 1, u5.I -= (l5 + 1 & d4) << f5, a4[c6] = ((h5 ^ d4) - d4) * n4[(0 < i4) + 0];
      }
      return 16;
    }
    function $t2(t5) {
      var e3 = t5.rb[t5.sb - 1];
      e3.la = 0, e3.Na = 0, i3(t5.zc, 0, 0, t5.zc.length), t5.ja = 0;
    }
    function Qt2(t5, r3) {
      if (null == t5)
        return 0;
      if (null == r3)
        return Jt2(t5, 2, "NULL VP8Io parameter in VP8Decode().");
      if (!t5.cb && !Kt2(t5, r3))
        return 0;
      if (e2(t5.cb), null == r3.ac || r3.ac(r3)) {
        r3.ob && (t5.L = 0);
        var s4 = Ri[t5.L];
        if (2 == t5.L ? (t5.yb = 0, t5.zb = 0) : (t5.yb = r3.v - s4 >> 4, t5.zb = r3.j - s4 >> 4, 0 > t5.yb && (t5.yb = 0), 0 > t5.zb && (t5.zb = 0)), t5.Va = r3.o + 15 + s4 >> 4, t5.Hb = r3.va + 15 + s4 >> 4, t5.Hb > t5.za && (t5.Hb = t5.za), t5.Va > t5.Ub && (t5.Va = t5.Ub), 0 < t5.L) {
          var c6 = t5.ed;
          for (s4 = 0; 4 > s4; ++s4) {
            var u5;
            if (t5.Qa.Cb) {
              var h5 = t5.Qa.Lb[s4];
              t5.Qa.Fb || (h5 += c6.Tb);
            } else
              h5 = c6.Tb;
            for (u5 = 0; 1 >= u5; ++u5) {
              var l5 = t5.gd[s4][u5], f5 = h5;
              if (c6.Pc && (f5 += c6.vd[0], u5 && (f5 += c6.od[0])), 0 < (f5 = 0 > f5 ? 0 : 63 < f5 ? 63 : f5)) {
                var d4 = f5;
                0 < c6.wb && ((d4 = 4 < c6.wb ? d4 >> 2 : d4 >> 1) > 9 - c6.wb && (d4 = 9 - c6.wb)), 1 > d4 && (d4 = 1), l5.dd = d4, l5.tc = 2 * f5 + d4, l5.ld = 40 <= f5 ? 2 : 15 <= f5 ? 1 : 0;
              } else
                l5.tc = 0;
              l5.La = u5;
            }
          }
        }
        s4 = 0;
      } else
        Jt2(t5, 6, "Frame setup failed"), s4 = t5.a;
      if (s4 = 0 == s4) {
        if (s4) {
          t5.$c = 0, 0 < t5.Aa || (t5.Ic = Ui);
          t: {
            s4 = t5.Ic;
            c6 = 4 * (d4 = t5.za);
            var p5 = 32 * d4, g4 = d4 + 1, m6 = 0 < t5.L ? d4 * (0 < t5.Aa ? 2 : 1) : 0, v6 = (2 == t5.Aa ? 2 : 1) * d4;
            if ((l5 = c6 + 832 + (u5 = 3 * (16 * s4 + Ri[t5.L]) / 2 * p5) + (h5 = null != t5.Fa && 0 < t5.Fa.length ? t5.Kc.c * t5.Kc.i : 0)) != l5)
              s4 = 0;
            else {
              if (l5 > t5.Vb) {
                if (t5.Vb = 0, t5.Ec = a3(l5), t5.Fc = 0, null == t5.Ec) {
                  s4 = Jt2(t5, 1, "no memory during frame initialization.");
                  break t;
                }
                t5.Vb = l5;
              }
              l5 = t5.Ec, f5 = t5.Fc, t5.Ac = l5, t5.Bc = f5, f5 += c6, t5.Gd = o3(p5, Ht2), t5.Hd = 0, t5.rb = o3(g4 + 1, Rt2), t5.sb = 1, t5.wa = m6 ? o3(m6, Dt2) : null, t5.Y = 0, t5.D.Nb = 0, t5.D.wa = t5.wa, t5.D.Y = t5.Y, 0 < t5.Aa && (t5.D.Y += d4), e2(true), t5.oc = l5, t5.pc = f5, f5 += 832, t5.ya = o3(v6, Ut2), t5.aa = 0, t5.D.ya = t5.ya, t5.D.aa = t5.aa, 2 == t5.Aa && (t5.D.aa += d4), t5.R = 16 * d4, t5.B = 8 * d4, d4 = (p5 = Ri[t5.L]) * t5.R, p5 = p5 / 2 * t5.B, t5.sa = l5, t5.ta = f5 + d4, t5.qa = t5.sa, t5.ra = t5.ta + 16 * s4 * t5.R + p5, t5.Ha = t5.qa, t5.Ia = t5.ra + 8 * s4 * t5.B + p5, t5.$c = 0, f5 += u5, t5.mb = h5 ? l5 : null, t5.nb = h5 ? f5 : null, e2(f5 + h5 <= t5.Fc + t5.Vb), $t2(t5), i3(t5.Ac, t5.Bc, 0, c6), s4 = 1;
            }
          }
          if (s4) {
            if (r3.ka = 0, r3.y = t5.sa, r3.O = t5.ta, r3.f = t5.qa, r3.N = t5.ra, r3.ea = t5.Ha, r3.Vd = t5.Ia, r3.fa = t5.R, r3.Rc = t5.B, r3.F = null, r3.J = 0, !Cn) {
              for (s4 = -255; 255 >= s4; ++s4)
                Pn[255 + s4] = 0 > s4 ? -s4 : s4;
              for (s4 = -1020; 1020 >= s4; ++s4)
                kn[1020 + s4] = -128 > s4 ? -128 : 127 < s4 ? 127 : s4;
              for (s4 = -112; 112 >= s4; ++s4)
                In[112 + s4] = -16 > s4 ? -16 : 15 < s4 ? 15 : s4;
              for (s4 = -255; 510 >= s4; ++s4)
                Fn[255 + s4] = 0 > s4 ? 0 : 255 < s4 ? 255 : s4;
              Cn = 1;
            }
            an = ue2, on2 = ae2, cn = oe2, un = se2, hn = ce2, sn = ie2, ln2 = Je, fn = Xe, dn = $e, pn = Qe, gn = Ke, mn = Ze, vn = tr, bn = er, yn = ze, wn = He, Nn = We, Ln = Ve, fi[0] = xe, fi[1] = le2, fi[2] = Le2, fi[3] = Ae, fi[4] = Se, fi[5] = Pe, fi[6] = _e, fi[7] = ke, fi[8] = Fe, fi[9] = Ie, li[0] = ve2, li[1] = de2, li[2] = pe2, li[3] = ge2, li[4] = be2, li[5] = ye2, li[6] = we2, di[0] = Be, di[1] = fe2, di[2] = Ce, di[3] = je, di[4] = Ee, di[5] = Me, di[6] = qe, s4 = 1;
          } else
            s4 = 0;
        }
        s4 && (s4 = function(t6, r4) {
          for (t6.M = 0; t6.M < t6.Va; ++t6.M) {
            var o4, s5 = t6.Jc[t6.M & t6.Xb], c7 = t6.m, u6 = t6;
            for (o4 = 0; o4 < u6.za; ++o4) {
              var h6 = c7, l6 = u6, f6 = l6.Ac, d5 = l6.Bc + 4 * o4, p6 = l6.zc, g5 = l6.ya[l6.aa + o4];
              if (l6.Qa.Bb ? g5.$b = k2(h6, l6.Pa.jb[0]) ? 2 + k2(h6, l6.Pa.jb[2]) : k2(h6, l6.Pa.jb[1]) : g5.$b = 0, l6.kc && (g5.Ad = k2(h6, l6.Bd)), g5.Za = !k2(h6, 145) + 0, g5.Za) {
                var m7 = g5.Ob, v7 = 0;
                for (l6 = 0; 4 > l6; ++l6) {
                  var b4, y6 = p6[0 + l6];
                  for (b4 = 0; 4 > b4; ++b4) {
                    y6 = ci[f6[d5 + b4]][y6];
                    for (var w4 = oi[k2(h6, y6[0])]; 0 < w4; )
                      w4 = oi[2 * w4 + k2(h6, y6[w4])];
                    y6 = -w4, f6[d5 + b4] = y6;
                  }
                  n3(m7, v7, f6, d5, 4), v7 += 4, p6[0 + l6] = y6;
                }
              } else
                y6 = k2(h6, 156) ? k2(h6, 128) ? 1 : 3 : k2(h6, 163) ? 2 : 0, g5.Ob[0] = y6, i3(f6, d5, y6, 4), i3(p6, 0, y6, 4);
              g5.Dd = k2(h6, 142) ? k2(h6, 114) ? k2(h6, 183) ? 1 : 3 : 2 : 0;
            }
            if (u6.m.Ka)
              return Jt2(t6, 7, "Premature end-of-partition0 encountered.");
            for (; t6.ja < t6.za; ++t6.ja) {
              if (u6 = s5, h6 = (c7 = t6).rb[c7.sb - 1], f6 = c7.rb[c7.sb + c7.ja], o4 = c7.ya[c7.aa + c7.ja], d5 = c7.kc ? o4.Ad : 0)
                h6.la = f6.la = 0, o4.Za || (h6.Na = f6.Na = 0), o4.Hc = 0, o4.Gc = 0, o4.ia = 0;
              else {
                var N5, L4;
                h6 = f6, f6 = u6, d5 = c7.Pa.Xc, p6 = c7.ya[c7.aa + c7.ja], g5 = c7.pb[p6.$b];
                if (l6 = p6.ad, m7 = 0, v7 = c7.rb[c7.sb - 1], y6 = b4 = 0, i3(l6, m7, 0, 384), p6.Za)
                  var A5 = 0, x4 = d5[3];
                else {
                  w4 = a3(16);
                  var S3 = h6.Na + v7.Na;
                  if (S3 = ni(f6, d5[1], S3, g5.Eb, 0, w4, 0), h6.Na = v7.Na = (0 < S3) + 0, 1 < S3)
                    an(w4, 0, l6, m7);
                  else {
                    var _4 = w4[0] + 3 >> 3;
                    for (w4 = 0; 256 > w4; w4 += 16)
                      l6[m7 + w4] = _4;
                  }
                  A5 = 1, x4 = d5[0];
                }
                var P3 = 15 & h6.la, I3 = 15 & v7.la;
                for (w4 = 0; 4 > w4; ++w4) {
                  var F3 = 1 & I3;
                  for (_4 = L4 = 0; 4 > _4; ++_4)
                    P3 = P3 >> 1 | (F3 = (S3 = ni(f6, x4, S3 = F3 + (1 & P3), g5.Sc, A5, l6, m7)) > A5) << 7, L4 = L4 << 2 | (3 < S3 ? 3 : 1 < S3 ? 2 : 0 != l6[m7 + 0]), m7 += 16;
                  P3 >>= 4, I3 = I3 >> 1 | F3 << 7, b4 = (b4 << 8 | L4) >>> 0;
                }
                for (x4 = P3, A5 = I3 >> 4, N5 = 0; 4 > N5; N5 += 2) {
                  for (L4 = 0, P3 = h6.la >> 4 + N5, I3 = v7.la >> 4 + N5, w4 = 0; 2 > w4; ++w4) {
                    for (F3 = 1 & I3, _4 = 0; 2 > _4; ++_4)
                      S3 = F3 + (1 & P3), P3 = P3 >> 1 | (F3 = 0 < (S3 = ni(f6, d5[2], S3, g5.Qc, 0, l6, m7))) << 3, L4 = L4 << 2 | (3 < S3 ? 3 : 1 < S3 ? 2 : 0 != l6[m7 + 0]), m7 += 16;
                    P3 >>= 2, I3 = I3 >> 1 | F3 << 5;
                  }
                  y6 |= L4 << 4 * N5, x4 |= P3 << 4 << N5, A5 |= (240 & I3) << N5;
                }
                h6.la = x4, v7.la = A5, p6.Hc = b4, p6.Gc = y6, p6.ia = 43690 & y6 ? 0 : g5.ia, d5 = !(b4 | y6);
              }
              if (0 < c7.L && (c7.wa[c7.Y + c7.ja] = c7.gd[o4.$b][o4.Za], c7.wa[c7.Y + c7.ja].La |= !d5), u6.Ka)
                return Jt2(t6, 7, "Premature end-of-file encountered.");
            }
            if ($t2(t6), c7 = r4, u6 = 1, o4 = (s5 = t6).D, h6 = 0 < s5.L && s5.M >= s5.zb && s5.M <= s5.Va, 0 == s5.Aa)
              t: {
                if (o4.M = s5.M, o4.uc = h6, Or(s5, o4), u6 = 1, o4 = (L4 = s5.D).Nb, h6 = (y6 = Ri[s5.L]) * s5.R, f6 = y6 / 2 * s5.B, w4 = 16 * o4 * s5.R, _4 = 8 * o4 * s5.B, d5 = s5.sa, p6 = s5.ta - h6 + w4, g5 = s5.qa, l6 = s5.ra - f6 + _4, m7 = s5.Ha, v7 = s5.Ia - f6 + _4, I3 = 0 == (P3 = L4.M), b4 = P3 >= s5.Va - 1, 2 == s5.Aa && Or(s5, L4), L4.uc)
                  for (F3 = (S3 = s5).D.M, e2(S3.D.uc), L4 = S3.yb; L4 < S3.Hb; ++L4) {
                    A5 = L4, x4 = F3;
                    var C3 = (j3 = (U3 = S3).D).Nb;
                    N5 = U3.R;
                    var j3 = j3.wa[j3.Y + A5], O4 = U3.sa, B3 = U3.ta + 16 * C3 * N5 + 16 * A5, M3 = j3.dd, E3 = j3.tc;
                    if (0 != E3)
                      if (e2(3 <= E3), 1 == U3.L)
                        0 < A5 && wn(O4, B3, N5, E3 + 4), j3.La && Ln(O4, B3, N5, E3), 0 < x4 && yn(O4, B3, N5, E3 + 4), j3.La && Nn(O4, B3, N5, E3);
                      else {
                        var q3 = U3.B, D3 = U3.qa, R3 = U3.ra + 8 * C3 * q3 + 8 * A5, T4 = U3.Ha, U3 = U3.Ia + 8 * C3 * q3 + 8 * A5;
                        C3 = j3.ld;
                        0 < A5 && (fn(O4, B3, N5, E3 + 4, M3, C3), pn(D3, R3, T4, U3, q3, E3 + 4, M3, C3)), j3.La && (mn(O4, B3, N5, E3, M3, C3), bn(D3, R3, T4, U3, q3, E3, M3, C3)), 0 < x4 && (ln2(O4, B3, N5, E3 + 4, M3, C3), dn(D3, R3, T4, U3, q3, E3 + 4, M3, C3)), j3.La && (gn(O4, B3, N5, E3, M3, C3), vn(D3, R3, T4, U3, q3, E3, M3, C3));
                      }
                  }
                if (s5.ia && alert("todo:DitherRow"), null != c7.put) {
                  if (L4 = 16 * P3, P3 = 16 * (P3 + 1), I3 ? (c7.y = s5.sa, c7.O = s5.ta + w4, c7.f = s5.qa, c7.N = s5.ra + _4, c7.ea = s5.Ha, c7.W = s5.Ia + _4) : (L4 -= y6, c7.y = d5, c7.O = p6, c7.f = g5, c7.N = l6, c7.ea = m7, c7.W = v7), b4 || (P3 -= y6), P3 > c7.o && (P3 = c7.o), c7.F = null, c7.J = null, null != s5.Fa && 0 < s5.Fa.length && L4 < P3 && (c7.J = lr(s5, c7, L4, P3 - L4), c7.F = s5.mb, null == c7.F && 0 == c7.F.length)) {
                    u6 = Jt2(s5, 3, "Could not decode alpha data.");
                    break t;
                  }
                  L4 < c7.j && (y6 = c7.j - L4, L4 = c7.j, e2(!(1 & y6)), c7.O += s5.R * y6, c7.N += s5.B * (y6 >> 1), c7.W += s5.B * (y6 >> 1), null != c7.F && (c7.J += c7.width * y6)), L4 < P3 && (c7.O += c7.v, c7.N += c7.v >> 1, c7.W += c7.v >> 1, null != c7.F && (c7.J += c7.v), c7.ka = L4 - c7.j, c7.U = c7.va - c7.v, c7.T = P3 - L4, u6 = c7.put(c7));
                }
                o4 + 1 != s5.Ic || b4 || (n3(s5.sa, s5.ta - h6, d5, p6 + 16 * s5.R, h6), n3(s5.qa, s5.ra - f6, g5, l6 + 8 * s5.B, f6), n3(s5.Ha, s5.Ia - f6, m7, v7 + 8 * s5.B, f6));
              }
            if (!u6)
              return Jt2(t6, 6, "Output aborted.");
          }
          return 1;
        }(t5, r3)), null != r3.bc && r3.bc(r3), s4 &= 1;
      }
      return s4 ? (t5.cb = 0, s4) : 0;
    }
    function te2(t5, e3, r3, n4, i4) {
      i4 = t5[e3 + r3 + 32 * n4] + (i4 >> 3), t5[e3 + r3 + 32 * n4] = -256 & i4 ? 0 > i4 ? 0 : 255 : i4;
    }
    function ee2(t5, e3, r3, n4, i4, a4) {
      te2(t5, e3, 0, r3, n4 + i4), te2(t5, e3, 1, r3, n4 + a4), te2(t5, e3, 2, r3, n4 - a4), te2(t5, e3, 3, r3, n4 - i4);
    }
    function re2(t5) {
      return (20091 * t5 >> 16) + t5;
    }
    function ne2(t5, e3, r3, n4) {
      var i4, o4 = 0, s4 = a3(16);
      for (i4 = 0; 4 > i4; ++i4) {
        var c6 = t5[e3 + 0] + t5[e3 + 8], u5 = t5[e3 + 0] - t5[e3 + 8], h5 = (35468 * t5[e3 + 4] >> 16) - re2(t5[e3 + 12]), l5 = re2(t5[e3 + 4]) + (35468 * t5[e3 + 12] >> 16);
        s4[o4 + 0] = c6 + l5, s4[o4 + 1] = u5 + h5, s4[o4 + 2] = u5 - h5, s4[o4 + 3] = c6 - l5, o4 += 4, e3++;
      }
      for (i4 = o4 = 0; 4 > i4; ++i4)
        c6 = (t5 = s4[o4 + 0] + 4) + s4[o4 + 8], u5 = t5 - s4[o4 + 8], h5 = (35468 * s4[o4 + 4] >> 16) - re2(s4[o4 + 12]), te2(r3, n4, 0, 0, c6 + (l5 = re2(s4[o4 + 4]) + (35468 * s4[o4 + 12] >> 16))), te2(r3, n4, 1, 0, u5 + h5), te2(r3, n4, 2, 0, u5 - h5), te2(r3, n4, 3, 0, c6 - l5), o4++, n4 += 32;
    }
    function ie2(t5, e3, r3, n4) {
      var i4 = t5[e3 + 0] + 4, a4 = 35468 * t5[e3 + 4] >> 16, o4 = re2(t5[e3 + 4]), s4 = 35468 * t5[e3 + 1] >> 16;
      ee2(r3, n4, 0, i4 + o4, t5 = re2(t5[e3 + 1]), s4), ee2(r3, n4, 1, i4 + a4, t5, s4), ee2(r3, n4, 2, i4 - a4, t5, s4), ee2(r3, n4, 3, i4 - o4, t5, s4);
    }
    function ae2(t5, e3, r3, n4, i4) {
      ne2(t5, e3, r3, n4), i4 && ne2(t5, e3 + 16, r3, n4 + 4);
    }
    function oe2(t5, e3, r3, n4) {
      on2(t5, e3 + 0, r3, n4, 1), on2(t5, e3 + 32, r3, n4 + 128, 1);
    }
    function se2(t5, e3, r3, n4) {
      var i4;
      for (t5 = t5[e3 + 0] + 4, i4 = 0; 4 > i4; ++i4)
        for (e3 = 0; 4 > e3; ++e3)
          te2(r3, n4, e3, i4, t5);
    }
    function ce2(t5, e3, r3, n4) {
      t5[e3 + 0] && un(t5, e3 + 0, r3, n4), t5[e3 + 16] && un(t5, e3 + 16, r3, n4 + 4), t5[e3 + 32] && un(t5, e3 + 32, r3, n4 + 128), t5[e3 + 48] && un(t5, e3 + 48, r3, n4 + 128 + 4);
    }
    function ue2(t5, e3, r3, n4) {
      var i4, o4 = a3(16);
      for (i4 = 0; 4 > i4; ++i4) {
        var s4 = t5[e3 + 0 + i4] + t5[e3 + 12 + i4], c6 = t5[e3 + 4 + i4] + t5[e3 + 8 + i4], u5 = t5[e3 + 4 + i4] - t5[e3 + 8 + i4], h5 = t5[e3 + 0 + i4] - t5[e3 + 12 + i4];
        o4[0 + i4] = s4 + c6, o4[8 + i4] = s4 - c6, o4[4 + i4] = h5 + u5, o4[12 + i4] = h5 - u5;
      }
      for (i4 = 0; 4 > i4; ++i4)
        s4 = (t5 = o4[0 + 4 * i4] + 3) + o4[3 + 4 * i4], c6 = o4[1 + 4 * i4] + o4[2 + 4 * i4], u5 = o4[1 + 4 * i4] - o4[2 + 4 * i4], h5 = t5 - o4[3 + 4 * i4], r3[n4 + 0] = s4 + c6 >> 3, r3[n4 + 16] = h5 + u5 >> 3, r3[n4 + 32] = s4 - c6 >> 3, r3[n4 + 48] = h5 - u5 >> 3, n4 += 64;
    }
    function he2(t5, e3, r3) {
      var n4, i4 = e3 - 32, a4 = Bn, o4 = 255 - t5[i4 - 1];
      for (n4 = 0; n4 < r3; ++n4) {
        var s4, c6 = a4, u5 = o4 + t5[e3 - 1];
        for (s4 = 0; s4 < r3; ++s4)
          t5[e3 + s4] = c6[u5 + t5[i4 + s4]];
        e3 += 32;
      }
    }
    function le2(t5, e3) {
      he2(t5, e3, 4);
    }
    function fe2(t5, e3) {
      he2(t5, e3, 8);
    }
    function de2(t5, e3) {
      he2(t5, e3, 16);
    }
    function pe2(t5, e3) {
      var r3;
      for (r3 = 0; 16 > r3; ++r3)
        n3(t5, e3 + 32 * r3, t5, e3 - 32, 16);
    }
    function ge2(t5, e3) {
      var r3;
      for (r3 = 16; 0 < r3; --r3)
        i3(t5, e3, t5[e3 - 1], 16), e3 += 32;
    }
    function me2(t5, e3, r3) {
      var n4;
      for (n4 = 0; 16 > n4; ++n4)
        i3(e3, r3 + 32 * n4, t5, 16);
    }
    function ve2(t5, e3) {
      var r3, n4 = 16;
      for (r3 = 0; 16 > r3; ++r3)
        n4 += t5[e3 - 1 + 32 * r3] + t5[e3 + r3 - 32];
      me2(n4 >> 5, t5, e3);
    }
    function be2(t5, e3) {
      var r3, n4 = 8;
      for (r3 = 0; 16 > r3; ++r3)
        n4 += t5[e3 - 1 + 32 * r3];
      me2(n4 >> 4, t5, e3);
    }
    function ye2(t5, e3) {
      var r3, n4 = 8;
      for (r3 = 0; 16 > r3; ++r3)
        n4 += t5[e3 + r3 - 32];
      me2(n4 >> 4, t5, e3);
    }
    function we2(t5, e3) {
      me2(128, t5, e3);
    }
    function Ne2(t5, e3, r3) {
      return t5 + 2 * e3 + r3 + 2 >> 2;
    }
    function Le2(t5, e3) {
      var r3, i4 = e3 - 32;
      i4 = new Uint8Array([Ne2(t5[i4 - 1], t5[i4 + 0], t5[i4 + 1]), Ne2(t5[i4 + 0], t5[i4 + 1], t5[i4 + 2]), Ne2(t5[i4 + 1], t5[i4 + 2], t5[i4 + 3]), Ne2(t5[i4 + 2], t5[i4 + 3], t5[i4 + 4])]);
      for (r3 = 0; 4 > r3; ++r3)
        n3(t5, e3 + 32 * r3, i4, 0, i4.length);
    }
    function Ae(t5, e3) {
      var r3 = t5[e3 - 1], n4 = t5[e3 - 1 + 32], i4 = t5[e3 - 1 + 64], a4 = t5[e3 - 1 + 96];
      I2(t5, e3 + 0, 16843009 * Ne2(t5[e3 - 1 - 32], r3, n4)), I2(t5, e3 + 32, 16843009 * Ne2(r3, n4, i4)), I2(t5, e3 + 64, 16843009 * Ne2(n4, i4, a4)), I2(t5, e3 + 96, 16843009 * Ne2(i4, a4, a4));
    }
    function xe(t5, e3) {
      var r3, n4 = 4;
      for (r3 = 0; 4 > r3; ++r3)
        n4 += t5[e3 + r3 - 32] + t5[e3 - 1 + 32 * r3];
      for (n4 >>= 3, r3 = 0; 4 > r3; ++r3)
        i3(t5, e3 + 32 * r3, n4, 4);
    }
    function Se(t5, e3) {
      var r3 = t5[e3 - 1 + 0], n4 = t5[e3 - 1 + 32], i4 = t5[e3 - 1 + 64], a4 = t5[e3 - 1 - 32], o4 = t5[e3 + 0 - 32], s4 = t5[e3 + 1 - 32], c6 = t5[e3 + 2 - 32], u5 = t5[e3 + 3 - 32];
      t5[e3 + 0 + 96] = Ne2(n4, i4, t5[e3 - 1 + 96]), t5[e3 + 1 + 96] = t5[e3 + 0 + 64] = Ne2(r3, n4, i4), t5[e3 + 2 + 96] = t5[e3 + 1 + 64] = t5[e3 + 0 + 32] = Ne2(a4, r3, n4), t5[e3 + 3 + 96] = t5[e3 + 2 + 64] = t5[e3 + 1 + 32] = t5[e3 + 0 + 0] = Ne2(o4, a4, r3), t5[e3 + 3 + 64] = t5[e3 + 2 + 32] = t5[e3 + 1 + 0] = Ne2(s4, o4, a4), t5[e3 + 3 + 32] = t5[e3 + 2 + 0] = Ne2(c6, s4, o4), t5[e3 + 3 + 0] = Ne2(u5, c6, s4);
    }
    function _e(t5, e3) {
      var r3 = t5[e3 + 1 - 32], n4 = t5[e3 + 2 - 32], i4 = t5[e3 + 3 - 32], a4 = t5[e3 + 4 - 32], o4 = t5[e3 + 5 - 32], s4 = t5[e3 + 6 - 32], c6 = t5[e3 + 7 - 32];
      t5[e3 + 0 + 0] = Ne2(t5[e3 + 0 - 32], r3, n4), t5[e3 + 1 + 0] = t5[e3 + 0 + 32] = Ne2(r3, n4, i4), t5[e3 + 2 + 0] = t5[e3 + 1 + 32] = t5[e3 + 0 + 64] = Ne2(n4, i4, a4), t5[e3 + 3 + 0] = t5[e3 + 2 + 32] = t5[e3 + 1 + 64] = t5[e3 + 0 + 96] = Ne2(i4, a4, o4), t5[e3 + 3 + 32] = t5[e3 + 2 + 64] = t5[e3 + 1 + 96] = Ne2(a4, o4, s4), t5[e3 + 3 + 64] = t5[e3 + 2 + 96] = Ne2(o4, s4, c6), t5[e3 + 3 + 96] = Ne2(s4, c6, c6);
    }
    function Pe(t5, e3) {
      var r3 = t5[e3 - 1 + 0], n4 = t5[e3 - 1 + 32], i4 = t5[e3 - 1 + 64], a4 = t5[e3 - 1 - 32], o4 = t5[e3 + 0 - 32], s4 = t5[e3 + 1 - 32], c6 = t5[e3 + 2 - 32], u5 = t5[e3 + 3 - 32];
      t5[e3 + 0 + 0] = t5[e3 + 1 + 64] = a4 + o4 + 1 >> 1, t5[e3 + 1 + 0] = t5[e3 + 2 + 64] = o4 + s4 + 1 >> 1, t5[e3 + 2 + 0] = t5[e3 + 3 + 64] = s4 + c6 + 1 >> 1, t5[e3 + 3 + 0] = c6 + u5 + 1 >> 1, t5[e3 + 0 + 96] = Ne2(i4, n4, r3), t5[e3 + 0 + 64] = Ne2(n4, r3, a4), t5[e3 + 0 + 32] = t5[e3 + 1 + 96] = Ne2(r3, a4, o4), t5[e3 + 1 + 32] = t5[e3 + 2 + 96] = Ne2(a4, o4, s4), t5[e3 + 2 + 32] = t5[e3 + 3 + 96] = Ne2(o4, s4, c6), t5[e3 + 3 + 32] = Ne2(s4, c6, u5);
    }
    function ke(t5, e3) {
      var r3 = t5[e3 + 0 - 32], n4 = t5[e3 + 1 - 32], i4 = t5[e3 + 2 - 32], a4 = t5[e3 + 3 - 32], o4 = t5[e3 + 4 - 32], s4 = t5[e3 + 5 - 32], c6 = t5[e3 + 6 - 32], u5 = t5[e3 + 7 - 32];
      t5[e3 + 0 + 0] = r3 + n4 + 1 >> 1, t5[e3 + 1 + 0] = t5[e3 + 0 + 64] = n4 + i4 + 1 >> 1, t5[e3 + 2 + 0] = t5[e3 + 1 + 64] = i4 + a4 + 1 >> 1, t5[e3 + 3 + 0] = t5[e3 + 2 + 64] = a4 + o4 + 1 >> 1, t5[e3 + 0 + 32] = Ne2(r3, n4, i4), t5[e3 + 1 + 32] = t5[e3 + 0 + 96] = Ne2(n4, i4, a4), t5[e3 + 2 + 32] = t5[e3 + 1 + 96] = Ne2(i4, a4, o4), t5[e3 + 3 + 32] = t5[e3 + 2 + 96] = Ne2(a4, o4, s4), t5[e3 + 3 + 64] = Ne2(o4, s4, c6), t5[e3 + 3 + 96] = Ne2(s4, c6, u5);
    }
    function Ie(t5, e3) {
      var r3 = t5[e3 - 1 + 0], n4 = t5[e3 - 1 + 32], i4 = t5[e3 - 1 + 64], a4 = t5[e3 - 1 + 96];
      t5[e3 + 0 + 0] = r3 + n4 + 1 >> 1, t5[e3 + 2 + 0] = t5[e3 + 0 + 32] = n4 + i4 + 1 >> 1, t5[e3 + 2 + 32] = t5[e3 + 0 + 64] = i4 + a4 + 1 >> 1, t5[e3 + 1 + 0] = Ne2(r3, n4, i4), t5[e3 + 3 + 0] = t5[e3 + 1 + 32] = Ne2(n4, i4, a4), t5[e3 + 3 + 32] = t5[e3 + 1 + 64] = Ne2(i4, a4, a4), t5[e3 + 3 + 64] = t5[e3 + 2 + 64] = t5[e3 + 0 + 96] = t5[e3 + 1 + 96] = t5[e3 + 2 + 96] = t5[e3 + 3 + 96] = a4;
    }
    function Fe(t5, e3) {
      var r3 = t5[e3 - 1 + 0], n4 = t5[e3 - 1 + 32], i4 = t5[e3 - 1 + 64], a4 = t5[e3 - 1 + 96], o4 = t5[e3 - 1 - 32], s4 = t5[e3 + 0 - 32], c6 = t5[e3 + 1 - 32], u5 = t5[e3 + 2 - 32];
      t5[e3 + 0 + 0] = t5[e3 + 2 + 32] = r3 + o4 + 1 >> 1, t5[e3 + 0 + 32] = t5[e3 + 2 + 64] = n4 + r3 + 1 >> 1, t5[e3 + 0 + 64] = t5[e3 + 2 + 96] = i4 + n4 + 1 >> 1, t5[e3 + 0 + 96] = a4 + i4 + 1 >> 1, t5[e3 + 3 + 0] = Ne2(s4, c6, u5), t5[e3 + 2 + 0] = Ne2(o4, s4, c6), t5[e3 + 1 + 0] = t5[e3 + 3 + 32] = Ne2(r3, o4, s4), t5[e3 + 1 + 32] = t5[e3 + 3 + 64] = Ne2(n4, r3, o4), t5[e3 + 1 + 64] = t5[e3 + 3 + 96] = Ne2(i4, n4, r3), t5[e3 + 1 + 96] = Ne2(a4, i4, n4);
    }
    function Ce(t5, e3) {
      var r3;
      for (r3 = 0; 8 > r3; ++r3)
        n3(t5, e3 + 32 * r3, t5, e3 - 32, 8);
    }
    function je(t5, e3) {
      var r3;
      for (r3 = 0; 8 > r3; ++r3)
        i3(t5, e3, t5[e3 - 1], 8), e3 += 32;
    }
    function Oe(t5, e3, r3) {
      var n4;
      for (n4 = 0; 8 > n4; ++n4)
        i3(e3, r3 + 32 * n4, t5, 8);
    }
    function Be(t5, e3) {
      var r3, n4 = 8;
      for (r3 = 0; 8 > r3; ++r3)
        n4 += t5[e3 + r3 - 32] + t5[e3 - 1 + 32 * r3];
      Oe(n4 >> 4, t5, e3);
    }
    function Me(t5, e3) {
      var r3, n4 = 4;
      for (r3 = 0; 8 > r3; ++r3)
        n4 += t5[e3 + r3 - 32];
      Oe(n4 >> 3, t5, e3);
    }
    function Ee(t5, e3) {
      var r3, n4 = 4;
      for (r3 = 0; 8 > r3; ++r3)
        n4 += t5[e3 - 1 + 32 * r3];
      Oe(n4 >> 3, t5, e3);
    }
    function qe(t5, e3) {
      Oe(128, t5, e3);
    }
    function De(t5, e3, r3) {
      var n4 = t5[e3 - r3], i4 = t5[e3 + 0], a4 = 3 * (i4 - n4) + jn[1020 + t5[e3 - 2 * r3] - t5[e3 + r3]], o4 = On[112 + (a4 + 4 >> 3)];
      t5[e3 - r3] = Bn[255 + n4 + On[112 + (a4 + 3 >> 3)]], t5[e3 + 0] = Bn[255 + i4 - o4];
    }
    function Re(t5, e3, r3, n4) {
      var i4 = t5[e3 + 0], a4 = t5[e3 + r3];
      return Mn[255 + t5[e3 - 2 * r3] - t5[e3 - r3]] > n4 || Mn[255 + a4 - i4] > n4;
    }
    function Te(t5, e3, r3, n4) {
      return 4 * Mn[255 + t5[e3 - r3] - t5[e3 + 0]] + Mn[255 + t5[e3 - 2 * r3] - t5[e3 + r3]] <= n4;
    }
    function Ue(t5, e3, r3, n4, i4) {
      var a4 = t5[e3 - 3 * r3], o4 = t5[e3 - 2 * r3], s4 = t5[e3 - r3], c6 = t5[e3 + 0], u5 = t5[e3 + r3], h5 = t5[e3 + 2 * r3], l5 = t5[e3 + 3 * r3];
      return 4 * Mn[255 + s4 - c6] + Mn[255 + o4 - u5] > n4 ? 0 : Mn[255 + t5[e3 - 4 * r3] - a4] <= i4 && Mn[255 + a4 - o4] <= i4 && Mn[255 + o4 - s4] <= i4 && Mn[255 + l5 - h5] <= i4 && Mn[255 + h5 - u5] <= i4 && Mn[255 + u5 - c6] <= i4;
    }
    function ze(t5, e3, r3, n4) {
      var i4 = 2 * n4 + 1;
      for (n4 = 0; 16 > n4; ++n4)
        Te(t5, e3 + n4, r3, i4) && De(t5, e3 + n4, r3);
    }
    function He(t5, e3, r3, n4) {
      var i4 = 2 * n4 + 1;
      for (n4 = 0; 16 > n4; ++n4)
        Te(t5, e3 + n4 * r3, 1, i4) && De(t5, e3 + n4 * r3, 1);
    }
    function We(t5, e3, r3, n4) {
      var i4;
      for (i4 = 3; 0 < i4; --i4)
        ze(t5, e3 += 4 * r3, r3, n4);
    }
    function Ve(t5, e3, r3, n4) {
      var i4;
      for (i4 = 3; 0 < i4; --i4)
        He(t5, e3 += 4, r3, n4);
    }
    function Ge(t5, e3, r3, n4, i4, a4, o4, s4) {
      for (a4 = 2 * a4 + 1; 0 < i4--; ) {
        if (Ue(t5, e3, r3, a4, o4))
          if (Re(t5, e3, r3, s4))
            De(t5, e3, r3);
          else {
            var c6 = t5, u5 = e3, h5 = r3, l5 = c6[u5 - 2 * h5], f5 = c6[u5 - h5], d4 = c6[u5 + 0], p5 = c6[u5 + h5], g4 = c6[u5 + 2 * h5], m6 = 27 * (b4 = jn[1020 + 3 * (d4 - f5) + jn[1020 + l5 - p5]]) + 63 >> 7, v6 = 18 * b4 + 63 >> 7, b4 = 9 * b4 + 63 >> 7;
            c6[u5 - 3 * h5] = Bn[255 + c6[u5 - 3 * h5] + b4], c6[u5 - 2 * h5] = Bn[255 + l5 + v6], c6[u5 - h5] = Bn[255 + f5 + m6], c6[u5 + 0] = Bn[255 + d4 - m6], c6[u5 + h5] = Bn[255 + p5 - v6], c6[u5 + 2 * h5] = Bn[255 + g4 - b4];
          }
        e3 += n4;
      }
    }
    function Ye(t5, e3, r3, n4, i4, a4, o4, s4) {
      for (a4 = 2 * a4 + 1; 0 < i4--; ) {
        if (Ue(t5, e3, r3, a4, o4))
          if (Re(t5, e3, r3, s4))
            De(t5, e3, r3);
          else {
            var c6 = t5, u5 = e3, h5 = r3, l5 = c6[u5 - h5], f5 = c6[u5 + 0], d4 = c6[u5 + h5], p5 = On[112 + ((g4 = 3 * (f5 - l5)) + 4 >> 3)], g4 = On[112 + (g4 + 3 >> 3)], m6 = p5 + 1 >> 1;
            c6[u5 - 2 * h5] = Bn[255 + c6[u5 - 2 * h5] + m6], c6[u5 - h5] = Bn[255 + l5 + g4], c6[u5 + 0] = Bn[255 + f5 - p5], c6[u5 + h5] = Bn[255 + d4 - m6];
          }
        e3 += n4;
      }
    }
    function Je(t5, e3, r3, n4, i4, a4) {
      Ge(t5, e3, r3, 1, 16, n4, i4, a4);
    }
    function Xe(t5, e3, r3, n4, i4, a4) {
      Ge(t5, e3, 1, r3, 16, n4, i4, a4);
    }
    function Ke(t5, e3, r3, n4, i4, a4) {
      var o4;
      for (o4 = 3; 0 < o4; --o4)
        Ye(t5, e3 += 4 * r3, r3, 1, 16, n4, i4, a4);
    }
    function Ze(t5, e3, r3, n4, i4, a4) {
      var o4;
      for (o4 = 3; 0 < o4; --o4)
        Ye(t5, e3 += 4, 1, r3, 16, n4, i4, a4);
    }
    function $e(t5, e3, r3, n4, i4, a4, o4, s4) {
      Ge(t5, e3, i4, 1, 8, a4, o4, s4), Ge(r3, n4, i4, 1, 8, a4, o4, s4);
    }
    function Qe(t5, e3, r3, n4, i4, a4, o4, s4) {
      Ge(t5, e3, 1, i4, 8, a4, o4, s4), Ge(r3, n4, 1, i4, 8, a4, o4, s4);
    }
    function tr(t5, e3, r3, n4, i4, a4, o4, s4) {
      Ye(t5, e3 + 4 * i4, i4, 1, 8, a4, o4, s4), Ye(r3, n4 + 4 * i4, i4, 1, 8, a4, o4, s4);
    }
    function er(t5, e3, r3, n4, i4, a4, o4, s4) {
      Ye(t5, e3 + 4, 1, i4, 8, a4, o4, s4), Ye(r3, n4 + 4, 1, i4, 8, a4, o4, s4);
    }
    function rr() {
      this.ba = new ot2(), this.ec = [], this.cc = [], this.Mc = [], this.Dc = this.Nc = this.dc = this.fc = 0, this.Oa = new ct2(), this.memory = 0, this.Ib = "OutputFunc", this.Jb = "OutputAlphaFunc", this.Nd = "OutputRowFunc";
    }
    function nr() {
      this.data = [], this.offset = this.kd = this.ha = this.w = 0, this.na = [], this.xa = this.gb = this.Ja = this.Sa = this.P = 0;
    }
    function ir() {
      this.nc = this.Ea = this.b = this.hc = 0, this.K = [], this.w = 0;
    }
    function ar() {
      this.ua = 0, this.Wa = new M2(), this.vb = new M2(), this.md = this.xc = this.wc = 0, this.vc = [], this.Wb = 0, this.Ya = new d3(), this.yc = new l4();
    }
    function or() {
      this.xb = this.a = 0, this.l = new Gt2(), this.ca = new ot2(), this.V = [], this.Ba = 0, this.Ta = [], this.Ua = 0, this.m = new N4(), this.Pb = 0, this.wd = new N4(), this.Ma = this.$ = this.C = this.i = this.c = this.xd = 0, this.s = new ar(), this.ab = 0, this.gc = o3(4, ir), this.Oc = 0;
    }
    function sr() {
      this.Lc = this.Z = this.$a = this.i = this.c = 0, this.l = new Gt2(), this.ic = 0, this.ca = [], this.tb = 0, this.qd = null, this.rd = 0;
    }
    function cr(t5, e3, r3, n4, i4, a4, o4) {
      for (t5 = null == t5 ? 0 : t5[e3 + 0], e3 = 0; e3 < o4; ++e3)
        i4[a4 + e3] = t5 + r3[n4 + e3] & 255, t5 = i4[a4 + e3];
    }
    function ur(t5, e3, r3, n4, i4, a4, o4) {
      var s4;
      if (null == t5)
        cr(null, null, r3, n4, i4, a4, o4);
      else
        for (s4 = 0; s4 < o4; ++s4)
          i4[a4 + s4] = t5[e3 + s4] + r3[n4 + s4] & 255;
    }
    function hr(t5, e3, r3, n4, i4, a4, o4) {
      if (null == t5)
        cr(null, null, r3, n4, i4, a4, o4);
      else {
        var s4, c6 = t5[e3 + 0], u5 = c6, h5 = c6;
        for (s4 = 0; s4 < o4; ++s4)
          u5 = h5 + (c6 = t5[e3 + s4]) - u5, h5 = r3[n4 + s4] + (-256 & u5 ? 0 > u5 ? 0 : 255 : u5) & 255, u5 = c6, i4[a4 + s4] = h5;
      }
    }
    function lr(t5, r3, i4, o4) {
      var s4 = r3.width, c6 = r3.o;
      if (e2(null != t5 && null != r3), 0 > i4 || 0 >= o4 || i4 + o4 > c6)
        return null;
      if (!t5.Cc) {
        if (null == t5.ga) {
          var u5;
          if (t5.ga = new sr(), (u5 = null == t5.ga) || (u5 = r3.width * r3.o, e2(0 == t5.Gb.length), t5.Gb = a3(u5), t5.Uc = 0, null == t5.Gb ? u5 = 0 : (t5.mb = t5.Gb, t5.nb = t5.Uc, t5.rc = null, u5 = 1), u5 = !u5), !u5) {
            u5 = t5.ga;
            var h5 = t5.Fa, l5 = t5.P, f5 = t5.qc, d4 = t5.mb, p5 = t5.nb, g4 = l5 + 1, m6 = f5 - 1, b4 = u5.l;
            if (e2(null != h5 && null != d4 && null != r3), mi[0] = null, mi[1] = cr, mi[2] = ur, mi[3] = hr, u5.ca = d4, u5.tb = p5, u5.c = r3.width, u5.i = r3.height, e2(0 < u5.c && 0 < u5.i), 1 >= f5)
              r3 = 0;
            else if (u5.$a = h5[l5 + 0] >> 0 & 3, u5.Z = h5[l5 + 0] >> 2 & 3, u5.Lc = h5[l5 + 0] >> 4 & 3, l5 = h5[l5 + 0] >> 6 & 3, 0 > u5.$a || 1 < u5.$a || 4 <= u5.Z || 1 < u5.Lc || l5)
              r3 = 0;
            else if (b4.put = dt2, b4.ac = ft2, b4.bc = pt2, b4.ma = u5, b4.width = r3.width, b4.height = r3.height, b4.Da = r3.Da, b4.v = r3.v, b4.va = r3.va, b4.j = r3.j, b4.o = r3.o, u5.$a)
              t: {
                e2(1 == u5.$a), r3 = kt2();
                e:
                  for (; ; ) {
                    if (null == r3) {
                      r3 = 0;
                      break t;
                    }
                    if (e2(null != u5), u5.mc = r3, r3.c = u5.c, r3.i = u5.i, r3.l = u5.l, r3.l.ma = u5, r3.l.width = u5.c, r3.l.height = u5.i, r3.a = 0, v5(r3.m, h5, g4, m6), !It2(u5.c, u5.i, 1, r3, null))
                      break e;
                    if (1 == r3.ab && 3 == r3.gc[0].hc && At2(r3.s) ? (u5.ic = 1, h5 = r3.c * r3.i, r3.Ta = null, r3.Ua = 0, r3.V = a3(h5), r3.Ba = 0, null == r3.V ? (r3.a = 1, r3 = 0) : r3 = 1) : (u5.ic = 0, r3 = Ft2(r3, u5.c)), !r3)
                      break e;
                    r3 = 1;
                    break t;
                  }
                u5.mc = null, r3 = 0;
              }
            else
              r3 = m6 >= u5.c * u5.i;
            u5 = !r3;
          }
          if (u5)
            return null;
          1 != t5.ga.Lc ? t5.Ga = 0 : o4 = c6 - i4;
        }
        e2(null != t5.ga), e2(i4 + o4 <= c6);
        t: {
          if (r3 = (h5 = t5.ga).c, c6 = h5.l.o, 0 == h5.$a) {
            if (g4 = t5.rc, m6 = t5.Vc, b4 = t5.Fa, l5 = t5.P + 1 + i4 * r3, f5 = t5.mb, d4 = t5.nb + i4 * r3, e2(l5 <= t5.P + t5.qc), 0 != h5.Z)
              for (e2(null != mi[h5.Z]), u5 = 0; u5 < o4; ++u5)
                mi[h5.Z](g4, m6, b4, l5, f5, d4, r3), g4 = f5, m6 = d4, d4 += r3, l5 += r3;
            else
              for (u5 = 0; u5 < o4; ++u5)
                n3(f5, d4, b4, l5, r3), g4 = f5, m6 = d4, d4 += r3, l5 += r3;
            t5.rc = g4, t5.Vc = m6;
          } else {
            if (e2(null != h5.mc), r3 = i4 + o4, e2(null != (u5 = h5.mc)), e2(r3 <= u5.i), u5.C >= r3)
              r3 = 1;
            else if (h5.ic || mr(), h5.ic) {
              h5 = u5.V, g4 = u5.Ba, m6 = u5.c;
              var y6 = u5.i, w4 = (b4 = 1, l5 = u5.$ / m6, f5 = u5.$ % m6, d4 = u5.m, p5 = u5.s, u5.$), N5 = m6 * y6, L4 = m6 * r3, x4 = p5.wc, _4 = w4 < L4 ? wt2(p5, f5, l5) : null;
              e2(w4 <= N5), e2(r3 <= y6), e2(At2(p5));
              e:
                for (; ; ) {
                  for (; !d4.h && w4 < L4; ) {
                    if (f5 & x4 || (_4 = wt2(p5, f5, l5)), e2(null != _4), S2(d4), 256 > (y6 = bt2(_4.G[0], _4.H[0], d4)))
                      h5[g4 + w4] = y6, ++w4, ++f5 >= m6 && (f5 = 0, ++l5 <= r3 && !(l5 % 16) && St2(u5, l5));
                    else {
                      if (!(280 > y6)) {
                        b4 = 0;
                        break e;
                      }
                      y6 = mt2(y6 - 256, d4);
                      var P3, k3 = bt2(_4.G[4], _4.H[4], d4);
                      if (S2(d4), !(w4 >= (k3 = vt2(m6, k3 = mt2(k3, d4))) && N5 - w4 >= y6)) {
                        b4 = 0;
                        break e;
                      }
                      for (P3 = 0; P3 < y6; ++P3)
                        h5[g4 + w4 + P3] = h5[g4 + w4 + P3 - k3];
                      for (w4 += y6, f5 += y6; f5 >= m6; )
                        f5 -= m6, ++l5 <= r3 && !(l5 % 16) && St2(u5, l5);
                      w4 < L4 && f5 & x4 && (_4 = wt2(p5, f5, l5));
                    }
                    e2(d4.h == A4(d4));
                  }
                  St2(u5, l5 > r3 ? r3 : l5);
                  break e;
                }
              !b4 || d4.h && w4 < N5 ? (b4 = 0, u5.a = d4.h ? 5 : 3) : u5.$ = w4, r3 = b4;
            } else
              r3 = _t2(u5, u5.V, u5.Ba, u5.c, u5.i, r3, Ct2);
            if (!r3) {
              o4 = 0;
              break t;
            }
          }
          i4 + o4 >= c6 && (t5.Cc = 1), o4 = 1;
        }
        if (!o4)
          return null;
        if (t5.Cc && (null != (o4 = t5.ga) && (o4.mc = null), t5.ga = null, 0 < t5.Ga))
          return alert("todo:WebPDequantizeLevels"), null;
      }
      return t5.nb + i4 * s4;
    }
    function fr(t5, e3, r3, n4, i4, a4) {
      for (; 0 < i4--; ) {
        var o4, s4 = t5, c6 = e3 + (r3 ? 1 : 0), u5 = t5, h5 = e3 + (r3 ? 0 : 3);
        for (o4 = 0; o4 < n4; ++o4) {
          var l5 = u5[h5 + 4 * o4];
          255 != l5 && (l5 *= 32897, s4[c6 + 4 * o4 + 0] = s4[c6 + 4 * o4 + 0] * l5 >> 23, s4[c6 + 4 * o4 + 1] = s4[c6 + 4 * o4 + 1] * l5 >> 23, s4[c6 + 4 * o4 + 2] = s4[c6 + 4 * o4 + 2] * l5 >> 23);
        }
        e3 += a4;
      }
    }
    function dr(t5, e3, r3, n4, i4) {
      for (; 0 < n4--; ) {
        var a4;
        for (a4 = 0; a4 < r3; ++a4) {
          var o4 = t5[e3 + 2 * a4 + 0], s4 = 15 & (u5 = t5[e3 + 2 * a4 + 1]), c6 = 4369 * s4, u5 = (240 & u5 | u5 >> 4) * c6 >> 16;
          t5[e3 + 2 * a4 + 0] = (240 & o4 | o4 >> 4) * c6 >> 16 & 240 | (15 & o4 | o4 << 4) * c6 >> 16 >> 4 & 15, t5[e3 + 2 * a4 + 1] = 240 & u5 | s4;
        }
        e3 += i4;
      }
    }
    function pr(t5, e3, r3, n4, i4, a4, o4, s4) {
      var c6, u5, h5 = 255;
      for (u5 = 0; u5 < i4; ++u5) {
        for (c6 = 0; c6 < n4; ++c6) {
          var l5 = t5[e3 + c6];
          a4[o4 + 4 * c6] = l5, h5 &= l5;
        }
        e3 += r3, o4 += s4;
      }
      return 255 != h5;
    }
    function gr(t5, e3, r3, n4, i4) {
      var a4;
      for (a4 = 0; a4 < i4; ++a4)
        r3[n4 + a4] = t5[e3 + a4] >> 8;
    }
    function mr() {
      An = fr, xn = dr, Sn = pr, _n = gr;
    }
    function vr(r3, n4, i4) {
      t4[r3] = function(t5, r4, a4, o4, s4, c6, u5, h5, l5, f5, d4, p5, g4, m6, v6, b4, y6) {
        var w4, N5 = y6 - 1 >> 1, L4 = s4[c6 + 0] | u5[h5 + 0] << 16, A5 = l5[f5 + 0] | d4[p5 + 0] << 16;
        e2(null != t5);
        var x4 = 3 * L4 + A5 + 131074 >> 2;
        for (n4(t5[r4 + 0], 255 & x4, x4 >> 16, g4, m6), null != a4 && (x4 = 3 * A5 + L4 + 131074 >> 2, n4(a4[o4 + 0], 255 & x4, x4 >> 16, v6, b4)), w4 = 1; w4 <= N5; ++w4) {
          var S3 = s4[c6 + w4] | u5[h5 + w4] << 16, _4 = l5[f5 + w4] | d4[p5 + w4] << 16, P3 = L4 + S3 + A5 + _4 + 524296, k3 = P3 + 2 * (S3 + A5) >> 3;
          x4 = k3 + L4 >> 1, L4 = (P3 = P3 + 2 * (L4 + _4) >> 3) + S3 >> 1, n4(t5[r4 + 2 * w4 - 1], 255 & x4, x4 >> 16, g4, m6 + (2 * w4 - 1) * i4), n4(t5[r4 + 2 * w4 - 0], 255 & L4, L4 >> 16, g4, m6 + (2 * w4 - 0) * i4), null != a4 && (x4 = P3 + A5 >> 1, L4 = k3 + _4 >> 1, n4(a4[o4 + 2 * w4 - 1], 255 & x4, x4 >> 16, v6, b4 + (2 * w4 - 1) * i4), n4(a4[o4 + 2 * w4 + 0], 255 & L4, L4 >> 16, v6, b4 + (2 * w4 + 0) * i4)), L4 = S3, A5 = _4;
        }
        1 & y6 || (x4 = 3 * L4 + A5 + 131074 >> 2, n4(t5[r4 + y6 - 1], 255 & x4, x4 >> 16, g4, m6 + (y6 - 1) * i4), null != a4 && (x4 = 3 * A5 + L4 + 131074 >> 2, n4(a4[o4 + y6 - 1], 255 & x4, x4 >> 16, v6, b4 + (y6 - 1) * i4)));
      };
    }
    function br() {
      vi[En] = bi, vi[qn] = wi, vi[Dn] = yi, vi[Rn] = Ni, vi[Tn] = Li, vi[Un] = Ai, vi[zn] = xi, vi[Hn] = wi, vi[Wn] = Ni, vi[Vn] = Li, vi[Gn] = Ai;
    }
    function yr(t5) {
      return t5 & ~Fi ? 0 > t5 ? 0 : 255 : t5 >> Ii;
    }
    function wr(t5, e3) {
      return yr((19077 * t5 >> 8) + (26149 * e3 >> 8) - 14234);
    }
    function Nr(t5, e3, r3) {
      return yr((19077 * t5 >> 8) - (6419 * e3 >> 8) - (13320 * r3 >> 8) + 8708);
    }
    function Lr(t5, e3) {
      return yr((19077 * t5 >> 8) + (33050 * e3 >> 8) - 17685);
    }
    function Ar(t5, e3, r3, n4, i4) {
      n4[i4 + 0] = wr(t5, r3), n4[i4 + 1] = Nr(t5, e3, r3), n4[i4 + 2] = Lr(t5, e3);
    }
    function xr(t5, e3, r3, n4, i4) {
      n4[i4 + 0] = Lr(t5, e3), n4[i4 + 1] = Nr(t5, e3, r3), n4[i4 + 2] = wr(t5, r3);
    }
    function Sr(t5, e3, r3, n4, i4) {
      var a4 = Nr(t5, e3, r3);
      e3 = a4 << 3 & 224 | Lr(t5, e3) >> 3, n4[i4 + 0] = 248 & wr(t5, r3) | a4 >> 5, n4[i4 + 1] = e3;
    }
    function _r(t5, e3, r3, n4, i4) {
      var a4 = 240 & Lr(t5, e3) | 15;
      n4[i4 + 0] = 240 & wr(t5, r3) | Nr(t5, e3, r3) >> 4, n4[i4 + 1] = a4;
    }
    function Pr(t5, e3, r3, n4, i4) {
      n4[i4 + 0] = 255, Ar(t5, e3, r3, n4, i4 + 1);
    }
    function kr(t5, e3, r3, n4, i4) {
      xr(t5, e3, r3, n4, i4), n4[i4 + 3] = 255;
    }
    function Ir(t5, e3, r3, n4, i4) {
      Ar(t5, e3, r3, n4, i4), n4[i4 + 3] = 255;
    }
    function Vt2(t5, e3) {
      return 0 > t5 ? 0 : t5 > e3 ? e3 : t5;
    }
    function Fr(e3, r3, n4) {
      t4[e3] = function(t5, e4, i4, a4, o4, s4, c6, u5, h5) {
        for (var l5 = u5 + (-2 & h5) * n4; u5 != l5; )
          r3(t5[e4 + 0], i4[a4 + 0], o4[s4 + 0], c6, u5), r3(t5[e4 + 1], i4[a4 + 0], o4[s4 + 0], c6, u5 + n4), e4 += 2, ++a4, ++s4, u5 += 2 * n4;
        1 & h5 && r3(t5[e4 + 0], i4[a4 + 0], o4[s4 + 0], c6, u5);
      };
    }
    function Cr(t5, e3, r3) {
      return 0 == r3 ? 0 == t5 ? 0 == e3 ? 6 : 5 : 0 == e3 ? 4 : 0 : r3;
    }
    function jr(t5, e3, r3, n4, i4) {
      switch (t5 >>> 30) {
        case 3:
          on2(e3, r3, n4, i4, 0);
          break;
        case 2:
          sn(e3, r3, n4, i4);
          break;
        case 1:
          un(e3, r3, n4, i4);
      }
    }
    function Or(t5, e3) {
      var r3, a4, o4 = e3.M, s4 = e3.Nb, c6 = t5.oc, u5 = t5.pc + 40, h5 = t5.oc, l5 = t5.pc + 584, f5 = t5.oc, d4 = t5.pc + 600;
      for (r3 = 0; 16 > r3; ++r3)
        c6[u5 + 32 * r3 - 1] = 129;
      for (r3 = 0; 8 > r3; ++r3)
        h5[l5 + 32 * r3 - 1] = 129, f5[d4 + 32 * r3 - 1] = 129;
      for (0 < o4 ? c6[u5 - 1 - 32] = h5[l5 - 1 - 32] = f5[d4 - 1 - 32] = 129 : (i3(c6, u5 - 32 - 1, 127, 21), i3(h5, l5 - 32 - 1, 127, 9), i3(f5, d4 - 32 - 1, 127, 9)), a4 = 0; a4 < t5.za; ++a4) {
        var p5 = e3.ya[e3.aa + a4];
        if (0 < a4) {
          for (r3 = -1; 16 > r3; ++r3)
            n3(c6, u5 + 32 * r3 - 4, c6, u5 + 32 * r3 + 12, 4);
          for (r3 = -1; 8 > r3; ++r3)
            n3(h5, l5 + 32 * r3 - 4, h5, l5 + 32 * r3 + 4, 4), n3(f5, d4 + 32 * r3 - 4, f5, d4 + 32 * r3 + 4, 4);
        }
        var g4 = t5.Gd, m6 = t5.Hd + a4, v6 = p5.ad, b4 = p5.Hc;
        if (0 < o4 && (n3(c6, u5 - 32, g4[m6].y, 0, 16), n3(h5, l5 - 32, g4[m6].f, 0, 8), n3(f5, d4 - 32, g4[m6].ea, 0, 8)), p5.Za) {
          var y6 = c6, w4 = u5 - 32 + 16;
          for (0 < o4 && (a4 >= t5.za - 1 ? i3(y6, w4, g4[m6].y[15], 4) : n3(y6, w4, g4[m6 + 1].y, 0, 4)), r3 = 0; 4 > r3; r3++)
            y6[w4 + 128 + r3] = y6[w4 + 256 + r3] = y6[w4 + 384 + r3] = y6[w4 + 0 + r3];
          for (r3 = 0; 16 > r3; ++r3, b4 <<= 2)
            y6 = c6, w4 = u5 + Di[r3], fi[p5.Ob[r3]](y6, w4), jr(b4, v6, 16 * +r3, y6, w4);
        } else if (y6 = Cr(a4, o4, p5.Ob[0]), li[y6](c6, u5), 0 != b4)
          for (r3 = 0; 16 > r3; ++r3, b4 <<= 2)
            jr(b4, v6, 16 * +r3, c6, u5 + Di[r3]);
        for (r3 = p5.Gc, y6 = Cr(a4, o4, p5.Dd), di[y6](h5, l5), di[y6](f5, d4), b4 = v6, y6 = h5, w4 = l5, 255 & (p5 = r3 >> 0) && (170 & p5 ? cn(b4, 256, y6, w4) : hn(b4, 256, y6, w4)), p5 = f5, b4 = d4, 255 & (r3 >>= 8) && (170 & r3 ? cn(v6, 320, p5, b4) : hn(v6, 320, p5, b4)), o4 < t5.Ub - 1 && (n3(g4[m6].y, 0, c6, u5 + 480, 16), n3(g4[m6].f, 0, h5, l5 + 224, 8), n3(g4[m6].ea, 0, f5, d4 + 224, 8)), r3 = 8 * s4 * t5.B, g4 = t5.sa, m6 = t5.ta + 16 * a4 + 16 * s4 * t5.R, v6 = t5.qa, p5 = t5.ra + 8 * a4 + r3, b4 = t5.Ha, y6 = t5.Ia + 8 * a4 + r3, r3 = 0; 16 > r3; ++r3)
          n3(g4, m6 + r3 * t5.R, c6, u5 + 32 * r3, 16);
        for (r3 = 0; 8 > r3; ++r3)
          n3(v6, p5 + r3 * t5.B, h5, l5 + 32 * r3, 8), n3(b4, y6 + r3 * t5.B, f5, d4 + 32 * r3, 8);
      }
    }
    function Br(t5, n4, i4, a4, o4, s4, c6, u5, h5) {
      var l5 = [0], f5 = [0], d4 = 0, p5 = null != h5 ? h5.kd : 0, g4 = null != h5 ? h5 : new nr();
      if (null == t5 || 12 > i4)
        return 7;
      g4.data = t5, g4.w = n4, g4.ha = i4, n4 = [n4], i4 = [i4], g4.gb = [g4.gb];
      t: {
        var m6 = n4, b4 = i4, y6 = g4.gb;
        if (e2(null != t5), e2(null != b4), e2(null != y6), y6[0] = 0, 12 <= b4[0] && !r2(t5, m6[0], "RIFF")) {
          if (r2(t5, m6[0] + 8, "WEBP")) {
            y6 = 3;
            break t;
          }
          var w4 = j2(t5, m6[0] + 4);
          if (12 > w4 || 4294967286 < w4) {
            y6 = 3;
            break t;
          }
          if (p5 && w4 > b4[0] - 8) {
            y6 = 7;
            break t;
          }
          y6[0] = w4, m6[0] += 12, b4[0] -= 12;
        }
        y6 = 0;
      }
      if (0 != y6)
        return y6;
      for (w4 = 0 < g4.gb[0], i4 = i4[0]; ; ) {
        t: {
          var L4 = t5;
          b4 = n4, y6 = i4;
          var A5 = l5, x4 = f5, S3 = m6 = [0];
          if ((k3 = d4 = [d4])[0] = 0, 8 > y6[0])
            y6 = 7;
          else {
            if (!r2(L4, b4[0], "VP8X")) {
              if (10 != j2(L4, b4[0] + 4)) {
                y6 = 3;
                break t;
              }
              if (18 > y6[0]) {
                y6 = 7;
                break t;
              }
              var _4 = j2(L4, b4[0] + 8), P3 = 1 + C2(L4, b4[0] + 12);
              if (2147483648 <= P3 * (L4 = 1 + C2(L4, b4[0] + 15))) {
                y6 = 3;
                break t;
              }
              null != S3 && (S3[0] = _4), null != A5 && (A5[0] = P3), null != x4 && (x4[0] = L4), b4[0] += 18, y6[0] -= 18, k3[0] = 1;
            }
            y6 = 0;
          }
        }
        if (d4 = d4[0], m6 = m6[0], 0 != y6)
          return y6;
        if (b4 = !!(2 & m6), !w4 && d4)
          return 3;
        if (null != s4 && (s4[0] = !!(16 & m6)), null != c6 && (c6[0] = b4), null != u5 && (u5[0] = 0), c6 = l5[0], m6 = f5[0], d4 && b4 && null == h5) {
          y6 = 0;
          break;
        }
        if (4 > i4) {
          y6 = 7;
          break;
        }
        if (w4 && d4 || !w4 && !d4 && !r2(t5, n4[0], "ALPH")) {
          i4 = [i4], g4.na = [g4.na], g4.P = [g4.P], g4.Sa = [g4.Sa];
          t: {
            _4 = t5, y6 = n4, w4 = i4;
            var k3 = g4.gb;
            A5 = g4.na, x4 = g4.P, S3 = g4.Sa;
            P3 = 22, e2(null != _4), e2(null != w4), L4 = y6[0];
            var I3 = w4[0];
            for (e2(null != A5), e2(null != S3), A5[0] = null, x4[0] = null, S3[0] = 0; ; ) {
              if (y6[0] = L4, w4[0] = I3, 8 > I3) {
                y6 = 7;
                break t;
              }
              var F3 = j2(_4, L4 + 4);
              if (4294967286 < F3) {
                y6 = 3;
                break t;
              }
              var O4 = 8 + F3 + 1 & -2;
              if (P3 += O4, 0 < k3 && P3 > k3) {
                y6 = 3;
                break t;
              }
              if (!r2(_4, L4, "VP8 ") || !r2(_4, L4, "VP8L")) {
                y6 = 0;
                break t;
              }
              if (I3[0] < O4) {
                y6 = 7;
                break t;
              }
              r2(_4, L4, "ALPH") || (A5[0] = _4, x4[0] = L4 + 8, S3[0] = F3), L4 += O4, I3 -= O4;
            }
          }
          if (i4 = i4[0], g4.na = g4.na[0], g4.P = g4.P[0], g4.Sa = g4.Sa[0], 0 != y6)
            break;
        }
        i4 = [i4], g4.Ja = [g4.Ja], g4.xa = [g4.xa];
        t:
          if (k3 = t5, y6 = n4, w4 = i4, A5 = g4.gb[0], x4 = g4.Ja, S3 = g4.xa, _4 = y6[0], L4 = !r2(k3, _4, "VP8 "), P3 = !r2(k3, _4, "VP8L"), e2(null != k3), e2(null != w4), e2(null != x4), e2(null != S3), 8 > w4[0])
            y6 = 7;
          else {
            if (L4 || P3) {
              if (k3 = j2(k3, _4 + 4), 12 <= A5 && k3 > A5 - 12) {
                y6 = 3;
                break t;
              }
              if (p5 && k3 > w4[0] - 8) {
                y6 = 7;
                break t;
              }
              x4[0] = k3, y6[0] += 8, w4[0] -= 8, S3[0] = P3;
            } else
              S3[0] = 5 <= w4[0] && 47 == k3[_4 + 0] && !(k3[_4 + 4] >> 5), x4[0] = w4[0];
            y6 = 0;
          }
        if (i4 = i4[0], g4.Ja = g4.Ja[0], g4.xa = g4.xa[0], n4 = n4[0], 0 != y6)
          break;
        if (4294967286 < g4.Ja)
          return 3;
        if (null == u5 || b4 || (u5[0] = g4.xa ? 2 : 1), c6 = [c6], m6 = [m6], g4.xa) {
          if (5 > i4) {
            y6 = 7;
            break;
          }
          u5 = c6, p5 = m6, b4 = s4, null == t5 || 5 > i4 ? t5 = 0 : 5 <= i4 && 47 == t5[n4 + 0] && !(t5[n4 + 4] >> 5) ? (w4 = [0], k3 = [0], A5 = [0], v5(x4 = new N4(), t5, n4, i4), gt2(x4, w4, k3, A5) ? (null != u5 && (u5[0] = w4[0]), null != p5 && (p5[0] = k3[0]), null != b4 && (b4[0] = A5[0]), t5 = 1) : t5 = 0) : t5 = 0;
        } else {
          if (10 > i4) {
            y6 = 7;
            break;
          }
          u5 = m6, null == t5 || 10 > i4 || !Xt2(t5, n4 + 3, i4 - 3) ? t5 = 0 : (p5 = t5[n4 + 0] | t5[n4 + 1] << 8 | t5[n4 + 2] << 16, b4 = 16383 & (t5[n4 + 7] << 8 | t5[n4 + 6]), t5 = 16383 & (t5[n4 + 9] << 8 | t5[n4 + 8]), 1 & p5 || 3 < (p5 >> 1 & 7) || !(p5 >> 4 & 1) || p5 >> 5 >= g4.Ja || !b4 || !t5 ? t5 = 0 : (c6 && (c6[0] = b4), u5 && (u5[0] = t5), t5 = 1));
        }
        if (!t5)
          return 3;
        if (c6 = c6[0], m6 = m6[0], d4 && (l5[0] != c6 || f5[0] != m6))
          return 3;
        null != h5 && (h5[0] = g4, h5.offset = n4 - h5.w, e2(4294967286 > n4 - h5.w), e2(h5.offset == h5.ha - i4));
        break;
      }
      return 0 == y6 || 7 == y6 && d4 && null == h5 ? (null != s4 && (s4[0] |= null != g4.na && 0 < g4.na.length), null != a4 && (a4[0] = c6), null != o4 && (o4[0] = m6), 0) : y6;
    }
    function Mr(t5, e3, r3) {
      var n4 = e3.width, i4 = e3.height, a4 = 0, o4 = 0, s4 = n4, c6 = i4;
      if (e3.Da = null != t5 && 0 < t5.Da, e3.Da && (s4 = t5.cd, c6 = t5.bd, a4 = t5.v, o4 = t5.j, 11 > r3 || (a4 &= -2, o4 &= -2), 0 > a4 || 0 > o4 || 0 >= s4 || 0 >= c6 || a4 + s4 > n4 || o4 + c6 > i4))
        return 0;
      if (e3.v = a4, e3.j = o4, e3.va = a4 + s4, e3.o = o4 + c6, e3.U = s4, e3.T = c6, e3.da = null != t5 && 0 < t5.da, e3.da) {
        if (!E2(s4, c6, r3 = [t5.ib], a4 = [t5.hb]))
          return 0;
        e3.ib = r3[0], e3.hb = a4[0];
      }
      return e3.ob = null != t5 && t5.ob, e3.Kb = null == t5 || !t5.Sd, e3.da && (e3.ob = e3.ib < 3 * n4 / 4 && e3.hb < 3 * i4 / 4, e3.Kb = 0), 1;
    }
    function Er(t5) {
      if (null == t5)
        return 2;
      if (11 > t5.S) {
        var e3 = t5.f.RGBA;
        e3.fb += (t5.height - 1) * e3.A, e3.A = -e3.A;
      } else
        e3 = t5.f.kb, t5 = t5.height, e3.O += (t5 - 1) * e3.fa, e3.fa = -e3.fa, e3.N += (t5 - 1 >> 1) * e3.Ab, e3.Ab = -e3.Ab, e3.W += (t5 - 1 >> 1) * e3.Db, e3.Db = -e3.Db, null != e3.F && (e3.J += (t5 - 1) * e3.lb, e3.lb = -e3.lb);
      return 0;
    }
    function qr(t5, e3, r3, n4) {
      if (null == n4 || 0 >= t5 || 0 >= e3)
        return 2;
      if (null != r3) {
        if (r3.Da) {
          var i4 = r3.cd, o4 = r3.bd, s4 = -2 & r3.v, c6 = -2 & r3.j;
          if (0 > s4 || 0 > c6 || 0 >= i4 || 0 >= o4 || s4 + i4 > t5 || c6 + o4 > e3)
            return 2;
          t5 = i4, e3 = o4;
        }
        if (r3.da) {
          if (!E2(t5, e3, i4 = [r3.ib], o4 = [r3.hb]))
            return 2;
          t5 = i4[0], e3 = o4[0];
        }
      }
      n4.width = t5, n4.height = e3;
      t: {
        var u5 = n4.width, h5 = n4.height;
        if (t5 = n4.S, 0 >= u5 || 0 >= h5 || !(t5 >= En && 13 > t5))
          t5 = 2;
        else {
          if (0 >= n4.Rd && null == n4.sd) {
            s4 = o4 = i4 = e3 = 0;
            var l5 = (c6 = u5 * zi[t5]) * h5;
            if (11 > t5 || (o4 = (h5 + 1) / 2 * (e3 = (u5 + 1) / 2), 12 == t5 && (s4 = (i4 = u5) * h5)), null == (h5 = a3(l5 + 2 * o4 + s4))) {
              t5 = 1;
              break t;
            }
            n4.sd = h5, 11 > t5 ? ((u5 = n4.f.RGBA).eb = h5, u5.fb = 0, u5.A = c6, u5.size = l5) : ((u5 = n4.f.kb).y = h5, u5.O = 0, u5.fa = c6, u5.Fd = l5, u5.f = h5, u5.N = 0 + l5, u5.Ab = e3, u5.Cd = o4, u5.ea = h5, u5.W = 0 + l5 + o4, u5.Db = e3, u5.Ed = o4, 12 == t5 && (u5.F = h5, u5.J = 0 + l5 + 2 * o4), u5.Tc = s4, u5.lb = i4);
          }
          if (e3 = 1, i4 = n4.S, o4 = n4.width, s4 = n4.height, i4 >= En && 13 > i4)
            if (11 > i4)
              t5 = n4.f.RGBA, e3 &= (c6 = Math.abs(t5.A)) * (s4 - 1) + o4 <= t5.size, e3 &= c6 >= o4 * zi[i4], e3 &= null != t5.eb;
            else {
              t5 = n4.f.kb, c6 = (o4 + 1) / 2, l5 = (s4 + 1) / 2, u5 = Math.abs(t5.fa);
              h5 = Math.abs(t5.Ab);
              var f5 = Math.abs(t5.Db), d4 = Math.abs(t5.lb), p5 = d4 * (s4 - 1) + o4;
              e3 &= u5 * (s4 - 1) + o4 <= t5.Fd, e3 &= h5 * (l5 - 1) + c6 <= t5.Cd, e3 = (e3 &= f5 * (l5 - 1) + c6 <= t5.Ed) & u5 >= o4 & h5 >= c6 & f5 >= c6, e3 &= null != t5.y, e3 &= null != t5.f, e3 &= null != t5.ea, 12 == i4 && (e3 &= d4 >= o4, e3 &= p5 <= t5.Tc, e3 &= null != t5.F);
            }
          else
            e3 = 0;
          t5 = e3 ? 0 : 2;
        }
      }
      return 0 != t5 || null != r3 && r3.fd && (t5 = Er(n4)), t5;
    }
    var Dr = 64, Rr = [0, 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191, 16383, 32767, 65535, 131071, 262143, 524287, 1048575, 2097151, 4194303, 8388607, 16777215], Tr = 24, Ur = 32, zr = 8, Hr = [0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7];
    R2("Predictor0", "PredictorAdd0"), t4.Predictor0 = function() {
      return 4278190080;
    }, t4.Predictor1 = function(t5) {
      return t5;
    }, t4.Predictor2 = function(t5, e3, r3) {
      return e3[r3 + 0];
    }, t4.Predictor3 = function(t5, e3, r3) {
      return e3[r3 + 1];
    }, t4.Predictor4 = function(t5, e3, r3) {
      return e3[r3 - 1];
    }, t4.Predictor5 = function(t5, e3, r3) {
      return U2(U2(t5, e3[r3 + 1]), e3[r3 + 0]);
    }, t4.Predictor6 = function(t5, e3, r3) {
      return U2(t5, e3[r3 - 1]);
    }, t4.Predictor7 = function(t5, e3, r3) {
      return U2(t5, e3[r3 + 0]);
    }, t4.Predictor8 = function(t5, e3, r3) {
      return U2(e3[r3 - 1], e3[r3 + 0]);
    }, t4.Predictor9 = function(t5, e3, r3) {
      return U2(e3[r3 + 0], e3[r3 + 1]);
    }, t4.Predictor10 = function(t5, e3, r3) {
      return U2(U2(t5, e3[r3 - 1]), U2(e3[r3 + 0], e3[r3 + 1]));
    }, t4.Predictor11 = function(t5, e3, r3) {
      var n4 = e3[r3 + 0];
      return 0 >= W2(n4 >> 24 & 255, t5 >> 24 & 255, (e3 = e3[r3 - 1]) >> 24 & 255) + W2(n4 >> 16 & 255, t5 >> 16 & 255, e3 >> 16 & 255) + W2(n4 >> 8 & 255, t5 >> 8 & 255, e3 >> 8 & 255) + W2(255 & n4, 255 & t5, 255 & e3) ? n4 : t5;
    }, t4.Predictor12 = function(t5, e3, r3) {
      var n4 = e3[r3 + 0];
      return (z2((t5 >> 24 & 255) + (n4 >> 24 & 255) - ((e3 = e3[r3 - 1]) >> 24 & 255)) << 24 | z2((t5 >> 16 & 255) + (n4 >> 16 & 255) - (e3 >> 16 & 255)) << 16 | z2((t5 >> 8 & 255) + (n4 >> 8 & 255) - (e3 >> 8 & 255)) << 8 | z2((255 & t5) + (255 & n4) - (255 & e3))) >>> 0;
    }, t4.Predictor13 = function(t5, e3, r3) {
      var n4 = e3[r3 - 1];
      return (H2((t5 = U2(t5, e3[r3 + 0])) >> 24 & 255, n4 >> 24 & 255) << 24 | H2(t5 >> 16 & 255, n4 >> 16 & 255) << 16 | H2(t5 >> 8 & 255, n4 >> 8 & 255) << 8 | H2(t5 >> 0 & 255, n4 >> 0 & 255)) >>> 0;
    };
    var Wr = t4.PredictorAdd0;
    t4.PredictorAdd1 = V2, R2("Predictor2", "PredictorAdd2"), R2("Predictor3", "PredictorAdd3"), R2("Predictor4", "PredictorAdd4"), R2("Predictor5", "PredictorAdd5"), R2("Predictor6", "PredictorAdd6"), R2("Predictor7", "PredictorAdd7"), R2("Predictor8", "PredictorAdd8"), R2("Predictor9", "PredictorAdd9"), R2("Predictor10", "PredictorAdd10"), R2("Predictor11", "PredictorAdd11"), R2("Predictor12", "PredictorAdd12"), R2("Predictor13", "PredictorAdd13");
    var Vr = t4.PredictorAdd2;
    X2("ColorIndexInverseTransform", "MapARGB", "32b", function(t5) {
      return t5 >> 8 & 255;
    }, function(t5) {
      return t5;
    }), X2("VP8LColorIndexInverseTransformAlpha", "MapAlpha", "8b", function(t5) {
      return t5;
    }, function(t5) {
      return t5 >> 8 & 255;
    });
    var Gr, Yr = t4.ColorIndexInverseTransform, Jr = t4.MapARGB, Xr = t4.VP8LColorIndexInverseTransformAlpha, Kr = t4.MapAlpha, Zr = t4.VP8LPredictorsAdd = [];
    Zr.length = 16, (t4.VP8LPredictors = []).length = 16, (t4.VP8LPredictorsAdd_C = []).length = 16, (t4.VP8LPredictors_C = []).length = 16;
    var $r, Qr, tn, en, rn, nn, an, on2, sn, cn, un, hn, ln2, fn, dn, pn, gn, mn, vn, bn, yn, wn, Nn, Ln, An, xn, Sn, _n, Pn = a3(511), kn = a3(2041), In = a3(225), Fn = a3(767), Cn = 0, jn = kn, On = In, Bn = Fn, Mn = Pn, En = 0, qn = 1, Dn = 2, Rn = 3, Tn = 4, Un = 5, zn = 6, Hn = 7, Wn = 8, Vn = 9, Gn = 10, Yn = [2, 3, 7], Jn = [3, 3, 11], Xn = [280, 256, 256, 256, 40], Kn = [0, 1, 1, 1, 0], Zn = [17, 18, 0, 1, 2, 3, 4, 5, 16, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], $n = [24, 7, 23, 25, 40, 6, 39, 41, 22, 26, 38, 42, 56, 5, 55, 57, 21, 27, 54, 58, 37, 43, 72, 4, 71, 73, 20, 28, 53, 59, 70, 74, 36, 44, 88, 69, 75, 52, 60, 3, 87, 89, 19, 29, 86, 90, 35, 45, 68, 76, 85, 91, 51, 61, 104, 2, 103, 105, 18, 30, 102, 106, 34, 46, 84, 92, 67, 77, 101, 107, 50, 62, 120, 1, 119, 121, 83, 93, 17, 31, 100, 108, 66, 78, 118, 122, 33, 47, 117, 123, 49, 63, 99, 109, 82, 94, 0, 116, 124, 65, 79, 16, 32, 98, 110, 48, 115, 125, 81, 95, 64, 114, 126, 97, 111, 80, 113, 127, 96, 112], Qn = [2954, 2956, 2958, 2962, 2970, 2986, 3018, 3082, 3212, 3468, 3980, 5004], ti = 8, ei = [4, 5, 6, 7, 8, 9, 10, 10, 11, 12, 13, 14, 15, 16, 17, 17, 18, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 25, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 91, 93, 95, 96, 98, 100, 101, 102, 104, 106, 108, 110, 112, 114, 116, 118, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 143, 145, 148, 151, 154, 157], ri = [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, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 119, 122, 125, 128, 131, 134, 137, 140, 143, 146, 149, 152, 155, 158, 161, 164, 167, 170, 173, 177, 181, 185, 189, 193, 197, 201, 205, 209, 213, 217, 221, 225, 229, 234, 239, 245, 249, 254, 259, 264, 269, 274, 279, 284], ni = null, ii = [[173, 148, 140, 0], [176, 155, 140, 135, 0], [180, 157, 141, 134, 130, 0], [254, 254, 243, 230, 196, 177, 153, 140, 133, 130, 129, 0]], ai = [0, 1, 4, 8, 5, 2, 3, 6, 9, 12, 13, 10, 7, 11, 14, 15], oi = [-0, 1, -1, 2, -2, 3, 4, 6, -3, 5, -4, -5, -6, 7, -7, 8, -8, -9], si = [[[[128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128], [128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128], [128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128]], [[253, 136, 254, 255, 228, 219, 128, 128, 128, 128, 128], [189, 129, 242, 255, 227, 213, 255, 219, 128, 128, 128], [106, 126, 227, 252, 214, 209, 255, 255, 128, 128, 128]], [[1, 98, 248, 255, 236, 226, 255, 255, 128, 128, 128], [181, 133, 238, 254, 221, 234, 255, 154, 128, 128, 128], [78, 134, 202, 247, 198, 180, 255, 219, 128, 128, 128]], [[1, 185, 249, 255, 243, 255, 128, 128, 128, 128, 128], [184, 150, 247, 255, 236, 224, 128, 128, 128, 128, 128], [77, 110, 216, 255, 236, 230, 128, 128, 128, 128, 128]], [[1, 101, 251, 255, 241, 255, 128, 128, 128, 128, 128], [170, 139, 241, 252, 236, 209, 255, 255, 128, 128, 128], [37, 116, 196, 243, 228, 255, 255, 255, 128, 128, 128]], [[1, 204, 254, 255, 245, 255, 128, 128, 128, 128, 128], [207, 160, 250, 255, 238, 128, 128, 128, 128, 128, 128], [102, 103, 231, 255, 211, 171, 128, 128, 128, 128, 128]], [[1, 152, 252, 255, 240, 255, 128, 128, 128, 128, 128], [177, 135, 243, 255, 234, 225, 128, 128, 128, 128, 128], [80, 129, 211, 255, 194, 224, 128, 128, 128, 128, 128]], [[1, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128], [246, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128], [255, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128]]], [[[198, 35, 237, 223, 193, 187, 162, 160, 145, 155, 62], [131, 45, 198, 221, 172, 176, 220, 157, 252, 221, 1], [68, 47, 146, 208, 149, 167, 221, 162, 255, 223, 128]], [[1, 149, 241, 255, 221, 224, 255, 255, 128, 128, 128], [184, 141, 234, 253, 222, 220, 255, 199, 128, 128, 128], [81, 99, 181, 242, 176, 190, 249, 202, 255, 255, 128]], [[1, 129, 232, 253, 214, 197, 242, 196, 255, 255, 128], [99, 121, 210, 250, 201, 198, 255, 202, 128, 128, 128], [23, 91, 163, 242, 170, 187, 247, 210, 255, 255, 128]], [[1, 200, 246, 255, 234, 255, 128, 128, 128, 128, 128], [109, 178, 241, 255, 231, 245, 255, 255, 128, 128, 128], [44, 130, 201, 253, 205, 192, 255, 255, 128, 128, 128]], [[1, 132, 239, 251, 219, 209, 255, 165, 128, 128, 128], [94, 136, 225, 251, 218, 190, 255, 255, 128, 128, 128], [22, 100, 174, 245, 186, 161, 255, 199, 128, 128, 128]], [[1, 182, 249, 255, 232, 235, 128, 128, 128, 128, 128], [124, 143, 241, 255, 227, 234, 128, 128, 128, 128, 128], [35, 77, 181, 251, 193, 211, 255, 205, 128, 128, 128]], [[1, 157, 247, 255, 236, 231, 255, 255, 128, 128, 128], [121, 141, 235, 255, 225, 227, 255, 255, 128, 128, 128], [45, 99, 188, 251, 195, 217, 255, 224, 128, 128, 128]], [[1, 1, 251, 255, 213, 255, 128, 128, 128, 128, 128], [203, 1, 248, 255, 255, 128, 128, 128, 128, 128, 128], [137, 1, 177, 255, 224, 255, 128, 128, 128, 128, 128]]], [[[253, 9, 248, 251, 207, 208, 255, 192, 128, 128, 128], [175, 13, 224, 243, 193, 185, 249, 198, 255, 255, 128], [73, 17, 171, 221, 161, 179, 236, 167, 255, 234, 128]], [[1, 95, 247, 253, 212, 183, 255, 255, 128, 128, 128], [239, 90, 244, 250, 211, 209, 255, 255, 128, 128, 128], [155, 77, 195, 248, 188, 195, 255, 255, 128, 128, 128]], [[1, 24, 239, 251, 218, 219, 255, 205, 128, 128, 128], [201, 51, 219, 255, 196, 186, 128, 128, 128, 128, 128], [69, 46, 190, 239, 201, 218, 255, 228, 128, 128, 128]], [[1, 191, 251, 255, 255, 128, 128, 128, 128, 128, 128], [223, 165, 249, 255, 213, 255, 128, 128, 128, 128, 128], [141, 124, 248, 255, 255, 128, 128, 128, 128, 128, 128]], [[1, 16, 248, 255, 255, 128, 128, 128, 128, 128, 128], [190, 36, 230, 255, 236, 255, 128, 128, 128, 128, 128], [149, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128]], [[1, 226, 255, 128, 128, 128, 128, 128, 128, 128, 128], [247, 192, 255, 128, 128, 128, 128, 128, 128, 128, 128], [240, 128, 255, 128, 128, 128, 128, 128, 128, 128, 128]], [[1, 134, 252, 255, 255, 128, 128, 128, 128, 128, 128], [213, 62, 250, 255, 255, 128, 128, 128, 128, 128, 128], [55, 93, 255, 128, 128, 128, 128, 128, 128, 128, 128]], [[128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128], [128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128], [128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128]]], [[[202, 24, 213, 235, 186, 191, 220, 160, 240, 175, 255], [126, 38, 182, 232, 169, 184, 228, 174, 255, 187, 128], [61, 46, 138, 219, 151, 178, 240, 170, 255, 216, 128]], [[1, 112, 230, 250, 199, 191, 247, 159, 255, 255, 128], [166, 109, 228, 252, 211, 215, 255, 174, 128, 128, 128], [39, 77, 162, 232, 172, 180, 245, 178, 255, 255, 128]], [[1, 52, 220, 246, 198, 199, 249, 220, 255, 255, 128], [124, 74, 191, 243, 183, 193, 250, 221, 255, 255, 128], [24, 71, 130, 219, 154, 170, 243, 182, 255, 255, 128]], [[1, 182, 225, 249, 219, 240, 255, 224, 128, 128, 128], [149, 150, 226, 252, 216, 205, 255, 171, 128, 128, 128], [28, 108, 170, 242, 183, 194, 254, 223, 255, 255, 128]], [[1, 81, 230, 252, 204, 203, 255, 192, 128, 128, 128], [123, 102, 209, 247, 188, 196, 255, 233, 128, 128, 128], [20, 95, 153, 243, 164, 173, 255, 203, 128, 128, 128]], [[1, 222, 248, 255, 216, 213, 128, 128, 128, 128, 128], [168, 175, 246, 252, 235, 205, 255, 255, 128, 128, 128], [47, 116, 215, 255, 211, 212, 255, 255, 128, 128, 128]], [[1, 121, 236, 253, 212, 214, 255, 255, 128, 128, 128], [141, 84, 213, 252, 201, 202, 255, 219, 128, 128, 128], [42, 80, 160, 240, 162, 185, 255, 205, 128, 128, 128]], [[1, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128], [244, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128], [238, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128]]]], ci = [[[231, 120, 48, 89, 115, 113, 120, 152, 112], [152, 179, 64, 126, 170, 118, 46, 70, 95], [175, 69, 143, 80, 85, 82, 72, 155, 103], [56, 58, 10, 171, 218, 189, 17, 13, 152], [114, 26, 17, 163, 44, 195, 21, 10, 173], [121, 24, 80, 195, 26, 62, 44, 64, 85], [144, 71, 10, 38, 171, 213, 144, 34, 26], [170, 46, 55, 19, 136, 160, 33, 206, 71], [63, 20, 8, 114, 114, 208, 12, 9, 226], [81, 40, 11, 96, 182, 84, 29, 16, 36]], [[134, 183, 89, 137, 98, 101, 106, 165, 148], [72, 187, 100, 130, 157, 111, 32, 75, 80], [66, 102, 167, 99, 74, 62, 40, 234, 128], [41, 53, 9, 178, 241, 141, 26, 8, 107], [74, 43, 26, 146, 73, 166, 49, 23, 157], [65, 38, 105, 160, 51, 52, 31, 115, 128], [104, 79, 12, 27, 217, 255, 87, 17, 7], [87, 68, 71, 44, 114, 51, 15, 186, 23], [47, 41, 14, 110, 182, 183, 21, 17, 194], [66, 45, 25, 102, 197, 189, 23, 18, 22]], [[88, 88, 147, 150, 42, 46, 45, 196, 205], [43, 97, 183, 117, 85, 38, 35, 179, 61], [39, 53, 200, 87, 26, 21, 43, 232, 171], [56, 34, 51, 104, 114, 102, 29, 93, 77], [39, 28, 85, 171, 58, 165, 90, 98, 64], [34, 22, 116, 206, 23, 34, 43, 166, 73], [107, 54, 32, 26, 51, 1, 81, 43, 31], [68, 25, 106, 22, 64, 171, 36, 225, 114], [34, 19, 21, 102, 132, 188, 16, 76, 124], [62, 18, 78, 95, 85, 57, 50, 48, 51]], [[193, 101, 35, 159, 215, 111, 89, 46, 111], [60, 148, 31, 172, 219, 228, 21, 18, 111], [112, 113, 77, 85, 179, 255, 38, 120, 114], [40, 42, 1, 196, 245, 209, 10, 25, 109], [88, 43, 29, 140, 166, 213, 37, 43, 154], [61, 63, 30, 155, 67, 45, 68, 1, 209], [100, 80, 8, 43, 154, 1, 51, 26, 71], [142, 78, 78, 16, 255, 128, 34, 197, 171], [41, 40, 5, 102, 211, 183, 4, 1, 221], [51, 50, 17, 168, 209, 192, 23, 25, 82]], [[138, 31, 36, 171, 27, 166, 38, 44, 229], [67, 87, 58, 169, 82, 115, 26, 59, 179], [63, 59, 90, 180, 59, 166, 93, 73, 154], [40, 40, 21, 116, 143, 209, 34, 39, 175], [47, 15, 16, 183, 34, 223, 49, 45, 183], [46, 17, 33, 183, 6, 98, 15, 32, 183], [57, 46, 22, 24, 128, 1, 54, 17, 37], [65, 32, 73, 115, 28, 128, 23, 128, 205], [40, 3, 9, 115, 51, 192, 18, 6, 223], [87, 37, 9, 115, 59, 77, 64, 21, 47]], [[104, 55, 44, 218, 9, 54, 53, 130, 226], [64, 90, 70, 205, 40, 41, 23, 26, 57], [54, 57, 112, 184, 5, 41, 38, 166, 213], [30, 34, 26, 133, 152, 116, 10, 32, 134], [39, 19, 53, 221, 26, 114, 32, 73, 255], [31, 9, 65, 234, 2, 15, 1, 118, 73], [75, 32, 12, 51, 192, 255, 160, 43, 51], [88, 31, 35, 67, 102, 85, 55, 186, 85], [56, 21, 23, 111, 59, 205, 45, 37, 192], [55, 38, 70, 124, 73, 102, 1, 34, 98]], [[125, 98, 42, 88, 104, 85, 117, 175, 82], [95, 84, 53, 89, 128, 100, 113, 101, 45], [75, 79, 123, 47, 51, 128, 81, 171, 1], [57, 17, 5, 71, 102, 57, 53, 41, 49], [38, 33, 13, 121, 57, 73, 26, 1, 85], [41, 10, 67, 138, 77, 110, 90, 47, 114], [115, 21, 2, 10, 102, 255, 166, 23, 6], [101, 29, 16, 10, 85, 128, 101, 196, 26], [57, 18, 10, 102, 102, 213, 34, 20, 43], [117, 20, 15, 36, 163, 128, 68, 1, 26]], [[102, 61, 71, 37, 34, 53, 31, 243, 192], [69, 60, 71, 38, 73, 119, 28, 222, 37], [68, 45, 128, 34, 1, 47, 11, 245, 171], [62, 17, 19, 70, 146, 85, 55, 62, 70], [37, 43, 37, 154, 100, 163, 85, 160, 1], [63, 9, 92, 136, 28, 64, 32, 201, 85], [75, 15, 9, 9, 64, 255, 184, 119, 16], [86, 6, 28, 5, 64, 255, 25, 248, 1], [56, 8, 17, 132, 137, 255, 55, 116, 128], [58, 15, 20, 82, 135, 57, 26, 121, 40]], [[164, 50, 31, 137, 154, 133, 25, 35, 218], [51, 103, 44, 131, 131, 123, 31, 6, 158], [86, 40, 64, 135, 148, 224, 45, 183, 128], [22, 26, 17, 131, 240, 154, 14, 1, 209], [45, 16, 21, 91, 64, 222, 7, 1, 197], [56, 21, 39, 155, 60, 138, 23, 102, 213], [83, 12, 13, 54, 192, 255, 68, 47, 28], [85, 26, 85, 85, 128, 128, 32, 146, 171], [18, 11, 7, 63, 144, 171, 4, 4, 246], [35, 27, 10, 146, 174, 171, 12, 26, 128]], [[190, 80, 35, 99, 180, 80, 126, 54, 45], [85, 126, 47, 87, 176, 51, 41, 20, 32], [101, 75, 128, 139, 118, 146, 116, 128, 85], [56, 41, 15, 176, 236, 85, 37, 9, 62], [71, 30, 17, 119, 118, 255, 17, 18, 138], [101, 38, 60, 138, 55, 70, 43, 26, 142], [146, 36, 19, 30, 171, 255, 97, 27, 20], [138, 45, 61, 62, 219, 1, 81, 188, 64], [32, 41, 20, 117, 151, 142, 20, 21, 163], [112, 19, 12, 61, 195, 128, 48, 4, 24]]], ui = [[[[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[176, 246, 255, 255, 255, 255, 255, 255, 255, 255, 255], [223, 241, 252, 255, 255, 255, 255, 255, 255, 255, 255], [249, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 244, 252, 255, 255, 255, 255, 255, 255, 255, 255], [234, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255], [253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 246, 254, 255, 255, 255, 255, 255, 255, 255, 255], [239, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255], [254, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 248, 254, 255, 255, 255, 255, 255, 255, 255, 255], [251, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255], [251, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255], [254, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 254, 253, 255, 254, 255, 255, 255, 255, 255, 255], [250, 255, 254, 255, 254, 255, 255, 255, 255, 255, 255], [254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]]], [[[217, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [225, 252, 241, 253, 255, 255, 254, 255, 255, 255, 255], [234, 250, 241, 250, 253, 255, 253, 254, 255, 255, 255]], [[255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255], [223, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255], [238, 253, 254, 254, 255, 255, 255, 255, 255, 255, 255]], [[255, 248, 254, 255, 255, 255, 255, 255, 255, 255, 255], [249, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 253, 255, 255, 255, 255, 255, 255, 255, 255, 255], [247, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255], [252, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255], [253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 254, 253, 255, 255, 255, 255, 255, 255, 255, 255], [250, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]]], [[[186, 251, 250, 255, 255, 255, 255, 255, 255, 255, 255], [234, 251, 244, 254, 255, 255, 255, 255, 255, 255, 255], [251, 251, 243, 253, 254, 255, 254, 255, 255, 255, 255]], [[255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255], [236, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255], [251, 253, 253, 254, 254, 255, 255, 255, 255, 255, 255]], [[255, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255], [254, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255], [254, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255], [254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]]], [[[248, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [250, 254, 252, 254, 255, 255, 255, 255, 255, 255, 255], [248, 254, 249, 253, 255, 255, 255, 255, 255, 255, 255]], [[255, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255], [246, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255], [252, 254, 251, 254, 254, 255, 255, 255, 255, 255, 255]], [[255, 254, 252, 255, 255, 255, 255, 255, 255, 255, 255], [248, 254, 253, 255, 255, 255, 255, 255, 255, 255, 255], [253, 255, 254, 254, 255, 255, 255, 255, 255, 255, 255]], [[255, 251, 254, 255, 255, 255, 255, 255, 255, 255, 255], [245, 251, 254, 255, 255, 255, 255, 255, 255, 255, 255], [253, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 251, 253, 255, 255, 255, 255, 255, 255, 255, 255], [252, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255], [255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 252, 255, 255, 255, 255, 255, 255, 255, 255, 255], [249, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 255, 253, 255, 255, 255, 255, 255, 255, 255, 255], [250, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]]]], hi = [0, 1, 2, 3, 6, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7, 0], li = [], fi = [], di = [], pi = 1, gi = 2, mi = [], vi = [];
    vr("UpsampleRgbLinePair", Ar, 3), vr("UpsampleBgrLinePair", xr, 3), vr("UpsampleRgbaLinePair", Ir, 4), vr("UpsampleBgraLinePair", kr, 4), vr("UpsampleArgbLinePair", Pr, 4), vr("UpsampleRgba4444LinePair", _r, 2), vr("UpsampleRgb565LinePair", Sr, 2);
    var bi = t4.UpsampleRgbLinePair, yi = t4.UpsampleBgrLinePair, wi = t4.UpsampleRgbaLinePair, Ni = t4.UpsampleBgraLinePair, Li = t4.UpsampleArgbLinePair, Ai = t4.UpsampleRgba4444LinePair, xi = t4.UpsampleRgb565LinePair, Si = 16, _i = 1 << Si - 1, Pi = -227, ki = 482, Ii = 6, Fi = (256 << Ii) - 1, Ci = 0, ji = a3(256), Oi = a3(256), Bi = a3(256), Mi = a3(256), Ei = a3(ki - Pi), qi = a3(ki - Pi);
    Fr("YuvToRgbRow", Ar, 3), Fr("YuvToBgrRow", xr, 3), Fr("YuvToRgbaRow", Ir, 4), Fr("YuvToBgraRow", kr, 4), Fr("YuvToArgbRow", Pr, 4), Fr("YuvToRgba4444Row", _r, 2), Fr("YuvToRgb565Row", Sr, 2);
    var Di = [0, 4, 8, 12, 128, 132, 136, 140, 256, 260, 264, 268, 384, 388, 392, 396], Ri = [0, 2, 8], Ti = [8, 7, 6, 4, 4, 2, 2, 2, 1, 1, 1, 1], Ui = 1;
    this.WebPDecodeRGBA = function(t5, r3, n4, i4, a4) {
      var o4 = qn, s4 = new rr(), c6 = new ot2();
      s4.ba = c6, c6.S = o4, c6.width = [c6.width], c6.height = [c6.height];
      var u5 = c6.width, h5 = c6.height, l5 = new st2();
      if (null == l5 || null == t5)
        var f5 = 2;
      else
        e2(null != l5), f5 = Br(t5, r3, n4, l5.width, l5.height, l5.Pd, l5.Qd, l5.format, null);
      if (0 != f5 ? u5 = 0 : (null != u5 && (u5[0] = l5.width[0]), null != h5 && (h5[0] = l5.height[0]), u5 = 1), u5) {
        c6.width = c6.width[0], c6.height = c6.height[0], null != i4 && (i4[0] = c6.width), null != a4 && (a4[0] = c6.height);
        t: {
          if (i4 = new Gt2(), (a4 = new nr()).data = t5, a4.w = r3, a4.ha = n4, a4.kd = 1, r3 = [0], e2(null != a4), (0 == (t5 = Br(a4.data, a4.w, a4.ha, null, null, null, r3, null, a4)) || 7 == t5) && r3[0] && (t5 = 4), 0 == (r3 = t5)) {
            if (e2(null != s4), i4.data = a4.data, i4.w = a4.w + a4.offset, i4.ha = a4.ha - a4.offset, i4.put = dt2, i4.ac = ft2, i4.bc = pt2, i4.ma = s4, a4.xa) {
              if (null == (t5 = kt2())) {
                s4 = 1;
                break t;
              }
              if (function(t6, r4) {
                var n5 = [0], i5 = [0], a5 = [0];
                e:
                  for (; ; ) {
                    if (null == t6)
                      return 0;
                    if (null == r4)
                      return t6.a = 2, 0;
                    if (t6.l = r4, t6.a = 0, v5(t6.m, r4.data, r4.w, r4.ha), !gt2(t6.m, n5, i5, a5)) {
                      t6.a = 3;
                      break e;
                    }
                    if (t6.xb = gi, r4.width = n5[0], r4.height = i5[0], !It2(n5[0], i5[0], 1, t6, null))
                      break e;
                    return 1;
                  }
                return e2(0 != t6.a), 0;
              }(t5, i4)) {
                if (i4 = 0 == (r3 = qr(i4.width, i4.height, s4.Oa, s4.ba))) {
                  e: {
                    i4 = t5;
                    r:
                      for (; ; ) {
                        if (null == i4) {
                          i4 = 0;
                          break e;
                        }
                        if (e2(null != i4.s.yc), e2(null != i4.s.Ya), e2(0 < i4.s.Wb), e2(null != (n4 = i4.l)), e2(null != (a4 = n4.ma)), 0 != i4.xb) {
                          if (i4.ca = a4.ba, i4.tb = a4.tb, e2(null != i4.ca), !Mr(a4.Oa, n4, Rn)) {
                            i4.a = 2;
                            break r;
                          }
                          if (!Ft2(i4, n4.width))
                            break r;
                          if (n4.da)
                            break r;
                          if ((n4.da || nt2(i4.ca.S)) && mr(), 11 > i4.ca.S || (alert("todo:WebPInitConvertARGBToYUV"), null != i4.ca.f.kb.F && mr()), i4.Pb && 0 < i4.s.ua && null == i4.s.vb.X && !O3(i4.s.vb, i4.s.Wa.Xa)) {
                            i4.a = 1;
                            break r;
                          }
                          i4.xb = 0;
                        }
                        if (!_t2(i4, i4.V, i4.Ba, i4.c, i4.i, n4.o, Lt2))
                          break r;
                        a4.Dc = i4.Ma, i4 = 1;
                        break e;
                      }
                    e2(0 != i4.a), i4 = 0;
                  }
                  i4 = !i4;
                }
                i4 && (r3 = t5.a);
              } else
                r3 = t5.a;
            } else {
              if (null == (t5 = new Yt2())) {
                s4 = 1;
                break t;
              }
              if (t5.Fa = a4.na, t5.P = a4.P, t5.qc = a4.Sa, Kt2(t5, i4)) {
                if (0 == (r3 = qr(i4.width, i4.height, s4.Oa, s4.ba))) {
                  if (t5.Aa = 0, n4 = s4.Oa, e2(null != (a4 = t5)), null != n4) {
                    if (0 < (u5 = 0 > (u5 = n4.Md) ? 0 : 100 < u5 ? 255 : 255 * u5 / 100)) {
                      for (h5 = l5 = 0; 4 > h5; ++h5)
                        12 > (f5 = a4.pb[h5]).lc && (f5.ia = u5 * Ti[0 > f5.lc ? 0 : f5.lc] >> 3), l5 |= f5.ia;
                      l5 && (alert("todo:VP8InitRandom"), a4.ia = 1);
                    }
                    a4.Ga = n4.Id, 100 < a4.Ga ? a4.Ga = 100 : 0 > a4.Ga && (a4.Ga = 0);
                  }
                  Qt2(t5, i4) || (r3 = t5.a);
                }
              } else
                r3 = t5.a;
            }
            0 == r3 && null != s4.Oa && s4.Oa.fd && (r3 = Er(s4.ba));
          }
          s4 = r3;
        }
        o4 = 0 != s4 ? null : 11 > o4 ? c6.f.RGBA.eb : c6.f.kb.y;
      } else
        o4 = null;
      return o4;
    };
    var zi = [3, 4, 3, 4, 4, 2, 2, 4, 4, 4, 2, 1, 1];
  };
  function u3(t4, e3) {
    for (var r3 = "", n4 = 0; n4 < 4; n4++)
      r3 += String.fromCharCode(t4[e3++]);
    return r3;
  }
  function h3(t4, e3) {
    return (t4[e3 + 0] << 0 | t4[e3 + 1] << 8 | t4[e3 + 2] << 16) >>> 0;
  }
  function l3(t4, e3) {
    return (t4[e3 + 0] << 0 | t4[e3 + 1] << 8 | t4[e3 + 2] << 16 | t4[e3 + 3] << 24) >>> 0;
  }
  new c4();
  var f3 = [0], d2 = [0], p3 = [], g2 = new c4(), m4 = t3, v3 = function(t4, e3) {
    var r3 = {}, n4 = 0, i4 = false, a4 = 0, o4 = 0;
    if (r3.frames = [], !/** @license
       * Copyright (c) 2017 Dominik Homberger
      Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
      The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
      THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
      https://webpjs.appspot.com
      WebPRiffParser dominikhlbg@gmail.com
      */
    function(t5, e4, r4, n5) {
      for (var i5 = 0; i5 < n5; i5++)
        if (t5[e4 + i5] != r4.charCodeAt(i5))
          return true;
      return false;
    }(t4, e3, "RIFF", 4)) {
      var s4, c5;
      l3(t4, e3 += 4);
      for (e3 += 8; e3 < t4.length; ) {
        var f4 = u3(t4, e3), d3 = l3(t4, e3 += 4);
        e3 += 4;
        var p4 = d3 + (1 & d3);
        switch (f4) {
          case "VP8 ":
          case "VP8L":
            void 0 === r3.frames[n4] && (r3.frames[n4] = {});
            (v5 = r3.frames[n4]).src_off = i4 ? o4 : e3 - 8, v5.src_size = a4 + d3 + 8, n4++, i4 && (i4 = false, a4 = 0, o4 = 0);
            break;
          case "VP8X":
            (v5 = r3.header = {}).feature_flags = t4[e3];
            var g3 = e3 + 4;
            v5.canvas_width = 1 + h3(t4, g3);
            g3 += 3;
            v5.canvas_height = 1 + h3(t4, g3);
            g3 += 3;
            break;
          case "ALPH":
            i4 = true, a4 = p4 + 8, o4 = e3 - 8;
            break;
          case "ANIM":
            (v5 = r3.header).bgcolor = l3(t4, e3);
            g3 = e3 + 4;
            v5.loop_count = (s4 = t4)[(c5 = g3) + 0] << 0 | s4[c5 + 1] << 8;
            g3 += 2;
            break;
          case "ANMF":
            var m5, v5;
            (v5 = r3.frames[n4] = {}).offset_x = 2 * h3(t4, e3), e3 += 3, v5.offset_y = 2 * h3(t4, e3), e3 += 3, v5.width = 1 + h3(t4, e3), e3 += 3, v5.height = 1 + h3(t4, e3), e3 += 3, v5.duration = h3(t4, e3), e3 += 3, m5 = t4[e3++], v5.dispose = 1 & m5, v5.blend = m5 >> 1 & 1;
        }
        "ANMF" != f4 && (e3 += p4);
      }
      return r3;
    }
  }(m4, 0);
  v3.response = m4, v3.rgbaoutput = true, v3.dataurl = false;
  var b2 = v3.header ? v3.header : null, y4 = v3.frames ? v3.frames : null;
  if (b2) {
    b2.loop_counter = b2.loop_count, f3 = [b2.canvas_height], d2 = [b2.canvas_width];
    for (var w2 = 0; w2 < y4.length && 0 != y4[w2].blend; w2++)
      ;
  }
  var N3 = y4[0], L2 = g2.WebPDecodeRGBA(m4, N3.src_off, N3.src_size, d2, f3);
  N3.rgba = L2, N3.imgwidth = d2[0], N3.imgheight = f3[0];
  for (var A3 = 0; A3 < d2[0] * f3[0] * 4; A3++)
    p3[A3] = L2[A3];
  return this.width = d2, this.height = f3, this.data = p3, this;
}
!function(t3) {
  var r2 = function() {
    return "function" == typeof zlibSync;
  }, n3 = function(r3, n4, a4, h4) {
    var l4 = 4, f4 = s3;
    switch (h4) {
      case t3.image_compression.FAST:
        l4 = 1, f4 = o3;
        break;
      case t3.image_compression.MEDIUM:
        l4 = 6, f4 = c4;
        break;
      case t3.image_compression.SLOW:
        l4 = 9, f4 = u3;
    }
    r3 = i3(r3, n4, a4, f4);
    var d2 = zlibSync(r3, { level: l4 });
    return t3.__addimage__.arrayBufferToBinaryString(d2);
  }, i3 = function(t4, e2, r3, n4) {
    for (var i4, a4, o4, s4 = t4.length / e2, c5 = new Uint8Array(t4.length + s4), u4 = l3(), h4 = 0; h4 < s4; h4 += 1) {
      if (o4 = h4 * e2, i4 = t4.subarray(o4, o4 + e2), n4)
        c5.set(n4(i4, r3, a4), o4 + h4);
      else {
        for (var d2, p3 = u4.length, g2 = []; d2 < p3; d2 += 1)
          g2[d2] = u4[d2](i4, r3, a4);
        var m4 = f3(g2.concat());
        c5.set(g2[m4], o4 + h4);
      }
      a4 = i4;
    }
    return c5;
  }, a3 = function(t4) {
    var e2 = Array.apply([], t4);
    return e2.unshift(0), e2;
  }, o3 = function(t4, e2) {
    var r3, n4 = [], i4 = t4.length;
    n4[0] = 1;
    for (var a4 = 0; a4 < i4; a4 += 1)
      r3 = t4[a4 - e2] || 0, n4[a4 + 1] = t4[a4] - r3 + 256 & 255;
    return n4;
  }, s3 = function(t4, e2, r3) {
    var n4, i4 = [], a4 = t4.length;
    i4[0] = 2;
    for (var o4 = 0; o4 < a4; o4 += 1)
      n4 = r3 && r3[o4] || 0, i4[o4 + 1] = t4[o4] - n4 + 256 & 255;
    return i4;
  }, c4 = function(t4, e2, r3) {
    var n4, i4, a4 = [], o4 = t4.length;
    a4[0] = 3;
    for (var s4 = 0; s4 < o4; s4 += 1)
      n4 = t4[s4 - e2] || 0, i4 = r3 && r3[s4] || 0, a4[s4 + 1] = t4[s4] + 256 - (n4 + i4 >>> 1) & 255;
    return a4;
  }, u3 = function(t4, e2, r3) {
    var n4, i4, a4, o4, s4 = [], c5 = t4.length;
    s4[0] = 4;
    for (var u4 = 0; u4 < c5; u4 += 1)
      n4 = t4[u4 - e2] || 0, i4 = r3 && r3[u4] || 0, a4 = r3 && r3[u4 - e2] || 0, o4 = h3(n4, i4, a4), s4[u4 + 1] = t4[u4] - o4 + 256 & 255;
    return s4;
  }, h3 = function(t4, e2, r3) {
    if (t4 === e2 && e2 === r3)
      return t4;
    var n4 = Math.abs(e2 - r3), i4 = Math.abs(t4 - r3), a4 = Math.abs(t4 + e2 - r3 - r3);
    return n4 <= i4 && n4 <= a4 ? t4 : i4 <= a4 ? e2 : r3;
  }, l3 = function() {
    return [a3, o3, s3, c4, u3];
  }, f3 = function(t4) {
    var e2 = t4.map(function(t5) {
      return t5.reduce(function(t6, e3) {
        return t6 + Math.abs(e3);
      }, 0);
    });
    return e2.indexOf(Math.min.apply(null, e2));
  };
  t3.processPNG = function(e2, i4, a4, o4) {
    var s4, c5, u4, h4, l4, f4, d2, p3, g2, m4, v3, b2, y4, w2, N3, L2 = this.decode.FLATE_DECODE, A3 = "";
    if (this.__addimage__.isArrayBuffer(e2) && (e2 = new Uint8Array(e2)), this.__addimage__.isArrayBufferView(e2)) {
      if (e2 = (u4 = new Kt(e2)).imgData, c5 = u4.bits, s4 = u4.colorSpace, l4 = u4.colors, -1 !== [4, 6].indexOf(u4.colorType)) {
        if (8 === u4.bits) {
          g2 = (p3 = 32 == u4.pixelBitlength ? new Uint32Array(u4.decodePixels().buffer) : 16 == u4.pixelBitlength ? new Uint16Array(u4.decodePixels().buffer) : new Uint8Array(u4.decodePixels().buffer)).length, v3 = new Uint8Array(g2 * u4.colors), m4 = new Uint8Array(g2);
          var x3, S2 = u4.pixelBitlength - u4.bits;
          for (w2 = 0, N3 = 0; w2 < g2; w2++) {
            for (y4 = p3[w2], x3 = 0; x3 < S2; )
              v3[N3++] = y4 >>> x3 & 255, x3 += u4.bits;
            m4[w2] = y4 >>> x3 & 255;
          }
        }
        if (16 === u4.bits) {
          g2 = (p3 = new Uint32Array(u4.decodePixels().buffer)).length, v3 = new Uint8Array(g2 * (32 / u4.pixelBitlength) * u4.colors), m4 = new Uint8Array(g2 * (32 / u4.pixelBitlength)), b2 = u4.colors > 1, w2 = 0, N3 = 0;
          for (var _3 = 0; w2 < g2; )
            y4 = p3[w2++], v3[N3++] = y4 >>> 0 & 255, b2 && (v3[N3++] = y4 >>> 16 & 255, y4 = p3[w2++], v3[N3++] = y4 >>> 0 & 255), m4[_3++] = y4 >>> 16 & 255;
          c5 = 8;
        }
        o4 !== t3.image_compression.NONE && r2() ? (e2 = n3(v3, u4.width * u4.colors, u4.colors, o4), d2 = n3(m4, u4.width, 1, o4)) : (e2 = v3, d2 = m4, L2 = void 0);
      }
      if (3 === u4.colorType && (s4 = this.color_spaces.INDEXED, f4 = u4.palette, u4.transparency.indexed)) {
        var P2 = u4.transparency.indexed, k2 = 0;
        for (w2 = 0, g2 = P2.length; w2 < g2; ++w2)
          k2 += P2[w2];
        if ((k2 /= 255) === g2 - 1 && -1 !== P2.indexOf(0))
          h4 = [P2.indexOf(0)];
        else if (k2 !== g2) {
          for (p3 = u4.decodePixels(), m4 = new Uint8Array(p3.length), w2 = 0, g2 = p3.length; w2 < g2; w2++)
            m4[w2] = P2[p3[w2]];
          d2 = n3(m4, u4.width, 1);
        }
      }
      var I2 = function(e3) {
        var r3;
        switch (e3) {
          case t3.image_compression.FAST:
            r3 = 11;
            break;
          case t3.image_compression.MEDIUM:
            r3 = 13;
            break;
          case t3.image_compression.SLOW:
            r3 = 14;
            break;
          default:
            r3 = 12;
        }
        return r3;
      }(o4);
      return L2 === this.decode.FLATE_DECODE && (A3 = "/Predictor " + I2 + " "), A3 += "/Colors " + l4 + " /BitsPerComponent " + c5 + " /Columns " + u4.width, (this.__addimage__.isArrayBuffer(e2) || this.__addimage__.isArrayBufferView(e2)) && (e2 = this.__addimage__.arrayBufferToBinaryString(e2)), (d2 && this.__addimage__.isArrayBuffer(d2) || this.__addimage__.isArrayBufferView(d2)) && (d2 = this.__addimage__.arrayBufferToBinaryString(d2)), { alias: a4, data: e2, index: i4, filter: L2, decodeParameters: A3, transparency: h4, palette: f4, sMask: d2, predictor: I2, width: u4.width, height: u4.height, bitsPerComponent: c5, colorSpace: s4 };
    }
  };
}(E.API), function(t3) {
  t3.processGIF89A = function(e2, r2, n3, i3) {
    var a3 = new Zt(e2), o3 = a3.width, s3 = a3.height, c4 = [];
    a3.decodeAndBlitFrameRGBA(0, c4);
    var u3 = { data: c4, width: o3, height: s3 }, h3 = new Qt(100).encode(u3, 100);
    return t3.processJPEG.call(this, h3, r2, n3, i3);
  }, t3.processGIF87A = t3.processGIF89A;
}(E.API), te.prototype.parseHeader = function() {
  if (this.fileSize = this.datav.getUint32(this.pos, true), this.pos += 4, this.reserved = this.datav.getUint32(this.pos, true), this.pos += 4, this.offset = this.datav.getUint32(this.pos, true), this.pos += 4, this.headerSize = this.datav.getUint32(this.pos, true), this.pos += 4, this.width = this.datav.getUint32(this.pos, true), this.pos += 4, this.height = this.datav.getInt32(this.pos, true), this.pos += 4, this.planes = this.datav.getUint16(this.pos, true), this.pos += 2, this.bitPP = this.datav.getUint16(this.pos, true), this.pos += 2, this.compress = this.datav.getUint32(this.pos, true), this.pos += 4, this.rawSize = this.datav.getUint32(this.pos, true), this.pos += 4, this.hr = this.datav.getUint32(this.pos, true), this.pos += 4, this.vr = this.datav.getUint32(this.pos, true), this.pos += 4, this.colors = this.datav.getUint32(this.pos, true), this.pos += 4, this.importantColors = this.datav.getUint32(this.pos, true), this.pos += 4, 16 === this.bitPP && this.is_with_alpha && (this.bitPP = 15), this.bitPP < 15) {
    var t3 = 0 === this.colors ? 1 << this.bitPP : this.colors;
    this.palette = new Array(t3);
    for (var e2 = 0; e2 < t3; e2++) {
      var r2 = this.datav.getUint8(this.pos++, true), n3 = this.datav.getUint8(this.pos++, true), i3 = this.datav.getUint8(this.pos++, true), a3 = this.datav.getUint8(this.pos++, true);
      this.palette[e2] = { red: i3, green: n3, blue: r2, quad: a3 };
    }
  }
  this.height < 0 && (this.height *= -1, this.bottom_up = false);
}, te.prototype.parseBGR = function() {
  this.pos = this.offset;
  try {
    var t3 = "bit" + this.bitPP, e2 = this.width * this.height * 4;
    this.data = new Uint8Array(e2), this[t3]();
  } catch (t4) {
    a2.log("bit decode error:" + t4);
  }
}, te.prototype.bit1 = function() {
  var t3, e2 = Math.ceil(this.width / 8), r2 = e2 % 4;
  for (t3 = this.height - 1; t3 >= 0; t3--) {
    for (var n3 = this.bottom_up ? t3 : this.height - 1 - t3, i3 = 0; i3 < e2; i3++)
      for (var a3 = this.datav.getUint8(this.pos++, true), o3 = n3 * this.width * 4 + 8 * i3 * 4, s3 = 0; s3 < 8 && 8 * i3 + s3 < this.width; s3++) {
        var c4 = this.palette[a3 >> 7 - s3 & 1];
        this.data[o3 + 4 * s3] = c4.blue, this.data[o3 + 4 * s3 + 1] = c4.green, this.data[o3 + 4 * s3 + 2] = c4.red, this.data[o3 + 4 * s3 + 3] = 255;
      }
    0 !== r2 && (this.pos += 4 - r2);
  }
}, te.prototype.bit4 = function() {
  for (var t3 = Math.ceil(this.width / 2), e2 = t3 % 4, r2 = this.height - 1; r2 >= 0; r2--) {
    for (var n3 = this.bottom_up ? r2 : this.height - 1 - r2, i3 = 0; i3 < t3; i3++) {
      var a3 = this.datav.getUint8(this.pos++, true), o3 = n3 * this.width * 4 + 2 * i3 * 4, s3 = a3 >> 4, c4 = 15 & a3, u3 = this.palette[s3];
      if (this.data[o3] = u3.blue, this.data[o3 + 1] = u3.green, this.data[o3 + 2] = u3.red, this.data[o3 + 3] = 255, 2 * i3 + 1 >= this.width)
        break;
      u3 = this.palette[c4], this.data[o3 + 4] = u3.blue, this.data[o3 + 4 + 1] = u3.green, this.data[o3 + 4 + 2] = u3.red, this.data[o3 + 4 + 3] = 255;
    }
    0 !== e2 && (this.pos += 4 - e2);
  }
}, te.prototype.bit8 = function() {
  for (var t3 = this.width % 4, e2 = this.height - 1; e2 >= 0; e2--) {
    for (var r2 = this.bottom_up ? e2 : this.height - 1 - e2, n3 = 0; n3 < this.width; n3++) {
      var i3 = this.datav.getUint8(this.pos++, true), a3 = r2 * this.width * 4 + 4 * n3;
      if (i3 < this.palette.length) {
        var o3 = this.palette[i3];
        this.data[a3] = o3.red, this.data[a3 + 1] = o3.green, this.data[a3 + 2] = o3.blue, this.data[a3 + 3] = 255;
      } else
        this.data[a3] = 255, this.data[a3 + 1] = 255, this.data[a3 + 2] = 255, this.data[a3 + 3] = 255;
    }
    0 !== t3 && (this.pos += 4 - t3);
  }
}, te.prototype.bit15 = function() {
  for (var t3 = this.width % 3, e2 = parseInt("11111", 2), r2 = this.height - 1; r2 >= 0; r2--) {
    for (var n3 = this.bottom_up ? r2 : this.height - 1 - r2, i3 = 0; i3 < this.width; i3++) {
      var a3 = this.datav.getUint16(this.pos, true);
      this.pos += 2;
      var o3 = (a3 & e2) / e2 * 255 | 0, s3 = (a3 >> 5 & e2) / e2 * 255 | 0, c4 = (a3 >> 10 & e2) / e2 * 255 | 0, u3 = a3 >> 15 ? 255 : 0, h3 = n3 * this.width * 4 + 4 * i3;
      this.data[h3] = c4, this.data[h3 + 1] = s3, this.data[h3 + 2] = o3, this.data[h3 + 3] = u3;
    }
    this.pos += t3;
  }
}, te.prototype.bit16 = function() {
  for (var t3 = this.width % 3, e2 = parseInt("11111", 2), r2 = parseInt("111111", 2), n3 = this.height - 1; n3 >= 0; n3--) {
    for (var i3 = this.bottom_up ? n3 : this.height - 1 - n3, a3 = 0; a3 < this.width; a3++) {
      var o3 = this.datav.getUint16(this.pos, true);
      this.pos += 2;
      var s3 = (o3 & e2) / e2 * 255 | 0, c4 = (o3 >> 5 & r2) / r2 * 255 | 0, u3 = (o3 >> 11) / e2 * 255 | 0, h3 = i3 * this.width * 4 + 4 * a3;
      this.data[h3] = u3, this.data[h3 + 1] = c4, this.data[h3 + 2] = s3, this.data[h3 + 3] = 255;
    }
    this.pos += t3;
  }
}, te.prototype.bit24 = function() {
  for (var t3 = this.height - 1; t3 >= 0; t3--) {
    for (var e2 = this.bottom_up ? t3 : this.height - 1 - t3, r2 = 0; r2 < this.width; r2++) {
      var n3 = this.datav.getUint8(this.pos++, true), i3 = this.datav.getUint8(this.pos++, true), a3 = this.datav.getUint8(this.pos++, true), o3 = e2 * this.width * 4 + 4 * r2;
      this.data[o3] = a3, this.data[o3 + 1] = i3, this.data[o3 + 2] = n3, this.data[o3 + 3] = 255;
    }
    this.pos += this.width % 4;
  }
}, te.prototype.bit32 = function() {
  for (var t3 = this.height - 1; t3 >= 0; t3--)
    for (var e2 = this.bottom_up ? t3 : this.height - 1 - t3, r2 = 0; r2 < this.width; r2++) {
      var n3 = this.datav.getUint8(this.pos++, true), i3 = this.datav.getUint8(this.pos++, true), a3 = this.datav.getUint8(this.pos++, true), o3 = this.datav.getUint8(this.pos++, true), s3 = e2 * this.width * 4 + 4 * r2;
      this.data[s3] = a3, this.data[s3 + 1] = i3, this.data[s3 + 2] = n3, this.data[s3 + 3] = o3;
    }
}, te.prototype.getData = function() {
  return this.data;
}, /**
 * @license
 * Copyright (c) 2018 Aras Abbasi
 *
 * Licensed under the MIT License.
 * http://opensource.org/licenses/mit-license
 */
function(t3) {
  t3.processBMP = function(e2, r2, n3, i3) {
    var a3 = new te(e2, false), o3 = a3.width, s3 = a3.height, c4 = { data: a3.getData(), width: o3, height: s3 }, u3 = new Qt(100).encode(c4, 100);
    return t3.processJPEG.call(this, u3, r2, n3, i3);
  };
}(E.API), ee.prototype.getData = function() {
  return this.data;
}, /**
 * @license
 * Copyright (c) 2019 Aras Abbasi
 *
 * Licensed under the MIT License.
 * http://opensource.org/licenses/mit-license
 */
function(t3) {
  t3.processWEBP = function(e2, r2, n3, i3) {
    var a3 = new ee(e2, false), o3 = a3.width, s3 = a3.height, c4 = { data: a3.getData(), width: o3, height: s3 }, u3 = new Qt(100).encode(c4, 100);
    return t3.processJPEG.call(this, u3, r2, n3, i3);
  };
}(E.API), E.API.processRGBA = function(t3, e2, r2) {
  for (var n3 = t3.data, i3 = n3.length, a3 = new Uint8Array(i3 / 4 * 3), o3 = new Uint8Array(i3 / 4), s3 = 0, c4 = 0, u3 = 0; u3 < i3; u3 += 4) {
    var h3 = n3[u3], l3 = n3[u3 + 1], f3 = n3[u3 + 2], d2 = n3[u3 + 3];
    a3[s3++] = h3, a3[s3++] = l3, a3[s3++] = f3, o3[c4++] = d2;
  }
  var p3 = this.__addimage__.arrayBufferToBinaryString(a3);
  return { alpha: this.__addimage__.arrayBufferToBinaryString(o3), data: p3, index: e2, alias: r2, colorSpace: "DeviceRGB", bitsPerComponent: 8, width: t3.width, height: t3.height };
}, E.API.setLanguage = function(t3) {
  return void 0 === this.internal.languageSettings && (this.internal.languageSettings = {}, this.internal.languageSettings.isSubscribed = false), void 0 !== { af: "Afrikaans", sq: "Albanian", ar: "Arabic (Standard)", "ar-DZ": "Arabic (Algeria)", "ar-BH": "Arabic (Bahrain)", "ar-EG": "Arabic (Egypt)", "ar-IQ": "Arabic (Iraq)", "ar-JO": "Arabic (Jordan)", "ar-KW": "Arabic (Kuwait)", "ar-LB": "Arabic (Lebanon)", "ar-LY": "Arabic (Libya)", "ar-MA": "Arabic (Morocco)", "ar-OM": "Arabic (Oman)", "ar-QA": "Arabic (Qatar)", "ar-SA": "Arabic (Saudi Arabia)", "ar-SY": "Arabic (Syria)", "ar-TN": "Arabic (Tunisia)", "ar-AE": "Arabic (U.A.E.)", "ar-YE": "Arabic (Yemen)", an: "Aragonese", hy: "Armenian", as: "Assamese", ast: "Asturian", az: "Azerbaijani", eu: "Basque", be: "Belarusian", bn: "Bengali", bs: "Bosnian", br: "Breton", bg: "Bulgarian", my: "Burmese", ca: "Catalan", ch: "Chamorro", ce: "Chechen", zh: "Chinese", "zh-HK": "Chinese (Hong Kong)", "zh-CN": "Chinese (PRC)", "zh-SG": "Chinese (Singapore)", "zh-TW": "Chinese (Taiwan)", cv: "Chuvash", co: "Corsican", cr: "Cree", hr: "Croatian", cs: "Czech", da: "Danish", nl: "Dutch (Standard)", "nl-BE": "Dutch (Belgian)", en: "English", "en-AU": "English (Australia)", "en-BZ": "English (Belize)", "en-CA": "English (Canada)", "en-IE": "English (Ireland)", "en-JM": "English (Jamaica)", "en-NZ": "English (New Zealand)", "en-PH": "English (Philippines)", "en-ZA": "English (South Africa)", "en-TT": "English (Trinidad & Tobago)", "en-GB": "English (United Kingdom)", "en-US": "English (United States)", "en-ZW": "English (Zimbabwe)", eo: "Esperanto", et: "Estonian", fo: "Faeroese", fj: "Fijian", fi: "Finnish", fr: "French (Standard)", "fr-BE": "French (Belgium)", "fr-CA": "French (Canada)", "fr-FR": "French (France)", "fr-LU": "French (Luxembourg)", "fr-MC": "French (Monaco)", "fr-CH": "French (Switzerland)", fy: "Frisian", fur: "Friulian", gd: "Gaelic (Scots)", "gd-IE": "Gaelic (Irish)", gl: "Galacian", ka: "Georgian", de: "German (Standard)", "de-AT": "German (Austria)", "de-DE": "German (Germany)", "de-LI": "German (Liechtenstein)", "de-LU": "German (Luxembourg)", "de-CH": "German (Switzerland)", el: "Greek", gu: "Gujurati", ht: "Haitian", he: "Hebrew", hi: "Hindi", hu: "Hungarian", is: "Icelandic", id: "Indonesian", iu: "Inuktitut", ga: "Irish", it: "Italian (Standard)", "it-CH": "Italian (Switzerland)", ja: "Japanese", kn: "Kannada", ks: "Kashmiri", kk: "Kazakh", km: "Khmer", ky: "Kirghiz", tlh: "Klingon", ko: "Korean", "ko-KP": "Korean (North Korea)", "ko-KR": "Korean (South Korea)", la: "Latin", lv: "Latvian", lt: "Lithuanian", lb: "Luxembourgish", mk: "North Macedonia", ms: "Malay", ml: "Malayalam", mt: "Maltese", mi: "Maori", mr: "Marathi", mo: "Moldavian", nv: "Navajo", ng: "Ndonga", ne: "Nepali", no: "Norwegian", nb: "Norwegian (Bokmal)", nn: "Norwegian (Nynorsk)", oc: "Occitan", or: "Oriya", om: "Oromo", fa: "Persian", "fa-IR": "Persian/Iran", pl: "Polish", pt: "Portuguese", "pt-BR": "Portuguese (Brazil)", pa: "Punjabi", "pa-IN": "Punjabi (India)", "pa-PK": "Punjabi (Pakistan)", qu: "Quechua", rm: "Rhaeto-Romanic", ro: "Romanian", "ro-MO": "Romanian (Moldavia)", ru: "Russian", "ru-MO": "Russian (Moldavia)", sz: "Sami (Lappish)", sg: "Sango", sa: "Sanskrit", sc: "Sardinian", sd: "Sindhi", si: "Singhalese", sr: "Serbian", sk: "Slovak", sl: "Slovenian", so: "Somani", sb: "Sorbian", es: "Spanish", "es-AR": "Spanish (Argentina)", "es-BO": "Spanish (Bolivia)", "es-CL": "Spanish (Chile)", "es-CO": "Spanish (Colombia)", "es-CR": "Spanish (Costa Rica)", "es-DO": "Spanish (Dominican Republic)", "es-EC": "Spanish (Ecuador)", "es-SV": "Spanish (El Salvador)", "es-GT": "Spanish (Guatemala)", "es-HN": "Spanish (Honduras)", "es-MX": "Spanish (Mexico)", "es-NI": "Spanish (Nicaragua)", "es-PA": "Spanish (Panama)", "es-PY": "Spanish (Paraguay)", "es-PE": "Spanish (Peru)", "es-PR": "Spanish (Puerto Rico)", "es-ES": "Spanish (Spain)", "es-UY": "Spanish (Uruguay)", "es-VE": "Spanish (Venezuela)", sx: "Sutu", sw: "Swahili", sv: "Swedish", "sv-FI": "Swedish (Finland)", "sv-SV": "Swedish (Sweden)", ta: "Tamil", tt: "Tatar", te: "Teluga", th: "Thai", tig: "Tigre", ts: "Tsonga", tn: "Tswana", tr: "Turkish", tk: "Turkmen", uk: "Ukrainian", hsb: "Upper Sorbian", ur: "Urdu", ve: "Venda", vi: "Vietnamese", vo: "Volapuk", wa: "Walloon", cy: "Welsh", xh: "Xhosa", ji: "Yiddish", zu: "Zulu" }[t3] && (this.internal.languageSettings.languageCode = t3, false === this.internal.languageSettings.isSubscribed && (this.internal.events.subscribe("putCatalog", function() {
    this.internal.write("/Lang (" + this.internal.languageSettings.languageCode + ")");
  }), this.internal.languageSettings.isSubscribed = true)), this;
}, Vt = E.API, Gt = Vt.getCharWidthsArray = function(e2, r2) {
  var n3, i3, a3 = (r2 = r2 || {}).font || this.internal.getFont(), o3 = r2.fontSize || this.internal.getFontSize(), s3 = r2.charSpace || this.internal.getCharSpace(), c4 = r2.widths ? r2.widths : a3.metadata.Unicode.widths, u3 = c4.fof ? c4.fof : 1, h3 = r2.kerning ? r2.kerning : a3.metadata.Unicode.kerning, l3 = h3.fof ? h3.fof : 1, f3 = false !== r2.doKerning, d2 = 0, p3 = e2.length, g2 = 0, m4 = c4[0] || u3, v3 = [];
  for (n3 = 0; n3 < p3; n3++)
    i3 = e2.charCodeAt(n3), "function" == typeof a3.metadata.widthOfString ? v3.push((a3.metadata.widthOfGlyph(a3.metadata.characterToGlyph(i3)) + s3 * (1e3 / o3) || 0) / 1e3) : (d2 = f3 && "object" === _typeof(h3[i3]) && !isNaN(parseInt(h3[i3][g2], 10)) ? h3[i3][g2] / l3 : 0, v3.push((c4[i3] || m4) / u3 + d2)), g2 = i3;
  return v3;
}, Yt = Vt.getStringUnitWidth = function(t3, e2) {
  var r2 = (e2 = e2 || {}).fontSize || this.internal.getFontSize(), n3 = e2.font || this.internal.getFont(), i3 = e2.charSpace || this.internal.getCharSpace();
  return Vt.processArabic && (t3 = Vt.processArabic(t3)), "function" == typeof n3.metadata.widthOfString ? n3.metadata.widthOfString(t3, r2, i3) / r2 : Gt.apply(this, arguments).reduce(function(t4, e3) {
    return t4 + e3;
  }, 0);
}, Jt = function(t3, e2, r2, n3) {
  for (var i3 = [], a3 = 0, o3 = t3.length, s3 = 0; a3 !== o3 && s3 + e2[a3] < r2; )
    s3 += e2[a3], a3++;
  i3.push(t3.slice(0, a3));
  var c4 = a3;
  for (s3 = 0; a3 !== o3; )
    s3 + e2[a3] > n3 && (i3.push(t3.slice(c4, a3)), s3 = 0, c4 = a3), s3 += e2[a3], a3++;
  return c4 !== a3 && i3.push(t3.slice(c4, a3)), i3;
}, Xt = function(t3, e2, r2) {
  r2 || (r2 = {});
  var n3, i3, a3, o3, s3, c4, u3, h3 = [], l3 = [h3], f3 = r2.textIndent || 0, d2 = 0, p3 = 0, g2 = t3.split(" "), m4 = Gt.apply(this, [" ", r2])[0];
  if (c4 = -1 === r2.lineIndent ? g2[0].length + 2 : r2.lineIndent || 0) {
    var v3 = Array(c4).join(" "), b2 = [];
    g2.map(function(t4) {
      (t4 = t4.split(/\s*\n/)).length > 1 ? b2 = b2.concat(t4.map(function(t5, e3) {
        return (e3 && t5.length ? "\n" : "") + t5;
      })) : b2.push(t4[0]);
    }), g2 = b2, c4 = Yt.apply(this, [v3, r2]);
  }
  for (a3 = 0, o3 = g2.length; a3 < o3; a3++) {
    var y4 = 0;
    if (n3 = g2[a3], c4 && "\n" == n3[0] && (n3 = n3.substr(1), y4 = 1), f3 + d2 + (p3 = (i3 = Gt.apply(this, [n3, r2])).reduce(function(t4, e3) {
      return t4 + e3;
    }, 0)) > e2 || y4) {
      if (p3 > e2) {
        for (s3 = Jt.apply(this, [n3, i3, e2 - (f3 + d2), e2]), h3.push(s3.shift()), h3 = [s3.pop()]; s3.length; )
          l3.push([s3.shift()]);
        p3 = i3.slice(n3.length - (h3[0] ? h3[0].length : 0)).reduce(function(t4, e3) {
          return t4 + e3;
        }, 0);
      } else
        h3 = [n3];
      l3.push(h3), f3 = p3 + c4, d2 = m4;
    } else
      h3.push(n3), f3 += d2 + p3, d2 = m4;
  }
  return u3 = c4 ? function(t4, e3) {
    return (e3 ? v3 : "") + t4.join(" ");
  } : function(t4) {
    return t4.join(" ");
  }, l3.map(u3);
}, Vt.splitTextToSize = function(t3, e2, r2) {
  var n3, i3 = (r2 = r2 || {}).fontSize || this.internal.getFontSize(), a3 = function(t4) {
    if (t4.widths && t4.kerning)
      return { widths: t4.widths, kerning: t4.kerning };
    var e3 = this.internal.getFont(t4.fontName, t4.fontStyle);
    return e3.metadata.Unicode ? { widths: e3.metadata.Unicode.widths || { 0: 1 }, kerning: e3.metadata.Unicode.kerning || {} } : { font: e3.metadata, fontSize: this.internal.getFontSize(), charSpace: this.internal.getCharSpace() };
  }.call(this, r2);
  n3 = Array.isArray(t3) ? t3 : String(t3).split(/\r?\n/);
  var o3 = 1 * this.internal.scaleFactor * e2 / i3;
  a3.textIndent = r2.textIndent ? 1 * r2.textIndent * this.internal.scaleFactor / i3 : 0, a3.lineIndent = r2.lineIndent;
  var s3, c4, u3 = [];
  for (s3 = 0, c4 = n3.length; s3 < c4; s3++)
    u3 = u3.concat(Xt.apply(this, [n3[s3], o3, a3]));
  return u3;
}, function(e2) {
  e2.__fontmetrics__ = e2.__fontmetrics__ || {};
  for (var r2 = "klmnopqrstuvwxyz", n3 = {}, i3 = {}, a3 = 0; a3 < r2.length; a3++)
    n3[r2[a3]] = "0123456789abcdef"[a3], i3["0123456789abcdef"[a3]] = r2[a3];
  var o3 = function(t3) {
    return "0x" + parseInt(t3, 10).toString(16);
  }, s3 = e2.__fontmetrics__.compress = function(e3) {
    var r3, n4, a4, c5, u4 = ["{"];
    for (var h4 in e3) {
      if (r3 = e3[h4], isNaN(parseInt(h4, 10)) ? n4 = "'" + h4 + "'" : (h4 = parseInt(h4, 10), n4 = (n4 = o3(h4).slice(2)).slice(0, -1) + i3[n4.slice(-1)]), "number" == typeof r3)
        r3 < 0 ? (a4 = o3(r3).slice(3), c5 = "-") : (a4 = o3(r3).slice(2), c5 = ""), a4 = c5 + a4.slice(0, -1) + i3[a4.slice(-1)];
      else {
        if ("object" !== _typeof(r3))
          throw new Error("Don't know what to do with value type " + _typeof(r3) + ".");
        a4 = s3(r3);
      }
      u4.push(n4 + a4);
    }
    return u4.push("}"), u4.join("");
  }, c4 = e2.__fontmetrics__.uncompress = function(t3) {
    if ("string" != typeof t3)
      throw new Error("Invalid argument passed to uncompress.");
    for (var e3, r3, i4, a4, o4 = {}, s4 = 1, c5 = o4, u4 = [], h4 = "", l4 = "", f3 = t3.length - 1, d2 = 1; d2 < f3; d2 += 1)
      "'" == (a4 = t3[d2]) ? e3 ? (i4 = e3.join(""), e3 = void 0) : e3 = [] : e3 ? e3.push(a4) : "{" == a4 ? (u4.push([c5, i4]), c5 = {}, i4 = void 0) : "}" == a4 ? ((r3 = u4.pop())[0][r3[1]] = c5, i4 = void 0, c5 = r3[0]) : "-" == a4 ? s4 = -1 : void 0 === i4 ? n3.hasOwnProperty(a4) ? (h4 += n3[a4], i4 = parseInt(h4, 16) * s4, s4 = 1, h4 = "") : h4 += a4 : n3.hasOwnProperty(a4) ? (l4 += n3[a4], c5[i4] = parseInt(l4, 16) * s4, s4 = 1, i4 = void 0, l4 = "") : l4 += a4;
    return o4;
  }, u3 = { codePages: ["WinAnsiEncoding"], WinAnsiEncoding: c4("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}") }, h3 = { Unicode: { Courier: u3, "Courier-Bold": u3, "Courier-BoldOblique": u3, "Courier-Oblique": u3, Helvetica: u3, "Helvetica-Bold": u3, "Helvetica-BoldOblique": u3, "Helvetica-Oblique": u3, "Times-Roman": u3, "Times-Bold": u3, "Times-BoldItalic": u3, "Times-Italic": u3 } }, l3 = { Unicode: { "Courier-Oblique": c4("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"), "Times-BoldItalic": c4("{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}"), "Helvetica-Bold": c4("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"), Courier: c4("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"), "Courier-BoldOblique": c4("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"), "Times-Bold": c4("{'widths'{k3q2q5ncx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2l202m2n2n3m2o3m2p6o202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5x4l4s4m4m4n4s4o4s4p4m4q3x4r4y4s4y4t2r4u3m4v4y4w4m4x5y4y4s4z4y5k3x5l4y5m4s5n3r5o4m5p4s5q4s5r6o5s4s5t4s5u4m5v2l5w1w5x2l5y3u5z3m6k2l6l3m6m3r6n2w6o3r6p2w6q2l6r3m6s3r6t1w6u2l6v3r6w1w6x5n6y3r6z3m7k3r7l3r7m2w7n2r7o2l7p3r7q3m7r4s7s3m7t3m7u2w7v2r7w1q7x2r7y3o202l3mcl4sal2lam3man3mao3map3mar3mas2lat4uau1yav3maw3tay4uaz2lbk2sbl3t'fof'6obo2lbp3rbr1tbs2lbu2lbv3mbz3mck4s202k3mcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3rek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3m3u2l17s4s19m3m}'kerning'{cl{4qt5ks5ot5qy5rw17sv5tv}201t{cks4lscmscnscoscpscls4wv}2k{201ts}2w{4qu5ku7mu5os5qx5ru17su5tu}2x{17su5tu5ou5qs}2y{4qv5kv7mu5ot5qz5ru17su5tu}'fof'-6o7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qu}3v{17su5tu5os5qu}fu{17su5tu5ou5qu}7p{17su5tu5ou5qu}ck{4qt5ks5ot5qy5rw17sv5tv}4l{4qt5ks5ot5qy5rw17sv5tv}cm{4qt5ks5ot5qy5rw17sv5tv}cn{4qt5ks5ot5qy5rw17sv5tv}co{4qt5ks5ot5qy5rw17sv5tv}cp{4qt5ks5ot5qy5rw17sv5tv}6l{17st5tt5ou5qu}17s{ckuclucmucnucoucpu4lu4wu}5o{ckuclucmucnucoucpu4lu4wu}5q{ckzclzcmzcnzcozcpz4lz4wu}5r{ckxclxcmxcnxcoxcpx4lx4wu}5t{ckuclucmucnucoucpu4lu4wu}7q{ckuclucmucnucoucpu4lu}6p{17sw5tw5ou5qu}ek{17st5tt5qu}el{17st5tt5ou5qu}em{17st5tt5qu}en{17st5tt5qu}eo{17st5tt5qu}ep{17st5tt5ou5qu}es{17ss5ts5qu}et{17sw5tw5ou5qu}eu{17sw5tw5ou5qu}ev{17ss5ts5qu}6z{17sw5tw5ou5qu5rs}fm{17sw5tw5ou5qu5rs}fn{17sw5tw5ou5qu5rs}fo{17sw5tw5ou5qu5rs}fp{17sw5tw5ou5qu5rs}fq{17sw5tw5ou5qu5rs}7r{cktcltcmtcntcotcpt4lt5os}fs{17sw5tw5ou5qu5rs}ft{17su5tu5ou5qu}7m{5os}fv{17su5tu5ou5qu}fw{17su5tu5ou5qu}fz{cksclscmscnscoscps4ls}}}"), Symbol: c4("{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}"), Helvetica: c4("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}"), "Helvetica-BoldOblique": c4("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"), ZapfDingbats: c4("{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}"), "Courier-Bold": c4("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"), "Times-Italic": c4("{'widths'{k3n2q4ycx2l201n3m201o5t201s2l201t2l201u2l201w3r201x3r201y3r2k1t2l2l202m2n2n3m2o3m2p5n202q5t2r1p2s2l2t2l2u3m2v4n2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w4n3x4n3y4n3z3m4k5w4l3x4m3x4n4m4o4s4p3x4q3x4r4s4s4s4t2l4u2w4v4m4w3r4x5n4y4m4z4s5k3x5l4s5m3x5n3m5o3r5p4s5q3x5r5n5s3x5t3r5u3r5v2r5w1w5x2r5y2u5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q1w6r3m6s3m6t1w6u1w6v2w6w1w6x4s6y3m6z3m7k3m7l3m7m2r7n2r7o1w7p3m7q2w7r4m7s2w7t2w7u2r7v2s7w1v7x2s7y3q202l3mcl3xal2ram3man3mao3map3mar3mas2lat4wau1vav3maw4nay4waz2lbk2sbl4n'fof'6obo2lbp3mbq3obr1tbs2lbu1zbv3mbz3mck3x202k3mcm3xcn3xco3xcp3xcq5tcr4mcs3xct3xcu3xcv3xcw2l2m2ucy2lcz2ldl4mdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr4nfs3mft3mfu3mfv3mfw3mfz2w203k6o212m6m2dw2l2cq2l3t3m3u2l17s3r19m3m}'kerning'{cl{5kt4qw}201s{201sw}201t{201tw2wy2yy6q-t}201x{2wy2yy}2k{201tw}2w{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}2x{17ss5ts5os}2y{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}'fof'-6o6t{17ss5ts5qs}7t{5os}3v{5qs}7p{17su5tu5qs}ck{5kt4qw}4l{5kt4qw}cm{5kt4qw}cn{5kt4qw}co{5kt4qw}cp{5kt4qw}6l{4qs5ks5ou5qw5ru17su5tu}17s{2ks}5q{ckvclvcmvcnvcovcpv4lv}5r{ckuclucmucnucoucpu4lu}5t{2ks}6p{4qs5ks5ou5qw5ru17su5tu}ek{4qs5ks5ou5qw5ru17su5tu}el{4qs5ks5ou5qw5ru17su5tu}em{4qs5ks5ou5qw5ru17su5tu}en{4qs5ks5ou5qw5ru17su5tu}eo{4qs5ks5ou5qw5ru17su5tu}ep{4qs5ks5ou5qw5ru17su5tu}es{5ks5qs4qs}et{4qs5ks5ou5qw5ru17su5tu}eu{4qs5ks5qw5ru17su5tu}ev{5ks5qs4qs}ex{17ss5ts5qs}6z{4qv5ks5ou5qw5ru17su5tu}fm{4qv5ks5ou5qw5ru17su5tu}fn{4qv5ks5ou5qw5ru17su5tu}fo{4qv5ks5ou5qw5ru17su5tu}fp{4qv5ks5ou5qw5ru17su5tu}fq{4qv5ks5ou5qw5ru17su5tu}7r{5os}fs{4qv5ks5ou5qw5ru17su5tu}ft{17su5tu5qs}fu{17su5tu5qs}fv{17su5tu5qs}fw{17su5tu5qs}}}"), "Times-Roman": c4("{'widths'{k3n2q4ycx2l201n3m201o6o201s2l201t2l201u2l201w2w201x2w201y2w2k1t2l2l202m2n2n3m2o3m2p5n202q6o2r1m2s2l2t2l2u3m2v3s2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v1w3w3s3x3s3y3s3z2w4k5w4l4s4m4m4n4m4o4s4p3x4q3r4r4s4s4s4t2l4u2r4v4s4w3x4x5t4y4s4z4s5k3r5l4s5m4m5n3r5o3x5p4s5q4s5r5y5s4s5t4s5u3x5v2l5w1w5x2l5y2z5z3m6k2l6l2w6m3m6n2w6o3m6p2w6q2l6r3m6s3m6t1w6u1w6v3m6w1w6x4y6y3m6z3m7k3m7l3m7m2l7n2r7o1w7p3m7q3m7r4s7s3m7t3m7u2w7v3k7w1o7x3k7y3q202l3mcl4sal2lam3man3mao3map3mar3mas2lat4wau1vav3maw3say4waz2lbk2sbl3s'fof'6obo2lbp3mbq2xbr1tbs2lbu1zbv3mbz2wck4s202k3mcm4scn4sco4scp4scq5tcr4mcs3xct3xcu3xcv3xcw2l2m2tcy2lcz2ldl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek2wel2wem2wen2weo2wep2weq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr3sfs3mft3mfu3mfv3mfw3mfz3m203k6o212m6m2dw2l2cq2l3t3m3u1w17s4s19m3m}'kerning'{cl{4qs5ku17sw5ou5qy5rw201ss5tw201ws}201s{201ss}201t{ckw4lwcmwcnwcowcpwclw4wu201ts}2k{201ts}2w{4qs5kw5os5qx5ru17sx5tx}2x{17sw5tw5ou5qu}2y{4qs5kw5os5qx5ru17sx5tx}'fof'-6o7t{ckuclucmucnucoucpu4lu5os5rs}3u{17su5tu5qs}3v{17su5tu5qs}7p{17sw5tw5qs}ck{4qs5ku17sw5ou5qy5rw201ss5tw201ws}4l{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cm{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cn{4qs5ku17sw5ou5qy5rw201ss5tw201ws}co{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cp{4qs5ku17sw5ou5qy5rw201ss5tw201ws}6l{17su5tu5os5qw5rs}17s{2ktclvcmvcnvcovcpv4lv4wuckv}5o{ckwclwcmwcnwcowcpw4lw4wu}5q{ckyclycmycnycoycpy4ly4wu5ms}5r{cktcltcmtcntcotcpt4lt4ws}5t{2ktclvcmvcnvcovcpv4lv4wuckv}7q{cksclscmscnscoscps4ls}6p{17su5tu5qw5rs}ek{5qs5rs}el{17su5tu5os5qw5rs}em{17su5tu5os5qs5rs}en{17su5qs5rs}eo{5qs5rs}ep{17su5tu5os5qw5rs}es{5qs}et{17su5tu5qw5rs}eu{17su5tu5qs5rs}ev{5qs}6z{17sv5tv5os5qx5rs}fm{5os5qt5rs}fn{17sv5tv5os5qx5rs}fo{17sv5tv5os5qx5rs}fp{5os5qt5rs}fq{5os5qt5rs}7r{ckuclucmucnucoucpu4lu5os}fs{17sv5tv5os5qx5rs}ft{17ss5ts5qs}fu{17sw5tw5qs}fv{17sw5tw5qs}fw{17ss5ts5qs}fz{ckuclucmucnucoucpu4lu5os5rs}}}"), "Helvetica-Oblique": c4("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}") } };
  e2.events.push(["addFont", function(t3) {
    var e3 = t3.font, r3 = l3.Unicode[e3.postScriptName];
    r3 && (e3.metadata.Unicode = {}, e3.metadata.Unicode.widths = r3.widths, e3.metadata.Unicode.kerning = r3.kerning);
    var n4 = h3.Unicode[e3.postScriptName];
    n4 && (e3.metadata.Unicode.encoding = n4, e3.encoding = n4.codePages[0]);
  }]);
}(E.API), /**
 * @license
 * Licensed under the MIT License.
 * http://opensource.org/licenses/mit-license
 */
function(t3) {
  var e2 = function(t4) {
    for (var e3 = t4.length, r2 = new Uint8Array(e3), n3 = 0; n3 < e3; n3++)
      r2[n3] = t4.charCodeAt(n3);
    return r2;
  };
  t3.API.events.push(["addFont", function(r2) {
    var n3 = void 0, i3 = r2.font, a3 = r2.instance;
    if (!i3.isStandardFont) {
      if (void 0 === a3)
        throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('" + i3.postScriptName + "').");
      if ("string" != typeof (n3 = false === a3.existsFileInVFS(i3.postScriptName) ? a3.loadFile(i3.postScriptName) : a3.getFileFromVFS(i3.postScriptName)))
        throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('" + i3.postScriptName + "').");
      !function(r3, n4) {
        n4 = /^\x00\x01\x00\x00/.test(n4) ? e2(n4) : e2(u2(n4)), r3.metadata = t3.API.TTFFont.open(n4), r3.metadata.Unicode = r3.metadata.Unicode || { encoding: {}, kerning: {}, widths: [] }, r3.metadata.glyIdsUsed = [0];
      }(i3, n3);
    }
  }]);
}(E), /** @license
 * Copyright (c) 2012 Willow Systems Corporation, https://github.com/willowsystems
 *
 * Permission is hereby granted, free of charge, to any person obtaining
 * a copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including
 * without limitation the rights to use, copy, modify, merge, publish,
 * distribute, sublicense, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject to
 * the following conditions:
 *
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 * ====================================================================
 */
function(t3) {
  function e2() {
    return (n2.canvg ? Promise.resolve(n2.canvg) : Promise.resolve().then(() => (init_index_es(), index_es_exports))).catch(function(t4) {
      return Promise.reject(new Error("Could not load canvg: " + t4));
    }).then(function(t4) {
      return t4.default ? t4.default : t4;
    });
  }
  E.API.addSvgAsImage = function(t4, r2, n3, i3, o3, s3, c4, u3) {
    if (isNaN(r2) || isNaN(n3))
      throw a2.error("jsPDF.addSvgAsImage: Invalid coordinates", arguments), new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");
    if (isNaN(i3) || isNaN(o3))
      throw a2.error("jsPDF.addSvgAsImage: Invalid measurements", arguments), new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");
    var h3 = document.createElement("canvas");
    h3.width = i3, h3.height = o3;
    var l3 = h3.getContext("2d");
    l3.fillStyle = "#fff", l3.fillRect(0, 0, h3.width, h3.height);
    var f3 = { ignoreMouse: true, ignoreAnimation: true, ignoreDimensions: true }, d2 = this;
    return e2().then(function(e3) {
      return e3.fromString(l3, t4, f3);
    }, function() {
      return Promise.reject(new Error("Could not load canvg."));
    }).then(function(t5) {
      return t5.render(f3);
    }).then(function() {
      d2.addImage(h3.toDataURL("image/jpeg", 1), r2, n3, i3, o3, c4, u3);
    });
  };
}(), E.API.putTotalPages = function(t3) {
  var e2, r2 = 0;
  parseInt(this.internal.getFont().id.substr(1), 10) < 15 ? (e2 = new RegExp(t3, "g"), r2 = this.internal.getNumberOfPages()) : (e2 = new RegExp(this.pdfEscape16(t3, this.internal.getFont()), "g"), r2 = this.pdfEscape16(this.internal.getNumberOfPages() + "", this.internal.getFont()));
  for (var n3 = 1; n3 <= this.internal.getNumberOfPages(); n3++)
    for (var i3 = 0; i3 < this.internal.pages[n3].length; i3++)
      this.internal.pages[n3][i3] = this.internal.pages[n3][i3].replace(e2, r2);
  return this;
}, E.API.viewerPreferences = function(e2, r2) {
  var n3;
  e2 = e2 || {}, r2 = r2 || false;
  var i3, a3, o3, s3 = { HideToolbar: { defaultValue: false, value: false, type: "boolean", explicitSet: false, valueSet: [true, false], pdfVersion: 1.3 }, HideMenubar: { defaultValue: false, value: false, type: "boolean", explicitSet: false, valueSet: [true, false], pdfVersion: 1.3 }, HideWindowUI: { defaultValue: false, value: false, type: "boolean", explicitSet: false, valueSet: [true, false], pdfVersion: 1.3 }, FitWindow: { defaultValue: false, value: false, type: "boolean", explicitSet: false, valueSet: [true, false], pdfVersion: 1.3 }, CenterWindow: { defaultValue: false, value: false, type: "boolean", explicitSet: false, valueSet: [true, false], pdfVersion: 1.3 }, DisplayDocTitle: { defaultValue: false, value: false, type: "boolean", explicitSet: false, valueSet: [true, false], pdfVersion: 1.4 }, NonFullScreenPageMode: { defaultValue: "UseNone", value: "UseNone", type: "name", explicitSet: false, valueSet: ["UseNone", "UseOutlines", "UseThumbs", "UseOC"], pdfVersion: 1.3 }, Direction: { defaultValue: "L2R", value: "L2R", type: "name", explicitSet: false, valueSet: ["L2R", "R2L"], pdfVersion: 1.3 }, ViewArea: { defaultValue: "CropBox", value: "CropBox", type: "name", explicitSet: false, valueSet: ["MediaBox", "CropBox", "TrimBox", "BleedBox", "ArtBox"], pdfVersion: 1.4 }, ViewClip: { defaultValue: "CropBox", value: "CropBox", type: "name", explicitSet: false, valueSet: ["MediaBox", "CropBox", "TrimBox", "BleedBox", "ArtBox"], pdfVersion: 1.4 }, PrintArea: { defaultValue: "CropBox", value: "CropBox", type: "name", explicitSet: false, valueSet: ["MediaBox", "CropBox", "TrimBox", "BleedBox", "ArtBox"], pdfVersion: 1.4 }, PrintClip: { defaultValue: "CropBox", value: "CropBox", type: "name", explicitSet: false, valueSet: ["MediaBox", "CropBox", "TrimBox", "BleedBox", "ArtBox"], pdfVersion: 1.4 }, PrintScaling: { defaultValue: "AppDefault", value: "AppDefault", type: "name", explicitSet: false, valueSet: ["AppDefault", "None"], pdfVersion: 1.6 }, Duplex: { defaultValue: "", value: "none", type: "name", explicitSet: false, valueSet: ["Simplex", "DuplexFlipShortEdge", "DuplexFlipLongEdge", "none"], pdfVersion: 1.7 }, PickTrayByPDFSize: { defaultValue: false, value: false, type: "boolean", explicitSet: false, valueSet: [true, false], pdfVersion: 1.7 }, PrintPageRange: { defaultValue: "", value: "", type: "array", explicitSet: false, valueSet: null, pdfVersion: 1.7 }, NumCopies: { defaultValue: 1, value: 1, type: "integer", explicitSet: false, valueSet: null, pdfVersion: 1.7 } }, c4 = Object.keys(s3), u3 = [], h3 = 0, l3 = 0, f3 = 0;
  function d2(t3, e3) {
    var r3, n4 = false;
    for (r3 = 0; r3 < t3.length; r3 += 1)
      t3[r3] === e3 && (n4 = true);
    return n4;
  }
  if (void 0 === this.internal.viewerpreferences && (this.internal.viewerpreferences = {}, this.internal.viewerpreferences.configuration = JSON.parse(JSON.stringify(s3)), this.internal.viewerpreferences.isSubscribed = false), n3 = this.internal.viewerpreferences.configuration, "reset" === e2 || true === r2) {
    var p3 = c4.length;
    for (f3 = 0; f3 < p3; f3 += 1)
      n3[c4[f3]].value = n3[c4[f3]].defaultValue, n3[c4[f3]].explicitSet = false;
  }
  if ("object" === _typeof(e2)) {
    for (a3 in e2)
      if (o3 = e2[a3], d2(c4, a3) && void 0 !== o3) {
        if ("boolean" === n3[a3].type && "boolean" == typeof o3)
          n3[a3].value = o3;
        else if ("name" === n3[a3].type && d2(n3[a3].valueSet, o3))
          n3[a3].value = o3;
        else if ("integer" === n3[a3].type && Number.isInteger(o3))
          n3[a3].value = o3;
        else if ("array" === n3[a3].type) {
          for (h3 = 0; h3 < o3.length; h3 += 1)
            if (i3 = true, 1 === o3[h3].length && "number" == typeof o3[h3][0])
              u3.push(String(o3[h3] - 1));
            else if (o3[h3].length > 1) {
              for (l3 = 0; l3 < o3[h3].length; l3 += 1)
                "number" != typeof o3[h3][l3] && (i3 = false);
              true === i3 && u3.push([o3[h3][0] - 1, o3[h3][1] - 1].join(" "));
            }
          n3[a3].value = "[" + u3.join(" ") + "]";
        } else
          n3[a3].value = n3[a3].defaultValue;
        n3[a3].explicitSet = true;
      }
  }
  return false === this.internal.viewerpreferences.isSubscribed && (this.internal.events.subscribe("putCatalog", function() {
    var t3, e3 = [];
    for (t3 in n3)
      true === n3[t3].explicitSet && ("name" === n3[t3].type ? e3.push("/" + t3 + " /" + n3[t3].value) : e3.push("/" + t3 + " " + n3[t3].value));
    0 !== e3.length && this.internal.write("/ViewerPreferences\n<<\n" + e3.join("\n") + "\n>>");
  }), this.internal.viewerpreferences.isSubscribed = true), this.internal.viewerpreferences.configuration = n3, this;
}, /** ====================================================================
 * @license
 * jsPDF XMP metadata plugin
 * Copyright (c) 2016 Jussi Utunen, u-jussi@suomi24.fi
 *
 * Permission is hereby granted, free of charge, to any person obtaining
 * a copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including
 * without limitation the rights to use, copy, modify, merge, publish,
 * distribute, sublicense, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject to
 * the following conditions:
 *
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 * ====================================================================
 */
function(t3) {
  var e2 = function() {
    var t4 = '<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="" xmlns:jspdf="' + this.internal.__metadata__.namespaceuri + '"><jspdf:metadata>', e3 = unescape(encodeURIComponent('<x:xmpmeta xmlns:x="adobe:ns:meta/">')), r3 = unescape(encodeURIComponent(t4)), n3 = unescape(encodeURIComponent(this.internal.__metadata__.metadata)), i3 = unescape(encodeURIComponent("</jspdf:metadata></rdf:Description></rdf:RDF>")), a3 = unescape(encodeURIComponent("</x:xmpmeta>")), o3 = r3.length + n3.length + i3.length + e3.length + a3.length;
    this.internal.__metadata__.metadata_object_number = this.internal.newObject(), this.internal.write("<< /Type /Metadata /Subtype /XML /Length " + o3 + " >>"), this.internal.write("stream"), this.internal.write(e3 + r3 + n3 + i3 + a3), this.internal.write("endstream"), this.internal.write("endobj");
  }, r2 = function() {
    this.internal.__metadata__.metadata_object_number && this.internal.write("/Metadata " + this.internal.__metadata__.metadata_object_number + " 0 R");
  };
  t3.addMetadata = function(t4, n3) {
    return void 0 === this.internal.__metadata__ && (this.internal.__metadata__ = { metadata: t4, namespaceuri: n3 || "http://jspdf.default.namespaceuri/" }, this.internal.events.subscribe("putCatalog", r2), this.internal.events.subscribe("postPutResources", e2)), this;
  };
}(E.API), function(t3) {
  var e2 = t3.API, r2 = e2.pdfEscape16 = function(t4, e3) {
    for (var r3, n4 = e3.metadata.Unicode.widths, i4 = ["", "0", "00", "000", "0000"], a3 = [""], o3 = 0, s3 = t4.length; o3 < s3; ++o3) {
      if (r3 = e3.metadata.characterToGlyph(t4.charCodeAt(o3)), e3.metadata.glyIdsUsed.push(r3), e3.metadata.toUnicode[r3] = t4.charCodeAt(o3), -1 == n4.indexOf(r3) && (n4.push(r3), n4.push([parseInt(e3.metadata.widthOfGlyph(r3), 10)])), "0" == r3)
        return a3.join("");
      r3 = r3.toString(16), a3.push(i4[4 - r3.length], r3);
    }
    return a3.join("");
  }, n3 = function(t4) {
    var e3, r3, n4, i4, a3, o3, s3;
    for (a3 = "/CIDInit /ProcSet findresource begin\n12 dict begin\nbegincmap\n/CIDSystemInfo <<\n  /Registry (Adobe)\n  /Ordering (UCS)\n  /Supplement 0\n>> def\n/CMapName /Adobe-Identity-UCS def\n/CMapType 2 def\n1 begincodespacerange\n<0000><ffff>\nendcodespacerange", n4 = [], o3 = 0, s3 = (r3 = Object.keys(t4).sort(function(t5, e4) {
      return t5 - e4;
    })).length; o3 < s3; o3++)
      e3 = r3[o3], n4.length >= 100 && (a3 += "\n" + n4.length + " beginbfchar\n" + n4.join("\n") + "\nendbfchar", n4 = []), void 0 !== t4[e3] && null !== t4[e3] && "function" == typeof t4[e3].toString && (i4 = ("0000" + t4[e3].toString(16)).slice(-4), e3 = ("0000" + (+e3).toString(16)).slice(-4), n4.push("<" + e3 + "><" + i4 + ">"));
    return n4.length && (a3 += "\n" + n4.length + " beginbfchar\n" + n4.join("\n") + "\nendbfchar\n"), a3 += "endcmap\nCMapName currentdict /CMap defineresource pop\nend\nend";
  };
  e2.events.push(["putFont", function(e3) {
    !function(e4) {
      var r3 = e4.font, i4 = e4.out, a3 = e4.newObject, o3 = e4.putStream;
      if (r3.metadata instanceof t3.API.TTFFont && "Identity-H" === r3.encoding) {
        for (var s3 = r3.metadata.Unicode.widths, c4 = r3.metadata.subset.encode(r3.metadata.glyIdsUsed, 1), u3 = "", h3 = 0; h3 < c4.length; h3++)
          u3 += String.fromCharCode(c4[h3]);
        var l3 = a3();
        o3({ data: u3, addLength1: true, objectId: l3 }), i4("endobj");
        var f3 = a3();
        o3({ data: n3(r3.metadata.toUnicode), addLength1: true, objectId: f3 }), i4("endobj");
        var d2 = a3();
        i4("<<"), i4("/Type /FontDescriptor"), i4("/FontName /" + F(r3.fontName)), i4("/FontFile2 " + l3 + " 0 R"), i4("/FontBBox " + t3.API.PDFObject.convert(r3.metadata.bbox)), i4("/Flags " + r3.metadata.flags), i4("/StemV " + r3.metadata.stemV), i4("/ItalicAngle " + r3.metadata.italicAngle), i4("/Ascent " + r3.metadata.ascender), i4("/Descent " + r3.metadata.decender), i4("/CapHeight " + r3.metadata.capHeight), i4(">>"), i4("endobj");
        var p3 = a3();
        i4("<<"), i4("/Type /Font"), i4("/BaseFont /" + F(r3.fontName)), i4("/FontDescriptor " + d2 + " 0 R"), i4("/W " + t3.API.PDFObject.convert(s3)), i4("/CIDToGIDMap /Identity"), i4("/DW 1000"), i4("/Subtype /CIDFontType2"), i4("/CIDSystemInfo"), i4("<<"), i4("/Supplement 0"), i4("/Registry (Adobe)"), i4("/Ordering (" + r3.encoding + ")"), i4(">>"), i4(">>"), i4("endobj"), r3.objectNumber = a3(), i4("<<"), i4("/Type /Font"), i4("/Subtype /Type0"), i4("/ToUnicode " + f3 + " 0 R"), i4("/BaseFont /" + F(r3.fontName)), i4("/Encoding /" + r3.encoding), i4("/DescendantFonts [" + p3 + " 0 R]"), i4(">>"), i4("endobj"), r3.isAlreadyPutted = true;
      }
    }(e3);
  }]);
  e2.events.push(["putFont", function(e3) {
    !function(e4) {
      var r3 = e4.font, i4 = e4.out, a3 = e4.newObject, o3 = e4.putStream;
      if (r3.metadata instanceof t3.API.TTFFont && "WinAnsiEncoding" === r3.encoding) {
        for (var s3 = r3.metadata.rawData, c4 = "", u3 = 0; u3 < s3.length; u3++)
          c4 += String.fromCharCode(s3[u3]);
        var h3 = a3();
        o3({ data: c4, addLength1: true, objectId: h3 }), i4("endobj");
        var l3 = a3();
        o3({ data: n3(r3.metadata.toUnicode), addLength1: true, objectId: l3 }), i4("endobj");
        var f3 = a3();
        i4("<<"), i4("/Descent " + r3.metadata.decender), i4("/CapHeight " + r3.metadata.capHeight), i4("/StemV " + r3.metadata.stemV), i4("/Type /FontDescriptor"), i4("/FontFile2 " + h3 + " 0 R"), i4("/Flags 96"), i4("/FontBBox " + t3.API.PDFObject.convert(r3.metadata.bbox)), i4("/FontName /" + F(r3.fontName)), i4("/ItalicAngle " + r3.metadata.italicAngle), i4("/Ascent " + r3.metadata.ascender), i4(">>"), i4("endobj"), r3.objectNumber = a3();
        for (var d2 = 0; d2 < r3.metadata.hmtx.widths.length; d2++)
          r3.metadata.hmtx.widths[d2] = parseInt(r3.metadata.hmtx.widths[d2] * (1e3 / r3.metadata.head.unitsPerEm));
        i4("<</Subtype/TrueType/Type/Font/ToUnicode " + l3 + " 0 R/BaseFont/" + F(r3.fontName) + "/FontDescriptor " + f3 + " 0 R/Encoding/" + r3.encoding + " /FirstChar 29 /LastChar 255 /Widths " + t3.API.PDFObject.convert(r3.metadata.hmtx.widths) + ">>"), i4("endobj"), r3.isAlreadyPutted = true;
      }
    }(e3);
  }]);
  var i3 = function(t4) {
    var e3, n4 = t4.text || "", i4 = t4.x, a3 = t4.y, o3 = t4.options || {}, s3 = t4.mutex || {}, c4 = s3.pdfEscape, u3 = s3.activeFontKey, h3 = s3.fonts, l3 = u3, f3 = "", d2 = 0, p3 = "", g2 = h3[l3].encoding;
    if ("Identity-H" !== h3[l3].encoding)
      return { text: n4, x: i4, y: a3, options: o3, mutex: s3 };
    for (p3 = n4, l3 = u3, Array.isArray(n4) && (p3 = n4[0]), d2 = 0; d2 < p3.length; d2 += 1)
      h3[l3].metadata.hasOwnProperty("cmap") && (e3 = h3[l3].metadata.cmap.unicode.codeMap[p3[d2].charCodeAt(0)]), e3 || p3[d2].charCodeAt(0) < 256 && h3[l3].metadata.hasOwnProperty("Unicode") ? f3 += p3[d2] : f3 += "";
    var m4 = "";
    return parseInt(l3.slice(1)) < 14 || "WinAnsiEncoding" === g2 ? m4 = c4(f3, l3).split("").map(function(t5) {
      return t5.charCodeAt(0).toString(16);
    }).join("") : "Identity-H" === g2 && (m4 = r2(f3, h3[l3])), s3.isHex = true, { text: m4, x: i4, y: a3, options: o3, mutex: s3 };
  };
  e2.events.push(["postProcessText", function(t4) {
    var e3 = t4.text || "", r3 = [], n4 = { text: e3, x: t4.x, y: t4.y, options: t4.options, mutex: t4.mutex };
    if (Array.isArray(e3)) {
      var a3 = 0;
      for (a3 = 0; a3 < e3.length; a3 += 1)
        Array.isArray(e3[a3]) && 3 === e3[a3].length ? r3.push([i3(Object.assign({}, n4, { text: e3[a3][0] })).text, e3[a3][1], e3[a3][2]]) : r3.push(i3(Object.assign({}, n4, { text: e3[a3] })).text);
      t4.text = r3;
    } else
      t4.text = i3(Object.assign({}, n4, { text: e3 })).text;
  }]);
}(E), /**
 * @license
 * jsPDF virtual FileSystem functionality
 *
 * Licensed under the MIT License.
 * http://opensource.org/licenses/mit-license
 */
function(t3) {
  var e2 = function() {
    return void 0 === this.internal.vFS && (this.internal.vFS = {}), true;
  };
  t3.existsFileInVFS = function(t4) {
    return e2.call(this), void 0 !== this.internal.vFS[t4];
  }, t3.addFileToVFS = function(t4, r2) {
    return e2.call(this), this.internal.vFS[t4] = r2, this;
  }, t3.getFileFromVFS = function(t4) {
    return e2.call(this), void 0 !== this.internal.vFS[t4] ? this.internal.vFS[t4] : null;
  };
}(E.API), /**
 * @license
 * Unicode Bidi Engine based on the work of Alex Shensis (@asthensis)
 * MIT License
 */
function(t3) {
  t3.__bidiEngine__ = t3.prototype.__bidiEngine__ = function(t4) {
    var r3, n3, i3, a3, o3, s3, c4, u3 = e2, h3 = [[0, 3, 0, 1, 0, 0, 0], [0, 3, 0, 1, 2, 2, 0], [0, 3, 0, 17, 2, 0, 1], [0, 3, 5, 5, 4, 1, 0], [0, 3, 21, 21, 4, 0, 1], [0, 3, 5, 5, 4, 2, 0]], l3 = [[2, 0, 1, 1, 0, 1, 0], [2, 0, 1, 1, 0, 2, 0], [2, 0, 2, 1, 3, 2, 0], [2, 0, 2, 33, 3, 1, 1]], f3 = { L: 0, R: 1, EN: 2, AN: 3, N: 4, B: 5, S: 6 }, d2 = { 0: 0, 5: 1, 6: 2, 7: 3, 32: 4, 251: 5, 254: 6, 255: 7 }, p3 = ["(", ")", "(", "<", ">", "<", "[", "]", "[", "{", "}", "{", "\xAB", "\xBB", "\xAB", "\u2039", "\u203A", "\u2039", "\u2045", "\u2046", "\u2045", "\u207D", "\u207E", "\u207D", "\u208D", "\u208E", "\u208D", "\u2264", "\u2265", "\u2264", "\u2329", "\u232A", "\u2329", "\uFE59", "\uFE5A", "\uFE59", "\uFE5B", "\uFE5C", "\uFE5B", "\uFE5D", "\uFE5E", "\uFE5D", "\uFE64", "\uFE65", "\uFE64"], g2 = new RegExp(/^([1-4|9]|1[0-9]|2[0-9]|3[0168]|4[04589]|5[012]|7[78]|159|16[0-9]|17[0-2]|21[569]|22[03489]|250)$/), m4 = false, v3 = 0;
    this.__bidiEngine__ = {};
    var b2 = function(t5) {
      var e3 = t5.charCodeAt(), r4 = e3 >> 8, n4 = d2[r4];
      return void 0 !== n4 ? u3[256 * n4 + (255 & e3)] : 252 === r4 || 253 === r4 ? "AL" : g2.test(r4) ? "L" : 8 === r4 ? "R" : "N";
    }, y4 = function(t5) {
      for (var e3, r4 = 0; r4 < t5.length; r4++) {
        if ("L" === (e3 = b2(t5.charAt(r4))))
          return false;
        if ("R" === e3)
          return true;
      }
      return false;
    }, w2 = function(t5, e3, o4, s4) {
      var c5, u4, h4, l4, f4 = e3[s4];
      switch (f4) {
        case "L":
        case "R":
          m4 = false;
          break;
        case "N":
        case "AN":
          break;
        case "EN":
          m4 && (f4 = "AN");
          break;
        case "AL":
          m4 = true, f4 = "R";
          break;
        case "WS":
          f4 = "N";
          break;
        case "CS":
          s4 < 1 || s4 + 1 >= e3.length || "EN" !== (c5 = o4[s4 - 1]) && "AN" !== c5 || "EN" !== (u4 = e3[s4 + 1]) && "AN" !== u4 ? f4 = "N" : m4 && (u4 = "AN"), f4 = u4 === c5 ? u4 : "N";
          break;
        case "ES":
          f4 = "EN" === (c5 = s4 > 0 ? o4[s4 - 1] : "B") && s4 + 1 < e3.length && "EN" === e3[s4 + 1] ? "EN" : "N";
          break;
        case "ET":
          if (s4 > 0 && "EN" === o4[s4 - 1]) {
            f4 = "EN";
            break;
          }
          if (m4) {
            f4 = "N";
            break;
          }
          for (h4 = s4 + 1, l4 = e3.length; h4 < l4 && "ET" === e3[h4]; )
            h4++;
          f4 = h4 < l4 && "EN" === e3[h4] ? "EN" : "N";
          break;
        case "NSM":
          if (i3 && !a3) {
            for (l4 = e3.length, h4 = s4 + 1; h4 < l4 && "NSM" === e3[h4]; )
              h4++;
            if (h4 < l4) {
              var d3 = t5[s4], p4 = d3 >= 1425 && d3 <= 2303 || 64286 === d3;
              if (c5 = e3[h4], p4 && ("R" === c5 || "AL" === c5)) {
                f4 = "R";
                break;
              }
            }
          }
          f4 = s4 < 1 || "B" === (c5 = e3[s4 - 1]) ? "N" : o4[s4 - 1];
          break;
        case "B":
          m4 = false, r3 = true, f4 = v3;
          break;
        case "S":
          n3 = true, f4 = "N";
          break;
        case "LRE":
        case "RLE":
        case "LRO":
        case "RLO":
        case "PDF":
          m4 = false;
          break;
        case "BN":
          f4 = "N";
      }
      return f4;
    }, N3 = function(t5, e3, r4) {
      var n4 = t5.split("");
      return r4 && L2(n4, r4, { hiLevel: v3 }), n4.reverse(), e3 && e3.reverse(), n4.join("");
    }, L2 = function(t5, e3, i4) {
      var a4, o4, s4, c5, u4, d3 = -1, p4 = t5.length, g3 = 0, y5 = [], N4 = v3 ? l3 : h3, L3 = [];
      for (m4 = false, r3 = false, n3 = false, o4 = 0; o4 < p4; o4++)
        L3[o4] = b2(t5[o4]);
      for (s4 = 0; s4 < p4; s4++) {
        if (u4 = g3, y5[s4] = w2(t5, L3, y5, s4), a4 = 240 & (g3 = N4[u4][f3[y5[s4]]]), g3 &= 15, e3[s4] = c5 = N4[g3][5], a4 > 0)
          if (16 === a4) {
            for (o4 = d3; o4 < s4; o4++)
              e3[o4] = 1;
            d3 = -1;
          } else
            d3 = -1;
        if (N4[g3][6])
          -1 === d3 && (d3 = s4);
        else if (d3 > -1) {
          for (o4 = d3; o4 < s4; o4++)
            e3[o4] = c5;
          d3 = -1;
        }
        "B" === L3[s4] && (e3[s4] = 0), i4.hiLevel |= c5;
      }
      n3 && function(t6, e4, r4) {
        for (var n4 = 0; n4 < r4; n4++)
          if ("S" === t6[n4]) {
            e4[n4] = v3;
            for (var i5 = n4 - 1; i5 >= 0 && "WS" === t6[i5]; i5--)
              e4[i5] = v3;
          }
      }(L3, e3, p4);
    }, A3 = function(t5, e3, n4, i4, a4) {
      if (!(a4.hiLevel < t5)) {
        if (1 === t5 && 1 === v3 && !r3)
          return e3.reverse(), void (n4 && n4.reverse());
        for (var o4, s4, c5, u4, h4 = e3.length, l4 = 0; l4 < h4; ) {
          if (i4[l4] >= t5) {
            for (c5 = l4 + 1; c5 < h4 && i4[c5] >= t5; )
              c5++;
            for (u4 = l4, s4 = c5 - 1; u4 < s4; u4++, s4--)
              o4 = e3[u4], e3[u4] = e3[s4], e3[s4] = o4, n4 && (o4 = n4[u4], n4[u4] = n4[s4], n4[s4] = o4);
            l4 = c5;
          }
          l4++;
        }
      }
    }, x3 = function(t5, e3, r4) {
      var n4 = t5.split(""), i4 = { hiLevel: v3 };
      return r4 || (r4 = []), L2(n4, r4, i4), function(t6, e4, r5) {
        if (0 !== r5.hiLevel && c4)
          for (var n5, i5 = 0; i5 < t6.length; i5++)
            1 === e4[i5] && (n5 = p3.indexOf(t6[i5])) >= 0 && (t6[i5] = p3[n5 + 1]);
      }(n4, r4, i4), A3(2, n4, e3, r4, i4), A3(1, n4, e3, r4, i4), n4.join("");
    };
    return this.__bidiEngine__.doBidiReorder = function(t5, e3, r4) {
      if (function(t6, e4) {
        if (e4)
          for (var r5 = 0; r5 < t6.length; r5++)
            e4[r5] = r5;
        void 0 === a3 && (a3 = y4(t6)), void 0 === s3 && (s3 = y4(t6));
      }(t5, e3), i3 || !o3 || s3)
        if (i3 && o3 && a3 ^ s3)
          v3 = a3 ? 1 : 0, t5 = N3(t5, e3, r4);
        else if (!i3 && o3 && s3)
          v3 = a3 ? 1 : 0, t5 = x3(t5, e3, r4), t5 = N3(t5, e3);
        else if (!i3 || a3 || o3 || s3) {
          if (i3 && !o3 && a3 ^ s3)
            t5 = N3(t5, e3), a3 ? (v3 = 0, t5 = x3(t5, e3, r4)) : (v3 = 1, t5 = x3(t5, e3, r4), t5 = N3(t5, e3));
          else if (i3 && a3 && !o3 && s3)
            v3 = 1, t5 = x3(t5, e3, r4), t5 = N3(t5, e3);
          else if (!i3 && !o3 && a3 ^ s3) {
            var n4 = c4;
            a3 ? (v3 = 1, t5 = x3(t5, e3, r4), v3 = 0, c4 = false, t5 = x3(t5, e3, r4), c4 = n4) : (v3 = 0, t5 = x3(t5, e3, r4), t5 = N3(t5, e3), v3 = 1, c4 = false, t5 = x3(t5, e3, r4), c4 = n4, t5 = N3(t5, e3));
          }
        } else
          v3 = 0, t5 = x3(t5, e3, r4);
      else
        v3 = a3 ? 1 : 0, t5 = x3(t5, e3, r4);
      return t5;
    }, this.__bidiEngine__.setOptions = function(t5) {
      t5 && (i3 = t5.isInputVisual, o3 = t5.isOutputVisual, a3 = t5.isInputRtl, s3 = t5.isOutputRtl, c4 = t5.isSymmetricSwapping);
    }, this.__bidiEngine__.setOptions(t4), this.__bidiEngine__;
  };
  var e2 = ["BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "S", "B", "S", "WS", "B", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "B", "B", "B", "S", "WS", "N", "N", "ET", "ET", "ET", "N", "N", "N", "N", "N", "ES", "CS", "ES", "CS", "CS", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "CS", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "N", "BN", "BN", "BN", "BN", "BN", "BN", "B", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "CS", "N", "ET", "ET", "ET", "ET", "N", "N", "N", "N", "L", "N", "N", "BN", "N", "N", "ET", "ET", "EN", "EN", "N", "L", "N", "N", "N", "EN", "L", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "L", "L", "L", "L", "L", "L", "L", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "L", "N", "N", "N", "N", "N", "ET", "N", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "R", "NSM", "R", "NSM", "NSM", "R", "NSM", "NSM", "R", "NSM", "N", "N", "N", "N", "N", "N", "N", "N", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "N", "N", "N", "N", "N", "R", "R", "R", "R", "R", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "AN", "AN", "AN", "AN", "AN", "AN", "N", "N", "AL", "ET", "ET", "AL", "CS", "AL", "N", "N", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AL", "AL", "N", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "ET", "AN", "AN", "AL", "AL", "AL", "NSM", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AN", "N", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AL", "AL", "NSM", "NSM", "N", "NSM", "NSM", "NSM", "NSM", "AL", "AL", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "N", "AL", "AL", "NSM", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "N", "N", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AL", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "R", "R", "N", "N", "N", "N", "R", "N", "N", "N", "N", "N", "WS", "WS", "WS", "WS", "WS", "WS", "WS", "WS", "WS", "WS", "WS", "BN", "BN", "BN", "L", "R", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "WS", "B", "LRE", "RLE", "PDF", "LRO", "RLO", "CS", "ET", "ET", "ET", "ET", "ET", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "CS", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "WS", "BN", "BN", "BN", "BN", "BN", "N", "LRI", "RLI", "FSI", "PDI", "BN", "BN", "BN", "BN", "BN", "BN", "EN", "L", "N", "N", "EN", "EN", "EN", "EN", "EN", "EN", "ES", "ES", "N", "N", "N", "L", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "ES", "ES", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "N", "N", "N", "N", "N", "R", "NSM", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "ES", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "N", "R", "R", "R", "R", "R", "N", "R", "N", "R", "R", "N", "R", "R", "N", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "CS", "N", "CS", "N", "N", "CS", "N", "N", "N", "N", "N", "N", "N", "N", "N", "ET", "N", "N", "ES", "ES", "N", "N", "N", "N", "N", "ET", "ET", "N", "N", "N", "N", "N", "AL", "AL", "AL", "AL", "AL", "N", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "N", "N", "BN", "N", "N", "N", "ET", "ET", "ET", "N", "N", "N", "N", "N", "ES", "CS", "ES", "CS", "CS", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "CS", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "L", "L", "L", "L", "L", "L", "N", "N", "L", "L", "L", "L", "L", "L", "N", "N", "L", "L", "L", "L", "L", "L", "N", "N", "L", "L", "L", "N", "N", "N", "ET", "ET", "N", "N", "N", "ET", "ET", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N"], r2 = new t3.__bidiEngine__({ isInputVisual: true });
  t3.API.events.push(["postProcessText", function(t4) {
    var e3 = t4.text, n3 = (t4.x, t4.y, t4.options || {}), i3 = (t4.mutex, n3.lang, []);
    if (n3.isInputVisual = "boolean" != typeof n3.isInputVisual || n3.isInputVisual, r2.setOptions(n3), "[object Array]" === Object.prototype.toString.call(e3)) {
      var a3 = 0;
      for (i3 = [], a3 = 0; a3 < e3.length; a3 += 1)
        "[object Array]" === Object.prototype.toString.call(e3[a3]) ? i3.push([r2.doBidiReorder(e3[a3][0]), e3[a3][1], e3[a3][2]]) : i3.push([r2.doBidiReorder(e3[a3])]);
      t4.text = i3;
    } else
      t4.text = r2.doBidiReorder(e3);
    r2.setOptions({ isInputVisual: true });
  }]);
}(E), E.API.TTFFont = function() {
  function t3(t4) {
    var e2;
    if (this.rawData = t4, e2 = this.contents = new ne(t4), this.contents.pos = 4, "ttcf" === e2.readString(4))
      throw new Error("TTCF not supported.");
    e2.pos = 0, this.parse(), this.subset = new Le(this), this.registerTTF();
  }
  return t3.open = function(e2) {
    return new t3(e2);
  }, t3.prototype.parse = function() {
    return this.directory = new ie(this.contents), this.head = new se(this), this.name = new pe(this), this.cmap = new ue(this), this.toUnicode = {}, this.hhea = new he(this), this.maxp = new ge(this), this.hmtx = new me(this), this.post = new fe(this), this.os2 = new le(this), this.loca = new Ne(this), this.glyf = new be(this), this.ascender = this.os2.exists && this.os2.ascender || this.hhea.ascender, this.decender = this.os2.exists && this.os2.decender || this.hhea.decender, this.lineGap = this.os2.exists && this.os2.lineGap || this.hhea.lineGap, this.bbox = [this.head.xMin, this.head.yMin, this.head.xMax, this.head.yMax];
  }, t3.prototype.registerTTF = function() {
    var t4, e2, r2, n3, i3;
    if (this.scaleFactor = 1e3 / this.head.unitsPerEm, this.bbox = function() {
      var e3, r3, n4, i4;
      for (i4 = [], e3 = 0, r3 = (n4 = this.bbox).length; e3 < r3; e3++)
        t4 = n4[e3], i4.push(Math.round(t4 * this.scaleFactor));
      return i4;
    }.call(this), this.stemV = 0, this.post.exists ? (r2 = 255 & (n3 = this.post.italic_angle), 0 != (32768 & (e2 = n3 >> 16)) && (e2 = -(1 + (65535 ^ e2))), this.italicAngle = +(e2 + "." + r2)) : this.italicAngle = 0, this.ascender = Math.round(this.ascender * this.scaleFactor), this.decender = Math.round(this.decender * this.scaleFactor), this.lineGap = Math.round(this.lineGap * this.scaleFactor), this.capHeight = this.os2.exists && this.os2.capHeight || this.ascender, this.xHeight = this.os2.exists && this.os2.xHeight || 0, this.familyClass = (this.os2.exists && this.os2.familyClass || 0) >> 8, this.isSerif = 1 === (i3 = this.familyClass) || 2 === i3 || 3 === i3 || 4 === i3 || 5 === i3 || 7 === i3, this.isScript = 10 === this.familyClass, this.flags = 0, this.post.isFixedPitch && (this.flags |= 1), this.isSerif && (this.flags |= 2), this.isScript && (this.flags |= 8), 0 !== this.italicAngle && (this.flags |= 64), this.flags |= 32, !this.cmap.unicode)
      throw new Error("No unicode cmap for font");
  }, t3.prototype.characterToGlyph = function(t4) {
    var e2;
    return (null != (e2 = this.cmap.unicode) ? e2.codeMap[t4] : void 0) || 0;
  }, t3.prototype.widthOfGlyph = function(t4) {
    var e2;
    return e2 = 1e3 / this.head.unitsPerEm, this.hmtx.forGlyph(t4).advance * e2;
  }, t3.prototype.widthOfString = function(t4, e2, r2) {
    var n3, i3, a3, o3;
    for (a3 = 0, i3 = 0, o3 = (t4 = "" + t4).length; 0 <= o3 ? i3 < o3 : i3 > o3; i3 = 0 <= o3 ? ++i3 : --i3)
      n3 = t4.charCodeAt(i3), a3 += this.widthOfGlyph(this.characterToGlyph(n3)) + r2 * (1e3 / e2) || 0;
    return a3 * (e2 / 1e3);
  }, t3.prototype.lineHeight = function(t4, e2) {
    var r2;
    return null == e2 && (e2 = false), r2 = e2 ? this.lineGap : 0, (this.ascender + r2 - this.decender) / 1e3 * t4;
  }, t3;
}();
var re;
var ne = function() {
  function t3(t4) {
    this.data = null != t4 ? t4 : [], this.pos = 0, this.length = this.data.length;
  }
  return t3.prototype.readByte = function() {
    return this.data[this.pos++];
  }, t3.prototype.writeByte = function(t4) {
    return this.data[this.pos++] = t4;
  }, t3.prototype.readUInt32 = function() {
    return 16777216 * this.readByte() + (this.readByte() << 16) + (this.readByte() << 8) + this.readByte();
  }, t3.prototype.writeUInt32 = function(t4) {
    return this.writeByte(t4 >>> 24 & 255), this.writeByte(t4 >> 16 & 255), this.writeByte(t4 >> 8 & 255), this.writeByte(255 & t4);
  }, t3.prototype.readInt32 = function() {
    var t4;
    return (t4 = this.readUInt32()) >= 2147483648 ? t4 - 4294967296 : t4;
  }, t3.prototype.writeInt32 = function(t4) {
    return t4 < 0 && (t4 += 4294967296), this.writeUInt32(t4);
  }, t3.prototype.readUInt16 = function() {
    return this.readByte() << 8 | this.readByte();
  }, t3.prototype.writeUInt16 = function(t4) {
    return this.writeByte(t4 >> 8 & 255), this.writeByte(255 & t4);
  }, t3.prototype.readInt16 = function() {
    var t4;
    return (t4 = this.readUInt16()) >= 32768 ? t4 - 65536 : t4;
  }, t3.prototype.writeInt16 = function(t4) {
    return t4 < 0 && (t4 += 65536), this.writeUInt16(t4);
  }, t3.prototype.readString = function(t4) {
    var e2, r2;
    for (r2 = [], e2 = 0; 0 <= t4 ? e2 < t4 : e2 > t4; e2 = 0 <= t4 ? ++e2 : --e2)
      r2[e2] = String.fromCharCode(this.readByte());
    return r2.join("");
  }, t3.prototype.writeString = function(t4) {
    var e2, r2, n3;
    for (n3 = [], e2 = 0, r2 = t4.length; 0 <= r2 ? e2 < r2 : e2 > r2; e2 = 0 <= r2 ? ++e2 : --e2)
      n3.push(this.writeByte(t4.charCodeAt(e2)));
    return n3;
  }, t3.prototype.readShort = function() {
    return this.readInt16();
  }, t3.prototype.writeShort = function(t4) {
    return this.writeInt16(t4);
  }, t3.prototype.readLongLong = function() {
    var t4, e2, r2, n3, i3, a3, o3, s3;
    return t4 = this.readByte(), e2 = this.readByte(), r2 = this.readByte(), n3 = this.readByte(), i3 = this.readByte(), a3 = this.readByte(), o3 = this.readByte(), s3 = this.readByte(), 128 & t4 ? -1 * (72057594037927940 * (255 ^ t4) + 281474976710656 * (255 ^ e2) + 1099511627776 * (255 ^ r2) + 4294967296 * (255 ^ n3) + 16777216 * (255 ^ i3) + 65536 * (255 ^ a3) + 256 * (255 ^ o3) + (255 ^ s3) + 1) : 72057594037927940 * t4 + 281474976710656 * e2 + 1099511627776 * r2 + 4294967296 * n3 + 16777216 * i3 + 65536 * a3 + 256 * o3 + s3;
  }, t3.prototype.writeLongLong = function(t4) {
    var e2, r2;
    return e2 = Math.floor(t4 / 4294967296), r2 = 4294967295 & t4, this.writeByte(e2 >> 24 & 255), this.writeByte(e2 >> 16 & 255), this.writeByte(e2 >> 8 & 255), this.writeByte(255 & e2), this.writeByte(r2 >> 24 & 255), this.writeByte(r2 >> 16 & 255), this.writeByte(r2 >> 8 & 255), this.writeByte(255 & r2);
  }, t3.prototype.readInt = function() {
    return this.readInt32();
  }, t3.prototype.writeInt = function(t4) {
    return this.writeInt32(t4);
  }, t3.prototype.read = function(t4) {
    var e2, r2;
    for (e2 = [], r2 = 0; 0 <= t4 ? r2 < t4 : r2 > t4; r2 = 0 <= t4 ? ++r2 : --r2)
      e2.push(this.readByte());
    return e2;
  }, t3.prototype.write = function(t4) {
    var e2, r2, n3, i3;
    for (i3 = [], r2 = 0, n3 = t4.length; r2 < n3; r2++)
      e2 = t4[r2], i3.push(this.writeByte(e2));
    return i3;
  }, t3;
}();
var ie = function() {
  var t3;
  function e2(t4) {
    var e3, r2, n3;
    for (this.scalarType = t4.readInt(), this.tableCount = t4.readShort(), this.searchRange = t4.readShort(), this.entrySelector = t4.readShort(), this.rangeShift = t4.readShort(), this.tables = {}, r2 = 0, n3 = this.tableCount; 0 <= n3 ? r2 < n3 : r2 > n3; r2 = 0 <= n3 ? ++r2 : --r2)
      e3 = { tag: t4.readString(4), checksum: t4.readInt(), offset: t4.readInt(), length: t4.readInt() }, this.tables[e3.tag] = e3;
  }
  return e2.prototype.encode = function(e3) {
    var r2, n3, i3, a3, o3, s3, c4, u3, h3, l3, f3, d2, p3;
    for (p3 in f3 = Object.keys(e3).length, s3 = Math.log(2), h3 = 16 * Math.floor(Math.log(f3) / s3), a3 = Math.floor(h3 / s3), u3 = 16 * f3 - h3, (n3 = new ne()).writeInt(this.scalarType), n3.writeShort(f3), n3.writeShort(h3), n3.writeShort(a3), n3.writeShort(u3), i3 = 16 * f3, c4 = n3.pos + i3, o3 = null, d2 = [], e3)
      for (l3 = e3[p3], n3.writeString(p3), n3.writeInt(t3(l3)), n3.writeInt(c4), n3.writeInt(l3.length), d2 = d2.concat(l3), "head" === p3 && (o3 = c4), c4 += l3.length; c4 % 4; )
        d2.push(0), c4++;
    return n3.write(d2), r2 = 2981146554 - t3(n3.data), n3.pos = o3 + 8, n3.writeUInt32(r2), n3.data;
  }, t3 = function(t4) {
    var e3, r2, n3, i3;
    for (t4 = ve.call(t4); t4.length % 4; )
      t4.push(0);
    for (n3 = new ne(t4), r2 = 0, e3 = 0, i3 = t4.length; e3 < i3; e3 = e3 += 4)
      r2 += n3.readUInt32();
    return 4294967295 & r2;
  }, e2;
}();
var ae = {}.hasOwnProperty;
var oe = function(t3, e2) {
  for (var r2 in e2)
    ae.call(e2, r2) && (t3[r2] = e2[r2]);
  function n3() {
    this.constructor = t3;
  }
  return n3.prototype = e2.prototype, t3.prototype = new n3(), t3.__super__ = e2.prototype, t3;
};
re = function() {
  function t3(t4) {
    var e2;
    this.file = t4, e2 = this.file.directory.tables[this.tag], this.exists = !!e2, e2 && (this.offset = e2.offset, this.length = e2.length, this.parse(this.file.contents));
  }
  return t3.prototype.parse = function() {
  }, t3.prototype.encode = function() {
  }, t3.prototype.raw = function() {
    return this.exists ? (this.file.contents.pos = this.offset, this.file.contents.read(this.length)) : null;
  }, t3;
}();
var se = function(t3) {
  function e2() {
    return e2.__super__.constructor.apply(this, arguments);
  }
  return oe(e2, re), e2.prototype.tag = "head", e2.prototype.parse = function(t4) {
    return t4.pos = this.offset, this.version = t4.readInt(), this.revision = t4.readInt(), this.checkSumAdjustment = t4.readInt(), this.magicNumber = t4.readInt(), this.flags = t4.readShort(), this.unitsPerEm = t4.readShort(), this.created = t4.readLongLong(), this.modified = t4.readLongLong(), this.xMin = t4.readShort(), this.yMin = t4.readShort(), this.xMax = t4.readShort(), this.yMax = t4.readShort(), this.macStyle = t4.readShort(), this.lowestRecPPEM = t4.readShort(), this.fontDirectionHint = t4.readShort(), this.indexToLocFormat = t4.readShort(), this.glyphDataFormat = t4.readShort();
  }, e2.prototype.encode = function(t4) {
    var e3;
    return (e3 = new ne()).writeInt(this.version), e3.writeInt(this.revision), e3.writeInt(this.checkSumAdjustment), e3.writeInt(this.magicNumber), e3.writeShort(this.flags), e3.writeShort(this.unitsPerEm), e3.writeLongLong(this.created), e3.writeLongLong(this.modified), e3.writeShort(this.xMin), e3.writeShort(this.yMin), e3.writeShort(this.xMax), e3.writeShort(this.yMax), e3.writeShort(this.macStyle), e3.writeShort(this.lowestRecPPEM), e3.writeShort(this.fontDirectionHint), e3.writeShort(t4), e3.writeShort(this.glyphDataFormat), e3.data;
  }, e2;
}();
var ce = function() {
  function t3(t4, e2) {
    var r2, n3, i3, a3, o3, s3, c4, u3, h3, l3, f3, d2, p3, g2, m4, v3, b2;
    switch (this.platformID = t4.readUInt16(), this.encodingID = t4.readShort(), this.offset = e2 + t4.readInt(), h3 = t4.pos, t4.pos = this.offset, this.format = t4.readUInt16(), this.length = t4.readUInt16(), this.language = t4.readUInt16(), this.isUnicode = 3 === this.platformID && 1 === this.encodingID && 4 === this.format || 0 === this.platformID && 4 === this.format, this.codeMap = {}, this.format) {
      case 0:
        for (s3 = 0; s3 < 256; ++s3)
          this.codeMap[s3] = t4.readByte();
        break;
      case 4:
        for (f3 = t4.readUInt16(), l3 = f3 / 2, t4.pos += 6, i3 = function() {
          var e3, r3;
          for (r3 = [], s3 = e3 = 0; 0 <= l3 ? e3 < l3 : e3 > l3; s3 = 0 <= l3 ? ++e3 : --e3)
            r3.push(t4.readUInt16());
          return r3;
        }(), t4.pos += 2, p3 = function() {
          var e3, r3;
          for (r3 = [], s3 = e3 = 0; 0 <= l3 ? e3 < l3 : e3 > l3; s3 = 0 <= l3 ? ++e3 : --e3)
            r3.push(t4.readUInt16());
          return r3;
        }(), c4 = function() {
          var e3, r3;
          for (r3 = [], s3 = e3 = 0; 0 <= l3 ? e3 < l3 : e3 > l3; s3 = 0 <= l3 ? ++e3 : --e3)
            r3.push(t4.readUInt16());
          return r3;
        }(), u3 = function() {
          var e3, r3;
          for (r3 = [], s3 = e3 = 0; 0 <= l3 ? e3 < l3 : e3 > l3; s3 = 0 <= l3 ? ++e3 : --e3)
            r3.push(t4.readUInt16());
          return r3;
        }(), n3 = (this.length - t4.pos + this.offset) / 2, o3 = function() {
          var e3, r3;
          for (r3 = [], s3 = e3 = 0; 0 <= n3 ? e3 < n3 : e3 > n3; s3 = 0 <= n3 ? ++e3 : --e3)
            r3.push(t4.readUInt16());
          return r3;
        }(), s3 = m4 = 0, b2 = i3.length; m4 < b2; s3 = ++m4)
          for (g2 = i3[s3], r2 = v3 = d2 = p3[s3]; d2 <= g2 ? v3 <= g2 : v3 >= g2; r2 = d2 <= g2 ? ++v3 : --v3)
            0 === u3[s3] ? a3 = r2 + c4[s3] : 0 !== (a3 = o3[u3[s3] / 2 + (r2 - d2) - (l3 - s3)] || 0) && (a3 += c4[s3]), this.codeMap[r2] = 65535 & a3;
    }
    t4.pos = h3;
  }
  return t3.encode = function(t4, e2) {
    var r2, n3, i3, a3, o3, s3, c4, u3, h3, l3, f3, d2, p3, g2, m4, v3, b2, y4, w2, N3, L2, A3, x3, S2, _3, P2, k2, I2, F2, C2, j2, O3, B2, M2, E2, q2, D2, R2, T3, U2, z2, H2, W2, V2, G3, Y2;
    switch (I2 = new ne(), a3 = Object.keys(t4).sort(function(t5, e3) {
      return t5 - e3;
    }), e2) {
      case "macroman":
        for (p3 = 0, g2 = function() {
          var t5 = [];
          for (d2 = 0; d2 < 256; ++d2)
            t5.push(0);
          return t5;
        }(), v3 = { 0: 0 }, i3 = {}, F2 = 0, B2 = a3.length; F2 < B2; F2++)
          null == v3[W2 = t4[n3 = a3[F2]]] && (v3[W2] = ++p3), i3[n3] = { old: t4[n3], new: v3[t4[n3]] }, g2[n3] = v3[t4[n3]];
        return I2.writeUInt16(1), I2.writeUInt16(0), I2.writeUInt32(12), I2.writeUInt16(0), I2.writeUInt16(262), I2.writeUInt16(0), I2.write(g2), { charMap: i3, subtable: I2.data, maxGlyphID: p3 + 1 };
      case "unicode":
        for (P2 = [], h3 = [], b2 = 0, v3 = {}, r2 = {}, m4 = c4 = null, C2 = 0, M2 = a3.length; C2 < M2; C2++)
          null == v3[w2 = t4[n3 = a3[C2]]] && (v3[w2] = ++b2), r2[n3] = { old: w2, new: v3[w2] }, o3 = v3[w2] - n3, null != m4 && o3 === c4 || (m4 && h3.push(m4), P2.push(n3), c4 = o3), m4 = n3;
        for (m4 && h3.push(m4), h3.push(65535), P2.push(65535), S2 = 2 * (x3 = P2.length), A3 = 2 * Math.pow(Math.log(x3) / Math.LN2, 2), l3 = Math.log(A3 / 2) / Math.LN2, L2 = 2 * x3 - A3, s3 = [], N3 = [], f3 = [], d2 = j2 = 0, E2 = P2.length; j2 < E2; d2 = ++j2) {
          if (_3 = P2[d2], u3 = h3[d2], 65535 === _3) {
            s3.push(0), N3.push(0);
            break;
          }
          if (_3 - (k2 = r2[_3].new) >= 32768)
            for (s3.push(0), N3.push(2 * (f3.length + x3 - d2)), n3 = O3 = _3; _3 <= u3 ? O3 <= u3 : O3 >= u3; n3 = _3 <= u3 ? ++O3 : --O3)
              f3.push(r2[n3].new);
          else
            s3.push(k2 - _3), N3.push(0);
        }
        for (I2.writeUInt16(3), I2.writeUInt16(1), I2.writeUInt32(12), I2.writeUInt16(4), I2.writeUInt16(16 + 8 * x3 + 2 * f3.length), I2.writeUInt16(0), I2.writeUInt16(S2), I2.writeUInt16(A3), I2.writeUInt16(l3), I2.writeUInt16(L2), z2 = 0, q2 = h3.length; z2 < q2; z2++)
          n3 = h3[z2], I2.writeUInt16(n3);
        for (I2.writeUInt16(0), H2 = 0, D2 = P2.length; H2 < D2; H2++)
          n3 = P2[H2], I2.writeUInt16(n3);
        for (V2 = 0, R2 = s3.length; V2 < R2; V2++)
          o3 = s3[V2], I2.writeUInt16(o3);
        for (G3 = 0, T3 = N3.length; G3 < T3; G3++)
          y4 = N3[G3], I2.writeUInt16(y4);
        for (Y2 = 0, U2 = f3.length; Y2 < U2; Y2++)
          p3 = f3[Y2], I2.writeUInt16(p3);
        return { charMap: r2, subtable: I2.data, maxGlyphID: b2 + 1 };
    }
  }, t3;
}();
var ue = function(t3) {
  function e2() {
    return e2.__super__.constructor.apply(this, arguments);
  }
  return oe(e2, re), e2.prototype.tag = "cmap", e2.prototype.parse = function(t4) {
    var e3, r2, n3;
    for (t4.pos = this.offset, this.version = t4.readUInt16(), n3 = t4.readUInt16(), this.tables = [], this.unicode = null, r2 = 0; 0 <= n3 ? r2 < n3 : r2 > n3; r2 = 0 <= n3 ? ++r2 : --r2)
      e3 = new ce(t4, this.offset), this.tables.push(e3), e3.isUnicode && null == this.unicode && (this.unicode = e3);
    return true;
  }, e2.encode = function(t4, e3) {
    var r2, n3;
    return null == e3 && (e3 = "macroman"), r2 = ce.encode(t4, e3), (n3 = new ne()).writeUInt16(0), n3.writeUInt16(1), r2.table = n3.data.concat(r2.subtable), r2;
  }, e2;
}();
var he = function(t3) {
  function e2() {
    return e2.__super__.constructor.apply(this, arguments);
  }
  return oe(e2, re), e2.prototype.tag = "hhea", e2.prototype.parse = function(t4) {
    return t4.pos = this.offset, this.version = t4.readInt(), this.ascender = t4.readShort(), this.decender = t4.readShort(), this.lineGap = t4.readShort(), this.advanceWidthMax = t4.readShort(), this.minLeftSideBearing = t4.readShort(), this.minRightSideBearing = t4.readShort(), this.xMaxExtent = t4.readShort(), this.caretSlopeRise = t4.readShort(), this.caretSlopeRun = t4.readShort(), this.caretOffset = t4.readShort(), t4.pos += 8, this.metricDataFormat = t4.readShort(), this.numberOfMetrics = t4.readUInt16();
  }, e2;
}();
var le = function(t3) {
  function e2() {
    return e2.__super__.constructor.apply(this, arguments);
  }
  return oe(e2, re), e2.prototype.tag = "OS/2", e2.prototype.parse = function(t4) {
    if (t4.pos = this.offset, this.version = t4.readUInt16(), this.averageCharWidth = t4.readShort(), this.weightClass = t4.readUInt16(), this.widthClass = t4.readUInt16(), this.type = t4.readShort(), this.ySubscriptXSize = t4.readShort(), this.ySubscriptYSize = t4.readShort(), this.ySubscriptXOffset = t4.readShort(), this.ySubscriptYOffset = t4.readShort(), this.ySuperscriptXSize = t4.readShort(), this.ySuperscriptYSize = t4.readShort(), this.ySuperscriptXOffset = t4.readShort(), this.ySuperscriptYOffset = t4.readShort(), this.yStrikeoutSize = t4.readShort(), this.yStrikeoutPosition = t4.readShort(), this.familyClass = t4.readShort(), this.panose = function() {
      var e3, r2;
      for (r2 = [], e3 = 0; e3 < 10; ++e3)
        r2.push(t4.readByte());
      return r2;
    }(), this.charRange = function() {
      var e3, r2;
      for (r2 = [], e3 = 0; e3 < 4; ++e3)
        r2.push(t4.readInt());
      return r2;
    }(), this.vendorID = t4.readString(4), this.selection = t4.readShort(), this.firstCharIndex = t4.readShort(), this.lastCharIndex = t4.readShort(), this.version > 0 && (this.ascent = t4.readShort(), this.descent = t4.readShort(), this.lineGap = t4.readShort(), this.winAscent = t4.readShort(), this.winDescent = t4.readShort(), this.codePageRange = function() {
      var e3, r2;
      for (r2 = [], e3 = 0; e3 < 2; e3 = ++e3)
        r2.push(t4.readInt());
      return r2;
    }(), this.version > 1))
      return this.xHeight = t4.readShort(), this.capHeight = t4.readShort(), this.defaultChar = t4.readShort(), this.breakChar = t4.readShort(), this.maxContext = t4.readShort();
  }, e2;
}();
var fe = function(t3) {
  function e2() {
    return e2.__super__.constructor.apply(this, arguments);
  }
  return oe(e2, re), e2.prototype.tag = "post", e2.prototype.parse = function(t4) {
    var e3, r2, n3;
    switch (t4.pos = this.offset, this.format = t4.readInt(), this.italicAngle = t4.readInt(), this.underlinePosition = t4.readShort(), this.underlineThickness = t4.readShort(), this.isFixedPitch = t4.readInt(), this.minMemType42 = t4.readInt(), this.maxMemType42 = t4.readInt(), this.minMemType1 = t4.readInt(), this.maxMemType1 = t4.readInt(), this.format) {
      case 65536:
        break;
      case 131072:
        var i3;
        for (r2 = t4.readUInt16(), this.glyphNameIndex = [], i3 = 0; 0 <= r2 ? i3 < r2 : i3 > r2; i3 = 0 <= r2 ? ++i3 : --i3)
          this.glyphNameIndex.push(t4.readUInt16());
        for (this.names = [], n3 = []; t4.pos < this.offset + this.length; )
          e3 = t4.readByte(), n3.push(this.names.push(t4.readString(e3)));
        return n3;
      case 151552:
        return r2 = t4.readUInt16(), this.offsets = t4.read(r2);
      case 196608:
        break;
      case 262144:
        return this.map = function() {
          var e4, r3, n4;
          for (n4 = [], i3 = e4 = 0, r3 = this.file.maxp.numGlyphs; 0 <= r3 ? e4 < r3 : e4 > r3; i3 = 0 <= r3 ? ++e4 : --e4)
            n4.push(t4.readUInt32());
          return n4;
        }.call(this);
    }
  }, e2;
}();
var de = function(t3, e2) {
  this.raw = t3, this.length = t3.length, this.platformID = e2.platformID, this.encodingID = e2.encodingID, this.languageID = e2.languageID;
};
var pe = function(t3) {
  function e2() {
    return e2.__super__.constructor.apply(this, arguments);
  }
  return oe(e2, re), e2.prototype.tag = "name", e2.prototype.parse = function(t4) {
    var e3, r2, n3, i3, a3, o3, s3, c4, u3, h3, l3;
    for (t4.pos = this.offset, t4.readShort(), e3 = t4.readShort(), o3 = t4.readShort(), r2 = [], i3 = 0; 0 <= e3 ? i3 < e3 : i3 > e3; i3 = 0 <= e3 ? ++i3 : --i3)
      r2.push({ platformID: t4.readShort(), encodingID: t4.readShort(), languageID: t4.readShort(), nameID: t4.readShort(), length: t4.readShort(), offset: this.offset + o3 + t4.readShort() });
    for (s3 = {}, i3 = u3 = 0, h3 = r2.length; u3 < h3; i3 = ++u3)
      n3 = r2[i3], t4.pos = n3.offset, c4 = t4.readString(n3.length), a3 = new de(c4, n3), null == s3[l3 = n3.nameID] && (s3[l3] = []), s3[n3.nameID].push(a3);
    this.strings = s3, this.copyright = s3[0], this.fontFamily = s3[1], this.fontSubfamily = s3[2], this.uniqueSubfamily = s3[3], this.fontName = s3[4], this.version = s3[5];
    try {
      this.postscriptName = s3[6][0].raw.replace(/[\x00-\x19\x80-\xff]/g, "");
    } catch (t5) {
      this.postscriptName = s3[4][0].raw.replace(/[\x00-\x19\x80-\xff]/g, "");
    }
    return this.trademark = s3[7], this.manufacturer = s3[8], this.designer = s3[9], this.description = s3[10], this.vendorUrl = s3[11], this.designerUrl = s3[12], this.license = s3[13], this.licenseUrl = s3[14], this.preferredFamily = s3[15], this.preferredSubfamily = s3[17], this.compatibleFull = s3[18], this.sampleText = s3[19];
  }, e2;
}();
var ge = function(t3) {
  function e2() {
    return e2.__super__.constructor.apply(this, arguments);
  }
  return oe(e2, re), e2.prototype.tag = "maxp", e2.prototype.parse = function(t4) {
    return t4.pos = this.offset, this.version = t4.readInt(), this.numGlyphs = t4.readUInt16(), this.maxPoints = t4.readUInt16(), this.maxContours = t4.readUInt16(), this.maxCompositePoints = t4.readUInt16(), this.maxComponentContours = t4.readUInt16(), this.maxZones = t4.readUInt16(), this.maxTwilightPoints = t4.readUInt16(), this.maxStorage = t4.readUInt16(), this.maxFunctionDefs = t4.readUInt16(), this.maxInstructionDefs = t4.readUInt16(), this.maxStackElements = t4.readUInt16(), this.maxSizeOfInstructions = t4.readUInt16(), this.maxComponentElements = t4.readUInt16(), this.maxComponentDepth = t4.readUInt16();
  }, e2;
}();
var me = function(t3) {
  function e2() {
    return e2.__super__.constructor.apply(this, arguments);
  }
  return oe(e2, re), e2.prototype.tag = "hmtx", e2.prototype.parse = function(t4) {
    var e3, r2, n3, i3, a3, o3, s3;
    for (t4.pos = this.offset, this.metrics = [], e3 = 0, o3 = this.file.hhea.numberOfMetrics; 0 <= o3 ? e3 < o3 : e3 > o3; e3 = 0 <= o3 ? ++e3 : --e3)
      this.metrics.push({ advance: t4.readUInt16(), lsb: t4.readInt16() });
    for (n3 = this.file.maxp.numGlyphs - this.file.hhea.numberOfMetrics, this.leftSideBearings = function() {
      var r3, i4;
      for (i4 = [], e3 = r3 = 0; 0 <= n3 ? r3 < n3 : r3 > n3; e3 = 0 <= n3 ? ++r3 : --r3)
        i4.push(t4.readInt16());
      return i4;
    }(), this.widths = function() {
      var t5, e4, r3, n4;
      for (n4 = [], t5 = 0, e4 = (r3 = this.metrics).length; t5 < e4; t5++)
        i3 = r3[t5], n4.push(i3.advance);
      return n4;
    }.call(this), r2 = this.widths[this.widths.length - 1], s3 = [], e3 = a3 = 0; 0 <= n3 ? a3 < n3 : a3 > n3; e3 = 0 <= n3 ? ++a3 : --a3)
      s3.push(this.widths.push(r2));
    return s3;
  }, e2.prototype.forGlyph = function(t4) {
    return t4 in this.metrics ? this.metrics[t4] : { advance: this.metrics[this.metrics.length - 1].advance, lsb: this.leftSideBearings[t4 - this.metrics.length] };
  }, e2;
}();
var ve = [].slice;
var be = function(t3) {
  function e2() {
    return e2.__super__.constructor.apply(this, arguments);
  }
  return oe(e2, re), e2.prototype.tag = "glyf", e2.prototype.parse = function() {
    return this.cache = {};
  }, e2.prototype.glyphFor = function(t4) {
    var e3, r2, n3, i3, a3, o3, s3, c4, u3, h3;
    return t4 in this.cache ? this.cache[t4] : (i3 = this.file.loca, e3 = this.file.contents, r2 = i3.indexOf(t4), 0 === (n3 = i3.lengthOf(t4)) ? this.cache[t4] = null : (e3.pos = this.offset + r2, a3 = (o3 = new ne(e3.read(n3))).readShort(), c4 = o3.readShort(), h3 = o3.readShort(), s3 = o3.readShort(), u3 = o3.readShort(), this.cache[t4] = -1 === a3 ? new we(o3, c4, h3, s3, u3) : new ye(o3, a3, c4, h3, s3, u3), this.cache[t4]));
  }, e2.prototype.encode = function(t4, e3, r2) {
    var n3, i3, a3, o3, s3;
    for (a3 = [], i3 = [], o3 = 0, s3 = e3.length; o3 < s3; o3++)
      n3 = t4[e3[o3]], i3.push(a3.length), n3 && (a3 = a3.concat(n3.encode(r2)));
    return i3.push(a3.length), { table: a3, offsets: i3 };
  }, e2;
}();
var ye = function() {
  function t3(t4, e2, r2, n3, i3, a3) {
    this.raw = t4, this.numberOfContours = e2, this.xMin = r2, this.yMin = n3, this.xMax = i3, this.yMax = a3, this.compound = false;
  }
  return t3.prototype.encode = function() {
    return this.raw.data;
  }, t3;
}();
var we = function() {
  function t3(t4, e2, r2, n3, i3) {
    var a3, o3;
    for (this.raw = t4, this.xMin = e2, this.yMin = r2, this.xMax = n3, this.yMax = i3, this.compound = true, this.glyphIDs = [], this.glyphOffsets = [], a3 = this.raw; o3 = a3.readShort(), this.glyphOffsets.push(a3.pos), this.glyphIDs.push(a3.readUInt16()), 32 & o3; )
      a3.pos += 1 & o3 ? 4 : 2, 128 & o3 ? a3.pos += 8 : 64 & o3 ? a3.pos += 4 : 8 & o3 && (a3.pos += 2);
  }
  return 1, 8, 32, 64, 128, t3.prototype.encode = function() {
    var t4, e2, r2;
    for (e2 = new ne(ve.call(this.raw.data)), t4 = 0, r2 = this.glyphIDs.length; t4 < r2; ++t4)
      e2.pos = this.glyphOffsets[t4];
    return e2.data;
  }, t3;
}();
var Ne = function(t3) {
  function e2() {
    return e2.__super__.constructor.apply(this, arguments);
  }
  return oe(e2, re), e2.prototype.tag = "loca", e2.prototype.parse = function(t4) {
    var e3, r2;
    return t4.pos = this.offset, e3 = this.file.head.indexToLocFormat, this.offsets = 0 === e3 ? function() {
      var e4, n3;
      for (n3 = [], r2 = 0, e4 = this.length; r2 < e4; r2 += 2)
        n3.push(2 * t4.readUInt16());
      return n3;
    }.call(this) : function() {
      var e4, n3;
      for (n3 = [], r2 = 0, e4 = this.length; r2 < e4; r2 += 4)
        n3.push(t4.readUInt32());
      return n3;
    }.call(this);
  }, e2.prototype.indexOf = function(t4) {
    return this.offsets[t4];
  }, e2.prototype.lengthOf = function(t4) {
    return this.offsets[t4 + 1] - this.offsets[t4];
  }, e2.prototype.encode = function(t4, e3) {
    for (var r2 = new Uint32Array(this.offsets.length), n3 = 0, i3 = 0, a3 = 0; a3 < r2.length; ++a3)
      if (r2[a3] = n3, i3 < e3.length && e3[i3] == a3) {
        ++i3, r2[a3] = n3;
        var o3 = this.offsets[a3], s3 = this.offsets[a3 + 1] - o3;
        s3 > 0 && (n3 += s3);
      }
    for (var c4 = new Array(4 * r2.length), u3 = 0; u3 < r2.length; ++u3)
      c4[4 * u3 + 3] = 255 & r2[u3], c4[4 * u3 + 2] = (65280 & r2[u3]) >> 8, c4[4 * u3 + 1] = (16711680 & r2[u3]) >> 16, c4[4 * u3] = (4278190080 & r2[u3]) >> 24;
    return c4;
  }, e2;
}();
var Le = function() {
  function t3(t4) {
    this.font = t4, this.subset = {}, this.unicodes = {}, this.next = 33;
  }
  return t3.prototype.generateCmap = function() {
    var t4, e2, r2, n3, i3;
    for (e2 in n3 = this.font.cmap.tables[0].codeMap, t4 = {}, i3 = this.subset)
      r2 = i3[e2], t4[e2] = n3[r2];
    return t4;
  }, t3.prototype.glyphsFor = function(t4) {
    var e2, r2, n3, i3, a3, o3, s3;
    for (n3 = {}, a3 = 0, o3 = t4.length; a3 < o3; a3++)
      n3[i3 = t4[a3]] = this.font.glyf.glyphFor(i3);
    for (i3 in e2 = [], n3)
      (null != (r2 = n3[i3]) ? r2.compound : void 0) && e2.push.apply(e2, r2.glyphIDs);
    if (e2.length > 0)
      for (i3 in s3 = this.glyphsFor(e2))
        r2 = s3[i3], n3[i3] = r2;
    return n3;
  }, t3.prototype.encode = function(t4, e2) {
    var r2, n3, i3, a3, o3, s3, c4, u3, h3, l3, f3, d2, p3, g2, m4;
    for (n3 in r2 = ue.encode(this.generateCmap(), "unicode"), a3 = this.glyphsFor(t4), f3 = { 0: 0 }, m4 = r2.charMap)
      f3[(s3 = m4[n3]).old] = s3.new;
    for (d2 in l3 = r2.maxGlyphID, a3)
      d2 in f3 || (f3[d2] = l3++);
    return u3 = function(t5) {
      var e3, r3;
      for (e3 in r3 = {}, t5)
        r3[t5[e3]] = e3;
      return r3;
    }(f3), h3 = Object.keys(u3).sort(function(t5, e3) {
      return t5 - e3;
    }), p3 = function() {
      var t5, e3, r3;
      for (r3 = [], t5 = 0, e3 = h3.length; t5 < e3; t5++)
        o3 = h3[t5], r3.push(u3[o3]);
      return r3;
    }(), i3 = this.font.glyf.encode(a3, p3, f3), c4 = this.font.loca.encode(i3.offsets, p3), g2 = { cmap: this.font.cmap.raw(), glyf: i3.table, loca: c4, hmtx: this.font.hmtx.raw(), hhea: this.font.hhea.raw(), maxp: this.font.maxp.raw(), post: this.font.post.raw(), name: this.font.name.raw(), head: this.font.head.encode(e2) }, this.font.os2.exists && (g2["OS/2"] = this.font.os2.raw()), this.font.directory.encode(g2);
  }, t3;
}();
E.API.PDFObject = function() {
  var t3;
  function e2() {
  }
  return t3 = function(t4, e3) {
    return (Array(e3 + 1).join("0") + t4).slice(-e3);
  }, e2.convert = function(r2) {
    var n3, i3, a3, o3;
    if (Array.isArray(r2))
      return "[" + function() {
        var t4, i4, a4;
        for (a4 = [], t4 = 0, i4 = r2.length; t4 < i4; t4++)
          n3 = r2[t4], a4.push(e2.convert(n3));
        return a4;
      }().join(" ") + "]";
    if ("string" == typeof r2)
      return "/" + r2;
    if (null != r2 ? r2.isString : void 0)
      return "(" + r2 + ")";
    if (r2 instanceof Date)
      return "(D:" + t3(r2.getUTCFullYear(), 4) + t3(r2.getUTCMonth(), 2) + t3(r2.getUTCDate(), 2) + t3(r2.getUTCHours(), 2) + t3(r2.getUTCMinutes(), 2) + t3(r2.getUTCSeconds(), 2) + "Z)";
    if ("[object Object]" === {}.toString.call(r2)) {
      for (i3 in a3 = ["<<"], r2)
        o3 = r2[i3], a3.push("/" + i3 + " " + e2.convert(o3));
      return a3.push(">>"), a3.join("\n");
    }
    return "" + r2;
  }, e2;
}();
var jspdf_es_min_default = E;

// ../simple-mind-map/src/plugins/ExportPDF.js
var ExportPDF = class {
  //  构造函数
  constructor(opt) {
    this.mindMap = opt.mindMap;
  }
  //  导出为pdf
  pdf(name, img) {
    let pdf = new jspdf_es_min_default("", "pt", "a4");
    let a4Width = 595;
    let a4Height = 841;
    let a4Ratio = a4Width / a4Height;
    let image = new Image();
    image.onload = () => {
      let imageWidth = image.width;
      let imageHeight = image.height;
      let imageRatio = imageWidth / imageHeight;
      let w2, h3;
      if (imageWidth <= a4Width && imageHeight <= a4Height) {
        w2 = imageWidth;
        h3 = imageHeight;
      } else if (a4Ratio > imageRatio) {
        w2 = imageRatio * a4Height;
        h3 = a4Height;
      } else {
        w2 = a4Width;
        h3 = a4Width / imageRatio;
      }
      pdf.addImage(img, "PNG", (a4Width - w2) / 2, (a4Height - h3) / 2, w2, h3);
      pdf.save(name);
    };
    image.src = img;
  }
};
ExportPDF.instanceName = "doExportPDF";
var ExportPDF_default = ExportPDF;

// ../simple-mind-map/src/utils/simulateCSSBackgroundInCanvas.js
var getNumberValueFromStr = (value) => {
  let arr = String(value).split(/\s+/);
  return arr.map((item) => {
    if (/^[\d.]+/.test(item)) {
      let res = /^([\d.]+)(.*)$/.exec(item);
      return [Number(res[1]), res[2]];
    } else {
      return item;
    }
  });
};
var zoomWidth = (ratio, height2) => {
  return ratio * height2;
};
var zoomHeight = (ratio, width2) => {
  return width2 / ratio;
};
var keyWordToPercentageMap = {
  left: 0,
  top: 0,
  center: 50,
  bottom: 100,
  right: 100
};
var handleBackgroundSize = ({
  backgroundSize,
  drawOpt,
  imageRatio,
  canvasWidth,
  canvasHeight,
  canvasRatio
}) => {
  if (backgroundSize) {
    let backgroundSizeValueArr = getNumberValueFromStr(backgroundSize);
    if (backgroundSizeValueArr[0] === "auto" && backgroundSizeValueArr[1] === "auto") {
      return;
    }
    if (backgroundSizeValueArr[0] === "cover") {
      if (imageRatio > canvasRatio) {
        drawOpt.height = canvasHeight;
        drawOpt.width = zoomWidth(imageRatio, canvasHeight);
      } else {
        drawOpt.width = canvasWidth;
        drawOpt.height = zoomHeight(imageRatio, canvasWidth);
      }
      return;
    }
    if (backgroundSizeValueArr[0] === "contain") {
      if (imageRatio > canvasRatio) {
        drawOpt.width = canvasWidth;
        drawOpt.height = zoomHeight(imageRatio, canvasWidth);
      } else {
        drawOpt.height = canvasHeight;
        drawOpt.width = zoomWidth(imageRatio, canvasHeight);
      }
      return;
    }
    let newNumberWidth = -1;
    if (backgroundSizeValueArr[0]) {
      if (Array.isArray(backgroundSizeValueArr[0])) {
        if (backgroundSizeValueArr[0][1] === "%") {
          drawOpt.width = backgroundSizeValueArr[0][0] / 100 * canvasWidth;
          newNumberWidth = drawOpt.width;
        } else {
          drawOpt.width = backgroundSizeValueArr[0][0];
          newNumberWidth = backgroundSizeValueArr[0][0];
        }
      } else if (backgroundSizeValueArr[0] === "auto") {
        if (backgroundSizeValueArr[1]) {
          if (backgroundSizeValueArr[1][1] === "%") {
            drawOpt.width = zoomWidth(
              imageRatio,
              backgroundSizeValueArr[1][0] / 100 * canvasHeight
            );
          } else {
            drawOpt.width = zoomWidth(imageRatio, backgroundSizeValueArr[1][0]);
          }
        }
      }
    }
    if (backgroundSizeValueArr[1] && Array.isArray(backgroundSizeValueArr[1])) {
      if (backgroundSizeValueArr[1][1] === "%") {
        drawOpt.height = backgroundSizeValueArr[1][0] / 100 * canvasHeight;
      } else {
        drawOpt.height = backgroundSizeValueArr[1][0];
      }
    } else if (newNumberWidth !== -1) {
      drawOpt.height = zoomHeight(imageRatio, newNumberWidth);
    }
  }
};
var handleBackgroundPosition = ({
  backgroundPosition,
  drawOpt,
  imgWidth,
  imgHeight,
  canvasWidth,
  canvasHeight
}) => {
  if (backgroundPosition) {
    let backgroundPositionValueArr = getNumberValueFromStr(backgroundPosition);
    backgroundPositionValueArr = backgroundPositionValueArr.map((item) => {
      if (typeof item === "string") {
        return keyWordToPercentageMap[item] !== void 0 ? [keyWordToPercentageMap[item], "%"] : item;
      }
      return item;
    });
    if (Array.isArray(backgroundPositionValueArr[0])) {
      if (backgroundPositionValueArr.length === 1) {
        backgroundPositionValueArr.push([50, "%"]);
      }
      if (backgroundPositionValueArr[0][1] === "%") {
        let canvasX = backgroundPositionValueArr[0][0] / 100 * canvasWidth;
        let imgX = backgroundPositionValueArr[0][0] / 100 * imgWidth;
        drawOpt.x = canvasX - imgX;
      } else {
        drawOpt.x = backgroundPositionValueArr[0][0];
      }
      if (backgroundPositionValueArr[1][1] === "%") {
        let canvasY = backgroundPositionValueArr[1][0] / 100 * canvasHeight;
        let imgY = backgroundPositionValueArr[1][0] / 100 * imgHeight;
        drawOpt.y = canvasY - imgY;
      } else {
        drawOpt.y = backgroundPositionValueArr[1][0];
      }
    }
  }
};
var handleBackgroundRepeat = ({
  ctx,
  image,
  backgroundRepeat,
  drawOpt,
  imgWidth,
  imgHeight,
  canvasWidth,
  canvasHeight
}) => {
  if (backgroundRepeat) {
    let ox = drawOpt.x;
    let oy = drawOpt.y;
    let oxRepeatNum = Math.ceil(ox / imgWidth);
    let oyRepeatNum = Math.ceil(oy / imgHeight);
    let oxRepeatX = ox - oxRepeatNum * imgWidth;
    let oxRepeatY = oy - oyRepeatNum * imgHeight;
    let backgroundRepeatValueArr = getNumberValueFromStr(backgroundRepeat);
    if (backgroundRepeatValueArr[0] === "no-repeat" || imgWidth >= canvasWidth && imgHeight >= canvasHeight) {
      return;
    }
    if (backgroundRepeatValueArr[0] === "repeat-x") {
      if (canvasWidth > imgWidth) {
        let x3 = oxRepeatX;
        while (x3 < canvasWidth) {
          drawImage(ctx, image, {
            ...drawOpt,
            x: x3
          });
          x3 += imgWidth;
        }
        return true;
      }
    }
    if (backgroundRepeatValueArr[0] === "repeat-y") {
      if (canvasHeight > imgHeight) {
        let y4 = oxRepeatY;
        while (y4 < canvasHeight) {
          drawImage(ctx, image, {
            ...drawOpt,
            y: y4
          });
          y4 += imgHeight;
        }
        return true;
      }
    }
    if (backgroundRepeatValueArr[0] === "repeat") {
      let x3 = oxRepeatX;
      while (x3 < canvasWidth) {
        if (canvasHeight > imgHeight) {
          let y4 = oxRepeatY;
          while (y4 < canvasHeight) {
            drawImage(ctx, image, {
              ...drawOpt,
              x: x3,
              y: y4
            });
            y4 += imgHeight;
          }
        }
        x3 += imgWidth;
      }
      return true;
    }
  }
};
var drawImage = (ctx, image, drawOpt) => {
  ctx.drawImage(
    image,
    drawOpt.sx,
    drawOpt.sy,
    drawOpt.swidth,
    drawOpt.sheight,
    drawOpt.x,
    drawOpt.y,
    drawOpt.width,
    drawOpt.height
  );
};
var drawBackgroundImageToCanvas = (ctx, width2, height2, img, { backgroundSize, backgroundPosition, backgroundRepeat }, callback = () => {
}) => {
  let canvasRatio = width2 / height2;
  let image = new Image();
  image.src = img;
  image.onload = () => {
    let imgWidth = image.width;
    let imgHeight = image.height;
    let imageRatio = imgWidth / imgHeight;
    let drawOpt = {
      sx: 0,
      sy: 0,
      swidth: imgWidth,
      sheight: imgHeight,
      x: 0,
      y: 0,
      width: imgWidth,
      height: imgHeight
    };
    handleBackgroundSize({
      backgroundSize,
      drawOpt,
      imageRatio,
      canvasWidth: width2,
      canvasHeight: height2,
      canvasRatio
    });
    handleBackgroundPosition({
      backgroundPosition,
      drawOpt,
      imgWidth: drawOpt.width,
      imgHeight: drawOpt.height,
      imageRatio,
      canvasWidth: width2,
      canvasHeight: height2,
      canvasRatio
    });
    let notNeedDraw = handleBackgroundRepeat({
      ctx,
      image,
      backgroundRepeat,
      drawOpt,
      imgWidth: drawOpt.width,
      imgHeight: drawOpt.height,
      imageRatio,
      canvasWidth: width2,
      canvasHeight: height2,
      canvasRatio
    });
    if (!notNeedDraw) {
      drawImage(ctx, image, drawOpt);
    }
    callback();
  };
  image.onerror = (e2) => {
    callback(e2);
  };
};
var simulateCSSBackgroundInCanvas_default = drawBackgroundImageToCanvas;

// ../simple-mind-map/src/parse/toMarkdown.js
var el = null;
var getText = (str) => {
  if (!el) {
    el = document.createElement("div");
  }
  el.innerHTML = str;
  return el.textContent;
};
var getTitleMark = (level) => {
  return new Array(level).fill("#").join("");
};
var getIndentMark = (level) => {
  return new Array(level - 6).fill("   ").join("") + "*";
};
var transformToMarkdown = (root2) => {
  let content3 = "";
  walk(
    root2,
    null,
    (node3, parent, isRoot, layerIndex) => {
      let level = layerIndex + 1;
      let text3 = node3.data.richText ? getText(node3.data.text) : node3.data.text;
      if (level <= 6) {
        content3 += getTitleMark(level);
      } else {
        content3 += getIndentMark(level);
      }
      content3 += " " + text3;
      let generalization = node3.data.generalization;
      if (generalization && generalization.text) {
        let generalizationText = generalization.richText ? getText(generalization.text) : generalization.text;
        content3 += `[${generalizationText}]`;
      }
      content3 += "\n\n";
      if (node3.data.note) {
        content3 += node3.data.note + "\n\n";
      }
    },
    () => {
    },
    true
  );
  return content3;
};

// ../simple-mind-map/src/plugins/Export.js
var Export = class {
  //  构造函数
  constructor(opt) {
    this.mindMap = opt.mindMap;
    this.exportPadding = this.mindMap.opt.exportPadding;
  }
  //  导出
  async export(type, isDownload = true, name = "\u601D\u7EF4\u5BFC\u56FE", ...args) {
    if (this[type]) {
      let result = await this[type](name, ...args);
      if (isDownload && type !== "pdf") {
        downloadFile(result, name + "." + type);
      }
      return result;
    } else {
      return null;
    }
  }
  //  获取svg数据
  async getSvgData() {
    let { exportPaddingX, exportPaddingY } = this.mindMap.opt;
    let { svg: svg2, svgHTML } = this.mindMap.getSvgData({
      paddingX: exportPaddingX,
      paddingY: exportPaddingY
    });
    let imageList = svg2.find("image");
    let task = imageList.map(async (item) => {
      let imgUlr = item.attr("href") || item.attr("xlink:href");
      let imgData = await imgToDataUrl(imgUlr);
      item.attr("href", imgData);
    });
    await Promise.all(task);
    if (imageList.length > 0) {
      svgHTML = svg2.svg();
    }
    return {
      node: svg2,
      str: svgHTML
    };
  }
  //   svg转png
  svgToPng(svgSrc, transparent) {
    return new Promise((resolve, reject) => {
      const img = new Image();
      img.setAttribute("crossOrigin", "anonymous");
      img.onload = async () => {
        try {
          let canvas = document.createElement("canvas");
          canvas.width = img.width + this.exportPadding * 2;
          canvas.height = img.height + this.exportPadding * 2;
          let ctx = canvas.getContext("2d");
          if (!transparent) {
            await this.drawBackgroundToCanvas(ctx, canvas.width, canvas.height);
          }
          ctx.drawImage(
            img,
            0,
            0,
            img.width,
            img.height,
            this.exportPadding,
            this.exportPadding,
            img.width,
            img.height
          );
          resolve(canvas.toDataURL());
        } catch (error) {
          reject(error);
        }
      };
      img.onerror = (e2) => {
        reject(e2);
      };
      img.src = svgSrc;
    });
  }
  //  在canvas上绘制思维导图背景
  drawBackgroundToCanvas(ctx, width2, height2) {
    return new Promise((resolve, reject) => {
      let {
        backgroundColor = "#fff",
        backgroundImage,
        backgroundRepeat = "no-repeat",
        backgroundPosition = "center center",
        backgroundSize = "cover"
      } = this.mindMap.themeConfig;
      ctx.save();
      ctx.rect(0, 0, width2, height2);
      ctx.fillStyle = backgroundColor;
      ctx.fill();
      ctx.restore();
      if (backgroundImage && backgroundImage !== "none") {
        ctx.save();
        simulateCSSBackgroundInCanvas_default(ctx, width2, height2, backgroundImage, {
          backgroundRepeat,
          backgroundPosition,
          backgroundSize
        }, (err) => {
          if (err) {
            reject(err);
          } else {
            resolve();
          }
          ctx.restore();
        });
      } else {
        resolve();
      }
    });
  }
  //  在svg上绘制思维导图背景
  drawBackgroundToSvg(svg2) {
    return new Promise(async (resolve) => {
      let {
        backgroundColor = "#fff",
        backgroundImage,
        backgroundRepeat = "repeat"
      } = this.mindMap.themeConfig;
      svg2.css("background-color", backgroundColor);
      if (backgroundImage && backgroundImage !== "none") {
        let imgDataUrl = await imgToDataUrl(backgroundImage);
        svg2.css("background-image", `url(${imgDataUrl})`);
        svg2.css("background-repeat", backgroundRepeat);
        resolve();
      } else {
        resolve();
      }
    });
  }
  //  导出为png
  /**
   * 方法1.把svg的图片都转化成data:url格式，再转换
   * 方法2.把svg的图片提取出来再挨个绘制到canvas里，最后一起转换
   */
  async png(name, transparent = false) {
    let { node: node3, str } = await this.getSvgData();
    if (this.mindMap.richText) {
      let res2 = await this.mindMap.richText.handleExportPng(node3.node);
      let imgDataUrl = await this.svgToPng(res2, transparent);
      return imgDataUrl;
    }
    let blob = new Blob([str], {
      type: "image/svg+xml"
    });
    let svgUrl = await readBlob(blob);
    let res = await this.svgToPng(svgUrl, transparent);
    return res;
  }
  //  导出为pdf
  async pdf(name) {
    if (!this.mindMap.doExportPDF) {
      throw new Error("\u8BF7\u6CE8\u518CExportPDF\u63D2\u4EF6");
    }
    let img = await this.png();
    this.mindMap.doExportPDF.pdf(name, img);
  }
  //  导出为svg
  // plusCssText：附加的css样式，如果svg中存在dom节点，想要设置一些针对节点的样式可以通过这个参数传入
  async svg(name, plusCssText) {
    let { node: node3 } = await this.getSvgData();
    if (this.mindMap.richText) {
      if (plusCssText) {
        let foreignObjectList = node3.find("foreignObject");
        if (foreignObjectList.length > 0) {
          foreignObjectList[0].add(SVG(`<style>${plusCssText}</style>`));
        }
      }
    }
    node3.first().before(SVG(`<title>${name}</title>`));
    await this.drawBackgroundToSvg(node3);
    let str = node3.svg();
    let blob = new Blob([str], {
      type: "image/svg+xml"
    });
    let res = await readBlob(blob);
    return res;
  }
  //  导出为json
  async json(name, withConfig = true) {
    let data2 = this.mindMap.getData(withConfig);
    let str = JSON.stringify(data2);
    let blob = new Blob([str]);
    let res = await readBlob(blob);
    return res;
  }
  //  专有文件，其实就是json文件
  async smm(name, withConfig) {
    let res = await this.json(name, withConfig);
    return res;
  }
  // markdown文件
  async md() {
    let data2 = this.mindMap.getData();
    let content3 = transformToMarkdown(data2);
    let blob = new Blob([content3]);
    let res = await readBlob(blob);
    return res;
  }
};
Export.instanceName = "doExport";
var Export_default = Export;

// ../simple-mind-map/src/plugins/Drag.js
var Drag = class extends Base_default {
  //  构造函数
  constructor({ mindMap }) {
    super(mindMap.renderer);
    this.mindMap = mindMap;
    this.reset();
    this.bindEvent();
  }
  //  复位
  reset() {
    this.node = null;
    this.overlapNode = null;
    this.prevNode = null;
    this.nextNode = null;
    this.drawTransform = null;
    this.clone = null;
    this.line = null;
    this.placeholder = null;
    this.offsetX = 0;
    this.offsetY = 0;
    this.cloneNodeLeft = 0;
    this.cloneNodeTop = 0;
    this.isMousedown = false;
    this.mouseDownX = 0;
    this.mouseDownY = 0;
    this.mouseMoveX = 0;
    this.mouseMoveY = 0;
    this.checkDragOffset = 10;
  }
  //  绑定事件
  bindEvent() {
    this.checkOverlapNode = throttle(this.checkOverlapNode, 300, this);
    this.mindMap.on("node_mousedown", (node3, e2) => {
      if (this.mindMap.opt.readonly || node3.isGeneralization) {
        return;
      }
      if (e2.which !== 1 || node3.isRoot) {
        return;
      }
      e2.preventDefault();
      this.drawTransform = this.mindMap.draw.transform();
      let { scaleX, scaleY, translateX, translateY } = this.drawTransform;
      let { x: x3, y: y4 } = this.mindMap.toPos(e2.clientX, e2.clientY);
      this.offsetX = x3 - (node3.left * scaleX + translateX);
      this.offsetY = y4 - (node3.top * scaleY + translateY);
      this.node = node3;
      this.isMousedown = true;
      this.mouseDownX = x3;
      this.mouseDownY = y4;
    });
    this.mindMap.on("mousemove", (e2) => {
      if (this.mindMap.opt.readonly) {
        return;
      }
      if (!this.isMousedown) {
        return;
      }
      this.mindMap.emit("node_dragging", this.node);
      e2.preventDefault();
      let { x: x3, y: y4 } = this.mindMap.toPos(e2.clientX, e2.clientY);
      this.mouseMoveX = x3;
      this.mouseMoveY = y4;
      if (Math.abs(x3 - this.mouseDownX) <= this.checkDragOffset && Math.abs(y4 - this.mouseDownY) <= this.checkDragOffset && !this.node.isDrag) {
        return;
      }
      this.mindMap.renderer.clearAllActive();
      this.onMove(x3, y4);
    });
    this.onMouseup = this.onMouseup.bind(this);
    this.mindMap.on("node_mouseup", this.onMouseup);
    this.mindMap.on("mouseup", this.onMouseup);
  }
  //  鼠标松开事件
  onMouseup(e2) {
    if (!this.isMousedown) {
      return;
    }
    this.isMousedown = false;
    let _nodeIsDrag = this.node.isDrag;
    this.node.isDrag = false;
    this.node.show();
    this.removeCloneNode();
    if (this.overlapNode) {
      this.mindMap.renderer.setNodeActive(this.overlapNode, false);
      this.mindMap.execCommand("MOVE_NODE_TO", this.node, this.overlapNode);
    } else if (this.prevNode) {
      this.mindMap.renderer.setNodeActive(this.prevNode, false);
      this.mindMap.execCommand("INSERT_AFTER", this.node, this.prevNode);
    } else if (this.nextNode) {
      this.mindMap.renderer.setNodeActive(this.nextNode, false);
      this.mindMap.execCommand("INSERT_BEFORE", this.node, this.nextNode);
    } else if (_nodeIsDrag && this.mindMap.opt.enableFreeDrag) {
      let { x: x3, y: y4 } = this.mindMap.toPos(
        e2.clientX - this.offsetX,
        e2.clientY - this.offsetY
      );
      let { scaleX, scaleY, translateX, translateY } = this.drawTransform;
      x3 = (x3 - translateX) / scaleX;
      y4 = (y4 - translateY) / scaleY;
      this.node.left = x3;
      this.node.top = y4;
      this.node.customLeft = x3;
      this.node.customTop = y4;
      this.mindMap.execCommand("SET_NODE_CUSTOM_POSITION", this.node, x3, y4);
      this.mindMap.render();
    }
    this.reset();
    this.mindMap.emit("node_dragend");
  }
  //  创建克隆节点
  createCloneNode() {
    if (!this.clone) {
      this.clone = this.node.group.clone();
      this.clone.opacity(0.5);
      this.clone.css("z-index", 99999);
      this.node.isDrag = true;
      this.node.hide();
      this.line = this.draw.path();
      this.line.opacity(0.5);
      this.node.styleLine(this.line, this.node);
      this.placeholder = this.draw.rect().fill({
        color: this.node.style.merge("lineColor", true)
      });
      this.mindMap.draw.add(this.clone);
    }
  }
  //  移除克隆节点
  removeCloneNode() {
    if (!this.clone) {
      return;
    }
    this.clone.remove();
    this.line.remove();
    this.placeholder.remove();
  }
  //  拖动中
  onMove(x3, y4) {
    if (!this.isMousedown) {
      return;
    }
    this.createCloneNode();
    let { scaleX, scaleY, translateX, translateY } = this.drawTransform;
    this.cloneNodeLeft = x3 - this.offsetX;
    this.cloneNodeTop = y4 - this.offsetY;
    x3 = (this.cloneNodeLeft - translateX) / scaleX;
    y4 = (this.cloneNodeTop - translateY) / scaleY;
    let t3 = this.clone.transform();
    this.clone.translate(x3 - t3.translateX, y4 - t3.translateY);
    let parent = this.node.parent;
    this.line.plot(
      this.quadraticCurvePath(
        parent.left + parent.width / 2,
        parent.top + parent.height / 2,
        x3 + this.node.width / 2,
        y4 + this.node.height / 2
      )
    );
    this.checkOverlapNode();
  }
  //  检测重叠节点
  checkOverlapNode() {
    if (!this.drawTransform) {
      return;
    }
    let x3 = this.mouseMoveX;
    let y4 = this.mouseMoveY;
    this.overlapNode = null;
    this.prevNode = null;
    this.nextNode = null;
    this.placeholder.size(0, 0);
    bfsWalk(this.mindMap.renderer.root, (node3) => {
      if (node3.nodeData.data.isActive) {
        this.mindMap.renderer.setNodeActive(node3, false);
      }
      if (node3 === this.node || this.node.isParent(node3)) {
        return;
      }
      if (this.overlapNode || this.prevNode && this.nextNode) {
        return;
      }
      let nodeRect = this.getNodeRect(node3);
      let oneFourthHeight = nodeRect.height / 4;
      let checkList = node3.parent ? node3.parent.children.filter((item) => {
        return item !== this.node;
      }) : [];
      let index3 = checkList.findIndex((item) => {
        return item === node3;
      });
      let prevBrother = null;
      let nextBrother = null;
      if (index3 !== -1) {
        if (index3 - 1 >= 0) {
          prevBrother = checkList[index3 - 1];
        }
        if (index3 + 1 <= checkList.length - 1) {
          nextBrother = checkList[index3 + 1];
        }
      }
      let prevBrotherOffset = 0;
      if (prevBrother) {
        let prevNodeRect = this.getNodeRect(prevBrother);
        prevBrotherOffset = nodeRect.top - prevNodeRect.bottom;
        prevBrotherOffset = prevBrotherOffset >= 10 ? prevBrotherOffset / 2 : 0;
      } else {
        prevBrotherOffset = 10;
      }
      let nextBrotherOffset = 0;
      if (nextBrother) {
        let nextNodeRect = this.getNodeRect(nextBrother);
        nextBrotherOffset = nextNodeRect.top - nodeRect.bottom;
        nextBrotherOffset = nextBrotherOffset >= 10 ? nextBrotherOffset / 2 : 0;
      } else {
        nextBrotherOffset = 10;
      }
      if (nodeRect.left <= x3 && nodeRect.right >= x3) {
        if (!this.overlapNode && !this.prevNode && !this.nextNode && !node3.isRoot) {
          let checkIsPrevNode = nextBrotherOffset > 0 ? (
            // 距离下一个兄弟节点的距离大于0
            y4 > nodeRect.bottom && y4 <= nodeRect.bottom + nextBrotherOffset
          ) : (
            // 那么在当前节点外底部判断
            y4 >= nodeRect.bottom - oneFourthHeight && y4 <= nodeRect.bottom
          );
          let checkIsNextNode = prevBrotherOffset > 0 ? (
            // 距离上一个兄弟节点的距离大于0
            y4 < nodeRect.top && y4 >= nodeRect.top - prevBrotherOffset
          ) : (
            // 那么在当前节点外底部判断
            y4 >= nodeRect.top && y4 <= nodeRect.top + oneFourthHeight
          );
          if (checkIsPrevNode) {
            this.prevNode = node3;
            let size2 = nextBrotherOffset > 0 ? nextBrotherOffset : 5;
            this.placeholder.size(node3.width, size2).move(nodeRect.originLeft, nodeRect.originBottom);
          } else if (checkIsNextNode) {
            this.nextNode = node3;
            let size2 = prevBrotherOffset > 0 ? prevBrotherOffset : 5;
            this.placeholder.size(node3.width, size2).move(nodeRect.originLeft, nodeRect.originTop - size2);
          }
        }
        if (!this.overlapNode && !this.prevNode && !this.nextNode) {
          if (nodeRect.top + (prevBrotherOffset > 0 ? 0 : oneFourthHeight) <= y4 && nodeRect.bottom - (nextBrotherOffset > 0 ? 0 : oneFourthHeight) >= y4) {
            this.overlapNode = node3;
          }
        }
      }
    });
    if (this.overlapNode) {
      this.mindMap.renderer.setNodeActive(this.overlapNode, true);
    }
  }
  // 计算节点的位置尺寸信息
  getNodeRect(node3) {
    let { scaleX, scaleY, translateX, translateY } = this.drawTransform;
    let { left, top, width: width2, height: height2 } = node3;
    let originLeft = left;
    let originTop = top;
    let originBottom = top + height2;
    let right = (left + width2) * scaleX + translateX;
    let bottom = (top + height2) * scaleY + translateY;
    left = left * scaleX + translateX;
    top = top * scaleY + translateY;
    return {
      width: width2,
      height: height2,
      left,
      top,
      right,
      bottom,
      originLeft,
      originTop,
      originBottom
    };
  }
};
Drag.instanceName = "drag";
var Drag_default = Drag;

// ../simple-mind-map/src/plugins/Select.js
var Select = class {
  //  构造函数
  constructor({ mindMap }) {
    this.mindMap = mindMap;
    this.rect = null;
    this.isMousedown = false;
    this.mouseDownX = 0;
    this.mouseDownY = 0;
    this.mouseMoveX = 0;
    this.mouseMoveY = 0;
    this.bindEvent();
  }
  //  绑定事件
  bindEvent() {
    this.checkInNodes = throttle(this.checkInNodes, 300, this);
    this.mindMap.on("mousedown", (e2) => {
      if (this.mindMap.opt.readonly) {
        return;
      }
      let { useLeftKeySelectionRightKeyDrag } = this.mindMap.opt;
      if (!e2.ctrlKey && (useLeftKeySelectionRightKeyDrag ? e2.which !== 1 : e2.which !== 3)) {
        return;
      }
      e2.preventDefault();
      this.isMousedown = true;
      let { x: x3, y: y4 } = this.mindMap.toPos(e2.clientX, e2.clientY);
      this.mouseDownX = x3;
      this.mouseDownY = y4;
      this.createRect(x3, y4);
    });
    this.mindMap.on("mousemove", (e2) => {
      if (this.mindMap.opt.readonly) {
        return;
      }
      if (!this.isMousedown) {
        return;
      }
      let { x: x3, y: y4 } = this.mindMap.toPos(e2.clientX, e2.clientY);
      this.mouseMoveX = x3;
      this.mouseMoveY = y4;
      if (Math.abs(x3 - this.mouseDownX) <= 10 && Math.abs(y4 - this.mouseDownY) <= 10) {
        return;
      }
      clearTimeout(this.autoMoveTimer);
      this.onMove(x3, y4);
    });
    this.mindMap.on("mouseup", () => {
      if (this.mindMap.opt.readonly) {
        return;
      }
      if (!this.isMousedown) {
        return;
      }
      this.mindMap.emit(
        "node_active",
        null,
        this.mindMap.renderer.activeNodeList
      );
      clearTimeout(this.autoMoveTimer);
      this.isMousedown = false;
      if (this.rect)
        this.rect.remove();
      this.rect = null;
    });
  }
  //  鼠标移动事件
  onMove(x3, y4) {
    this.rect.plot([
      [this.mouseDownX, this.mouseDownY],
      [this.mouseMoveX, this.mouseDownY],
      [this.mouseMoveX, this.mouseMoveY],
      [this.mouseDownX, this.mouseMoveY]
    ]);
    this.checkInNodes();
    let step = this.mindMap.opt.selectTranslateStep;
    let limit = this.mindMap.opt.selectTranslateLimit;
    let count = 0;
    if (x3 <= this.mindMap.elRect.left + limit) {
      this.mouseDownX += step;
      this.mindMap.view.translateX(step);
      count++;
    }
    if (x3 >= this.mindMap.elRect.right - limit) {
      this.mouseDownX -= step;
      this.mindMap.view.translateX(-step);
      count++;
    }
    if (y4 <= this.mindMap.elRect.top + limit) {
      this.mouseDownY += step;
      this.mindMap.view.translateY(step);
      count++;
    }
    if (y4 >= this.mindMap.elRect.bottom - limit) {
      this.mouseDownY -= step;
      this.mindMap.view.translateY(-step);
      count++;
    }
    if (count > 0) {
      this.startAutoMove(x3, y4);
    }
  }
  //  开启自动移动
  startAutoMove(x3, y4) {
    this.autoMoveTimer = setTimeout(() => {
      this.onMove(x3, y4);
    }, 20);
  }
  //  创建矩形
  createRect(x3, y4) {
    this.rect = this.mindMap.svg.polygon().stroke({
      color: "#0984e3"
    }).fill({
      color: "rgba(9,132,227,0.3)"
    }).plot([[x3, y4]]);
  }
  //  检测在选区里的节点
  checkInNodes() {
    let { scaleX, scaleY, translateX, translateY } = this.mindMap.draw.transform();
    let minx = Math.min(this.mouseDownX, this.mouseMoveX);
    let miny = Math.min(this.mouseDownY, this.mouseMoveY);
    let maxx = Math.max(this.mouseDownX, this.mouseMoveX);
    let maxy = Math.max(this.mouseDownY, this.mouseMoveY);
    bfsWalk(this.mindMap.renderer.root, (node3) => {
      let { left, top, width: width2, height: height2 } = node3;
      let right = (left + width2) * scaleX + translateX;
      let bottom = (top + height2) * scaleY + translateY;
      left = left * scaleX + translateX;
      top = top * scaleY + translateY;
      if ((left >= minx && left <= maxx || right >= minx && right <= maxx) && (top >= miny && top <= maxy || bottom >= miny && bottom <= maxy)) {
        if (node3.nodeData.data.isActive) {
          return;
        }
        this.mindMap.renderer.setNodeActive(node3, true);
        this.mindMap.renderer.addActiveNode(node3);
      } else if (node3.nodeData.data.isActive) {
        if (!node3.nodeData.data.isActive) {
          return;
        }
        this.mindMap.renderer.setNodeActive(node3, false);
        this.mindMap.renderer.removeActiveNode(node3);
      }
    });
  }
};
Select.instanceName = "select";
var Select_default = Select;

// ../simple-mind-map/node_modules/uuid/dist/esm-browser/rng.js
var getRandomValues;
var rnds8 = new Uint8Array(16);
function rng() {
  if (!getRandomValues) {
    getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
    if (!getRandomValues) {
      throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
    }
  }
  return getRandomValues(rnds8);
}

// ../simple-mind-map/node_modules/uuid/dist/esm-browser/stringify.js
var byteToHex = [];
for (let i3 = 0; i3 < 256; ++i3) {
  byteToHex.push((i3 + 256).toString(16).slice(1));
}
function unsafeStringify(arr, offset = 0) {
  return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
}

// ../simple-mind-map/node_modules/uuid/dist/esm-browser/native.js
var randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
var native_default = {
  randomUUID
};

// ../simple-mind-map/node_modules/uuid/dist/esm-browser/v4.js
function v4(options, buf, offset) {
  if (native_default.randomUUID && !buf && !options) {
    return native_default.randomUUID();
  }
  options = options || {};
  const rnds = options.random || (options.rng || rng)();
  rnds[6] = rnds[6] & 15 | 64;
  rnds[8] = rnds[8] & 63 | 128;
  if (buf) {
    offset = offset || 0;
    for (let i3 = 0; i3 < 16; ++i3) {
      buf[offset + i3] = rnds[i3];
    }
    return buf;
  }
  return unsafeStringify(rnds);
}
var v4_default = v4;

// ../simple-mind-map/src/plugins/associativeLine/associativeLineUtils.js
var getAssociativeLineTargetIndex = (node3, toNode) => {
  return node3.nodeData.data.associativeLineTargets.findIndex((item) => {
    return item === toNode.nodeData.data.id;
  });
};
var computeCubicBezierPathPoints = (x1, y1, x22, y22) => {
  let cx1 = x1 + (x22 - x1) / 2;
  let cy1 = y1;
  let cx2 = cx1;
  let cy2 = y22;
  if (Math.abs(x1 - x22) <= 5) {
    cx1 = x1 + (y22 - y1) / 2;
    cx2 = cx1;
  }
  return [
    {
      x: cx1,
      y: cy1
    },
    {
      x: cx2,
      y: cy2
    }
  ];
};
var joinCubicBezierPath = (startPoint, endPoint, point1, point22) => {
  return `M ${startPoint.x},${startPoint.y} C ${point1.x},${point1.y} ${point22.x},${point22.y} ${endPoint.x},${endPoint.y}`;
};
var getNodeRect = (node3) => {
  let { left, top, width: width2, height: height2 } = node3;
  return {
    right: left + width2,
    bottom: top + height2,
    left,
    top
  };
};
var cubicBezierPath = (x1, y1, x22, y22) => {
  let points = computeCubicBezierPathPoints(x1, y1, x22, y22);
  return joinCubicBezierPath(
    { x: x1, y: y1 },
    { x: x22, y: y22 },
    points[0],
    points[1]
  );
};
var getNodePoint = (node3, dir = "right") => {
  let { left, top, width: width2, height: height2 } = node3;
  switch (dir) {
    case "left":
      return {
        x: left,
        y: top + height2 / 2
      };
    case "right":
      return {
        x: left + width2,
        y: top + height2 / 2
      };
    case "top":
      return {
        x: left + width2 / 2,
        y: top
      };
    case "bottom":
      return {
        x: left + width2 / 2,
        y: top + height2
      };
    default:
      break;
  }
};
var computeNodePoints = (fromNode, toNode) => {
  let fromRect = getNodeRect(fromNode);
  let fromCx = (fromRect.right + fromRect.left) / 2;
  let fromCy = (fromRect.bottom + fromRect.top) / 2;
  let toRect = getNodeRect(toNode);
  let toCx = (toRect.right + toRect.left) / 2;
  let toCy = (toRect.bottom + toRect.top) / 2;
  let offsetX = toCx - fromCx;
  let offsetY = toCy - fromCy;
  if (offsetX === 0 && offsetY === 0)
    return;
  let fromDir = "";
  let toDir = "";
  if (offsetX <= 0 && offsetX <= offsetY && offsetX <= -offsetY) {
    fromDir = "left";
    toDir = "right";
  } else if (offsetX > 0 && offsetX >= -offsetY && offsetX >= offsetY) {
    fromDir = "right";
    toDir = "left";
  } else if (offsetY <= 0 && offsetY < offsetX && offsetY < -offsetX) {
    fromDir = "top";
    toDir = "bottom";
  } else if (offsetY > 0 && -offsetY < offsetX && offsetY > offsetX) {
    fromDir = "bottom";
    toDir = "top";
  }
  return [getNodePoint(fromNode, fromDir), getNodePoint(toNode, toDir)];
};
var getNodeLinePath = (startPoint, endPoint, node3, toNode) => {
  let targetIndex = getAssociativeLineTargetIndex(node3, toNode);
  let controlPoints = [];
  let associativeLineTargetControlOffsets = node3.nodeData.data.associativeLineTargetControlOffsets;
  if (associativeLineTargetControlOffsets && associativeLineTargetControlOffsets[targetIndex]) {
    let offsets = associativeLineTargetControlOffsets[targetIndex];
    controlPoints = [
      {
        x: startPoint.x + offsets[0].x,
        y: startPoint.y + offsets[0].y
      },
      {
        x: endPoint.x + offsets[1].x,
        y: endPoint.y + offsets[1].y
      }
    ];
  } else {
    controlPoints = computeCubicBezierPathPoints(
      startPoint.x,
      startPoint.y,
      endPoint.x,
      endPoint.y
    );
  }
  return {
    path: joinCubicBezierPath(
      startPoint,
      endPoint,
      controlPoints[0],
      controlPoints[1]
    ),
    controlPoints
  };
};
var getDefaultControlPointOffsets = (startPoint, endPoint) => {
  let controlPoints = computeCubicBezierPathPoints(
    startPoint.x,
    startPoint.y,
    endPoint.x,
    endPoint.y
  );
  return [
    {
      x: controlPoints[0].x - startPoint.x,
      y: controlPoints[0].y - startPoint.y
    },
    {
      x: controlPoints[1].x - endPoint.x,
      y: controlPoints[1].y - endPoint.y
    }
  ];
};

// ../simple-mind-map/src/plugins/associativeLine/associativeLineControls.js
function createControlNodes() {
  let { associativeLineActiveColor } = this.mindMap.themeConfig;
  this.controlLine1 = this.draw.line().stroke({ color: associativeLineActiveColor, width: 2 });
  this.controlLine2 = this.draw.line().stroke({ color: associativeLineActiveColor, width: 2 });
  this.controlPoint1 = this.createOneControlNode("controlPoint1");
  this.controlPoint2 = this.createOneControlNode("controlPoint2");
}
function createOneControlNode(pointKey) {
  let { associativeLineActiveColor } = this.mindMap.themeConfig;
  return this.draw.circle(this.controlPointDiameter).stroke({ color: associativeLineActiveColor }).fill({ color: "#fff" }).click((e2) => {
    e2.stopPropagation();
  }).mousedown((e2) => {
    this.onControlPointMousedown(e2, pointKey);
  });
}
function onControlPointMousedown(e2, pointKey) {
  e2.stopPropagation();
  this.isControlPointMousedown = true;
  this.mousedownControlPointKey = pointKey;
}
function onControlPointMousemove(e2) {
  if (!this.isControlPointMousedown || !this.mousedownControlPointKey || !this[this.mousedownControlPointKey])
    return;
  e2.stopPropagation();
  e2.preventDefault();
  let radius = this.controlPointDiameter / 2;
  let { x: x3, y: y4 } = this.getTransformedEventPos(e2);
  this.controlPointMousemoveState.pos = {
    x: x3,
    y: y4
  };
  this[this.mousedownControlPointKey].x(x3 - radius).y(y4 - radius);
  let [path, clickPath, text3, node3, toNode] = this.activeLine;
  let [startPoint, endPoint] = computeNodePoints(node3, toNode);
  this.controlPointMousemoveState.startPoint = startPoint;
  this.controlPointMousemoveState.endPoint = endPoint;
  let targetIndex = getAssociativeLineTargetIndex(node3, toNode);
  this.controlPointMousemoveState.targetIndex = targetIndex;
  let offsets = [];
  let associativeLineTargetControlOffsets = node3.nodeData.data.associativeLineTargetControlOffsets;
  if (!associativeLineTargetControlOffsets) {
    offsets = getDefaultControlPointOffsets(startPoint, endPoint);
  } else {
    offsets = associativeLineTargetControlOffsets[targetIndex];
  }
  let point1 = null;
  let point22 = null;
  if (this.mousedownControlPointKey === "controlPoint1") {
    point1 = {
      x: x3,
      y: y4
    };
    point22 = {
      x: endPoint.x + offsets[1].x,
      y: endPoint.y + offsets[1].y
    };
    this.controlLine1.plot(startPoint.x, startPoint.y, point1.x, point1.y);
  } else {
    point1 = {
      x: startPoint.x + offsets[0].x,
      y: startPoint.y + offsets[0].y
    };
    point22 = {
      x: x3,
      y: y4
    };
    this.controlLine2.plot(endPoint.x, endPoint.y, point22.x, point22.y);
  }
  let pathStr = joinCubicBezierPath(startPoint, endPoint, point1, point22);
  path.plot(pathStr);
  clickPath.plot(pathStr);
  this.updateTextPos(path, text3);
  this.updateTextEditBoxPos(text3);
}
function onControlPointMouseup(e2) {
  if (!this.isControlPointMousedown)
    return;
  e2.stopPropagation();
  e2.preventDefault();
  let { pos, startPoint, endPoint, targetIndex } = this.controlPointMousemoveState;
  let [, , , node3] = this.activeLine;
  let offsetList = [];
  let associativeLineTargetControlOffsets = node3.nodeData.data.associativeLineTargetControlOffsets;
  if (!associativeLineTargetControlOffsets) {
    offsetList[targetIndex] = getDefaultControlPointOffsets(
      startPoint,
      endPoint
    );
  } else {
    offsetList = associativeLineTargetControlOffsets;
  }
  let offset1 = null;
  let offset2 = null;
  if (this.mousedownControlPointKey === "controlPoint1") {
    offset1 = {
      x: pos.x - startPoint.x,
      y: pos.y - startPoint.y
    };
    offset2 = offsetList[targetIndex][1];
  } else {
    offset1 = offsetList[targetIndex][0];
    offset2 = {
      x: pos.x - endPoint.x,
      y: pos.y - endPoint.y
    };
  }
  offsetList[targetIndex] = [offset1, offset2];
  this.mindMap.execCommand("SET_NODE_DATA", node3, {
    associativeLineTargetControlOffsets: offsetList
  });
  setTimeout(() => {
    this.resetControlPoint();
  }, 0);
}
function resetControlPoint() {
  this.isControlPointMousedown = false;
  this.mousedownControlPointKey = "";
  this.controlPointMousemoveState = {
    pos: null,
    startPoint: null,
    endPoint: null,
    targetIndex: ""
  };
}
function renderControls(startPoint, endPoint, point1, point22) {
  if (!this.controlLine1) {
    this.createControlNodes();
  }
  let radius = this.controlPointDiameter / 2;
  this.controlLine1.plot(startPoint.x, startPoint.y, point1.x, point1.y);
  this.controlLine2.plot(endPoint.x, endPoint.y, point22.x, point22.y);
  this.controlPoint1.x(point1.x - radius).y(point1.y - radius);
  this.controlPoint2.x(point22.x - radius).y(point22.y - radius);
}
function removeControls() {
  if (!this.controlLine1)
    return;
  [
    this.controlLine1,
    this.controlLine2,
    this.controlPoint1,
    this.controlPoint2
  ].forEach((item) => {
    item.remove();
  });
  this.controlLine1 = null;
  this.controlLine2 = null;
  this.controlPoint1 = null;
  this.controlPoint2 = null;
}
function hideControls() {
  if (!this.controlLine1)
    return;
  [
    this.controlLine1,
    this.controlLine2,
    this.controlPoint1,
    this.controlPoint2
  ].forEach((item) => {
    item.hide();
  });
}
function showControls() {
  if (!this.controlLine1)
    return;
  [
    this.controlLine1,
    this.controlLine2,
    this.controlPoint1,
    this.controlPoint2
  ].forEach((item) => {
    item.show();
  });
}
var associativeLineControls_default = {
  createControlNodes,
  createOneControlNode,
  onControlPointMousedown,
  onControlPointMousemove,
  onControlPointMouseup,
  resetControlPoint,
  renderControls,
  removeControls,
  hideControls,
  showControls
};

// ../simple-mind-map/src/plugins/associativeLine/associativeLineText.js
function createText(data2) {
  let g2 = this.draw.group();
  const setActive = () => {
    if (!this.activeLine || this.activeLine[3] !== data2.node || this.activeLine[4] !== data2.toNode) {
      this.setActiveLine({
        ...data2,
        text: g2
      });
    }
  };
  g2.click((e2) => {
    e2.stopPropagation();
    setActive();
  });
  g2.on("dblclick", (e2) => {
    e2.stopPropagation();
    setActive();
    if (!this.activeLine)
      return;
    this.showEditTextBox(g2);
  });
  return g2;
}
function showEditTextBox(g2) {
  this.mindMap.emit("before_show_text_edit");
  this.mindMap.keyCommand.addShortcut("Enter", () => {
    this.hideEditTextBox();
  });
  if (!this.textEditNode) {
    this.textEditNode = document.createElement("div");
    this.textEditNode.style.cssText = `position:fixed;box-sizing: border-box;background-color:#fff;box-shadow: 0 0 20px rgba(0,0,0,.5);padding: 3px 5px;margin-left: -5px;margin-top: -3px;outline: none; word-break: break-all;`;
    this.textEditNode.setAttribute("contenteditable", true);
    this.textEditNode.addEventListener("keyup", (e2) => {
      e2.stopPropagation();
    });
    this.textEditNode.addEventListener("click", (e2) => {
      e2.stopPropagation();
    });
    document.body.appendChild(this.textEditNode);
  }
  let {
    associativeLineTextFontSize,
    associativeLineTextFontFamily,
    associativeLineTextLineHeight
  } = this.mindMap.themeConfig;
  let scale = this.mindMap.view.scale;
  let [, , , node3, toNode] = this.activeLine;
  let textLines = (this.getText(node3, toNode) || this.mindMap.opt.defaultAssociativeLineText).split(/\n/gim);
  this.textEditNode.style.fontFamily = associativeLineTextFontFamily;
  this.textEditNode.style.fontSize = associativeLineTextFontSize * scale + "px";
  this.textEditNode.style.lineHeight = textLines.length > 1 ? associativeLineTextLineHeight : "normal";
  this.textEditNode.style.zIndex = this.mindMap.opt.nodeTextEditZIndex;
  this.textEditNode.innerHTML = textLines.join("<br>");
  this.textEditNode.style.display = "block";
  this.updateTextEditBoxPos(g2);
  this.showTextEdit = true;
}
function onScale() {
  this.hideEditTextBox();
}
function updateTextEditBoxPos(g2) {
  let rect = g2.node.getBoundingClientRect();
  this.textEditNode.style.minWidth = rect.width + 10 + "px";
  this.textEditNode.style.minHeight = rect.height + 6 + "px";
  this.textEditNode.style.left = rect.left + "px";
  this.textEditNode.style.top = rect.top + "px";
}
function hideEditTextBox() {
  if (!this.showTextEdit) {
    return;
  }
  let [path, , text3, node3, toNode] = this.activeLine;
  let str = getStrWithBrFromHtml(this.textEditNode.innerHTML);
  this.mindMap.execCommand("SET_NODE_DATA", node3, {
    associativeLineText: {
      ...node3.nodeData.data.associativeLineText || {},
      [toNode.nodeData.data.id]: str
    }
  });
  this.textEditNode.style.display = "none";
  this.textEditNode.innerHTML = "";
  this.showTextEdit = false;
  this.renderText(str, path, text3);
  this.mindMap.emit("hide_text_edit");
}
function getText2(node3, toNode) {
  let obj = node3.nodeData.data.associativeLineText;
  if (!obj) {
    return "";
  }
  return obj[toNode.nodeData.data.id] || "";
}
function renderText(str, path, text3) {
  if (!str)
    return;
  let { associativeLineTextFontSize, associativeLineTextLineHeight } = this.mindMap.themeConfig;
  text3.clear();
  let textArr = str.split(/\n/gim);
  textArr.forEach((item, index3) => {
    let node3 = new Text2().text(item);
    node3.y(associativeLineTextFontSize * associativeLineTextLineHeight * index3);
    this.styleText(node3);
    text3.add(node3);
  });
  updateTextPos(path, text3);
}
function styleText(node3) {
  let {
    associativeLineTextColor,
    associativeLineTextFontSize,
    associativeLineTextFontFamily
  } = this.mindMap.themeConfig;
  node3.fill({
    color: associativeLineTextColor
  }).css({
    "font-family": associativeLineTextFontFamily,
    "font-size": associativeLineTextFontSize
  });
}
function updateTextPos(path, text3) {
  let pathLength = path.length();
  let centerPoint = path.pointAt(pathLength / 2);
  let { width: textWidth, height: textHeight } = text3.bbox();
  text3.x(centerPoint.x - textWidth / 2);
  text3.y(centerPoint.y - textHeight / 2);
}
var associativeLineText_default = {
  getText: getText2,
  createText,
  styleText,
  onScale,
  showEditTextBox,
  hideEditTextBox,
  updateTextEditBoxPos,
  renderText,
  updateTextPos
};

// ../simple-mind-map/src/plugins/AssociativeLine.js
var AssociativeLine = class {
  constructor(opt = {}) {
    this.mindMap = opt.mindMap;
    this.draw = this.mindMap.draw;
    this.lineList = [];
    this.activeLine = null;
    this.isCreatingLine = false;
    this.creatingStartNode = null;
    this.creatingLine = null;
    this.overlapNode = null;
    this.isNodeDragging = false;
    this.markerPath = null;
    this.marker = this.createMarker();
    this.controlLine1 = null;
    this.controlLine2 = null;
    this.controlPoint1 = null;
    this.controlPoint2 = null;
    this.controlPointDiameter = 10;
    this.isControlPointMousedown = false;
    this.mousedownControlPointKey = "";
    this.controlPointMousemoveState = {
      pos: null,
      startPoint: null,
      endPoint: null,
      targetIndex: ""
    };
    this.checkOverlapNode = throttle(this.checkOverlapNode, 100, this);
    Object.keys(associativeLineControls_default).forEach((item) => {
      this[item] = associativeLineControls_default[item].bind(this);
    });
    Object.keys(associativeLineText_default).forEach((item) => {
      this[item] = associativeLineText_default[item].bind(this);
    });
    this.bindEvent();
  }
  // 监听事件
  bindEvent() {
    this.renderAllLines = this.renderAllLines.bind(this);
    this.mindMap.on("node_tree_render_end", this.renderAllLines);
    this.mindMap.on("data_change", this.renderAllLines);
    this.mindMap.on("draw_click", () => {
      if (this.isControlPointMousedown) {
        return;
      }
      this.clearActiveLine();
    });
    this.mindMap.on("node_click", (node3) => {
      if (this.isCreatingLine) {
        this.completeCreateLine(node3);
      } else {
        this.clearActiveLine();
      }
    });
    this.mindMap.keyCommand.addShortcut(
      "Del|Backspace",
      this.removeLine.bind(this)
    );
    this.mindMap.command.add("ADD_ASSOCIATIVE_LINE", this.addLine.bind(this));
    this.mindMap.on("mousemove", this.onMousemove.bind(this));
    this.mindMap.on("node_dragging", this.onNodeDragging.bind(this));
    this.mindMap.on("node_dragend", this.onNodeDragend.bind(this));
    this.mindMap.on("mouseup", this.onControlPointMouseup.bind(this));
    this.mindMap.on("scale", this.onScale);
  }
  // 创建箭头
  createMarker() {
    return this.draw.marker(20, 20, (add) => {
      add.ref(2, 5);
      add.size(10, 10);
      add.attr("orient", "auto-start-reverse");
      this.markerPath = add.path("M0,0 L2,5 L0,10 L10,5 Z");
    });
  }
  // 渲染所有连线
  renderAllLines() {
    this.removeAllLines();
    this.removeControls();
    this.clearActiveLine();
    let tree = this.mindMap.renderer.root;
    if (!tree)
      return;
    let idToNode = /* @__PURE__ */ new Map();
    let nodeToIds = /* @__PURE__ */ new Map();
    walk(
      tree,
      null,
      (cur) => {
        if (!cur)
          return;
        let data2 = cur.nodeData.data;
        if (data2.associativeLineTargets && data2.associativeLineTargets.length > 0) {
          nodeToIds.set(cur, data2.associativeLineTargets);
        }
        if (data2.id) {
          idToNode.set(data2.id, cur);
        }
      },
      () => {
      },
      true,
      0
    );
    nodeToIds.forEach((ids, node3) => {
      ids.forEach((id) => {
        let toNode = idToNode.get(id);
        if (!node3 || !toNode)
          return;
        let [startPoint, endPoint] = computeNodePoints(node3, toNode);
        this.drawLine(startPoint, endPoint, node3, toNode);
      });
    });
  }
  // 绘制连接线
  drawLine(startPoint, endPoint, node3, toNode) {
    let {
      associativeLineWidth,
      associativeLineColor,
      associativeLineActiveWidth,
      associativeLineActiveColor
    } = this.mindMap.themeConfig;
    this.markerPath.stroke({ color: associativeLineColor }).fill({ color: associativeLineColor });
    let { path: pathStr, controlPoints } = getNodeLinePath(
      startPoint,
      endPoint,
      node3,
      toNode
    );
    let path = this.draw.path();
    path.stroke({
      width: associativeLineWidth,
      color: associativeLineColor,
      dasharray: [6, 4]
    }).fill({ color: "none" });
    path.plot(pathStr);
    path.marker("end", this.marker);
    let clickPath = this.draw.path();
    clickPath.stroke({ width: associativeLineActiveWidth, color: "transparent" }).fill({ color: "none" });
    clickPath.plot(pathStr);
    let text3 = this.createText({ path, clickPath, node: node3, toNode, startPoint, endPoint, controlPoints });
    clickPath.click((e2) => {
      e2.stopPropagation();
      this.setActiveLine({ path, clickPath, text: text3, node: node3, toNode, startPoint, endPoint, controlPoints });
    });
    this.renderText(this.getText(node3, toNode), path, text3);
    this.lineList.push([path, clickPath, text3, node3, toNode]);
  }
  // 激活某根关联线
  setActiveLine({ path, clickPath, text: text3, node: node3, toNode, startPoint, endPoint, controlPoints }) {
    let {
      associativeLineActiveColor
    } = this.mindMap.themeConfig;
    if (this.mindMap.renderer.activeNodeList.length > 0) {
      this.clearActiveNodes();
    } else {
      this.clearActiveLine();
      this.activeLine = [path, clickPath, text3, node3, toNode];
      clickPath.stroke({ color: associativeLineActiveColor });
      if (!this.getText(node3, toNode)) {
        this.renderText(this.mindMap.opt.defaultAssociativeLineText, path, text3);
      }
      this.renderControls(
        startPoint,
        endPoint,
        controlPoints[0],
        controlPoints[1]
      );
      this.mindMap.emit("associative_line_click", path, clickPath, node3, toNode);
    }
  }
  // 移除所有连接线
  removeAllLines() {
    this.lineList.forEach((line) => {
      line[0].remove();
      line[1].remove();
      line[2].remove();
    });
    this.lineList = [];
  }
  // 从当前激活节点开始创建连接线
  createLineFromActiveNode() {
    if (this.mindMap.renderer.activeNodeList.length <= 0)
      return;
    let node3 = this.mindMap.renderer.activeNodeList[0];
    this.createLine(node3);
  }
  // 创建连接线
  createLine(fromNode) {
    let { associativeLineWidth, associativeLineColor } = this.mindMap.themeConfig;
    if (this.isCreatingLine || !fromNode)
      return;
    this.isCreatingLine = true;
    this.creatingStartNode = fromNode;
    this.creatingLine = this.draw.path();
    this.creatingLine.stroke({
      width: associativeLineWidth,
      color: associativeLineColor,
      dasharray: [6, 4]
    }).fill({ color: "none" });
    this.creatingLine.marker("end", this.marker);
  }
  // 鼠标移动事件
  onMousemove(e2) {
    this.onControlPointMousemove(e2);
    this.updateCreatingLine(e2);
  }
  // 更新创建过程中的连接线
  updateCreatingLine(e2) {
    if (!this.isCreatingLine)
      return;
    let { x: x3, y: y4 } = this.getTransformedEventPos(e2);
    let startPoint = getNodePoint(this.creatingStartNode);
    let offsetX = x3 > startPoint.x ? -10 : 10;
    let pathStr = cubicBezierPath(startPoint.x, startPoint.y, x3 + offsetX, y4);
    this.creatingLine.plot(pathStr);
    this.checkOverlapNode(x3, y4);
  }
  // 获取转换后的鼠标事件对象的坐标
  getTransformedEventPos(e2) {
    let { x: x3, y: y4 } = this.mindMap.toPos(e2.clientX, e2.clientY);
    let { scaleX, scaleY, translateX, translateY } = this.mindMap.draw.transform();
    return {
      x: (x3 - translateX) / scaleX,
      y: (y4 - translateY) / scaleY
    };
  }
  // 检测当前移动到的目标节点
  checkOverlapNode(x3, y4) {
    this.overlapNode = null;
    bfsWalk(this.mindMap.renderer.root, (node3) => {
      if (node3.nodeData.data.isActive) {
        this.mindMap.renderer.setNodeActive(node3, false);
      }
      if (node3 === this.creatingStartNode || this.overlapNode) {
        return;
      }
      let { left, top, width: width2, height: height2 } = node3;
      let right = left + width2;
      let bottom = top + height2;
      if (x3 >= left && x3 <= right && y4 >= top && y4 <= bottom) {
        this.overlapNode = node3;
      }
    });
    if (this.overlapNode && !this.overlapNode.nodeData.data.isActive) {
      this.mindMap.renderer.setNodeActive(this.overlapNode, true);
    }
  }
  // 完成创建连接线
  completeCreateLine(node3) {
    if (this.creatingStartNode === node3)
      return;
    this.addLine(this.creatingStartNode, node3);
    if (this.overlapNode && this.overlapNode.nodeData.data.isActive) {
      this.mindMap.renderer.setNodeActive(this.overlapNode, false);
    }
    this.isCreatingLine = false;
    this.creatingStartNode = null;
    this.creatingLine.remove();
    this.creatingLine = null;
    this.overlapNode = null;
  }
  // 添加连接线
  addLine(fromNode, toNode) {
    if (!fromNode || !toNode)
      return;
    let id = toNode.nodeData.data.id;
    if (!id) {
      id = v4_default();
      this.mindMap.execCommand("SET_NODE_DATA", toNode, {
        id
      });
    }
    let list2 = fromNode.nodeData.data.associativeLineTargets || [];
    list2.push(id);
    let [startPoint, endPoint] = computeNodePoints(fromNode, toNode);
    let controlPoints = computeCubicBezierPathPoints(
      startPoint.x,
      startPoint.y,
      endPoint.x,
      endPoint.y
    );
    let offsetList = fromNode.nodeData.data.associativeLineTargetControlOffsets || [];
    offsetList[list2.length - 1] = [
      {
        x: controlPoints[0].x - startPoint.x,
        y: controlPoints[0].y - startPoint.y
      },
      {
        x: controlPoints[1].x - endPoint.x,
        y: controlPoints[1].y - endPoint.y
      }
    ];
    this.mindMap.execCommand("SET_NODE_DATA", fromNode, {
      associativeLineTargets: list2,
      associativeLineTargetControlOffsets: offsetList
    });
  }
  // 删除连接线
  removeLine() {
    if (!this.activeLine)
      return;
    let [, , , node3, toNode] = this.activeLine;
    this.removeControls();
    let { associativeLineTargets, associativeLineTargetControlOffsets, associativeLineText } = node3.nodeData.data;
    let targetIndex = getAssociativeLineTargetIndex(node3, toNode);
    let newAssociativeLineText = {};
    if (associativeLineText) {
      Object.keys(associativeLineText).forEach((item) => {
        if (item !== toNode.nodeData.data.id) {
          newAssociativeLineText[item] = associativeLineText[item];
        }
      });
    }
    this.mindMap.execCommand("SET_NODE_DATA", node3, {
      // 目标
      associativeLineTargets: associativeLineTargets.filter((_3, index3) => {
        return index3 !== targetIndex;
      }),
      // 偏移量
      associativeLineTargetControlOffsets: associativeLineTargetControlOffsets ? associativeLineTargetControlOffsets.filter((_3, index3) => {
        return index3 !== targetIndex;
      }) : [],
      // 文本
      associativeLineText: newAssociativeLineText
    });
  }
  // 清除当前激活的节点
  clearActiveNodes() {
    if (this.mindMap.renderer.activeNodeList.length > 0) {
      this.mindMap.execCommand("CLEAR_ACTIVE_NODE");
    }
  }
  // 清除激活的线
  clearActiveLine() {
    if (this.activeLine) {
      let [, clickPath, text3, node3, toNode] = this.activeLine;
      clickPath.stroke({
        color: "transparent"
      });
      this.hideEditTextBox();
      if (!this.getText(node3, toNode)) {
        text3.clear();
      }
      this.activeLine = null;
      this.removeControls();
    }
  }
  // 处理节点正在拖拽事件
  onNodeDragging() {
    if (this.isNodeDragging)
      return;
    this.isNodeDragging = true;
    this.lineList.forEach((line) => {
      line[0].hide();
      line[1].hide();
      line[2].hide();
    });
    this.hideControls();
  }
  // 处理节点拖拽完成事件
  onNodeDragend() {
    if (!this.isNodeDragging)
      return;
    this.lineList.forEach((line) => {
      line[0].show();
      line[1].show();
      line[2].show();
    });
    this.showControls();
    this.isNodeDragging = false;
  }
};
AssociativeLine.instanceName = "associativeLine";
var AssociativeLine_default = AssociativeLine;

// ../simple-mind-map/src/plugins/RichText.js
var import_quill = __toESM(require_quill());
var import_html2canvas = __toESM(require_html2canvas());
var extended = false;
var fontFamilyList = [
  "\u5B8B\u4F53, SimSun, Songti SC",
  "\u5FAE\u8F6F\u96C5\u9ED1, Microsoft YaHei",
  "\u6977\u4F53, \u6977\u4F53_GB2312, SimKai, STKaiti",
  "\u9ED1\u4F53, SimHei, Heiti SC",
  "\u96B6\u4E66, SimLi",
  "andale mono",
  "arial, helvetica, sans-serif",
  "arial black, avant garde",
  "comic sans ms",
  "impact, chicago",
  "times new roman",
  "sans-serif",
  "serif"
];
var fontSizeList = new Array(100).fill(0).map((_3, index3) => {
  return index3 + "px";
});
var RichText = class {
  constructor({ mindMap, pluginOpt }) {
    this.mindMap = mindMap;
    this.pluginOpt = pluginOpt;
    this.textEditNode = null;
    this.showTextEdit = false;
    this.quill = null;
    this.range = null;
    this.lastRange = null;
    this.node = null;
    this.styleEl = null;
    this.cacheEditingText = "";
    this.lostStyle = false;
    this.isCompositing = false;
    this.initOpt();
    this.extendQuill();
    this.appendCss();
    this.bindEvent();
    if (this.mindMap.opt.data) {
      this.mindMap.opt.data = this.handleSetData(this.mindMap.opt.data);
    }
  }
  // 绑定事件
  bindEvent() {
    this.onCompositionStart = this.onCompositionStart.bind(this);
    this.onCompositionEnd = this.onCompositionEnd.bind(this);
    window.addEventListener("compositionstart", this.onCompositionStart);
    window.addEventListener("compositionend", this.onCompositionEnd);
  }
  // 解绑事件
  unbindEvent() {
    window.removeEventListener("compositionstart", this.onCompositionStart);
    window.removeEventListener("compositionend", this.onCompositionEnd);
  }
  // 插入样式
  appendCss() {
    let cssText = `
      .ql-editor {
        overflow: hidden;
        padding: 0;
        height: auto;
        line-height: normal;
        -webkit-user-select: text;
      }
      
      .ql-container {
        height: auto;
        font-size: inherit;
      }

      .ql-container.ql-snow {
        border: none;
      }

      .smm-richtext-node-wrap p {
        font-family: auto;
      }

      .smm-richtext-node-edit-wrap p {
        font-family: auto;
      }
    `;
    this.styleEl = document.createElement("style");
    this.styleEl.type = "text/css";
    this.styleEl.innerHTML = cssText;
    document.head.appendChild(this.styleEl);
  }
  // 处理选项参数
  initOpt() {
    if (this.pluginOpt.fontFamilyList && Array.isArray(this.pluginOpt.fontFamilyList)) {
      fontFamilyList = this.pluginOpt.fontFamilyList;
    }
    if (this.pluginOpt.fontSizeList && Array.isArray(this.pluginOpt.fontSizeList)) {
      fontSizeList = this.pluginOpt.fontSizeList;
    }
  }
  // 扩展quill编辑器
  extendQuill() {
    if (extended) {
      return;
    }
    extended = true;
    const FontAttributor = import_quill.default.import("attributors/class/font");
    FontAttributor.whitelist = fontFamilyList;
    import_quill.default.register(FontAttributor, true);
    const FontStyle = import_quill.default.import("attributors/style/font");
    FontStyle.whitelist = fontFamilyList;
    import_quill.default.register(FontStyle, true);
    const SizeAttributor = import_quill.default.import("attributors/class/size");
    SizeAttributor.whitelist = fontSizeList;
    import_quill.default.register(SizeAttributor, true);
    const SizeStyle = import_quill.default.import("attributors/style/size");
    SizeStyle.whitelist = fontSizeList;
    import_quill.default.register(SizeStyle, true);
  }
  // 显示文本编辑控件
  showEditText(node3, rect) {
    if (this.showTextEdit) {
      return;
    }
    this.node = node3;
    if (!rect)
      rect = node3._textData.node.node.getBoundingClientRect();
    this.mindMap.emit("before_show_text_edit");
    this.mindMap.renderer.textEdit.registerTmpShortcut();
    let g2 = node3._textData.node;
    let originWidth = g2.attr("data-width");
    let originHeight = g2.attr("data-height");
    let scaleX = rect.width / originWidth;
    let scaleY = rect.height / originHeight;
    const paddingX = 6;
    const paddingY = 4;
    if (!this.textEditNode) {
      this.textEditNode = document.createElement("div");
      this.textEditNode.classList.add("smm-richtext-node-edit-wrap");
      this.textEditNode.style.cssText = `position:fixed;box-sizing: border-box;box-shadow: 0 0 20px rgba(0,0,0,.5);outline: none; word-break: break-all;padding: ${paddingY}px ${paddingX}px;`;
      this.textEditNode.addEventListener("click", (e2) => {
        e2.stopPropagation();
      });
      document.body.appendChild(this.textEditNode);
    }
    let bgColor = node3.style.merge("fillColor");
    this.textEditNode.style.marginLeft = `-${paddingX * scaleX}px`;
    this.textEditNode.style.marginTop = `-${paddingY * scaleY}px`;
    this.textEditNode.style.zIndex = this.mindMap.opt.nodeTextEditZIndex;
    this.textEditNode.style.backgroundColor = bgColor === "transparent" ? "#fff" : bgColor;
    this.textEditNode.style.minWidth = originWidth + paddingX * 2 + "px";
    this.textEditNode.style.minHeight = originHeight + "px";
    this.textEditNode.style.left = rect.left + "px";
    this.textEditNode.style.top = rect.top + "px";
    this.textEditNode.style.display = "block";
    this.textEditNode.style.maxWidth = this.mindMap.opt.textAutoWrapWidth + paddingX * 2 + "px";
    this.textEditNode.style.transform = `scale(${scaleX}, ${scaleY})`;
    this.textEditNode.style.transformOrigin = "left top";
    if (!node3.nodeData.data.richText) {
      let text3 = node3.nodeData.data.text.split(/\n/gim).join("<br>");
      let html2 = `<p>${text3}</p>`;
      this.textEditNode.innerHTML = this.cacheEditingText || html2;
    } else {
      this.textEditNode.innerHTML = this.cacheEditingText || node3.nodeData.data.text;
    }
    this.initQuillEditor();
    document.querySelector(".ql-editor").style.minHeight = originHeight + "px";
    this.showTextEdit = true;
    this.focus();
    if (!node3.nodeData.data.richText) {
      this.setTextStyleIfNotRichText(node3);
    }
    this.cacheEditingText = "";
  }
  // 如果是非富文本的情况，需要手动应用文本样式
  setTextStyleIfNotRichText(node3) {
    let style = {
      font: node3.style.merge("fontFamily"),
      color: node3.style.merge("color"),
      italic: node3.style.merge("fontStyle") === "italic",
      bold: node3.style.merge("fontWeight") === "bold",
      size: node3.style.merge("fontSize") + "px",
      underline: node3.style.merge("textDecoration") === "underline",
      strike: node3.style.merge("textDecoration") === "line-through"
    };
    this.formatAllText(style);
  }
  // 获取当前正在编辑的内容
  getEditText() {
    let html2 = this.quill.container.firstChild.innerHTML;
    return html2.replace(/<p><br><\/p>$/, "");
  }
  // 隐藏文本编辑控件，即完成编辑
  hideEditText(nodes) {
    if (!this.showTextEdit) {
      return;
    }
    let html2 = this.getEditText();
    let list2 = nodes && nodes.length > 0 ? nodes : this.mindMap.renderer.activeNodeList;
    list2.forEach((node3) => {
      this.mindMap.execCommand("SET_NODE_TEXT", node3, html2, true);
      if (node3.isGeneralization) {
        node3.generalizationBelongNode.updateGeneralization();
      }
      this.mindMap.render();
    });
    this.mindMap.emit("hide_text_edit", this.textEditNode, list2);
    this.textEditNode.style.display = "none";
    this.showTextEdit = false;
    this.mindMap.emit("rich_text_selection_change", false);
    this.node = null;
  }
  // 初始化Quill富文本编辑器
  initQuillEditor() {
    this.quill = new import_quill.default(this.textEditNode, {
      modules: {
        toolbar: false,
        keyboard: {
          bindings: {
            enter: {
              key: 13,
              handler: function() {
              }
            }
          }
        }
      },
      theme: "snow"
    });
    this.quill.on("selection-change", (range) => {
      this.lastRange = this.range;
      this.range = null;
      if (range) {
        let bounds = this.quill.getBounds(range.index, range.length);
        let rect = this.textEditNode.getBoundingClientRect();
        let rectInfo = {
          left: bounds.left + rect.left,
          top: bounds.top + rect.top,
          right: bounds.right + rect.left,
          bottom: bounds.bottom + rect.top,
          width: bounds.width
        };
        let formatInfo = this.quill.getFormat(range.index, range.length);
        let hasRange = false;
        if (range.length == 0) {
          hasRange = false;
        } else {
          this.range = range;
          hasRange = true;
        }
        this.mindMap.emit(
          "rich_text_selection_change",
          hasRange,
          rectInfo,
          formatInfo
        );
      }
    });
    this.quill.on("text-change", () => {
      let contents = this.quill.getContents();
      let len = contents.ops.length;
      if (len <= 0 || len === 1 && contents.ops[0].insert === "\n") {
        this.lostStyle = true;
        this.syncFormatToNodeConfig(null, true);
      } else if (this.lostStyle && !this.isCompositing) {
        this.setTextStyleIfNotRichText(this.node);
        this.lostStyle = false;
      }
    });
  }
  // 正则输入中文
  onCompositionStart() {
    if (!this.showTextEdit) {
      return;
    }
    this.isCompositing = true;
  }
  // 中文输入结束
  onCompositionEnd() {
    if (!this.showTextEdit) {
      return;
    }
    this.isCompositing = false;
    this.setTextStyleIfNotRichText(this.node);
  }
  // 选中全部
  selectAll() {
    this.quill.setSelection(0, this.quill.getLength());
  }
  // 聚焦
  focus() {
    let len = this.quill.getLength();
    this.quill.setSelection(len, len);
  }
  // 格式化当前选中的文本
  formatText(config = {}, clear2 = false) {
    if (!this.range && !this.lastRange)
      return;
    this.syncFormatToNodeConfig(config, clear2);
    let rangeLost = !this.range;
    let range = rangeLost ? this.lastRange : this.range;
    clear2 ? this.quill.removeFormat(range.index, range.length) : this.quill.formatText(range.index, range.length, config);
    if (rangeLost) {
      this.quill.setSelection(this.lastRange.index, this.lastRange.length);
    }
  }
  // 清除当前选中文本的样式
  removeFormat() {
    this.formatText({}, true);
  }
  // 格式化指定范围的文本
  formatRangeText(range, config = {}) {
    if (!range)
      return;
    this.syncFormatToNodeConfig(config);
    this.quill.formatText(range.index, range.length, config);
  }
  // 格式化所有文本
  formatAllText(config = {}) {
    this.syncFormatToNodeConfig(config);
    this.quill.formatText(0, this.quill.getLength(), config);
  }
  // 同步格式化到节点样式配置
  syncFormatToNodeConfig(config, clear2) {
    if (!this.node)
      return;
    if (clear2) {
      ;
      [
        "fontFamily",
        "fontSize",
        "fontWeight",
        "fontStyle",
        "textDecoration",
        "color"
      ].forEach((prop) => {
        delete this.node.nodeData.data[prop];
      });
    } else {
      let data2 = this.richTextStyleToNormalStyle(config);
      this.mindMap.renderer.setNodeData(this.node, data2);
    }
  }
  // 将普通节点样式对象转换成富文本样式对象
  normalStyleToRichTextStyle(style) {
    let config = {};
    Object.keys(style).forEach((prop) => {
      let value = style[prop];
      switch (prop) {
        case "fontFamily":
          config.font = value;
          break;
        case "fontSize":
          config.size = value + "px";
          break;
        case "fontWeight":
          config.bold = value === "bold";
          break;
        case "fontStyle":
          config.italic = value === "italic";
          break;
        case "textDecoration":
          config.underline = value === "underline";
          config.strike = value === "line-through";
          break;
        case "color":
          config.color = value;
          break;
        default:
          break;
      }
    });
    return config;
  }
  // 将富文本样式对象转换成普通节点样式对象
  richTextStyleToNormalStyle(config) {
    let data2 = {};
    Object.keys(config).forEach((prop) => {
      let value = config[prop];
      switch (prop) {
        case "font":
          data2.fontFamily = value;
          break;
        case "size":
          data2.fontSize = parseFloat(value);
          break;
        case "bold":
          data2.fontWeight = value ? "bold" : "normal";
          break;
        case "italic":
          data2.fontStyle = value ? "italic" : "normal";
          break;
        case "underline":
          data2.textDecoration = value ? "underline" : "none";
          break;
        case "strike":
          data2.textDecoration = value ? "line-through" : "none";
          break;
        case "color":
          data2.color = value;
          break;
        default:
          break;
      }
    });
    return data2;
  }
  // 处理导出为图片
  async handleExportPng(node3) {
    let el2 = document.createElement("div");
    el2.style.position = "absolute";
    el2.style.left = "-9999999px";
    el2.appendChild(node3);
    this.mindMap.el.appendChild(el2);
    let walk2 = (root2) => {
      root2.style.margin = 0;
      root2.style.padding = 0;
      if (root2.hasChildNodes()) {
        Array.from(root2.children).forEach((item) => {
          walk2(item);
        });
      }
    };
    walk2(node3);
    let canvas = await (0, import_html2canvas.default)(el2, {
      backgroundColor: null
    });
    this.mindMap.el.removeChild(el2);
    return canvas.toDataURL();
  }
  // 将所有节点转换成非富文本节点
  transformAllNodesToNormalNode() {
    walk(
      this.mindMap.renderer.renderTree,
      null,
      (node3) => {
        if (node3.data.richText) {
          node3.data.richText = false;
          node3.data.text = getTextFromHtml(node3.data.text);
        }
      },
      null,
      true,
      0,
      0
    );
    this.mindMap.command.clearHistory();
    this.mindMap.command.addHistory();
    this.mindMap.render(null, CONSTANTS.TRANSFORM_TO_NORMAL_NODE);
  }
  // 处理导入数据
  handleSetData(data2) {
    let walk2 = (root2) => {
      if (!root2.data.richText) {
        root2.data.richText = true;
        root2.data.resetRichText = true;
      }
      if (root2.children && root2.children.length > 0) {
        Array.from(root2.children).forEach((item) => {
          walk2(item);
        });
      }
    };
    walk2(data2);
    return data2;
  }
  // 插件被移除前做的事情
  beforePluginRemove() {
    this.transformAllNodesToNormalNode();
    document.head.removeChild(this.styleEl);
  }
};
RichText.instanceName = "richText";
var RichText_default = RichText;

// ../simple-mind-map/src/parse/xmind.js
var import_jszip = __toESM(require_jszip_min());
var import_xml_js = __toESM(require_lib());
var parseXmindFile = (file) => {
  return new Promise((resolve, reject) => {
    import_jszip.default.loadAsync(file).then(
      async (zip) => {
        try {
          let content3 = "";
          if (zip.files["content.json"]) {
            let json = await zip.files["content.json"].async("string");
            content3 = transformXmind(json);
          } else if (zip.files["content.xml"]) {
            let xml = await zip.files["content.xml"].async("string");
            let json = import_xml_js.default.xml2json(xml);
            content3 = transformOldXmind(json);
          }
          if (content3) {
            resolve(content3);
          } else {
            reject(new Error("\u89E3\u6790\u5931\u8D25"));
          }
        } catch (error) {
          reject(error);
        }
      },
      (e2) => {
        reject(e2);
      }
    );
  });
};
var transformXmind = (content3) => {
  let data2 = JSON.parse(content3)[0];
  let nodeTree = data2.rootTopic;
  let newTree = {};
  let walk2 = (node3, newNode) => {
    newNode.data = {
      // 节点内容
      text: node3.title
    };
    if (node3.notes) {
      newNode.data.note = (node3.notes.realHTML || node3.notes.plain).content;
    }
    if (node3.href && /^https?:\/\//.test(node3.href)) {
      newNode.data.hyperlink = node3.href;
    }
    if (node3.labels && node3.labels.length > 0) {
      newNode.data.tag = node3.labels;
    }
    newNode.children = [];
    if (node3.children && node3.children.attached && node3.children.attached.length > 0) {
      node3.children.attached.forEach((item) => {
        let newChild = {};
        newNode.children.push(newChild);
        walk2(item, newChild);
      });
    }
  };
  walk2(nodeTree, newTree);
  return newTree;
};
var transformOldXmind = (content3) => {
  let data2 = JSON.parse(content3);
  let elements3 = data2.elements;
  let root2 = null;
  let getRoot = (arr) => {
    for (let i3 = 0; i3 < arr.length; i3++) {
      if (!root2 && arr[i3].name === "topic") {
        root2 = arr[i3];
        return;
      }
    }
    arr.forEach((item) => {
      getRoot(item.elements);
    });
  };
  getRoot(elements3);
  let newTree = {};
  let getItemByName = (arr, name) => {
    return arr.find((item) => {
      return item.name === name;
    });
  };
  let walk2 = (node3, newNode) => {
    let nodeElements = node3.elements;
    newNode.data = {
      // 节点内容
      text: getItemByName(nodeElements, "title").elements[0].text
    };
    try {
      let notesElement = getItemByName(nodeElements, "notes");
      if (notesElement) {
        newNode.data.note = notesElement.elements[0].elements[0].elements[0].text;
      }
    } catch (error) {
      console.log(error);
    }
    try {
      if (node3.attributes && node3.attributes["xlink:href"] && /^https?:\/\//.test(node3.attributes["xlink:href"])) {
        newNode.data.hyperlink = node3.attributes["xlink:href"];
      }
    } catch (error) {
      console.log(error);
    }
    try {
      let labelsElement = getItemByName(nodeElements, "labels");
      if (labelsElement) {
        newNode.data.tag = labelsElement.elements.map((item) => {
          return item.elements[0].text;
        });
      }
    } catch (error) {
      console.log(error);
    }
    newNode.children = [];
    let _children = getItemByName(nodeElements, "children");
    if (_children && _children.elements && _children.elements.length > 0) {
      _children.elements.forEach((item) => {
        if (item.name === "topics") {
          item.elements.forEach((item2) => {
            let newChild = {};
            newNode.children.push(newChild);
            walk2(item2, newChild);
          });
        } else {
          let newChild = {};
          newNode.children.push(newChild);
          walk2(item, newChild);
        }
      });
    }
  };
  walk2(root2, newTree);
  return newTree;
};
var xmind_default = {
  parseXmindFile,
  transformXmind,
  transformOldXmind
};

// ../simple-mind-map/node_modules/mdast-util-to-string/lib/index.js
function toString7(value, options) {
  const includeImageAlt = (options || {}).includeImageAlt;
  return one(
    value,
    typeof includeImageAlt === "boolean" ? includeImageAlt : true
  );
}
function one(value, includeImageAlt) {
  return node2(value) && ("value" in value && value.value || includeImageAlt && "alt" in value && value.alt || "children" in value && all(value.children, includeImageAlt)) || Array.isArray(value) && all(value, includeImageAlt) || "";
}
function all(values, includeImageAlt) {
  const result = [];
  let index3 = -1;
  while (++index3 < values.length) {
    result[index3] = one(values[index3], includeImageAlt);
  }
  return result.join("");
}
function node2(value) {
  return Boolean(value && typeof value === "object");
}

// ../simple-mind-map/node_modules/micromark-util-chunked/index.js
function splice(list2, start, remove, items) {
  const end = list2.length;
  let chunkStart = 0;
  let parameters;
  if (start < 0) {
    start = -start > end ? 0 : end + start;
  } else {
    start = start > end ? end : start;
  }
  remove = remove > 0 ? remove : 0;
  if (items.length < 1e4) {
    parameters = Array.from(items);
    parameters.unshift(start, remove);
    [].splice.apply(list2, parameters);
  } else {
    if (remove)
      [].splice.apply(list2, [start, remove]);
    while (chunkStart < items.length) {
      parameters = items.slice(chunkStart, chunkStart + 1e4);
      parameters.unshift(start, 0);
      [].splice.apply(list2, parameters);
      chunkStart += 1e4;
      start += 1e4;
    }
  }
}
function push3(list2, items) {
  if (list2.length > 0) {
    splice(list2, list2.length, 0, items);
    return list2;
  }
  return items;
}

// ../simple-mind-map/node_modules/micromark-util-combine-extensions/index.js
var hasOwnProperty = {}.hasOwnProperty;
function combineExtensions(extensions) {
  const all2 = {};
  let index3 = -1;
  while (++index3 < extensions.length) {
    syntaxExtension(all2, extensions[index3]);
  }
  return all2;
}
function syntaxExtension(all2, extension2) {
  let hook;
  for (hook in extension2) {
    const maybe = hasOwnProperty.call(all2, hook) ? all2[hook] : void 0;
    const left = maybe || (all2[hook] = {});
    const right = extension2[hook];
    let code;
    for (code in right) {
      if (!hasOwnProperty.call(left, code))
        left[code] = [];
      const value = right[code];
      constructs(
        // @ts-expect-error Looks like a list.
        left[code],
        Array.isArray(value) ? value : value ? [value] : []
      );
    }
  }
}
function constructs(existing, list2) {
  let index3 = -1;
  const before2 = [];
  while (++index3 < list2.length) {
    ;
    (list2[index3].add === "after" ? existing : before2).push(list2[index3]);
  }
  splice(existing, 0, 0, before2);
}

// ../simple-mind-map/node_modules/micromark-util-character/lib/unicode-punctuation-regex.js
var unicodePunctuationRegex = /[!-/:-@[-`{-~\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\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\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\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]/;

// ../simple-mind-map/node_modules/micromark-util-character/index.js
var asciiAlpha = regexCheck(/[A-Za-z]/);
var asciiDigit = regexCheck(/\d/);
var asciiHexDigit = regexCheck(/[\dA-Fa-f]/);
var asciiAlphanumeric = regexCheck(/[\dA-Za-z]/);
var asciiPunctuation = regexCheck(/[!-/:-@[-`{-~]/);
var asciiAtext = regexCheck(/[#-'*+\--9=?A-Z^-~]/);
function asciiControl(code) {
  return (
    // Special whitespace codes (which have negative values), C0 and Control
    // character DEL
    code !== null && (code < 32 || code === 127)
  );
}
function markdownLineEndingOrSpace(code) {
  return code !== null && (code < 0 || code === 32);
}
function markdownLineEnding(code) {
  return code !== null && code < -2;
}
function markdownSpace(code) {
  return code === -2 || code === -1 || code === 32;
}
var unicodeWhitespace = regexCheck(/\s/);
var unicodePunctuation = regexCheck(unicodePunctuationRegex);
function regexCheck(regex) {
  return check;
  function check(code) {
    return code !== null && regex.test(String.fromCharCode(code));
  }
}

// ../simple-mind-map/node_modules/micromark-factory-space/index.js
function factorySpace(effects, ok, type, max3) {
  const limit = max3 ? max3 - 1 : Number.POSITIVE_INFINITY;
  let size2 = 0;
  return start;
  function start(code) {
    if (markdownSpace(code)) {
      effects.enter(type);
      return prefix(code);
    }
    return ok(code);
  }
  function prefix(code) {
    if (markdownSpace(code) && size2++ < limit) {
      effects.consume(code);
      return prefix;
    }
    effects.exit(type);
    return ok(code);
  }
}

// ../simple-mind-map/node_modules/micromark/lib/initialize/content.js
var content = {
  tokenize: initializeContent
};
function initializeContent(effects) {
  const contentStart = effects.attempt(
    this.parser.constructs.contentInitial,
    afterContentStartConstruct,
    paragraphInitial
  );
  let previous2;
  return contentStart;
  function afterContentStartConstruct(code) {
    if (code === null) {
      effects.consume(code);
      return;
    }
    effects.enter("lineEnding");
    effects.consume(code);
    effects.exit("lineEnding");
    return factorySpace(effects, contentStart, "linePrefix");
  }
  function paragraphInitial(code) {
    effects.enter("paragraph");
    return lineStart(code);
  }
  function lineStart(code) {
    const token = effects.enter("chunkText", {
      contentType: "text",
      previous: previous2
    });
    if (previous2) {
      previous2.next = token;
    }
    previous2 = token;
    return data2(code);
  }
  function data2(code) {
    if (code === null) {
      effects.exit("chunkText");
      effects.exit("paragraph");
      effects.consume(code);
      return;
    }
    if (markdownLineEnding(code)) {
      effects.consume(code);
      effects.exit("chunkText");
      return lineStart;
    }
    effects.consume(code);
    return data2;
  }
}

// ../simple-mind-map/node_modules/micromark/lib/initialize/document.js
var document2 = {
  tokenize: initializeDocument
};
var containerConstruct = {
  tokenize: tokenizeContainer
};
function initializeDocument(effects) {
  const self2 = this;
  const stack = [];
  let continued = 0;
  let childFlow;
  let childToken;
  let lineStartOffset;
  return start;
  function start(code) {
    if (continued < stack.length) {
      const item = stack[continued];
      self2.containerState = item[1];
      return effects.attempt(
        item[0].continuation,
        documentContinue,
        checkNewContainers
      )(code);
    }
    return checkNewContainers(code);
  }
  function documentContinue(code) {
    continued++;
    if (self2.containerState._closeFlow) {
      self2.containerState._closeFlow = void 0;
      if (childFlow) {
        closeFlow();
      }
      const indexBeforeExits = self2.events.length;
      let indexBeforeFlow = indexBeforeExits;
      let point4;
      while (indexBeforeFlow--) {
        if (self2.events[indexBeforeFlow][0] === "exit" && self2.events[indexBeforeFlow][1].type === "chunkFlow") {
          point4 = self2.events[indexBeforeFlow][1].end;
          break;
        }
      }
      exitContainers(continued);
      let index3 = indexBeforeExits;
      while (index3 < self2.events.length) {
        self2.events[index3][1].end = Object.assign({}, point4);
        index3++;
      }
      splice(
        self2.events,
        indexBeforeFlow + 1,
        0,
        self2.events.slice(indexBeforeExits)
      );
      self2.events.length = index3;
      return checkNewContainers(code);
    }
    return start(code);
  }
  function checkNewContainers(code) {
    if (continued === stack.length) {
      if (!childFlow) {
        return documentContinued(code);
      }
      if (childFlow.currentConstruct && childFlow.currentConstruct.concrete) {
        return flowStart(code);
      }
      self2.interrupt = Boolean(
        childFlow.currentConstruct && !childFlow._gfmTableDynamicInterruptHack
      );
    }
    self2.containerState = {};
    return effects.check(
      containerConstruct,
      thereIsANewContainer,
      thereIsNoNewContainer
    )(code);
  }
  function thereIsANewContainer(code) {
    if (childFlow)
      closeFlow();
    exitContainers(continued);
    return documentContinued(code);
  }
  function thereIsNoNewContainer(code) {
    self2.parser.lazy[self2.now().line] = continued !== stack.length;
    lineStartOffset = self2.now().offset;
    return flowStart(code);
  }
  function documentContinued(code) {
    self2.containerState = {};
    return effects.attempt(
      containerConstruct,
      containerContinue,
      flowStart
    )(code);
  }
  function containerContinue(code) {
    continued++;
    stack.push([self2.currentConstruct, self2.containerState]);
    return documentContinued(code);
  }
  function flowStart(code) {
    if (code === null) {
      if (childFlow)
        closeFlow();
      exitContainers(0);
      effects.consume(code);
      return;
    }
    childFlow = childFlow || self2.parser.flow(self2.now());
    effects.enter("chunkFlow", {
      contentType: "flow",
      previous: childToken,
      _tokenizer: childFlow
    });
    return flowContinue(code);
  }
  function flowContinue(code) {
    if (code === null) {
      writeToChild(effects.exit("chunkFlow"), true);
      exitContainers(0);
      effects.consume(code);
      return;
    }
    if (markdownLineEnding(code)) {
      effects.consume(code);
      writeToChild(effects.exit("chunkFlow"));
      continued = 0;
      self2.interrupt = void 0;
      return start;
    }
    effects.consume(code);
    return flowContinue;
  }
  function writeToChild(token, eof) {
    const stream = self2.sliceStream(token);
    if (eof)
      stream.push(null);
    token.previous = childToken;
    if (childToken)
      childToken.next = token;
    childToken = token;
    childFlow.defineSkip(token.start);
    childFlow.write(stream);
    if (self2.parser.lazy[token.start.line]) {
      let index3 = childFlow.events.length;
      while (index3--) {
        if (
          // The token starts before the line ending…
          childFlow.events[index3][1].start.offset < lineStartOffset && // …and either is not ended yet…
          (!childFlow.events[index3][1].end || // …or ends after it.
          childFlow.events[index3][1].end.offset > lineStartOffset)
        ) {
          return;
        }
      }
      const indexBeforeExits = self2.events.length;
      let indexBeforeFlow = indexBeforeExits;
      let seen;
      let point4;
      while (indexBeforeFlow--) {
        if (self2.events[indexBeforeFlow][0] === "exit" && self2.events[indexBeforeFlow][1].type === "chunkFlow") {
          if (seen) {
            point4 = self2.events[indexBeforeFlow][1].end;
            break;
          }
          seen = true;
        }
      }
      exitContainers(continued);
      index3 = indexBeforeExits;
      while (index3 < self2.events.length) {
        self2.events[index3][1].end = Object.assign({}, point4);
        index3++;
      }
      splice(
        self2.events,
        indexBeforeFlow + 1,
        0,
        self2.events.slice(indexBeforeExits)
      );
      self2.events.length = index3;
    }
  }
  function exitContainers(size2) {
    let index3 = stack.length;
    while (index3-- > size2) {
      const entry = stack[index3];
      self2.containerState = entry[1];
      entry[0].exit.call(self2, effects);
    }
    stack.length = size2;
  }
  function closeFlow() {
    childFlow.write([null]);
    childToken = void 0;
    childFlow = void 0;
    self2.containerState._closeFlow = void 0;
  }
}
function tokenizeContainer(effects, ok, nok) {
  return factorySpace(
    effects,
    effects.attempt(this.parser.constructs.document, ok, nok),
    "linePrefix",
    this.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4
  );
}

// ../simple-mind-map/node_modules/micromark-util-classify-character/index.js
function classifyCharacter(code) {
  if (code === null || markdownLineEndingOrSpace(code) || unicodeWhitespace(code)) {
    return 1;
  }
  if (unicodePunctuation(code)) {
    return 2;
  }
}

// ../simple-mind-map/node_modules/micromark-util-resolve-all/index.js
function resolveAll(constructs2, events, context) {
  const called = [];
  let index3 = -1;
  while (++index3 < constructs2.length) {
    const resolve = constructs2[index3].resolveAll;
    if (resolve && !called.includes(resolve)) {
      events = resolve(events, context);
      called.push(resolve);
    }
  }
  return events;
}

// ../simple-mind-map/node_modules/micromark-core-commonmark/lib/attention.js
var attention = {
  name: "attention",
  tokenize: tokenizeAttention,
  resolveAll: resolveAllAttention
};
function resolveAllAttention(events, context) {
  let index3 = -1;
  let open3;
  let group;
  let text3;
  let openingSequence;
  let closingSequence;
  let use;
  let nextEvents;
  let offset;
  while (++index3 < events.length) {
    if (events[index3][0] === "enter" && events[index3][1].type === "attentionSequence" && events[index3][1]._close) {
      open3 = index3;
      while (open3--) {
        if (events[open3][0] === "exit" && events[open3][1].type === "attentionSequence" && events[open3][1]._open && // If the markers are the same:
        context.sliceSerialize(events[open3][1]).charCodeAt(0) === context.sliceSerialize(events[index3][1]).charCodeAt(0)) {
          if ((events[open3][1]._close || events[index3][1]._open) && (events[index3][1].end.offset - events[index3][1].start.offset) % 3 && !((events[open3][1].end.offset - events[open3][1].start.offset + events[index3][1].end.offset - events[index3][1].start.offset) % 3)) {
            continue;
          }
          use = events[open3][1].end.offset - events[open3][1].start.offset > 1 && events[index3][1].end.offset - events[index3][1].start.offset > 1 ? 2 : 1;
          const start = Object.assign({}, events[open3][1].end);
          const end = Object.assign({}, events[index3][1].start);
          movePoint(start, -use);
          movePoint(end, use);
          openingSequence = {
            type: use > 1 ? "strongSequence" : "emphasisSequence",
            start,
            end: Object.assign({}, events[open3][1].end)
          };
          closingSequence = {
            type: use > 1 ? "strongSequence" : "emphasisSequence",
            start: Object.assign({}, events[index3][1].start),
            end
          };
          text3 = {
            type: use > 1 ? "strongText" : "emphasisText",
            start: Object.assign({}, events[open3][1].end),
            end: Object.assign({}, events[index3][1].start)
          };
          group = {
            type: use > 1 ? "strong" : "emphasis",
            start: Object.assign({}, openingSequence.start),
            end: Object.assign({}, closingSequence.end)
          };
          events[open3][1].end = Object.assign({}, openingSequence.start);
          events[index3][1].start = Object.assign({}, closingSequence.end);
          nextEvents = [];
          if (events[open3][1].end.offset - events[open3][1].start.offset) {
            nextEvents = push3(nextEvents, [
              ["enter", events[open3][1], context],
              ["exit", events[open3][1], context]
            ]);
          }
          nextEvents = push3(nextEvents, [
            ["enter", group, context],
            ["enter", openingSequence, context],
            ["exit", openingSequence, context],
            ["enter", text3, context]
          ]);
          nextEvents = push3(
            nextEvents,
            resolveAll(
              context.parser.constructs.insideSpan.null,
              events.slice(open3 + 1, index3),
              context
            )
          );
          nextEvents = push3(nextEvents, [
            ["exit", text3, context],
            ["enter", closingSequence, context],
            ["exit", closingSequence, context],
            ["exit", group, context]
          ]);
          if (events[index3][1].end.offset - events[index3][1].start.offset) {
            offset = 2;
            nextEvents = push3(nextEvents, [
              ["enter", events[index3][1], context],
              ["exit", events[index3][1], context]
            ]);
          } else {
            offset = 0;
          }
          splice(events, open3 - 1, index3 - open3 + 3, nextEvents);
          index3 = open3 + nextEvents.length - offset - 2;
          break;
        }
      }
    }
  }
  index3 = -1;
  while (++index3 < events.length) {
    if (events[index3][1].type === "attentionSequence") {
      events[index3][1].type = "data";
    }
  }
  return events;
}
function tokenizeAttention(effects, ok) {
  const attentionMarkers2 = this.parser.constructs.attentionMarkers.null;
  const previous2 = this.previous;
  const before2 = classifyCharacter(previous2);
  let marker;
  return start;
  function start(code) {
    effects.enter("attentionSequence");
    marker = code;
    return sequence(code);
  }
  function sequence(code) {
    if (code === marker) {
      effects.consume(code);
      return sequence;
    }
    const token = effects.exit("attentionSequence");
    const after2 = classifyCharacter(code);
    const open3 = !after2 || after2 === 2 && before2 || attentionMarkers2.includes(code);
    const close2 = !before2 || before2 === 2 && after2 || attentionMarkers2.includes(previous2);
    token._open = Boolean(marker === 42 ? open3 : open3 && (before2 || !close2));
    token._close = Boolean(marker === 42 ? close2 : close2 && (after2 || !open3));
    return ok(code);
  }
}
function movePoint(point4, offset) {
  point4.column += offset;
  point4.offset += offset;
  point4._bufferIndex += offset;
}

// ../simple-mind-map/node_modules/micromark-core-commonmark/lib/autolink.js
var autolink = {
  name: "autolink",
  tokenize: tokenizeAutolink
};
function tokenizeAutolink(effects, ok, nok) {
  let size2 = 1;
  return start;
  function start(code) {
    effects.enter("autolink");
    effects.enter("autolinkMarker");
    effects.consume(code);
    effects.exit("autolinkMarker");
    effects.enter("autolinkProtocol");
    return open3;
  }
  function open3(code) {
    if (asciiAlpha(code)) {
      effects.consume(code);
      return schemeOrEmailAtext;
    }
    return asciiAtext(code) ? emailAtext(code) : nok(code);
  }
  function schemeOrEmailAtext(code) {
    return code === 43 || code === 45 || code === 46 || asciiAlphanumeric(code) ? schemeInsideOrEmailAtext(code) : emailAtext(code);
  }
  function schemeInsideOrEmailAtext(code) {
    if (code === 58) {
      effects.consume(code);
      return urlInside;
    }
    if ((code === 43 || code === 45 || code === 46 || asciiAlphanumeric(code)) && size2++ < 32) {
      effects.consume(code);
      return schemeInsideOrEmailAtext;
    }
    return emailAtext(code);
  }
  function urlInside(code) {
    if (code === 62) {
      effects.exit("autolinkProtocol");
      return end(code);
    }
    if (code === null || code === 32 || code === 60 || asciiControl(code)) {
      return nok(code);
    }
    effects.consume(code);
    return urlInside;
  }
  function emailAtext(code) {
    if (code === 64) {
      effects.consume(code);
      size2 = 0;
      return emailAtSignOrDot;
    }
    if (asciiAtext(code)) {
      effects.consume(code);
      return emailAtext;
    }
    return nok(code);
  }
  function emailAtSignOrDot(code) {
    return asciiAlphanumeric(code) ? emailLabel(code) : nok(code);
  }
  function emailLabel(code) {
    if (code === 46) {
      effects.consume(code);
      size2 = 0;
      return emailAtSignOrDot;
    }
    if (code === 62) {
      effects.exit("autolinkProtocol").type = "autolinkEmail";
      return end(code);
    }
    return emailValue(code);
  }
  function emailValue(code) {
    if ((code === 45 || asciiAlphanumeric(code)) && size2++ < 63) {
      effects.consume(code);
      return code === 45 ? emailValue : emailLabel;
    }
    return nok(code);
  }
  function end(code) {
    effects.enter("autolinkMarker");
    effects.consume(code);
    effects.exit("autolinkMarker");
    effects.exit("autolink");
    return ok;
  }
}

// ../simple-mind-map/node_modules/micromark-core-commonmark/lib/blank-line.js
var blankLine = {
  tokenize: tokenizeBlankLine,
  partial: true
};
function tokenizeBlankLine(effects, ok, nok) {
  return factorySpace(effects, afterWhitespace, "linePrefix");
  function afterWhitespace(code) {
    return code === null || markdownLineEnding(code) ? ok(code) : nok(code);
  }
}

// ../simple-mind-map/node_modules/micromark-core-commonmark/lib/block-quote.js
var blockQuote = {
  name: "blockQuote",
  tokenize: tokenizeBlockQuoteStart,
  continuation: {
    tokenize: tokenizeBlockQuoteContinuation
  },
  exit
};
function tokenizeBlockQuoteStart(effects, ok, nok) {
  const self2 = this;
  return start;
  function start(code) {
    if (code === 62) {
      const state = self2.containerState;
      if (!state.open) {
        effects.enter("blockQuote", {
          _container: true
        });
        state.open = true;
      }
      effects.enter("blockQuotePrefix");
      effects.enter("blockQuoteMarker");
      effects.consume(code);
      effects.exit("blockQuoteMarker");
      return after2;
    }
    return nok(code);
  }
  function after2(code) {
    if (markdownSpace(code)) {
      effects.enter("blockQuotePrefixWhitespace");
      effects.consume(code);
      effects.exit("blockQuotePrefixWhitespace");
      effects.exit("blockQuotePrefix");
      return ok;
    }
    effects.exit("blockQuotePrefix");
    return ok(code);
  }
}
function tokenizeBlockQuoteContinuation(effects, ok, nok) {
  return factorySpace(
    effects,
    effects.attempt(blockQuote, ok, nok),
    "linePrefix",
    this.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4
  );
}
function exit(effects) {
  effects.exit("blockQuote");
}

// ../simple-mind-map/node_modules/micromark-core-commonmark/lib/character-escape.js
var characterEscape = {
  name: "characterEscape",
  tokenize: tokenizeCharacterEscape
};
function tokenizeCharacterEscape(effects, ok, nok) {
  return start;
  function start(code) {
    effects.enter("characterEscape");
    effects.enter("escapeMarker");
    effects.consume(code);
    effects.exit("escapeMarker");
    return open3;
  }
  function open3(code) {
    if (asciiPunctuation(code)) {
      effects.enter("characterEscapeValue");
      effects.consume(code);
      effects.exit("characterEscapeValue");
      effects.exit("characterEscape");
      return ok;
    }
    return nok(code);
  }
}

// ../simple-mind-map/node_modules/decode-named-character-reference/index.dom.js
var element = document.createElement("i");
function decodeNamedCharacterReference(value) {
  const characterReference2 = "&" + value + ";";
  element.innerHTML = characterReference2;
  const char = element.textContent;
  if (char.charCodeAt(char.length - 1) === 59 && value !== "semi") {
    return false;
  }
  return char === characterReference2 ? false : char;
}

// ../simple-mind-map/node_modules/micromark-core-commonmark/lib/character-reference.js
var characterReference = {
  name: "characterReference",
  tokenize: tokenizeCharacterReference
};
function tokenizeCharacterReference(effects, ok, nok) {
  const self2 = this;
  let size2 = 0;
  let max3;
  let test2;
  return start;
  function start(code) {
    effects.enter("characterReference");
    effects.enter("characterReferenceMarker");
    effects.consume(code);
    effects.exit("characterReferenceMarker");
    return open3;
  }
  function open3(code) {
    if (code === 35) {
      effects.enter("characterReferenceMarkerNumeric");
      effects.consume(code);
      effects.exit("characterReferenceMarkerNumeric");
      return numeric;
    }
    effects.enter("characterReferenceValue");
    max3 = 31;
    test2 = asciiAlphanumeric;
    return value(code);
  }
  function numeric(code) {
    if (code === 88 || code === 120) {
      effects.enter("characterReferenceMarkerHexadecimal");
      effects.consume(code);
      effects.exit("characterReferenceMarkerHexadecimal");
      effects.enter("characterReferenceValue");
      max3 = 6;
      test2 = asciiHexDigit;
      return value;
    }
    effects.enter("characterReferenceValue");
    max3 = 7;
    test2 = asciiDigit;
    return value(code);
  }
  function value(code) {
    let token;
    if (code === 59 && size2) {
      token = effects.exit("characterReferenceValue");
      if (test2 === asciiAlphanumeric && !decodeNamedCharacterReference(self2.sliceSerialize(token))) {
        return nok(code);
      }
      effects.enter("characterReferenceMarker");
      effects.consume(code);
      effects.exit("characterReferenceMarker");
      effects.exit("characterReference");
      return ok;
    }
    if (test2(code) && size2++ < max3) {
      effects.consume(code);
      return value;
    }
    return nok(code);
  }
}

// ../simple-mind-map/node_modules/micromark-core-commonmark/lib/code-fenced.js
var codeFenced = {
  name: "codeFenced",
  tokenize: tokenizeCodeFenced,
  concrete: true
};
function tokenizeCodeFenced(effects, ok, nok) {
  const self2 = this;
  const closingFenceConstruct = {
    tokenize: tokenizeClosingFence,
    partial: true
  };
  const nonLazyLine = {
    tokenize: tokenizeNonLazyLine,
    partial: true
  };
  const tail = this.events[this.events.length - 1];
  const initialPrefix = tail && tail[1].type === "linePrefix" ? tail[2].sliceSerialize(tail[1], true).length : 0;
  let sizeOpen = 0;
  let marker;
  return start;
  function start(code) {
    effects.enter("codeFenced");
    effects.enter("codeFencedFence");
    effects.enter("codeFencedFenceSequence");
    marker = code;
    return sequenceOpen(code);
  }
  function sequenceOpen(code) {
    if (code === marker) {
      effects.consume(code);
      sizeOpen++;
      return sequenceOpen;
    }
    effects.exit("codeFencedFenceSequence");
    return sizeOpen < 3 ? nok(code) : factorySpace(effects, infoOpen, "whitespace")(code);
  }
  function infoOpen(code) {
    if (code === null || markdownLineEnding(code)) {
      return openAfter(code);
    }
    effects.enter("codeFencedFenceInfo");
    effects.enter("chunkString", {
      contentType: "string"
    });
    return info(code);
  }
  function info(code) {
    if (code === null || markdownLineEndingOrSpace(code)) {
      effects.exit("chunkString");
      effects.exit("codeFencedFenceInfo");
      return factorySpace(effects, infoAfter, "whitespace")(code);
    }
    if (code === 96 && code === marker)
      return nok(code);
    effects.consume(code);
    return info;
  }
  function infoAfter(code) {
    if (code === null || markdownLineEnding(code)) {
      return openAfter(code);
    }
    effects.enter("codeFencedFenceMeta");
    effects.enter("chunkString", {
      contentType: "string"
    });
    return meta(code);
  }
  function meta(code) {
    if (code === null || markdownLineEnding(code)) {
      effects.exit("chunkString");
      effects.exit("codeFencedFenceMeta");
      return openAfter(code);
    }
    if (code === 96 && code === marker)
      return nok(code);
    effects.consume(code);
    return meta;
  }
  function openAfter(code) {
    effects.exit("codeFencedFence");
    return self2.interrupt ? ok(code) : contentStart(code);
  }
  function contentStart(code) {
    if (code === null) {
      return after2(code);
    }
    if (markdownLineEnding(code)) {
      return effects.attempt(
        nonLazyLine,
        effects.attempt(
          closingFenceConstruct,
          after2,
          initialPrefix ? factorySpace(
            effects,
            contentStart,
            "linePrefix",
            initialPrefix + 1
          ) : contentStart
        ),
        after2
      )(code);
    }
    effects.enter("codeFlowValue");
    return contentContinue(code);
  }
  function contentContinue(code) {
    if (code === null || markdownLineEnding(code)) {
      effects.exit("codeFlowValue");
      return contentStart(code);
    }
    effects.consume(code);
    return contentContinue;
  }
  function after2(code) {
    effects.exit("codeFenced");
    return ok(code);
  }
  function tokenizeNonLazyLine(effects2, ok2, nok2) {
    const self3 = this;
    return start2;
    function start2(code) {
      effects2.enter("lineEnding");
      effects2.consume(code);
      effects2.exit("lineEnding");
      return lineStart;
    }
    function lineStart(code) {
      return self3.parser.lazy[self3.now().line] ? nok2(code) : ok2(code);
    }
  }
  function tokenizeClosingFence(effects2, ok2, nok2) {
    let size2 = 0;
    return factorySpace(
      effects2,
      closingSequenceStart,
      "linePrefix",
      this.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4
    );
    function closingSequenceStart(code) {
      effects2.enter("codeFencedFence");
      effects2.enter("codeFencedFenceSequence");
      return closingSequence(code);
    }
    function closingSequence(code) {
      if (code === marker) {
        effects2.consume(code);
        size2++;
        return closingSequence;
      }
      if (size2 < sizeOpen)
        return nok2(code);
      effects2.exit("codeFencedFenceSequence");
      return factorySpace(effects2, closingSequenceEnd, "whitespace")(code);
    }
    function closingSequenceEnd(code) {
      if (code === null || markdownLineEnding(code)) {
        effects2.exit("codeFencedFence");
        return ok2(code);
      }
      return nok2(code);
    }
  }
}

// ../simple-mind-map/node_modules/micromark-core-commonmark/lib/code-indented.js
var codeIndented = {
  name: "codeIndented",
  tokenize: tokenizeCodeIndented
};
var indentedContent = {
  tokenize: tokenizeIndentedContent,
  partial: true
};
function tokenizeCodeIndented(effects, ok, nok) {
  const self2 = this;
  return start;
  function start(code) {
    effects.enter("codeIndented");
    return factorySpace(effects, afterStartPrefix, "linePrefix", 4 + 1)(code);
  }
  function afterStartPrefix(code) {
    const tail = self2.events[self2.events.length - 1];
    return tail && tail[1].type === "linePrefix" && tail[2].sliceSerialize(tail[1], true).length >= 4 ? afterPrefix(code) : nok(code);
  }
  function afterPrefix(code) {
    if (code === null) {
      return after2(code);
    }
    if (markdownLineEnding(code)) {
      return effects.attempt(indentedContent, afterPrefix, after2)(code);
    }
    effects.enter("codeFlowValue");
    return content3(code);
  }
  function content3(code) {
    if (code === null || markdownLineEnding(code)) {
      effects.exit("codeFlowValue");
      return afterPrefix(code);
    }
    effects.consume(code);
    return content3;
  }
  function after2(code) {
    effects.exit("codeIndented");
    return ok(code);
  }
}
function tokenizeIndentedContent(effects, ok, nok) {
  const self2 = this;
  return start;
  function start(code) {
    if (self2.parser.lazy[self2.now().line]) {
      return nok(code);
    }
    if (markdownLineEnding(code)) {
      effects.enter("lineEnding");
      effects.consume(code);
      effects.exit("lineEnding");
      return start;
    }
    return factorySpace(effects, afterPrefix, "linePrefix", 4 + 1)(code);
  }
  function afterPrefix(code) {
    const tail = self2.events[self2.events.length - 1];
    return tail && tail[1].type === "linePrefix" && tail[2].sliceSerialize(tail[1], true).length >= 4 ? ok(code) : markdownLineEnding(code) ? start(code) : nok(code);
  }
}

// ../simple-mind-map/node_modules/micromark-core-commonmark/lib/code-text.js
var codeText = {
  name: "codeText",
  tokenize: tokenizeCodeText,
  resolve: resolveCodeText,
  previous
};
function resolveCodeText(events) {
  let tailExitIndex = events.length - 4;
  let headEnterIndex = 3;
  let index3;
  let enter;
  if ((events[headEnterIndex][1].type === "lineEnding" || events[headEnterIndex][1].type === "space") && (events[tailExitIndex][1].type === "lineEnding" || events[tailExitIndex][1].type === "space")) {
    index3 = headEnterIndex;
    while (++index3 < tailExitIndex) {
      if (events[index3][1].type === "codeTextData") {
        events[headEnterIndex][1].type = "codeTextPadding";
        events[tailExitIndex][1].type = "codeTextPadding";
        headEnterIndex += 2;
        tailExitIndex -= 2;
        break;
      }
    }
  }
  index3 = headEnterIndex - 1;
  tailExitIndex++;
  while (++index3 <= tailExitIndex) {
    if (enter === void 0) {
      if (index3 !== tailExitIndex && events[index3][1].type !== "lineEnding") {
        enter = index3;
      }
    } else if (index3 === tailExitIndex || events[index3][1].type === "lineEnding") {
      events[enter][1].type = "codeTextData";
      if (index3 !== enter + 2) {
        events[enter][1].end = events[index3 - 1][1].end;
        events.splice(enter + 2, index3 - enter - 2);
        tailExitIndex -= index3 - enter - 2;
        index3 = enter + 2;
      }
      enter = void 0;
    }
  }
  return events;
}
function previous(code) {
  return code !== 96 || this.events[this.events.length - 1][1].type === "characterEscape";
}
function tokenizeCodeText(effects, ok, nok) {
  const self2 = this;
  let sizeOpen = 0;
  let size2;
  let token;
  return start;
  function start(code) {
    effects.enter("codeText");
    effects.enter("codeTextSequence");
    return openingSequence(code);
  }
  function openingSequence(code) {
    if (code === 96) {
      effects.consume(code);
      sizeOpen++;
      return openingSequence;
    }
    effects.exit("codeTextSequence");
    return gap(code);
  }
  function gap(code) {
    if (code === null) {
      return nok(code);
    }
    if (code === 96) {
      token = effects.enter("codeTextSequence");
      size2 = 0;
      return closingSequence(code);
    }
    if (code === 32) {
      effects.enter("space");
      effects.consume(code);
      effects.exit("space");
      return gap;
    }
    if (markdownLineEnding(code)) {
      effects.enter("lineEnding");
      effects.consume(code);
      effects.exit("lineEnding");
      return gap;
    }
    effects.enter("codeTextData");
    return data2(code);
  }
  function data2(code) {
    if (code === null || code === 32 || code === 96 || markdownLineEnding(code)) {
      effects.exit("codeTextData");
      return gap(code);
    }
    effects.consume(code);
    return data2;
  }
  function closingSequence(code) {
    if (code === 96) {
      effects.consume(code);
      size2++;
      return closingSequence;
    }
    if (size2 === sizeOpen) {
      effects.exit("codeTextSequence");
      effects.exit("codeText");
      return ok(code);
    }
    token.type = "codeTextData";
    return data2(code);
  }
}

// ../simple-mind-map/node_modules/micromark-util-subtokenize/index.js
function subtokenize(events) {
  const jumps = {};
  let index3 = -1;
  let event;
  let lineIndex;
  let otherIndex;
  let otherEvent;
  let parameters;
  let subevents;
  let more;
  while (++index3 < events.length) {
    while (index3 in jumps) {
      index3 = jumps[index3];
    }
    event = events[index3];
    if (index3 && event[1].type === "chunkFlow" && events[index3 - 1][1].type === "listItemPrefix") {
      subevents = event[1]._tokenizer.events;
      otherIndex = 0;
      if (otherIndex < subevents.length && subevents[otherIndex][1].type === "lineEndingBlank") {
        otherIndex += 2;
      }
      if (otherIndex < subevents.length && subevents[otherIndex][1].type === "content") {
        while (++otherIndex < subevents.length) {
          if (subevents[otherIndex][1].type === "content") {
            break;
          }
          if (subevents[otherIndex][1].type === "chunkText") {
            subevents[otherIndex][1]._isInFirstContentOfListItem = true;
            otherIndex++;
          }
        }
      }
    }
    if (event[0] === "enter") {
      if (event[1].contentType) {
        Object.assign(jumps, subcontent(events, index3));
        index3 = jumps[index3];
        more = true;
      }
    } else if (event[1]._container) {
      otherIndex = index3;
      lineIndex = void 0;
      while (otherIndex--) {
        otherEvent = events[otherIndex];
        if (otherEvent[1].type === "lineEnding" || otherEvent[1].type === "lineEndingBlank") {
          if (otherEvent[0] === "enter") {
            if (lineIndex) {
              events[lineIndex][1].type = "lineEndingBlank";
            }
            otherEvent[1].type = "lineEnding";
            lineIndex = otherIndex;
          }
        } else {
          break;
        }
      }
      if (lineIndex) {
        event[1].end = Object.assign({}, events[lineIndex][1].start);
        parameters = events.slice(lineIndex, index3);
        parameters.unshift(event);
        splice(events, lineIndex, index3 - lineIndex + 1, parameters);
      }
    }
  }
  return !more;
}
function subcontent(events, eventIndex) {
  const token = events[eventIndex][1];
  const context = events[eventIndex][2];
  let startPosition = eventIndex - 1;
  const startPositions = [];
  const tokenizer = token._tokenizer || context.parser[token.contentType](token.start);
  const childEvents = tokenizer.events;
  const jumps = [];
  const gaps = {};
  let stream;
  let previous2;
  let index3 = -1;
  let current = token;
  let adjust = 0;
  let start = 0;
  const breaks = [start];
  while (current) {
    while (events[++startPosition][1] !== current) {
    }
    startPositions.push(startPosition);
    if (!current._tokenizer) {
      stream = context.sliceStream(current);
      if (!current.next) {
        stream.push(null);
      }
      if (previous2) {
        tokenizer.defineSkip(current.start);
      }
      if (current._isInFirstContentOfListItem) {
        tokenizer._gfmTasklistFirstContentOfListItem = true;
      }
      tokenizer.write(stream);
      if (current._isInFirstContentOfListItem) {
        tokenizer._gfmTasklistFirstContentOfListItem = void 0;
      }
    }
    previous2 = current;
    current = current.next;
  }
  current = token;
  while (++index3 < childEvents.length) {
    if (
      // Find a void token that includes a break.
      childEvents[index3][0] === "exit" && childEvents[index3 - 1][0] === "enter" && childEvents[index3][1].type === childEvents[index3 - 1][1].type && childEvents[index3][1].start.line !== childEvents[index3][1].end.line
    ) {
      start = index3 + 1;
      breaks.push(start);
      current._tokenizer = void 0;
      current.previous = void 0;
      current = current.next;
    }
  }
  tokenizer.events = [];
  if (current) {
    current._tokenizer = void 0;
    current.previous = void 0;
  } else {
    breaks.pop();
  }
  index3 = breaks.length;
  while (index3--) {
    const slice2 = childEvents.slice(breaks[index3], breaks[index3 + 1]);
    const start2 = startPositions.pop();
    jumps.unshift([start2, start2 + slice2.length - 1]);
    splice(events, start2, 2, slice2);
  }
  index3 = -1;
  while (++index3 < jumps.length) {
    gaps[adjust + jumps[index3][0]] = adjust + jumps[index3][1];
    adjust += jumps[index3][1] - jumps[index3][0] - 1;
  }
  return gaps;
}

// ../simple-mind-map/node_modules/micromark-core-commonmark/lib/content.js
var content2 = {
  tokenize: tokenizeContent,
  resolve: resolveContent
};
var continuationConstruct = {
  tokenize: tokenizeContinuation,
  partial: true
};
function resolveContent(events) {
  subtokenize(events);
  return events;
}
function tokenizeContent(effects, ok) {
  let previous2;
  return start;
  function start(code) {
    effects.enter("content");
    previous2 = effects.enter("chunkContent", {
      contentType: "content"
    });
    return data2(code);
  }
  function data2(code) {
    if (code === null) {
      return contentEnd(code);
    }
    if (markdownLineEnding(code)) {
      return effects.check(
        continuationConstruct,
        contentContinue,
        contentEnd
      )(code);
    }
    effects.consume(code);
    return data2;
  }
  function contentEnd(code) {
    effects.exit("chunkContent");
    effects.exit("content");
    return ok(code);
  }
  function contentContinue(code) {
    effects.consume(code);
    effects.exit("chunkContent");
    previous2.next = effects.enter("chunkContent", {
      contentType: "content",
      previous: previous2
    });
    previous2 = previous2.next;
    return data2;
  }
}
function tokenizeContinuation(effects, ok, nok) {
  const self2 = this;
  return startLookahead;
  function startLookahead(code) {
    effects.exit("chunkContent");
    effects.enter("lineEnding");
    effects.consume(code);
    effects.exit("lineEnding");
    return factorySpace(effects, prefixed, "linePrefix");
  }
  function prefixed(code) {
    if (code === null || markdownLineEnding(code)) {
      return nok(code);
    }
    const tail = self2.events[self2.events.length - 1];
    if (!self2.parser.constructs.disable.null.includes("codeIndented") && tail && tail[1].type === "linePrefix" && tail[2].sliceSerialize(tail[1], true).length >= 4) {
      return ok(code);
    }
    return effects.interrupt(self2.parser.constructs.flow, nok, ok)(code);
  }
}

// ../simple-mind-map/node_modules/micromark-factory-destination/index.js
function factoryDestination(effects, ok, nok, type, literalType, literalMarkerType, rawType, stringType, max3) {
  const limit = max3 || Number.POSITIVE_INFINITY;
  let balance = 0;
  return start;
  function start(code) {
    if (code === 60) {
      effects.enter(type);
      effects.enter(literalType);
      effects.enter(literalMarkerType);
      effects.consume(code);
      effects.exit(literalMarkerType);
      return destinationEnclosedBefore;
    }
    if (code === null || code === 41 || asciiControl(code)) {
      return nok(code);
    }
    effects.enter(type);
    effects.enter(rawType);
    effects.enter(stringType);
    effects.enter("chunkString", {
      contentType: "string"
    });
    return destinationRaw(code);
  }
  function destinationEnclosedBefore(code) {
    if (code === 62) {
      effects.enter(literalMarkerType);
      effects.consume(code);
      effects.exit(literalMarkerType);
      effects.exit(literalType);
      effects.exit(type);
      return ok;
    }
    effects.enter(stringType);
    effects.enter("chunkString", {
      contentType: "string"
    });
    return destinationEnclosed(code);
  }
  function destinationEnclosed(code) {
    if (code === 62) {
      effects.exit("chunkString");
      effects.exit(stringType);
      return destinationEnclosedBefore(code);
    }
    if (code === null || code === 60 || markdownLineEnding(code)) {
      return nok(code);
    }
    effects.consume(code);
    return code === 92 ? destinationEnclosedEscape : destinationEnclosed;
  }
  function destinationEnclosedEscape(code) {
    if (code === 60 || code === 62 || code === 92) {
      effects.consume(code);
      return destinationEnclosed;
    }
    return destinationEnclosed(code);
  }
  function destinationRaw(code) {
    if (code === 40) {
      if (++balance > limit)
        return nok(code);
      effects.consume(code);
      return destinationRaw;
    }
    if (code === 41) {
      if (!balance--) {
        effects.exit("chunkString");
        effects.exit(stringType);
        effects.exit(rawType);
        effects.exit(type);
        return ok(code);
      }
      effects.consume(code);
      return destinationRaw;
    }
    if (code === null || markdownLineEndingOrSpace(code)) {
      if (balance)
        return nok(code);
      effects.exit("chunkString");
      effects.exit(stringType);
      effects.exit(rawType);
      effects.exit(type);
      return ok(code);
    }
    if (asciiControl(code))
      return nok(code);
    effects.consume(code);
    return code === 92 ? destinationRawEscape : destinationRaw;
  }
  function destinationRawEscape(code) {
    if (code === 40 || code === 41 || code === 92) {
      effects.consume(code);
      return destinationRaw;
    }
    return destinationRaw(code);
  }
}

// ../simple-mind-map/node_modules/micromark-factory-label/index.js
function factoryLabel(effects, ok, nok, type, markerType, stringType) {
  const self2 = this;
  let size2 = 0;
  let data2;
  return start;
  function start(code) {
    effects.enter(type);
    effects.enter(markerType);
    effects.consume(code);
    effects.exit(markerType);
    effects.enter(stringType);
    return atBreak;
  }
  function atBreak(code) {
    if (code === null || code === 91 || code === 93 && !data2 || /* To do: remove in the future once we’ve switched from
     * `micromark-extension-footnote` to `micromark-extension-gfm-footnote`,
     * which doesn’t need this */
    /* Hidden footnotes hook */
    /* c8 ignore next 3 */
    code === 94 && !size2 && "_hiddenFootnoteSupport" in self2.parser.constructs || size2 > 999) {
      return nok(code);
    }
    if (code === 93) {
      effects.exit(stringType);
      effects.enter(markerType);
      effects.consume(code);
      effects.exit(markerType);
      effects.exit(type);
      return ok;
    }
    if (markdownLineEnding(code)) {
      effects.enter("lineEnding");
      effects.consume(code);
      effects.exit("lineEnding");
      return atBreak;
    }
    effects.enter("chunkString", {
      contentType: "string"
    });
    return label(code);
  }
  function label(code) {
    if (code === null || code === 91 || code === 93 || markdownLineEnding(code) || size2++ > 999) {
      effects.exit("chunkString");
      return atBreak(code);
    }
    effects.consume(code);
    data2 = data2 || !markdownSpace(code);
    return code === 92 ? labelEscape : label;
  }
  function labelEscape(code) {
    if (code === 91 || code === 92 || code === 93) {
      effects.consume(code);
      size2++;
      return label;
    }
    return label(code);
  }
}

// ../simple-mind-map/node_modules/micromark-factory-title/index.js
function factoryTitle(effects, ok, nok, type, markerType, stringType) {
  let marker;
  return start;
  function start(code) {
    effects.enter(type);
    effects.enter(markerType);
    effects.consume(code);
    effects.exit(markerType);
    marker = code === 40 ? 41 : code;
    return atFirstTitleBreak;
  }
  function atFirstTitleBreak(code) {
    if (code === marker) {
      effects.enter(markerType);
      effects.consume(code);
      effects.exit(markerType);
      effects.exit(type);
      return ok;
    }
    effects.enter(stringType);
    return atTitleBreak(code);
  }
  function atTitleBreak(code) {
    if (code === marker) {
      effects.exit(stringType);
      return atFirstTitleBreak(marker);
    }
    if (code === null) {
      return nok(code);
    }
    if (markdownLineEnding(code)) {
      effects.enter("lineEnding");
      effects.consume(code);
      effects.exit("lineEnding");
      return factorySpace(effects, atTitleBreak, "linePrefix");
    }
    effects.enter("chunkString", {
      contentType: "string"
    });
    return title(code);
  }
  function title(code) {
    if (code === marker || code === null || markdownLineEnding(code)) {
      effects.exit("chunkString");
      return atTitleBreak(code);
    }
    effects.consume(code);
    return code === 92 ? titleEscape : title;
  }
  function titleEscape(code) {
    if (code === marker || code === 92) {
      effects.consume(code);
      return title;
    }
    return title(code);
  }
}

// ../simple-mind-map/node_modules/micromark-factory-whitespace/index.js
function factoryWhitespace(effects, ok) {
  let seen;
  return start;
  function start(code) {
    if (markdownLineEnding(code)) {
      effects.enter("lineEnding");
      effects.consume(code);
      effects.exit("lineEnding");
      seen = true;
      return start;
    }
    if (markdownSpace(code)) {
      return factorySpace(
        effects,
        start,
        seen ? "linePrefix" : "lineSuffix"
      )(code);
    }
    return ok(code);
  }
}

// ../simple-mind-map/node_modules/micromark-util-normalize-identifier/index.js
function normalizeIdentifier(value) {
  return value.replace(/[\t\n\r ]+/g, " ").replace(/^ | $/g, "").toLowerCase().toUpperCase();
}

// ../simple-mind-map/node_modules/micromark-core-commonmark/lib/definition.js
var definition = {
  name: "definition",
  tokenize: tokenizeDefinition
};
var titleConstruct = {
  tokenize: tokenizeTitle,
  partial: true
};
function tokenizeDefinition(effects, ok, nok) {
  const self2 = this;
  let identifier;
  return start;
  function start(code) {
    effects.enter("definition");
    return factoryLabel.call(
      self2,
      effects,
      labelAfter,
      nok,
      "definitionLabel",
      "definitionLabelMarker",
      "definitionLabelString"
    )(code);
  }
  function labelAfter(code) {
    identifier = normalizeIdentifier(
      self2.sliceSerialize(self2.events[self2.events.length - 1][1]).slice(1, -1)
    );
    if (code === 58) {
      effects.enter("definitionMarker");
      effects.consume(code);
      effects.exit("definitionMarker");
      return factoryWhitespace(
        effects,
        factoryDestination(
          effects,
          effects.attempt(
            titleConstruct,
            factorySpace(effects, after2, "whitespace"),
            factorySpace(effects, after2, "whitespace")
          ),
          nok,
          "definitionDestination",
          "definitionDestinationLiteral",
          "definitionDestinationLiteralMarker",
          "definitionDestinationRaw",
          "definitionDestinationString"
        )
      );
    }
    return nok(code);
  }
  function after2(code) {
    if (code === null || markdownLineEnding(code)) {
      effects.exit("definition");
      if (!self2.parser.defined.includes(identifier)) {
        self2.parser.defined.push(identifier);
      }
      return ok(code);
    }
    return nok(code);
  }
}
function tokenizeTitle(effects, ok, nok) {
  return start;
  function start(code) {
    return markdownLineEndingOrSpace(code) ? factoryWhitespace(effects, before2)(code) : nok(code);
  }
  function before2(code) {
    if (code === 34 || code === 39 || code === 40) {
      return factoryTitle(
        effects,
        factorySpace(effects, after2, "whitespace"),
        nok,
        "definitionTitle",
        "definitionTitleMarker",
        "definitionTitleString"
      )(code);
    }
    return nok(code);
  }
  function after2(code) {
    return code === null || markdownLineEnding(code) ? ok(code) : nok(code);
  }
}

// ../simple-mind-map/node_modules/micromark-core-commonmark/lib/hard-break-escape.js
var hardBreakEscape = {
  name: "hardBreakEscape",
  tokenize: tokenizeHardBreakEscape
};
function tokenizeHardBreakEscape(effects, ok, nok) {
  return start;
  function start(code) {
    effects.enter("hardBreakEscape");
    effects.enter("escapeMarker");
    effects.consume(code);
    return open3;
  }
  function open3(code) {
    if (markdownLineEnding(code)) {
      effects.exit("escapeMarker");
      effects.exit("hardBreakEscape");
      return ok(code);
    }
    return nok(code);
  }
}

// ../simple-mind-map/node_modules/micromark-core-commonmark/lib/heading-atx.js
var headingAtx = {
  name: "headingAtx",
  tokenize: tokenizeHeadingAtx,
  resolve: resolveHeadingAtx
};
function resolveHeadingAtx(events, context) {
  let contentEnd = events.length - 2;
  let contentStart = 3;
  let content3;
  let text3;
  if (events[contentStart][1].type === "whitespace") {
    contentStart += 2;
  }
  if (contentEnd - 2 > contentStart && events[contentEnd][1].type === "whitespace") {
    contentEnd -= 2;
  }
  if (events[contentEnd][1].type === "atxHeadingSequence" && (contentStart === contentEnd - 1 || contentEnd - 4 > contentStart && events[contentEnd - 2][1].type === "whitespace")) {
    contentEnd -= contentStart + 1 === contentEnd ? 2 : 4;
  }
  if (contentEnd > contentStart) {
    content3 = {
      type: "atxHeadingText",
      start: events[contentStart][1].start,
      end: events[contentEnd][1].end
    };
    text3 = {
      type: "chunkText",
      start: events[contentStart][1].start,
      end: events[contentEnd][1].end,
      // @ts-expect-error Constants are fine to assign.
      contentType: "text"
    };
    splice(events, contentStart, contentEnd - contentStart + 1, [
      ["enter", content3, context],
      ["enter", text3, context],
      ["exit", text3, context],
      ["exit", content3, context]
    ]);
  }
  return events;
}
function tokenizeHeadingAtx(effects, ok, nok) {
  const self2 = this;
  let size2 = 0;
  return start;
  function start(code) {
    effects.enter("atxHeading");
    effects.enter("atxHeadingSequence");
    return fenceOpenInside(code);
  }
  function fenceOpenInside(code) {
    if (code === 35 && size2++ < 6) {
      effects.consume(code);
      return fenceOpenInside;
    }
    if (code === null || markdownLineEndingOrSpace(code)) {
      effects.exit("atxHeadingSequence");
      return self2.interrupt ? ok(code) : headingBreak(code);
    }
    return nok(code);
  }
  function headingBreak(code) {
    if (code === 35) {
      effects.enter("atxHeadingSequence");
      return sequence(code);
    }
    if (code === null || markdownLineEnding(code)) {
      effects.exit("atxHeading");
      return ok(code);
    }
    if (markdownSpace(code)) {
      return factorySpace(effects, headingBreak, "whitespace")(code);
    }
    effects.enter("atxHeadingText");
    return data2(code);
  }
  function sequence(code) {
    if (code === 35) {
      effects.consume(code);
      return sequence;
    }
    effects.exit("atxHeadingSequence");
    return headingBreak(code);
  }
  function data2(code) {
    if (code === null || code === 35 || markdownLineEndingOrSpace(code)) {
      effects.exit("atxHeadingText");
      return headingBreak(code);
    }
    effects.consume(code);
    return data2;
  }
}

// ../simple-mind-map/node_modules/micromark-util-html-tag-name/index.js
var htmlBlockNames = [
  "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",
  "section",
  "summary",
  "table",
  "tbody",
  "td",
  "tfoot",
  "th",
  "thead",
  "title",
  "tr",
  "track",
  "ul"
];
var htmlRawNames = ["pre", "script", "style", "textarea"];

// ../simple-mind-map/node_modules/micromark-core-commonmark/lib/html-flow.js
var htmlFlow = {
  name: "htmlFlow",
  tokenize: tokenizeHtmlFlow,
  resolveTo: resolveToHtmlFlow,
  concrete: true
};
var nextBlankConstruct = {
  tokenize: tokenizeNextBlank,
  partial: true
};
function resolveToHtmlFlow(events) {
  let index3 = events.length;
  while (index3--) {
    if (events[index3][0] === "enter" && events[index3][1].type === "htmlFlow") {
      break;
    }
  }
  if (index3 > 1 && events[index3 - 2][1].type === "linePrefix") {
    events[index3][1].start = events[index3 - 2][1].start;
    events[index3 + 1][1].start = events[index3 - 2][1].start;
    events.splice(index3 - 2, 2);
  }
  return events;
}
function tokenizeHtmlFlow(effects, ok, nok) {
  const self2 = this;
  let kind;
  let startTag;
  let buffer;
  let index3;
  let marker;
  return start;
  function start(code) {
    effects.enter("htmlFlow");
    effects.enter("htmlFlowData");
    effects.consume(code);
    return open3;
  }
  function open3(code) {
    if (code === 33) {
      effects.consume(code);
      return declarationStart;
    }
    if (code === 47) {
      effects.consume(code);
      return tagCloseStart;
    }
    if (code === 63) {
      effects.consume(code);
      kind = 3;
      return self2.interrupt ? ok : continuationDeclarationInside;
    }
    if (asciiAlpha(code)) {
      effects.consume(code);
      buffer = String.fromCharCode(code);
      startTag = true;
      return tagName;
    }
    return nok(code);
  }
  function declarationStart(code) {
    if (code === 45) {
      effects.consume(code);
      kind = 2;
      return commentOpenInside;
    }
    if (code === 91) {
      effects.consume(code);
      kind = 5;
      buffer = "CDATA[";
      index3 = 0;
      return cdataOpenInside;
    }
    if (asciiAlpha(code)) {
      effects.consume(code);
      kind = 4;
      return self2.interrupt ? ok : continuationDeclarationInside;
    }
    return nok(code);
  }
  function commentOpenInside(code) {
    if (code === 45) {
      effects.consume(code);
      return self2.interrupt ? ok : continuationDeclarationInside;
    }
    return nok(code);
  }
  function cdataOpenInside(code) {
    if (code === buffer.charCodeAt(index3++)) {
      effects.consume(code);
      return index3 === buffer.length ? self2.interrupt ? ok : continuation : cdataOpenInside;
    }
    return nok(code);
  }
  function tagCloseStart(code) {
    if (asciiAlpha(code)) {
      effects.consume(code);
      buffer = String.fromCharCode(code);
      return tagName;
    }
    return nok(code);
  }
  function tagName(code) {
    if (code === null || code === 47 || code === 62 || markdownLineEndingOrSpace(code)) {
      if (code !== 47 && startTag && htmlRawNames.includes(buffer.toLowerCase())) {
        kind = 1;
        return self2.interrupt ? ok(code) : continuation(code);
      }
      if (htmlBlockNames.includes(buffer.toLowerCase())) {
        kind = 6;
        if (code === 47) {
          effects.consume(code);
          return basicSelfClosing;
        }
        return self2.interrupt ? ok(code) : continuation(code);
      }
      kind = 7;
      return self2.interrupt && !self2.parser.lazy[self2.now().line] ? nok(code) : startTag ? completeAttributeNameBefore(code) : completeClosingTagAfter(code);
    }
    if (code === 45 || asciiAlphanumeric(code)) {
      effects.consume(code);
      buffer += String.fromCharCode(code);
      return tagName;
    }
    return nok(code);
  }
  function basicSelfClosing(code) {
    if (code === 62) {
      effects.consume(code);
      return self2.interrupt ? ok : continuation;
    }
    return nok(code);
  }
  function completeClosingTagAfter(code) {
    if (markdownSpace(code)) {
      effects.consume(code);
      return completeClosingTagAfter;
    }
    return completeEnd(code);
  }
  function completeAttributeNameBefore(code) {
    if (code === 47) {
      effects.consume(code);
      return completeEnd;
    }
    if (code === 58 || code === 95 || asciiAlpha(code)) {
      effects.consume(code);
      return completeAttributeName;
    }
    if (markdownSpace(code)) {
      effects.consume(code);
      return completeAttributeNameBefore;
    }
    return completeEnd(code);
  }
  function completeAttributeName(code) {
    if (code === 45 || code === 46 || code === 58 || code === 95 || asciiAlphanumeric(code)) {
      effects.consume(code);
      return completeAttributeName;
    }
    return completeAttributeNameAfter(code);
  }
  function completeAttributeNameAfter(code) {
    if (code === 61) {
      effects.consume(code);
      return completeAttributeValueBefore;
    }
    if (markdownSpace(code)) {
      effects.consume(code);
      return completeAttributeNameAfter;
    }
    return completeAttributeNameBefore(code);
  }
  function completeAttributeValueBefore(code) {
    if (code === null || code === 60 || code === 61 || code === 62 || code === 96) {
      return nok(code);
    }
    if (code === 34 || code === 39) {
      effects.consume(code);
      marker = code;
      return completeAttributeValueQuoted;
    }
    if (markdownSpace(code)) {
      effects.consume(code);
      return completeAttributeValueBefore;
    }
    marker = null;
    return completeAttributeValueUnquoted(code);
  }
  function completeAttributeValueQuoted(code) {
    if (code === null || markdownLineEnding(code)) {
      return nok(code);
    }
    if (code === marker) {
      effects.consume(code);
      return completeAttributeValueQuotedAfter;
    }
    effects.consume(code);
    return completeAttributeValueQuoted;
  }
  function completeAttributeValueUnquoted(code) {
    if (code === null || code === 34 || code === 39 || code === 60 || code === 61 || code === 62 || code === 96 || markdownLineEndingOrSpace(code)) {
      return completeAttributeNameAfter(code);
    }
    effects.consume(code);
    return completeAttributeValueUnquoted;
  }
  function completeAttributeValueQuotedAfter(code) {
    if (code === 47 || code === 62 || markdownSpace(code)) {
      return completeAttributeNameBefore(code);
    }
    return nok(code);
  }
  function completeEnd(code) {
    if (code === 62) {
      effects.consume(code);
      return completeAfter;
    }
    return nok(code);
  }
  function completeAfter(code) {
    if (markdownSpace(code)) {
      effects.consume(code);
      return completeAfter;
    }
    return code === null || markdownLineEnding(code) ? continuation(code) : nok(code);
  }
  function continuation(code) {
    if (code === 45 && kind === 2) {
      effects.consume(code);
      return continuationCommentInside;
    }
    if (code === 60 && kind === 1) {
      effects.consume(code);
      return continuationRawTagOpen;
    }
    if (code === 62 && kind === 4) {
      effects.consume(code);
      return continuationClose;
    }
    if (code === 63 && kind === 3) {
      effects.consume(code);
      return continuationDeclarationInside;
    }
    if (code === 93 && kind === 5) {
      effects.consume(code);
      return continuationCharacterDataInside;
    }
    if (markdownLineEnding(code) && (kind === 6 || kind === 7)) {
      return effects.check(
        nextBlankConstruct,
        continuationClose,
        continuationAtLineEnding
      )(code);
    }
    if (code === null || markdownLineEnding(code)) {
      return continuationAtLineEnding(code);
    }
    effects.consume(code);
    return continuation;
  }
  function continuationAtLineEnding(code) {
    effects.exit("htmlFlowData");
    return htmlContinueStart(code);
  }
  function htmlContinueStart(code) {
    if (code === null) {
      return done(code);
    }
    if (markdownLineEnding(code)) {
      return effects.attempt(
        {
          tokenize: htmlLineEnd,
          partial: true
        },
        htmlContinueStart,
        done
      )(code);
    }
    effects.enter("htmlFlowData");
    return continuation(code);
  }
  function htmlLineEnd(effects2, ok2, nok2) {
    return start2;
    function start2(code) {
      effects2.enter("lineEnding");
      effects2.consume(code);
      effects2.exit("lineEnding");
      return lineStart;
    }
    function lineStart(code) {
      return self2.parser.lazy[self2.now().line] ? nok2(code) : ok2(code);
    }
  }
  function continuationCommentInside(code) {
    if (code === 45) {
      effects.consume(code);
      return continuationDeclarationInside;
    }
    return continuation(code);
  }
  function continuationRawTagOpen(code) {
    if (code === 47) {
      effects.consume(code);
      buffer = "";
      return continuationRawEndTag;
    }
    return continuation(code);
  }
  function continuationRawEndTag(code) {
    if (code === 62 && htmlRawNames.includes(buffer.toLowerCase())) {
      effects.consume(code);
      return continuationClose;
    }
    if (asciiAlpha(code) && buffer.length < 8) {
      effects.consume(code);
      buffer += String.fromCharCode(code);
      return continuationRawEndTag;
    }
    return continuation(code);
  }
  function continuationCharacterDataInside(code) {
    if (code === 93) {
      effects.consume(code);
      return continuationDeclarationInside;
    }
    return continuation(code);
  }
  function continuationDeclarationInside(code) {
    if (code === 62) {
      effects.consume(code);
      return continuationClose;
    }
    if (code === 45 && kind === 2) {
      effects.consume(code);
      return continuationDeclarationInside;
    }
    return continuation(code);
  }
  function continuationClose(code) {
    if (code === null || markdownLineEnding(code)) {
      effects.exit("htmlFlowData");
      return done(code);
    }
    effects.consume(code);
    return continuationClose;
  }
  function done(code) {
    effects.exit("htmlFlow");
    return ok(code);
  }
}
function tokenizeNextBlank(effects, ok, nok) {
  return start;
  function start(code) {
    effects.exit("htmlFlowData");
    effects.enter("lineEndingBlank");
    effects.consume(code);
    effects.exit("lineEndingBlank");
    return effects.attempt(blankLine, ok, nok);
  }
}

// ../simple-mind-map/node_modules/micromark-core-commonmark/lib/html-text.js
var htmlText = {
  name: "htmlText",
  tokenize: tokenizeHtmlText
};
function tokenizeHtmlText(effects, ok, nok) {
  const self2 = this;
  let marker;
  let buffer;
  let index3;
  let returnState;
  return start;
  function start(code) {
    effects.enter("htmlText");
    effects.enter("htmlTextData");
    effects.consume(code);
    return open3;
  }
  function open3(code) {
    if (code === 33) {
      effects.consume(code);
      return declarationOpen;
    }
    if (code === 47) {
      effects.consume(code);
      return tagCloseStart;
    }
    if (code === 63) {
      effects.consume(code);
      return instruction;
    }
    if (asciiAlpha(code)) {
      effects.consume(code);
      return tagOpen;
    }
    return nok(code);
  }
  function declarationOpen(code) {
    if (code === 45) {
      effects.consume(code);
      return commentOpen;
    }
    if (code === 91) {
      effects.consume(code);
      buffer = "CDATA[";
      index3 = 0;
      return cdataOpen;
    }
    if (asciiAlpha(code)) {
      effects.consume(code);
      return declaration;
    }
    return nok(code);
  }
  function commentOpen(code) {
    if (code === 45) {
      effects.consume(code);
      return commentStart;
    }
    return nok(code);
  }
  function commentStart(code) {
    if (code === null || code === 62) {
      return nok(code);
    }
    if (code === 45) {
      effects.consume(code);
      return commentStartDash;
    }
    return comment(code);
  }
  function commentStartDash(code) {
    if (code === null || code === 62) {
      return nok(code);
    }
    return comment(code);
  }
  function comment(code) {
    if (code === null) {
      return nok(code);
    }
    if (code === 45) {
      effects.consume(code);
      return commentClose;
    }
    if (markdownLineEnding(code)) {
      returnState = comment;
      return atLineEnding(code);
    }
    effects.consume(code);
    return comment;
  }
  function commentClose(code) {
    if (code === 45) {
      effects.consume(code);
      return end;
    }
    return comment(code);
  }
  function cdataOpen(code) {
    if (code === buffer.charCodeAt(index3++)) {
      effects.consume(code);
      return index3 === buffer.length ? cdata : cdataOpen;
    }
    return nok(code);
  }
  function cdata(code) {
    if (code === null) {
      return nok(code);
    }
    if (code === 93) {
      effects.consume(code);
      return cdataClose;
    }
    if (markdownLineEnding(code)) {
      returnState = cdata;
      return atLineEnding(code);
    }
    effects.consume(code);
    return cdata;
  }
  function cdataClose(code) {
    if (code === 93) {
      effects.consume(code);
      return cdataEnd;
    }
    return cdata(code);
  }
  function cdataEnd(code) {
    if (code === 62) {
      return end(code);
    }
    if (code === 93) {
      effects.consume(code);
      return cdataEnd;
    }
    return cdata(code);
  }
  function declaration(code) {
    if (code === null || code === 62) {
      return end(code);
    }
    if (markdownLineEnding(code)) {
      returnState = declaration;
      return atLineEnding(code);
    }
    effects.consume(code);
    return declaration;
  }
  function instruction(code) {
    if (code === null) {
      return nok(code);
    }
    if (code === 63) {
      effects.consume(code);
      return instructionClose;
    }
    if (markdownLineEnding(code)) {
      returnState = instruction;
      return atLineEnding(code);
    }
    effects.consume(code);
    return instruction;
  }
  function instructionClose(code) {
    return code === 62 ? end(code) : instruction(code);
  }
  function tagCloseStart(code) {
    if (asciiAlpha(code)) {
      effects.consume(code);
      return tagClose;
    }
    return nok(code);
  }
  function tagClose(code) {
    if (code === 45 || asciiAlphanumeric(code)) {
      effects.consume(code);
      return tagClose;
    }
    return tagCloseBetween(code);
  }
  function tagCloseBetween(code) {
    if (markdownLineEnding(code)) {
      returnState = tagCloseBetween;
      return atLineEnding(code);
    }
    if (markdownSpace(code)) {
      effects.consume(code);
      return tagCloseBetween;
    }
    return end(code);
  }
  function tagOpen(code) {
    if (code === 45 || asciiAlphanumeric(code)) {
      effects.consume(code);
      return tagOpen;
    }
    if (code === 47 || code === 62 || markdownLineEndingOrSpace(code)) {
      return tagOpenBetween(code);
    }
    return nok(code);
  }
  function tagOpenBetween(code) {
    if (code === 47) {
      effects.consume(code);
      return end;
    }
    if (code === 58 || code === 95 || asciiAlpha(code)) {
      effects.consume(code);
      return tagOpenAttributeName;
    }
    if (markdownLineEnding(code)) {
      returnState = tagOpenBetween;
      return atLineEnding(code);
    }
    if (markdownSpace(code)) {
      effects.consume(code);
      return tagOpenBetween;
    }
    return end(code);
  }
  function tagOpenAttributeName(code) {
    if (code === 45 || code === 46 || code === 58 || code === 95 || asciiAlphanumeric(code)) {
      effects.consume(code);
      return tagOpenAttributeName;
    }
    return tagOpenAttributeNameAfter(code);
  }
  function tagOpenAttributeNameAfter(code) {
    if (code === 61) {
      effects.consume(code);
      return tagOpenAttributeValueBefore;
    }
    if (markdownLineEnding(code)) {
      returnState = tagOpenAttributeNameAfter;
      return atLineEnding(code);
    }
    if (markdownSpace(code)) {
      effects.consume(code);
      return tagOpenAttributeNameAfter;
    }
    return tagOpenBetween(code);
  }
  function tagOpenAttributeValueBefore(code) {
    if (code === null || code === 60 || code === 61 || code === 62 || code === 96) {
      return nok(code);
    }
    if (code === 34 || code === 39) {
      effects.consume(code);
      marker = code;
      return tagOpenAttributeValueQuoted;
    }
    if (markdownLineEnding(code)) {
      returnState = tagOpenAttributeValueBefore;
      return atLineEnding(code);
    }
    if (markdownSpace(code)) {
      effects.consume(code);
      return tagOpenAttributeValueBefore;
    }
    effects.consume(code);
    marker = void 0;
    return tagOpenAttributeValueUnquoted;
  }
  function tagOpenAttributeValueQuoted(code) {
    if (code === marker) {
      effects.consume(code);
      return tagOpenAttributeValueQuotedAfter;
    }
    if (code === null) {
      return nok(code);
    }
    if (markdownLineEnding(code)) {
      returnState = tagOpenAttributeValueQuoted;
      return atLineEnding(code);
    }
    effects.consume(code);
    return tagOpenAttributeValueQuoted;
  }
  function tagOpenAttributeValueQuotedAfter(code) {
    if (code === 62 || code === 47 || markdownLineEndingOrSpace(code)) {
      return tagOpenBetween(code);
    }
    return nok(code);
  }
  function tagOpenAttributeValueUnquoted(code) {
    if (code === null || code === 34 || code === 39 || code === 60 || code === 61 || code === 96) {
      return nok(code);
    }
    if (code === 62 || markdownLineEndingOrSpace(code)) {
      return tagOpenBetween(code);
    }
    effects.consume(code);
    return tagOpenAttributeValueUnquoted;
  }
  function atLineEnding(code) {
    effects.exit("htmlTextData");
    effects.enter("lineEnding");
    effects.consume(code);
    effects.exit("lineEnding");
    return factorySpace(
      effects,
      afterPrefix,
      "linePrefix",
      self2.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4
    );
  }
  function afterPrefix(code) {
    effects.enter("htmlTextData");
    return returnState(code);
  }
  function end(code) {
    if (code === 62) {
      effects.consume(code);
      effects.exit("htmlTextData");
      effects.exit("htmlText");
      return ok;
    }
    return nok(code);
  }
}

// ../simple-mind-map/node_modules/micromark-core-commonmark/lib/label-end.js
var labelEnd = {
  name: "labelEnd",
  tokenize: tokenizeLabelEnd,
  resolveTo: resolveToLabelEnd,
  resolveAll: resolveAllLabelEnd
};
var resourceConstruct = {
  tokenize: tokenizeResource
};
var fullReferenceConstruct = {
  tokenize: tokenizeFullReference
};
var collapsedReferenceConstruct = {
  tokenize: tokenizeCollapsedReference
};
function resolveAllLabelEnd(events) {
  let index3 = -1;
  let token;
  while (++index3 < events.length) {
    token = events[index3][1];
    if (token.type === "labelImage" || token.type === "labelLink" || token.type === "labelEnd") {
      events.splice(index3 + 1, token.type === "labelImage" ? 4 : 2);
      token.type = "data";
      index3++;
    }
  }
  return events;
}
function resolveToLabelEnd(events, context) {
  let index3 = events.length;
  let offset = 0;
  let token;
  let open3;
  let close2;
  let media;
  while (index3--) {
    token = events[index3][1];
    if (open3) {
      if (token.type === "link" || token.type === "labelLink" && token._inactive) {
        break;
      }
      if (events[index3][0] === "enter" && token.type === "labelLink") {
        token._inactive = true;
      }
    } else if (close2) {
      if (events[index3][0] === "enter" && (token.type === "labelImage" || token.type === "labelLink") && !token._balanced) {
        open3 = index3;
        if (token.type !== "labelLink") {
          offset = 2;
          break;
        }
      }
    } else if (token.type === "labelEnd") {
      close2 = index3;
    }
  }
  const group = {
    type: events[open3][1].type === "labelLink" ? "link" : "image",
    start: Object.assign({}, events[open3][1].start),
    end: Object.assign({}, events[events.length - 1][1].end)
  };
  const label = {
    type: "label",
    start: Object.assign({}, events[open3][1].start),
    end: Object.assign({}, events[close2][1].end)
  };
  const text3 = {
    type: "labelText",
    start: Object.assign({}, events[open3 + offset + 2][1].end),
    end: Object.assign({}, events[close2 - 2][1].start)
  };
  media = [
    ["enter", group, context],
    ["enter", label, context]
  ];
  media = push3(media, events.slice(open3 + 1, open3 + offset + 3));
  media = push3(media, [["enter", text3, context]]);
  media = push3(
    media,
    resolveAll(
      context.parser.constructs.insideSpan.null,
      events.slice(open3 + offset + 4, close2 - 3),
      context
    )
  );
  media = push3(media, [
    ["exit", text3, context],
    events[close2 - 2],
    events[close2 - 1],
    ["exit", label, context]
  ]);
  media = push3(media, events.slice(close2 + 1));
  media = push3(media, [["exit", group, context]]);
  splice(events, open3, events.length, media);
  return events;
}
function tokenizeLabelEnd(effects, ok, nok) {
  const self2 = this;
  let index3 = self2.events.length;
  let labelStart;
  let defined;
  while (index3--) {
    if ((self2.events[index3][1].type === "labelImage" || self2.events[index3][1].type === "labelLink") && !self2.events[index3][1]._balanced) {
      labelStart = self2.events[index3][1];
      break;
    }
  }
  return start;
  function start(code) {
    if (!labelStart) {
      return nok(code);
    }
    if (labelStart._inactive)
      return balanced(code);
    defined = self2.parser.defined.includes(
      normalizeIdentifier(
        self2.sliceSerialize({
          start: labelStart.end,
          end: self2.now()
        })
      )
    );
    effects.enter("labelEnd");
    effects.enter("labelMarker");
    effects.consume(code);
    effects.exit("labelMarker");
    effects.exit("labelEnd");
    return afterLabelEnd;
  }
  function afterLabelEnd(code) {
    if (code === 40) {
      return effects.attempt(
        resourceConstruct,
        ok,
        defined ? ok : balanced
      )(code);
    }
    if (code === 91) {
      return effects.attempt(
        fullReferenceConstruct,
        ok,
        defined ? effects.attempt(collapsedReferenceConstruct, ok, balanced) : balanced
      )(code);
    }
    return defined ? ok(code) : balanced(code);
  }
  function balanced(code) {
    labelStart._balanced = true;
    return nok(code);
  }
}
function tokenizeResource(effects, ok, nok) {
  return start;
  function start(code) {
    effects.enter("resource");
    effects.enter("resourceMarker");
    effects.consume(code);
    effects.exit("resourceMarker");
    return factoryWhitespace(effects, open3);
  }
  function open3(code) {
    if (code === 41) {
      return end(code);
    }
    return factoryDestination(
      effects,
      destinationAfter,
      nok,
      "resourceDestination",
      "resourceDestinationLiteral",
      "resourceDestinationLiteralMarker",
      "resourceDestinationRaw",
      "resourceDestinationString",
      32
    )(code);
  }
  function destinationAfter(code) {
    return markdownLineEndingOrSpace(code) ? factoryWhitespace(effects, between)(code) : end(code);
  }
  function between(code) {
    if (code === 34 || code === 39 || code === 40) {
      return factoryTitle(
        effects,
        factoryWhitespace(effects, end),
        nok,
        "resourceTitle",
        "resourceTitleMarker",
        "resourceTitleString"
      )(code);
    }
    return end(code);
  }
  function end(code) {
    if (code === 41) {
      effects.enter("resourceMarker");
      effects.consume(code);
      effects.exit("resourceMarker");
      effects.exit("resource");
      return ok;
    }
    return nok(code);
  }
}
function tokenizeFullReference(effects, ok, nok) {
  const self2 = this;
  return start;
  function start(code) {
    return factoryLabel.call(
      self2,
      effects,
      afterLabel,
      nok,
      "reference",
      "referenceMarker",
      "referenceString"
    )(code);
  }
  function afterLabel(code) {
    return self2.parser.defined.includes(
      normalizeIdentifier(
        self2.sliceSerialize(self2.events[self2.events.length - 1][1]).slice(1, -1)
      )
    ) ? ok(code) : nok(code);
  }
}
function tokenizeCollapsedReference(effects, ok, nok) {
  return start;
  function start(code) {
    effects.enter("reference");
    effects.enter("referenceMarker");
    effects.consume(code);
    effects.exit("referenceMarker");
    return open3;
  }
  function open3(code) {
    if (code === 93) {
      effects.enter("referenceMarker");
      effects.consume(code);
      effects.exit("referenceMarker");
      effects.exit("reference");
      return ok;
    }
    return nok(code);
  }
}

// ../simple-mind-map/node_modules/micromark-core-commonmark/lib/label-start-image.js
var labelStartImage = {
  name: "labelStartImage",
  tokenize: tokenizeLabelStartImage,
  resolveAll: labelEnd.resolveAll
};
function tokenizeLabelStartImage(effects, ok, nok) {
  const self2 = this;
  return start;
  function start(code) {
    effects.enter("labelImage");
    effects.enter("labelImageMarker");
    effects.consume(code);
    effects.exit("labelImageMarker");
    return open3;
  }
  function open3(code) {
    if (code === 91) {
      effects.enter("labelMarker");
      effects.consume(code);
      effects.exit("labelMarker");
      effects.exit("labelImage");
      return after2;
    }
    return nok(code);
  }
  function after2(code) {
    return code === 94 && "_hiddenFootnoteSupport" in self2.parser.constructs ? nok(code) : ok(code);
  }
}

// ../simple-mind-map/node_modules/micromark-core-commonmark/lib/label-start-link.js
var labelStartLink = {
  name: "labelStartLink",
  tokenize: tokenizeLabelStartLink,
  resolveAll: labelEnd.resolveAll
};
function tokenizeLabelStartLink(effects, ok, nok) {
  const self2 = this;
  return start;
  function start(code) {
    effects.enter("labelLink");
    effects.enter("labelMarker");
    effects.consume(code);
    effects.exit("labelMarker");
    effects.exit("labelLink");
    return after2;
  }
  function after2(code) {
    return code === 94 && "_hiddenFootnoteSupport" in self2.parser.constructs ? nok(code) : ok(code);
  }
}

// ../simple-mind-map/node_modules/micromark-core-commonmark/lib/line-ending.js
var lineEnding = {
  name: "lineEnding",
  tokenize: tokenizeLineEnding
};
function tokenizeLineEnding(effects, ok) {
  return start;
  function start(code) {
    effects.enter("lineEnding");
    effects.consume(code);
    effects.exit("lineEnding");
    return factorySpace(effects, ok, "linePrefix");
  }
}

// ../simple-mind-map/node_modules/micromark-core-commonmark/lib/thematic-break.js
var thematicBreak = {
  name: "thematicBreak",
  tokenize: tokenizeThematicBreak
};
function tokenizeThematicBreak(effects, ok, nok) {
  let size2 = 0;
  let marker;
  return start;
  function start(code) {
    effects.enter("thematicBreak");
    marker = code;
    return atBreak(code);
  }
  function atBreak(code) {
    if (code === marker) {
      effects.enter("thematicBreakSequence");
      return sequence(code);
    }
    if (markdownSpace(code)) {
      return factorySpace(effects, atBreak, "whitespace")(code);
    }
    if (size2 < 3 || code !== null && !markdownLineEnding(code)) {
      return nok(code);
    }
    effects.exit("thematicBreak");
    return ok(code);
  }
  function sequence(code) {
    if (code === marker) {
      effects.consume(code);
      size2++;
      return sequence;
    }
    effects.exit("thematicBreakSequence");
    return atBreak(code);
  }
}

// ../simple-mind-map/node_modules/micromark-core-commonmark/lib/list.js
var list = {
  name: "list",
  tokenize: tokenizeListStart,
  continuation: {
    tokenize: tokenizeListContinuation
  },
  exit: tokenizeListEnd
};
var listItemPrefixWhitespaceConstruct = {
  tokenize: tokenizeListItemPrefixWhitespace,
  partial: true
};
var indentConstruct = {
  tokenize: tokenizeIndent,
  partial: true
};
function tokenizeListStart(effects, ok, nok) {
  const self2 = this;
  const tail = self2.events[self2.events.length - 1];
  let initialSize = tail && tail[1].type === "linePrefix" ? tail[2].sliceSerialize(tail[1], true).length : 0;
  let size2 = 0;
  return start;
  function start(code) {
    const kind = self2.containerState.type || (code === 42 || code === 43 || code === 45 ? "listUnordered" : "listOrdered");
    if (kind === "listUnordered" ? !self2.containerState.marker || code === self2.containerState.marker : asciiDigit(code)) {
      if (!self2.containerState.type) {
        self2.containerState.type = kind;
        effects.enter(kind, {
          _container: true
        });
      }
      if (kind === "listUnordered") {
        effects.enter("listItemPrefix");
        return code === 42 || code === 45 ? effects.check(thematicBreak, nok, atMarker)(code) : atMarker(code);
      }
      if (!self2.interrupt || code === 49) {
        effects.enter("listItemPrefix");
        effects.enter("listItemValue");
        return inside2(code);
      }
    }
    return nok(code);
  }
  function inside2(code) {
    if (asciiDigit(code) && ++size2 < 10) {
      effects.consume(code);
      return inside2;
    }
    if ((!self2.interrupt || size2 < 2) && (self2.containerState.marker ? code === self2.containerState.marker : code === 41 || code === 46)) {
      effects.exit("listItemValue");
      return atMarker(code);
    }
    return nok(code);
  }
  function atMarker(code) {
    effects.enter("listItemMarker");
    effects.consume(code);
    effects.exit("listItemMarker");
    self2.containerState.marker = self2.containerState.marker || code;
    return effects.check(
      blankLine,
      // Can’t be empty when interrupting.
      self2.interrupt ? nok : onBlank,
      effects.attempt(
        listItemPrefixWhitespaceConstruct,
        endOfPrefix,
        otherPrefix
      )
    );
  }
  function onBlank(code) {
    self2.containerState.initialBlankLine = true;
    initialSize++;
    return endOfPrefix(code);
  }
  function otherPrefix(code) {
    if (markdownSpace(code)) {
      effects.enter("listItemPrefixWhitespace");
      effects.consume(code);
      effects.exit("listItemPrefixWhitespace");
      return endOfPrefix;
    }
    return nok(code);
  }
  function endOfPrefix(code) {
    self2.containerState.size = initialSize + self2.sliceSerialize(effects.exit("listItemPrefix"), true).length;
    return ok(code);
  }
}
function tokenizeListContinuation(effects, ok, nok) {
  const self2 = this;
  self2.containerState._closeFlow = void 0;
  return effects.check(blankLine, onBlank, notBlank);
  function onBlank(code) {
    self2.containerState.furtherBlankLines = self2.containerState.furtherBlankLines || self2.containerState.initialBlankLine;
    return factorySpace(
      effects,
      ok,
      "listItemIndent",
      self2.containerState.size + 1
    )(code);
  }
  function notBlank(code) {
    if (self2.containerState.furtherBlankLines || !markdownSpace(code)) {
      self2.containerState.furtherBlankLines = void 0;
      self2.containerState.initialBlankLine = void 0;
      return notInCurrentItem(code);
    }
    self2.containerState.furtherBlankLines = void 0;
    self2.containerState.initialBlankLine = void 0;
    return effects.attempt(indentConstruct, ok, notInCurrentItem)(code);
  }
  function notInCurrentItem(code) {
    self2.containerState._closeFlow = true;
    self2.interrupt = void 0;
    return factorySpace(
      effects,
      effects.attempt(list, ok, nok),
      "linePrefix",
      self2.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4
    )(code);
  }
}
function tokenizeIndent(effects, ok, nok) {
  const self2 = this;
  return factorySpace(
    effects,
    afterPrefix,
    "listItemIndent",
    self2.containerState.size + 1
  );
  function afterPrefix(code) {
    const tail = self2.events[self2.events.length - 1];
    return tail && tail[1].type === "listItemIndent" && tail[2].sliceSerialize(tail[1], true).length === self2.containerState.size ? ok(code) : nok(code);
  }
}
function tokenizeListEnd(effects) {
  effects.exit(this.containerState.type);
}
function tokenizeListItemPrefixWhitespace(effects, ok, nok) {
  const self2 = this;
  return factorySpace(
    effects,
    afterPrefix,
    "listItemPrefixWhitespace",
    self2.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4 + 1
  );
  function afterPrefix(code) {
    const tail = self2.events[self2.events.length - 1];
    return !markdownSpace(code) && tail && tail[1].type === "listItemPrefixWhitespace" ? ok(code) : nok(code);
  }
}

// ../simple-mind-map/node_modules/micromark-core-commonmark/lib/setext-underline.js
var setextUnderline = {
  name: "setextUnderline",
  tokenize: tokenizeSetextUnderline,
  resolveTo: resolveToSetextUnderline
};
function resolveToSetextUnderline(events, context) {
  let index3 = events.length;
  let content3;
  let text3;
  let definition2;
  while (index3--) {
    if (events[index3][0] === "enter") {
      if (events[index3][1].type === "content") {
        content3 = index3;
        break;
      }
      if (events[index3][1].type === "paragraph") {
        text3 = index3;
      }
    } else {
      if (events[index3][1].type === "content") {
        events.splice(index3, 1);
      }
      if (!definition2 && events[index3][1].type === "definition") {
        definition2 = index3;
      }
    }
  }
  const heading = {
    type: "setextHeading",
    start: Object.assign({}, events[text3][1].start),
    end: Object.assign({}, events[events.length - 1][1].end)
  };
  events[text3][1].type = "setextHeadingText";
  if (definition2) {
    events.splice(text3, 0, ["enter", heading, context]);
    events.splice(definition2 + 1, 0, ["exit", events[content3][1], context]);
    events[content3][1].end = Object.assign({}, events[definition2][1].end);
  } else {
    events[content3][1] = heading;
  }
  events.push(["exit", heading, context]);
  return events;
}
function tokenizeSetextUnderline(effects, ok, nok) {
  const self2 = this;
  let index3 = self2.events.length;
  let marker;
  let paragraph;
  while (index3--) {
    if (self2.events[index3][1].type !== "lineEnding" && self2.events[index3][1].type !== "linePrefix" && self2.events[index3][1].type !== "content") {
      paragraph = self2.events[index3][1].type === "paragraph";
      break;
    }
  }
  return start;
  function start(code) {
    if (!self2.parser.lazy[self2.now().line] && (self2.interrupt || paragraph)) {
      effects.enter("setextHeadingLine");
      effects.enter("setextHeadingLineSequence");
      marker = code;
      return closingSequence(code);
    }
    return nok(code);
  }
  function closingSequence(code) {
    if (code === marker) {
      effects.consume(code);
      return closingSequence;
    }
    effects.exit("setextHeadingLineSequence");
    return factorySpace(effects, closingSequenceEnd, "lineSuffix")(code);
  }
  function closingSequenceEnd(code) {
    if (code === null || markdownLineEnding(code)) {
      effects.exit("setextHeadingLine");
      return ok(code);
    }
    return nok(code);
  }
}

// ../simple-mind-map/node_modules/micromark/lib/initialize/flow.js
var flow = {
  tokenize: initializeFlow
};
function initializeFlow(effects) {
  const self2 = this;
  const initial = effects.attempt(
    // Try to parse a blank line.
    blankLine,
    atBlankEnding,
    // Try to parse initial flow (essentially, only code).
    effects.attempt(
      this.parser.constructs.flowInitial,
      afterConstruct,
      factorySpace(
        effects,
        effects.attempt(
          this.parser.constructs.flow,
          afterConstruct,
          effects.attempt(content2, afterConstruct)
        ),
        "linePrefix"
      )
    )
  );
  return initial;
  function atBlankEnding(code) {
    if (code === null) {
      effects.consume(code);
      return;
    }
    effects.enter("lineEndingBlank");
    effects.consume(code);
    effects.exit("lineEndingBlank");
    self2.currentConstruct = void 0;
    return initial;
  }
  function afterConstruct(code) {
    if (code === null) {
      effects.consume(code);
      return;
    }
    effects.enter("lineEnding");
    effects.consume(code);
    effects.exit("lineEnding");
    self2.currentConstruct = void 0;
    return initial;
  }
}

// ../simple-mind-map/node_modules/micromark/lib/initialize/text.js
var resolver = {
  resolveAll: createResolver()
};
var string = initializeFactory("string");
var text = initializeFactory("text");
function initializeFactory(field) {
  return {
    tokenize: initializeText,
    resolveAll: createResolver(
      field === "text" ? resolveAllLineSuffixes : void 0
    )
  };
  function initializeText(effects) {
    const self2 = this;
    const constructs2 = this.parser.constructs[field];
    const text3 = effects.attempt(constructs2, start, notText);
    return start;
    function start(code) {
      return atBreak(code) ? text3(code) : notText(code);
    }
    function notText(code) {
      if (code === null) {
        effects.consume(code);
        return;
      }
      effects.enter("data");
      effects.consume(code);
      return data2;
    }
    function data2(code) {
      if (atBreak(code)) {
        effects.exit("data");
        return text3(code);
      }
      effects.consume(code);
      return data2;
    }
    function atBreak(code) {
      if (code === null) {
        return true;
      }
      const list2 = constructs2[code];
      let index3 = -1;
      if (list2) {
        while (++index3 < list2.length) {
          const item = list2[index3];
          if (!item.previous || item.previous.call(self2, self2.previous)) {
            return true;
          }
        }
      }
      return false;
    }
  }
}
function createResolver(extraResolver) {
  return resolveAllText;
  function resolveAllText(events, context) {
    let index3 = -1;
    let enter;
    while (++index3 <= events.length) {
      if (enter === void 0) {
        if (events[index3] && events[index3][1].type === "data") {
          enter = index3;
          index3++;
        }
      } else if (!events[index3] || events[index3][1].type !== "data") {
        if (index3 !== enter + 2) {
          events[enter][1].end = events[index3 - 1][1].end;
          events.splice(enter + 2, index3 - enter - 2);
          index3 = enter + 2;
        }
        enter = void 0;
      }
    }
    return extraResolver ? extraResolver(events, context) : events;
  }
}
function resolveAllLineSuffixes(events, context) {
  let eventIndex = 0;
  while (++eventIndex <= events.length) {
    if ((eventIndex === events.length || events[eventIndex][1].type === "lineEnding") && events[eventIndex - 1][1].type === "data") {
      const data2 = events[eventIndex - 1][1];
      const chunks = context.sliceStream(data2);
      let index3 = chunks.length;
      let bufferIndex = -1;
      let size2 = 0;
      let tabs;
      while (index3--) {
        const chunk = chunks[index3];
        if (typeof chunk === "string") {
          bufferIndex = chunk.length;
          while (chunk.charCodeAt(bufferIndex - 1) === 32) {
            size2++;
            bufferIndex--;
          }
          if (bufferIndex)
            break;
          bufferIndex = -1;
        } else if (chunk === -2) {
          tabs = true;
          size2++;
        } else if (chunk === -1) {
        } else {
          index3++;
          break;
        }
      }
      if (size2) {
        const token = {
          type: eventIndex === events.length || tabs || size2 < 2 ? "lineSuffix" : "hardBreakTrailing",
          start: {
            line: data2.end.line,
            column: data2.end.column - size2,
            offset: data2.end.offset - size2,
            _index: data2.start._index + index3,
            _bufferIndex: index3 ? bufferIndex : data2.start._bufferIndex + bufferIndex
          },
          end: Object.assign({}, data2.end)
        };
        data2.end = Object.assign({}, token.start);
        if (data2.start.offset === data2.end.offset) {
          Object.assign(data2, token);
        } else {
          events.splice(
            eventIndex,
            0,
            ["enter", token, context],
            ["exit", token, context]
          );
          eventIndex += 2;
        }
      }
      eventIndex++;
    }
  }
  return events;
}

// ../simple-mind-map/node_modules/micromark/lib/create-tokenizer.js
function createTokenizer(parser2, initialize, from2) {
  let point4 = Object.assign(
    from2 ? Object.assign({}, from2) : {
      line: 1,
      column: 1,
      offset: 0
    },
    {
      _index: 0,
      _bufferIndex: -1
    }
  );
  const columnStart = {};
  const resolveAllConstructs = [];
  let chunks = [];
  let stack = [];
  let consumed = true;
  const effects = {
    consume,
    enter,
    exit: exit2,
    attempt: constructFactory(onsuccessfulconstruct),
    check: constructFactory(onsuccessfulcheck),
    interrupt: constructFactory(onsuccessfulcheck, {
      interrupt: true
    })
  };
  const context = {
    previous: null,
    code: null,
    containerState: {},
    events: [],
    parser: parser2,
    sliceStream,
    sliceSerialize,
    now,
    defineSkip,
    write
  };
  let state = initialize.tokenize.call(context, effects);
  let expectedCode;
  if (initialize.resolveAll) {
    resolveAllConstructs.push(initialize);
  }
  return context;
  function write(slice2) {
    chunks = push3(chunks, slice2);
    main();
    if (chunks[chunks.length - 1] !== null) {
      return [];
    }
    addResult(initialize, 0);
    context.events = resolveAll(resolveAllConstructs, context.events, context);
    return context.events;
  }
  function sliceSerialize(token, expandTabs) {
    return serializeChunks(sliceStream(token), expandTabs);
  }
  function sliceStream(token) {
    return sliceChunks(chunks, token);
  }
  function now() {
    return Object.assign({}, point4);
  }
  function defineSkip(value) {
    columnStart[value.line] = value.column;
    accountForPotentialSkip();
  }
  function main() {
    let chunkIndex;
    while (point4._index < chunks.length) {
      const chunk = chunks[point4._index];
      if (typeof chunk === "string") {
        chunkIndex = point4._index;
        if (point4._bufferIndex < 0) {
          point4._bufferIndex = 0;
        }
        while (point4._index === chunkIndex && point4._bufferIndex < chunk.length) {
          go(chunk.charCodeAt(point4._bufferIndex));
        }
      } else {
        go(chunk);
      }
    }
  }
  function go(code) {
    consumed = void 0;
    expectedCode = code;
    state = state(code);
  }
  function consume(code) {
    if (markdownLineEnding(code)) {
      point4.line++;
      point4.column = 1;
      point4.offset += code === -3 ? 2 : 1;
      accountForPotentialSkip();
    } else if (code !== -1) {
      point4.column++;
      point4.offset++;
    }
    if (point4._bufferIndex < 0) {
      point4._index++;
    } else {
      point4._bufferIndex++;
      if (point4._bufferIndex === chunks[point4._index].length) {
        point4._bufferIndex = -1;
        point4._index++;
      }
    }
    context.previous = code;
    consumed = true;
  }
  function enter(type, fields) {
    const token = fields || {};
    token.type = type;
    token.start = now();
    context.events.push(["enter", token, context]);
    stack.push(token);
    return token;
  }
  function exit2(type) {
    const token = stack.pop();
    token.end = now();
    context.events.push(["exit", token, context]);
    return token;
  }
  function onsuccessfulconstruct(construct, info) {
    addResult(construct, info.from);
  }
  function onsuccessfulcheck(_3, info) {
    info.restore();
  }
  function constructFactory(onreturn, fields) {
    return hook;
    function hook(constructs2, returnState, bogusState) {
      let listOfConstructs;
      let constructIndex;
      let currentConstruct;
      let info;
      return Array.isArray(constructs2) ? (
        /* c8 ignore next 1 */
        handleListOfConstructs(constructs2)
      ) : "tokenize" in constructs2 ? handleListOfConstructs([constructs2]) : handleMapOfConstructs(constructs2);
      function handleMapOfConstructs(map3) {
        return start;
        function start(code) {
          const def = code !== null && map3[code];
          const all2 = code !== null && map3.null;
          const list2 = [
            // To do: add more extension tests.
            /* c8 ignore next 2 */
            ...Array.isArray(def) ? def : def ? [def] : [],
            ...Array.isArray(all2) ? all2 : all2 ? [all2] : []
          ];
          return handleListOfConstructs(list2)(code);
        }
      }
      function handleListOfConstructs(list2) {
        listOfConstructs = list2;
        constructIndex = 0;
        if (list2.length === 0) {
          return bogusState;
        }
        return handleConstruct(list2[constructIndex]);
      }
      function handleConstruct(construct) {
        return start;
        function start(code) {
          info = store();
          currentConstruct = construct;
          if (!construct.partial) {
            context.currentConstruct = construct;
          }
          if (construct.name && context.parser.constructs.disable.null.includes(construct.name)) {
            return nok(code);
          }
          return construct.tokenize.call(
            // If we do have fields, create an object w/ `context` as its
            // prototype.
            // This allows a “live binding”, which is needed for `interrupt`.
            fields ? Object.assign(Object.create(context), fields) : context,
            effects,
            ok,
            nok
          )(code);
        }
      }
      function ok(code) {
        consumed = true;
        onreturn(currentConstruct, info);
        return returnState;
      }
      function nok(code) {
        consumed = true;
        info.restore();
        if (++constructIndex < listOfConstructs.length) {
          return handleConstruct(listOfConstructs[constructIndex]);
        }
        return bogusState;
      }
    }
  }
  function addResult(construct, from3) {
    if (construct.resolveAll && !resolveAllConstructs.includes(construct)) {
      resolveAllConstructs.push(construct);
    }
    if (construct.resolve) {
      splice(
        context.events,
        from3,
        context.events.length - from3,
        construct.resolve(context.events.slice(from3), context)
      );
    }
    if (construct.resolveTo) {
      context.events = construct.resolveTo(context.events, context);
    }
  }
  function store() {
    const startPoint = now();
    const startPrevious = context.previous;
    const startCurrentConstruct = context.currentConstruct;
    const startEventsIndex = context.events.length;
    const startStack = Array.from(stack);
    return {
      restore,
      from: startEventsIndex
    };
    function restore() {
      point4 = startPoint;
      context.previous = startPrevious;
      context.currentConstruct = startCurrentConstruct;
      context.events.length = startEventsIndex;
      stack = startStack;
      accountForPotentialSkip();
    }
  }
  function accountForPotentialSkip() {
    if (point4.line in columnStart && point4.column < 2) {
      point4.column = columnStart[point4.line];
      point4.offset += columnStart[point4.line] - 1;
    }
  }
}
function sliceChunks(chunks, token) {
  const startIndex = token.start._index;
  const startBufferIndex = token.start._bufferIndex;
  const endIndex = token.end._index;
  const endBufferIndex = token.end._bufferIndex;
  let view;
  if (startIndex === endIndex) {
    view = [chunks[startIndex].slice(startBufferIndex, endBufferIndex)];
  } else {
    view = chunks.slice(startIndex, endIndex);
    if (startBufferIndex > -1) {
      view[0] = view[0].slice(startBufferIndex);
    }
    if (endBufferIndex > 0) {
      view.push(chunks[endIndex].slice(0, endBufferIndex));
    }
  }
  return view;
}
function serializeChunks(chunks, expandTabs) {
  let index3 = -1;
  const result = [];
  let atTab;
  while (++index3 < chunks.length) {
    const chunk = chunks[index3];
    let value;
    if (typeof chunk === "string") {
      value = chunk;
    } else
      switch (chunk) {
        case -5: {
          value = "\r";
          break;
        }
        case -4: {
          value = "\n";
          break;
        }
        case -3: {
          value = "\r\n";
          break;
        }
        case -2: {
          value = expandTabs ? " " : "	";
          break;
        }
        case -1: {
          if (!expandTabs && atTab)
            continue;
          value = " ";
          break;
        }
        default: {
          value = String.fromCharCode(chunk);
        }
      }
    atTab = chunk === -2;
    result.push(value);
  }
  return result.join("");
}

// ../simple-mind-map/node_modules/micromark/lib/constructs.js
var constructs_exports = {};
__export(constructs_exports, {
  attentionMarkers: () => attentionMarkers,
  contentInitial: () => contentInitial,
  disable: () => disable,
  document: () => document3,
  flow: () => flow2,
  flowInitial: () => flowInitial,
  insideSpan: () => insideSpan,
  string: () => string2,
  text: () => text2
});
var document3 = {
  [42]: list,
  [43]: list,
  [45]: list,
  [48]: list,
  [49]: list,
  [50]: list,
  [51]: list,
  [52]: list,
  [53]: list,
  [54]: list,
  [55]: list,
  [56]: list,
  [57]: list,
  [62]: blockQuote
};
var contentInitial = {
  [91]: definition
};
var flowInitial = {
  [-2]: codeIndented,
  [-1]: codeIndented,
  [32]: codeIndented
};
var flow2 = {
  [35]: headingAtx,
  [42]: thematicBreak,
  [45]: [setextUnderline, thematicBreak],
  [60]: htmlFlow,
  [61]: setextUnderline,
  [95]: thematicBreak,
  [96]: codeFenced,
  [126]: codeFenced
};
var string2 = {
  [38]: characterReference,
  [92]: characterEscape
};
var text2 = {
  [-5]: lineEnding,
  [-4]: lineEnding,
  [-3]: lineEnding,
  [33]: labelStartImage,
  [38]: characterReference,
  [42]: attention,
  [60]: [autolink, htmlText],
  [91]: labelStartLink,
  [92]: [hardBreakEscape, characterEscape],
  [93]: labelEnd,
  [95]: attention,
  [96]: codeText
};
var insideSpan = {
  null: [attention, resolver]
};
var attentionMarkers = {
  null: [42, 95]
};
var disable = {
  null: []
};

// ../simple-mind-map/node_modules/micromark/lib/parse.js
function parse(options = {}) {
  const constructs2 = combineExtensions(
    // @ts-expect-error Same as above.
    [constructs_exports].concat(options.extensions || [])
  );
  const parser2 = {
    defined: [],
    lazy: {},
    constructs: constructs2,
    content: create2(content),
    document: create2(document2),
    flow: create2(flow),
    string: create2(string),
    text: create2(text)
  };
  return parser2;
  function create2(initial) {
    return creator;
    function creator(from2) {
      return createTokenizer(parser2, initial, from2);
    }
  }
}

// ../simple-mind-map/node_modules/micromark/lib/preprocess.js
var search = /[\0\t\n\r]/g;
function preprocess() {
  let column = 1;
  let buffer = "";
  let start = true;
  let atCarriageReturn;
  return preprocessor;
  function preprocessor(value, encoding, end) {
    const chunks = [];
    let match;
    let next2;
    let startPosition;
    let endPosition;
    let code;
    value = buffer + value.toString(encoding);
    startPosition = 0;
    buffer = "";
    if (start) {
      if (value.charCodeAt(0) === 65279) {
        startPosition++;
      }
      start = void 0;
    }
    while (startPosition < value.length) {
      search.lastIndex = startPosition;
      match = search.exec(value);
      endPosition = match && match.index !== void 0 ? match.index : value.length;
      code = value.charCodeAt(endPosition);
      if (!match) {
        buffer = value.slice(startPosition);
        break;
      }
      if (code === 10 && startPosition === endPosition && atCarriageReturn) {
        chunks.push(-3);
        atCarriageReturn = void 0;
      } else {
        if (atCarriageReturn) {
          chunks.push(-5);
          atCarriageReturn = void 0;
        }
        if (startPosition < endPosition) {
          chunks.push(value.slice(startPosition, endPosition));
          column += endPosition - startPosition;
        }
        switch (code) {
          case 0: {
            chunks.push(65533);
            column++;
            break;
          }
          case 9: {
            next2 = Math.ceil(column / 4) * 4;
            chunks.push(-2);
            while (column++ < next2)
              chunks.push(-1);
            break;
          }
          case 10: {
            chunks.push(-4);
            column = 1;
            break;
          }
          default: {
            atCarriageReturn = true;
            column = 1;
          }
        }
      }
      startPosition = endPosition + 1;
    }
    if (end) {
      if (atCarriageReturn)
        chunks.push(-5);
      if (buffer)
        chunks.push(buffer);
      chunks.push(null);
    }
    return chunks;
  }
}

// ../simple-mind-map/node_modules/micromark/lib/postprocess.js
function postprocess(events) {
  while (!subtokenize(events)) {
  }
  return events;
}

// ../simple-mind-map/node_modules/micromark-util-decode-numeric-character-reference/index.js
function decodeNumericCharacterReference(value, base) {
  const code = Number.parseInt(value, base);
  if (
    // C0 except for HT, LF, FF, CR, space
    code < 9 || code === 11 || code > 13 && code < 32 || // Control character (DEL) of the basic block and C1 controls.
    code > 126 && code < 160 || // Lone high surrogates and low surrogates.
    code > 55295 && code < 57344 || // Noncharacters.
    code > 64975 && code < 65008 || (code & 65535) === 65535 || (code & 65535) === 65534 || // Out of range
    code > 1114111
  ) {
    return "\uFFFD";
  }
  return String.fromCharCode(code);
}

// ../simple-mind-map/node_modules/micromark-util-decode-string/index.js
var characterEscapeOrReference = /\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;
function decodeString(value) {
  return value.replace(characterEscapeOrReference, decode);
}
function decode($0, $1, $22) {
  if ($1) {
    return $1;
  }
  const head = $22.charCodeAt(0);
  if (head === 35) {
    const head2 = $22.charCodeAt(1);
    const hex2 = head2 === 120 || head2 === 88;
    return decodeNumericCharacterReference($22.slice(hex2 ? 2 : 1), hex2 ? 16 : 10);
  }
  return decodeNamedCharacterReference($22) || $0;
}

// ../simple-mind-map/node_modules/unist-util-stringify-position/lib/index.js
function stringifyPosition(value) {
  if (!value || typeof value !== "object") {
    return "";
  }
  if ("position" in value || "type" in value) {
    return position2(value.position);
  }
  if ("start" in value || "end" in value) {
    return position2(value);
  }
  if ("line" in value || "column" in value) {
    return point2(value);
  }
  return "";
}
function point2(point4) {
  return index2(point4 && point4.line) + ":" + index2(point4 && point4.column);
}
function position2(pos) {
  return point2(pos && pos.start) + "-" + point2(pos && pos.end);
}
function index2(value) {
  return value && typeof value === "number" ? value : 1;
}

// ../simple-mind-map/node_modules/mdast-util-from-markdown/lib/index.js
var own = {}.hasOwnProperty;
var fromMarkdown = (
  /**
   * @type {(
   *   ((value: Value, encoding: Encoding, options?: Options | null | undefined) => Root) &
   *   ((value: Value, options?: Options | null | undefined) => Root)
   * )}
   */
  /**
   * @param {Value} value
   * @param {Encoding | Options | null | undefined} [encoding]
   * @param {Options | null | undefined} [options]
   * @returns {Root}
   */
  function(value, encoding, options) {
    if (typeof encoding !== "string") {
      options = encoding;
      encoding = void 0;
    }
    return compiler(options)(
      postprocess(
        // @ts-expect-error: micromark types need to accept `null`.
        parse(options).document().write(preprocess()(value, encoding, true))
      )
    );
  }
);
function compiler(options) {
  const config = {
    transforms: [],
    canContainEols: ["emphasis", "fragment", "heading", "paragraph", "strong"],
    enter: {
      autolink: opener(link),
      autolinkProtocol: onenterdata,
      autolinkEmail: onenterdata,
      atxHeading: opener(heading),
      blockQuote: opener(blockQuote2),
      characterEscape: onenterdata,
      characterReference: onenterdata,
      codeFenced: opener(codeFlow),
      codeFencedFenceInfo: buffer,
      codeFencedFenceMeta: buffer,
      codeIndented: opener(codeFlow, buffer),
      codeText: opener(codeText2, buffer),
      codeTextData: onenterdata,
      data: onenterdata,
      codeFlowValue: onenterdata,
      definition: opener(definition2),
      definitionDestinationString: buffer,
      definitionLabelString: buffer,
      definitionTitleString: buffer,
      emphasis: opener(emphasis),
      hardBreakEscape: opener(hardBreak),
      hardBreakTrailing: opener(hardBreak),
      htmlFlow: opener(html2, buffer),
      htmlFlowData: onenterdata,
      htmlText: opener(html2, buffer),
      htmlTextData: onenterdata,
      image: opener(image),
      label: buffer,
      link: opener(link),
      listItem: opener(listItem),
      listItemValue: onenterlistitemvalue,
      listOrdered: opener(list2, onenterlistordered),
      listUnordered: opener(list2),
      paragraph: opener(paragraph),
      reference: onenterreference,
      referenceString: buffer,
      resourceDestinationString: buffer,
      resourceTitleString: buffer,
      setextHeading: opener(heading),
      strong: opener(strong),
      thematicBreak: opener(thematicBreak2)
    },
    exit: {
      atxHeading: closer(),
      atxHeadingSequence: onexitatxheadingsequence,
      autolink: closer(),
      autolinkEmail: onexitautolinkemail,
      autolinkProtocol: onexitautolinkprotocol,
      blockQuote: closer(),
      characterEscapeValue: onexitdata,
      characterReferenceMarkerHexadecimal: onexitcharacterreferencemarker,
      characterReferenceMarkerNumeric: onexitcharacterreferencemarker,
      characterReferenceValue: onexitcharacterreferencevalue,
      codeFenced: closer(onexitcodefenced),
      codeFencedFence: onexitcodefencedfence,
      codeFencedFenceInfo: onexitcodefencedfenceinfo,
      codeFencedFenceMeta: onexitcodefencedfencemeta,
      codeFlowValue: onexitdata,
      codeIndented: closer(onexitcodeindented),
      codeText: closer(onexitcodetext),
      codeTextData: onexitdata,
      data: onexitdata,
      definition: closer(),
      definitionDestinationString: onexitdefinitiondestinationstring,
      definitionLabelString: onexitdefinitionlabelstring,
      definitionTitleString: onexitdefinitiontitlestring,
      emphasis: closer(),
      hardBreakEscape: closer(onexithardbreak),
      hardBreakTrailing: closer(onexithardbreak),
      htmlFlow: closer(onexithtmlflow),
      htmlFlowData: onexitdata,
      htmlText: closer(onexithtmltext),
      htmlTextData: onexitdata,
      image: closer(onexitimage),
      label: onexitlabel,
      labelText: onexitlabeltext,
      lineEnding: onexitlineending,
      link: closer(onexitlink),
      listItem: closer(),
      listOrdered: closer(),
      listUnordered: closer(),
      paragraph: closer(),
      referenceString: onexitreferencestring,
      resourceDestinationString: onexitresourcedestinationstring,
      resourceTitleString: onexitresourcetitlestring,
      resource: onexitresource,
      setextHeading: closer(onexitsetextheading),
      setextHeadingLineSequence: onexitsetextheadinglinesequence,
      setextHeadingText: onexitsetextheadingtext,
      strong: closer(),
      thematicBreak: closer()
    }
  };
  configure(config, (options || {}).mdastExtensions || []);
  const data2 = {};
  return compile;
  function compile(events) {
    let tree = {
      type: "root",
      children: []
    };
    const context = {
      stack: [tree],
      tokenStack: [],
      config,
      enter,
      exit: exit2,
      buffer,
      resume,
      setData: setData2,
      getData
    };
    const listStack = [];
    let index3 = -1;
    while (++index3 < events.length) {
      if (events[index3][1].type === "listOrdered" || events[index3][1].type === "listUnordered") {
        if (events[index3][0] === "enter") {
          listStack.push(index3);
        } else {
          const tail = listStack.pop();
          index3 = prepareList(events, tail, index3);
        }
      }
    }
    index3 = -1;
    while (++index3 < events.length) {
      const handler = config[events[index3][0]];
      if (own.call(handler, events[index3][1].type)) {
        handler[events[index3][1].type].call(
          Object.assign(
            {
              sliceSerialize: events[index3][2].sliceSerialize
            },
            context
          ),
          events[index3][1]
        );
      }
    }
    if (context.tokenStack.length > 0) {
      const tail = context.tokenStack[context.tokenStack.length - 1];
      const handler = tail[1] || defaultOnError;
      handler.call(context, void 0, tail[0]);
    }
    tree.position = {
      start: point3(
        events.length > 0 ? events[0][1].start : {
          line: 1,
          column: 1,
          offset: 0
        }
      ),
      end: point3(
        events.length > 0 ? events[events.length - 2][1].end : {
          line: 1,
          column: 1,
          offset: 0
        }
      )
    };
    index3 = -1;
    while (++index3 < config.transforms.length) {
      tree = config.transforms[index3](tree) || tree;
    }
    return tree;
  }
  function prepareList(events, start, length2) {
    let index3 = start - 1;
    let containerBalance = -1;
    let listSpread = false;
    let listItem2;
    let lineIndex;
    let firstBlankLineIndex;
    let atMarker;
    while (++index3 <= length2) {
      const event = events[index3];
      if (event[1].type === "listUnordered" || event[1].type === "listOrdered" || event[1].type === "blockQuote") {
        if (event[0] === "enter") {
          containerBalance++;
        } else {
          containerBalance--;
        }
        atMarker = void 0;
      } else if (event[1].type === "lineEndingBlank") {
        if (event[0] === "enter") {
          if (listItem2 && !atMarker && !containerBalance && !firstBlankLineIndex) {
            firstBlankLineIndex = index3;
          }
          atMarker = void 0;
        }
      } else if (event[1].type === "linePrefix" || event[1].type === "listItemValue" || event[1].type === "listItemMarker" || event[1].type === "listItemPrefix" || event[1].type === "listItemPrefixWhitespace") {
      } else {
        atMarker = void 0;
      }
      if (!containerBalance && event[0] === "enter" && event[1].type === "listItemPrefix" || containerBalance === -1 && event[0] === "exit" && (event[1].type === "listUnordered" || event[1].type === "listOrdered")) {
        if (listItem2) {
          let tailIndex = index3;
          lineIndex = void 0;
          while (tailIndex--) {
            const tailEvent = events[tailIndex];
            if (tailEvent[1].type === "lineEnding" || tailEvent[1].type === "lineEndingBlank") {
              if (tailEvent[0] === "exit")
                continue;
              if (lineIndex) {
                events[lineIndex][1].type = "lineEndingBlank";
                listSpread = true;
              }
              tailEvent[1].type = "lineEnding";
              lineIndex = tailIndex;
            } else if (tailEvent[1].type === "linePrefix" || tailEvent[1].type === "blockQuotePrefix" || tailEvent[1].type === "blockQuotePrefixWhitespace" || tailEvent[1].type === "blockQuoteMarker" || tailEvent[1].type === "listItemIndent") {
            } else {
              break;
            }
          }
          if (firstBlankLineIndex && (!lineIndex || firstBlankLineIndex < lineIndex)) {
            listItem2._spread = true;
          }
          listItem2.end = Object.assign(
            {},
            lineIndex ? events[lineIndex][1].start : event[1].end
          );
          events.splice(lineIndex || index3, 0, ["exit", listItem2, event[2]]);
          index3++;
          length2++;
        }
        if (event[1].type === "listItemPrefix") {
          listItem2 = {
            type: "listItem",
            // @ts-expect-error Patched
            _spread: false,
            start: Object.assign({}, event[1].start)
          };
          events.splice(index3, 0, ["enter", listItem2, event[2]]);
          index3++;
          length2++;
          firstBlankLineIndex = void 0;
          atMarker = true;
        }
      }
    }
    events[start][1]._spread = listSpread;
    return length2;
  }
  function setData2(key, value) {
    data2[key] = value;
  }
  function getData(key) {
    return data2[key];
  }
  function opener(create2, and) {
    return open3;
    function open3(token) {
      enter.call(this, create2(token), token);
      if (and)
        and.call(this, token);
    }
  }
  function buffer() {
    this.stack.push({
      type: "fragment",
      children: []
    });
  }
  function enter(node3, token, errorHandler) {
    const parent = this.stack[this.stack.length - 1];
    parent.children.push(node3);
    this.stack.push(node3);
    this.tokenStack.push([token, errorHandler]);
    node3.position = {
      start: point3(token.start)
    };
    return node3;
  }
  function closer(and) {
    return close2;
    function close2(token) {
      if (and)
        and.call(this, token);
      exit2.call(this, token);
    }
  }
  function exit2(token, onExitError) {
    const node3 = this.stack.pop();
    const open3 = this.tokenStack.pop();
    if (!open3) {
      throw new Error(
        "Cannot close `" + token.type + "` (" + stringifyPosition({
          start: token.start,
          end: token.end
        }) + "): it\u2019s not open"
      );
    } else if (open3[0].type !== token.type) {
      if (onExitError) {
        onExitError.call(this, token, open3[0]);
      } else {
        const handler = open3[1] || defaultOnError;
        handler.call(this, token, open3[0]);
      }
    }
    node3.position.end = point3(token.end);
    return node3;
  }
  function resume() {
    return toString7(this.stack.pop());
  }
  function onenterlistordered() {
    setData2("expectingFirstListItemValue", true);
  }
  function onenterlistitemvalue(token) {
    if (getData("expectingFirstListItemValue")) {
      const ancestor = this.stack[this.stack.length - 2];
      ancestor.start = Number.parseInt(this.sliceSerialize(token), 10);
      setData2("expectingFirstListItemValue");
    }
  }
  function onexitcodefencedfenceinfo() {
    const data3 = this.resume();
    const node3 = this.stack[this.stack.length - 1];
    node3.lang = data3;
  }
  function onexitcodefencedfencemeta() {
    const data3 = this.resume();
    const node3 = this.stack[this.stack.length - 1];
    node3.meta = data3;
  }
  function onexitcodefencedfence() {
    if (getData("flowCodeInside"))
      return;
    this.buffer();
    setData2("flowCodeInside", true);
  }
  function onexitcodefenced() {
    const data3 = this.resume();
    const node3 = this.stack[this.stack.length - 1];
    node3.value = data3.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g, "");
    setData2("flowCodeInside");
  }
  function onexitcodeindented() {
    const data3 = this.resume();
    const node3 = this.stack[this.stack.length - 1];
    node3.value = data3.replace(/(\r?\n|\r)$/g, "");
  }
  function onexitdefinitionlabelstring(token) {
    const label = this.resume();
    const node3 = this.stack[this.stack.length - 1];
    node3.label = label;
    node3.identifier = normalizeIdentifier(
      this.sliceSerialize(token)
    ).toLowerCase();
  }
  function onexitdefinitiontitlestring() {
    const data3 = this.resume();
    const node3 = this.stack[this.stack.length - 1];
    node3.title = data3;
  }
  function onexitdefinitiondestinationstring() {
    const data3 = this.resume();
    const node3 = this.stack[this.stack.length - 1];
    node3.url = data3;
  }
  function onexitatxheadingsequence(token) {
    const node3 = this.stack[this.stack.length - 1];
    if (!node3.depth) {
      const depth = this.sliceSerialize(token).length;
      node3.depth = depth;
    }
  }
  function onexitsetextheadingtext() {
    setData2("setextHeadingSlurpLineEnding", true);
  }
  function onexitsetextheadinglinesequence(token) {
    const node3 = this.stack[this.stack.length - 1];
    node3.depth = this.sliceSerialize(token).charCodeAt(0) === 61 ? 1 : 2;
  }
  function onexitsetextheading() {
    setData2("setextHeadingSlurpLineEnding");
  }
  function onenterdata(token) {
    const node3 = this.stack[this.stack.length - 1];
    let tail = node3.children[node3.children.length - 1];
    if (!tail || tail.type !== "text") {
      tail = text3();
      tail.position = {
        start: point3(token.start)
      };
      node3.children.push(tail);
    }
    this.stack.push(tail);
  }
  function onexitdata(token) {
    const tail = this.stack.pop();
    tail.value += this.sliceSerialize(token);
    tail.position.end = point3(token.end);
  }
  function onexitlineending(token) {
    const context = this.stack[this.stack.length - 1];
    if (getData("atHardBreak")) {
      const tail = context.children[context.children.length - 1];
      tail.position.end = point3(token.end);
      setData2("atHardBreak");
      return;
    }
    if (!getData("setextHeadingSlurpLineEnding") && config.canContainEols.includes(context.type)) {
      onenterdata.call(this, token);
      onexitdata.call(this, token);
    }
  }
  function onexithardbreak() {
    setData2("atHardBreak", true);
  }
  function onexithtmlflow() {
    const data3 = this.resume();
    const node3 = this.stack[this.stack.length - 1];
    node3.value = data3;
  }
  function onexithtmltext() {
    const data3 = this.resume();
    const node3 = this.stack[this.stack.length - 1];
    node3.value = data3;
  }
  function onexitcodetext() {
    const data3 = this.resume();
    const node3 = this.stack[this.stack.length - 1];
    node3.value = data3;
  }
  function onexitlink() {
    const node3 = this.stack[this.stack.length - 1];
    if (getData("inReference")) {
      const referenceType = getData("referenceType") || "shortcut";
      node3.type += "Reference";
      node3.referenceType = referenceType;
      delete node3.url;
      delete node3.title;
    } else {
      delete node3.identifier;
      delete node3.label;
    }
    setData2("referenceType");
  }
  function onexitimage() {
    const node3 = this.stack[this.stack.length - 1];
    if (getData("inReference")) {
      const referenceType = getData("referenceType") || "shortcut";
      node3.type += "Reference";
      node3.referenceType = referenceType;
      delete node3.url;
      delete node3.title;
    } else {
      delete node3.identifier;
      delete node3.label;
    }
    setData2("referenceType");
  }
  function onexitlabeltext(token) {
    const string3 = this.sliceSerialize(token);
    const ancestor = this.stack[this.stack.length - 2];
    ancestor.label = decodeString(string3);
    ancestor.identifier = normalizeIdentifier(string3).toLowerCase();
  }
  function onexitlabel() {
    const fragment = this.stack[this.stack.length - 1];
    const value = this.resume();
    const node3 = this.stack[this.stack.length - 1];
    setData2("inReference", true);
    if (node3.type === "link") {
      const children = fragment.children;
      node3.children = children;
    } else {
      node3.alt = value;
    }
  }
  function onexitresourcedestinationstring() {
    const data3 = this.resume();
    const node3 = this.stack[this.stack.length - 1];
    node3.url = data3;
  }
  function onexitresourcetitlestring() {
    const data3 = this.resume();
    const node3 = this.stack[this.stack.length - 1];
    node3.title = data3;
  }
  function onexitresource() {
    setData2("inReference");
  }
  function onenterreference() {
    setData2("referenceType", "collapsed");
  }
  function onexitreferencestring(token) {
    const label = this.resume();
    const node3 = this.stack[this.stack.length - 1];
    node3.label = label;
    node3.identifier = normalizeIdentifier(
      this.sliceSerialize(token)
    ).toLowerCase();
    setData2("referenceType", "full");
  }
  function onexitcharacterreferencemarker(token) {
    setData2("characterReferenceType", token.type);
  }
  function onexitcharacterreferencevalue(token) {
    const data3 = this.sliceSerialize(token);
    const type = getData("characterReferenceType");
    let value;
    if (type) {
      value = decodeNumericCharacterReference(
        data3,
        type === "characterReferenceMarkerNumeric" ? 10 : 16
      );
      setData2("characterReferenceType");
    } else {
      const result = decodeNamedCharacterReference(data3);
      value = result;
    }
    const tail = this.stack.pop();
    tail.value += value;
    tail.position.end = point3(token.end);
  }
  function onexitautolinkprotocol(token) {
    onexitdata.call(this, token);
    const node3 = this.stack[this.stack.length - 1];
    node3.url = this.sliceSerialize(token);
  }
  function onexitautolinkemail(token) {
    onexitdata.call(this, token);
    const node3 = this.stack[this.stack.length - 1];
    node3.url = "mailto:" + this.sliceSerialize(token);
  }
  function blockQuote2() {
    return {
      type: "blockquote",
      children: []
    };
  }
  function codeFlow() {
    return {
      type: "code",
      lang: null,
      meta: null,
      value: ""
    };
  }
  function codeText2() {
    return {
      type: "inlineCode",
      value: ""
    };
  }
  function definition2() {
    return {
      type: "definition",
      identifier: "",
      label: null,
      title: null,
      url: ""
    };
  }
  function emphasis() {
    return {
      type: "emphasis",
      children: []
    };
  }
  function heading() {
    return {
      type: "heading",
      depth: void 0,
      children: []
    };
  }
  function hardBreak() {
    return {
      type: "break"
    };
  }
  function html2() {
    return {
      type: "html",
      value: ""
    };
  }
  function image() {
    return {
      type: "image",
      title: null,
      url: "",
      alt: null
    };
  }
  function link() {
    return {
      type: "link",
      title: null,
      url: "",
      children: []
    };
  }
  function list2(token) {
    return {
      type: "list",
      ordered: token.type === "listOrdered",
      start: null,
      // @ts-expect-error Patched.
      spread: token._spread,
      children: []
    };
  }
  function listItem(token) {
    return {
      type: "listItem",
      // @ts-expect-error Patched.
      spread: token._spread,
      checked: null,
      children: []
    };
  }
  function paragraph() {
    return {
      type: "paragraph",
      children: []
    };
  }
  function strong() {
    return {
      type: "strong",
      children: []
    };
  }
  function text3() {
    return {
      type: "text",
      value: ""
    };
  }
  function thematicBreak2() {
    return {
      type: "thematicBreak"
    };
  }
}
function point3(d2) {
  return {
    line: d2.line,
    column: d2.column,
    offset: d2.offset
  };
}
function configure(combined, extensions) {
  let index3 = -1;
  while (++index3 < extensions.length) {
    const value = extensions[index3];
    if (Array.isArray(value)) {
      configure(combined, value);
    } else {
      extension(combined, value);
    }
  }
}
function extension(combined, extension2) {
  let key;
  for (key in extension2) {
    if (own.call(extension2, key)) {
      if (key === "canContainEols") {
        const right = extension2[key];
        if (right) {
          combined[key].push(...right);
        }
      } else if (key === "transforms") {
        const right = extension2[key];
        if (right) {
          combined[key].push(...right);
        }
      } else if (key === "enter" || key === "exit") {
        const right = extension2[key];
        if (right) {
          Object.assign(combined[key], right);
        }
      }
    }
  }
}
function defaultOnError(left, right) {
  if (left) {
    throw new Error(
      "Cannot close `" + left.type + "` (" + stringifyPosition({
        start: left.start,
        end: left.end
      }) + "): a different token (`" + right.type + "`, " + stringifyPosition({
        start: right.start,
        end: right.end
      }) + ") is open"
    );
  } else {
    throw new Error(
      "Cannot close document, a token (`" + right.type + "`, " + stringifyPosition({
        start: right.start,
        end: right.end
      }) + ") is still open"
    );
  }
}

// ../simple-mind-map/src/parse/markdownTo.js
var handleList = (node3) => {
  let list2 = [];
  let walk2 = (arr, newArr) => {
    for (let i3 = 0; i3 < arr.length; i3++) {
      let cur = arr[i3];
      let node4 = {};
      node4.data = {
        // 节点内容
        text: cur.children[0].children[0].value
      };
      node4.children = [];
      newArr.push(node4);
      if (cur.children.length > 1) {
        for (let j2 = 1; j2 < cur.children.length; j2++) {
          let cur2 = cur.children[j2];
          if (cur2.type === "list") {
            walk2(cur2.children, node4.children);
          }
        }
      }
    }
  };
  walk2(node3.children, list2);
  return list2;
};
var transformMarkdownTo = async (md) => {
  const tree = fromMarkdown(md);
  let root2 = {
    children: []
  };
  let childrenQueue = [root2.children];
  let currentChildren = root2.children;
  let depthQueue = [-1];
  let currentDepth = -1;
  for (let i3 = 0; i3 < tree.children.length; i3++) {
    let cur = tree.children[i3];
    if (cur.type === "heading") {
      if (!cur.children[0])
        continue;
      let node3 = {};
      node3.data = {
        // 节点内容
        text: cur.children[0].value
      };
      node3.children = [];
      if (cur.depth > currentDepth) {
        currentChildren.push(node3);
        childrenQueue.push(node3.children);
        currentChildren = node3.children;
        depthQueue.push(cur.depth);
        currentDepth = cur.depth;
      } else if (cur.depth === currentDepth) {
        childrenQueue.pop();
        currentChildren = childrenQueue[childrenQueue.length - 1];
        depthQueue.pop();
        currentDepth = depthQueue[depthQueue.length - 1];
        currentChildren.push(node3);
        childrenQueue.push(node3.children);
        currentChildren = node3.children;
        depthQueue.push(cur.depth);
        currentDepth = cur.depth;
      } else {
        while (depthQueue.length) {
          childrenQueue.pop();
          currentChildren = childrenQueue[childrenQueue.length - 1];
          depthQueue.pop();
          currentDepth = depthQueue[depthQueue.length - 1];
          if (currentDepth < cur.depth) {
            currentChildren.push(node3);
            childrenQueue.push(node3.children);
            currentChildren = node3.children;
            depthQueue.push(cur.depth);
            currentDepth = cur.depth;
            break;
          }
        }
      }
    } else if (cur.type === "list") {
      currentChildren.push(...handleList(cur));
    }
  }
  return root2.children[0];
};

// ../simple-mind-map/src/parse/markdown.js
var markdown_default = {
  transformToMarkdown,
  transformMarkdownTo
};

// ../simple-mind-map/full.js
simple_mind_map_default.xmind = xmind_default;
simple_mind_map_default.markdown = markdown_default;
simple_mind_map_default.iconList = icons_default.nodeIconList;
simple_mind_map_default.usePlugin(MiniMap_default).usePlugin(Watermark_default).usePlugin(Drag_default).usePlugin(KeyboardNavigation_default).usePlugin(ExportPDF_default).usePlugin(Export_default).usePlugin(Select_default).usePlugin(AssociativeLine_default).usePlugin(RichText_default);
var full_default = simple_mind_map_default;
export {
  full_default as default
};
/*! Bundled license information:

html2canvas/dist/html2canvas.js:
  (*!
   * html2canvas 1.4.1 <https://html2canvas.hertzen.com>
   * Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>
   * Released under MIT License
   *)
  (*! *****************************************************************************
      Copyright (c) Microsoft Corporation.
  
      Permission to use, copy, modify, and/or distribute this software for any
      purpose with or without fee is hereby granted.
  
      THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
      REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
      AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
      INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
      LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
      OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
      PERFORMANCE OF THIS SOFTWARE.
      ***************************************************************************** *)

dompurify/dist/purify.js:
  (*! @license DOMPurify 2.4.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.4.1/LICENSE *)

svg-pathdata/lib/SVGPathData.module.js:
  (*! *****************************************************************************
  Copyright (c) Microsoft Corporation.
  
  Permission to use, copy, modify, and/or distribute this software for any
  purpose with or without fee is hereby granted.
  
  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  PERFORMANCE OF THIS SOFTWARE.
  ***************************************************************************** *)

quill/dist/quill.js:
  (*!
   * Quill Editor v1.3.6
   * https://quilljs.com/
   * Copyright (c) 2014, Jason Chen
   * Copyright (c) 2013, salesforce.com
   *)

jszip/dist/jszip.min.js:
  (*!
  
  JSZip v3.10.1 - A JavaScript class for generating and reading zip files
  <http://stuartk.com/jszip>
  
  (c) 2009-2016 Stuart Knightley <stuart [at] stuartk.com>
  Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown.
  
  JSZip uses the library pako released under the MIT license :
  https://github.com/nodeca/pako/blob/main/LICENSE
  *)

sax/lib/sax.js:
  (*! http://mths.be/fromcodepoint v0.1.0 by @mathias *)

@svgdotjs/svg.js/dist/svg.esm.js:
  (*!
  * @svgdotjs/svg.js - A lightweight library for manipulating and animating SVG.
  * @version 3.1.2
  * https://svgjs.dev/
  *
  * @copyright Wout Fierens <wout@mick-wout.com>
  * @license MIT
  *
  * BUILT: Wed Jan 26 2022 23:19:07 GMT+0100 (Mitteleuropäische Normalzeit)
  *)

jspdf/dist/jspdf.es.min.js:
  (** @license
   *
   * jsPDF - PDF Document creation from JavaScript
   * Version 2.5.1 Built on 2022-01-28T15:37:57.791Z
   *                      CommitID 00000000
   *
   * Copyright (c) 2010-2021 James Hall <james@parall.ax>, https://github.com/MrRio/jsPDF
   *               2015-2021 yWorks GmbH, http://www.yworks.com
   *               2015-2021 Lukas Holländer <lukas.hollaender@yworks.com>, https://github.com/HackbrettXXX
   *               2016-2018 Aras Abbasi <aras.abbasi@gmail.com>
   *               2010 Aaron Spike, https://github.com/acspike
   *               2012 Willow Systems Corporation, https://github.com/willowsystems
   *               2012 Pablo Hess, https://github.com/pablohess
   *               2012 Florian Jenett, https://github.com/fjenett
   *               2013 Warren Weckesser, https://github.com/warrenweckesser
   *               2013 Youssef Beddad, https://github.com/lifof
   *               2013 Lee Driscoll, https://github.com/lsdriscoll
   *               2013 Stefan Slonevskiy, https://github.com/stefslon
   *               2013 Jeremy Morel, https://github.com/jmorel
   *               2013 Christoph Hartmann, https://github.com/chris-rock
   *               2014 Juan Pablo Gaviria, https://github.com/juanpgaviria
   *               2014 James Makes, https://github.com/dollaruw
   *               2014 Diego Casorran, https://github.com/diegocr
   *               2014 Steven Spungin, https://github.com/Flamenco
   *               2014 Kenneth Glassey, https://github.com/Gavvers
   *
   * Permission is hereby granted, free of charge, to any person obtaining
   * a copy of this software and associated documentation files (the
   * "Software"), to deal in the Software without restriction, including
   * without limitation the rights to use, copy, modify, merge, publish,
   * distribute, sublicense, and/or sell copies of the Software, and to
   * permit persons to whom the Software is furnished to do so, subject to
   * the following conditions:
   *
   * The above copyright notice and this permission notice shall be
   * included in all copies or substantial portions of the Software.
   *
   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
   * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
   * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
   * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
   * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
   * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
   * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
   *
   * Contributor(s):
   *    siefkenj, ahwolf, rickygu, Midnith, saintclair, eaparango,
   *    kim3er, mfo, alnorth, Flamenco
   *)
  (**
   * A class to parse color values
   * @author Stoyan Stefanov <sstoo@gmail.com>
   * {@link   http://www.phpied.com/rgb-color-parser-in-javascript/}
   * @license Use it if you like it
   *)
  (**
   * @license
   * Joseph Myers does not specify a particular license for his work.
   *
   * Author: Joseph Myers
   * Accessed from: http://www.myersdaily.org/joseph/javascript/md5.js
   *
   * Modified by: Owen Leong
   *)
  (**
   * @license
   * FPDF is released under a permissive license: there is no usage restriction.
   * You may embed it freely in your application (commercial or not), with or
   * without modifications.
   *
   * Reference: http://www.fpdf.org/en/script/script37.php
   *)
  (**
   * @license
   * Licensed under the MIT License.
   * http://opensource.org/licenses/mit-license
   * Author: Owen Leong (@owenl131)
   * Date: 15 Oct 2020
   * References:
   * https://www.cs.cmu.edu/~dst/Adobe/Gallery/anon21jul01-pdf-encryption.txt
   * https://github.com/foliojs/pdfkit/blob/master/lib/security.js
   * http://www.fpdf.org/en/script/script37.php
   *)
  (**
   * @license
   *
   * Copyright (c) 2014 James Robb, https://github.com/jamesbrobb
   *
   * Permission is hereby granted, free of charge, to any person obtaining
   * a copy of this software and associated documentation files (the
   * "Software"), to deal in the Software without restriction, including
   * without limitation the rights to use, copy, modify, merge, publish,
   * distribute, sublicense, and/or sell copies of the Software, and to
   * permit persons to whom the Software is furnished to do so, subject to
   * the following conditions:
   *
   * The above copyright notice and this permission notice shall be
   * included in all copies or substantial portions of the Software.
   *
   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
   * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
   * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
   * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
   * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
   * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
   * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
   * ====================================================================
   *)
  (**
   * @license
   * (c) Dean McNamee <dean@gmail.com>, 2013.
   *
   * https://github.com/deanm/omggif
   *
   * Permission is hereby granted, free of charge, to any person obtaining a copy
   * of this software and associated documentation files (the "Software"), to
   * deal in the Software without restriction, including without limitation the
   * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
   * sell copies of the Software, and to permit persons to whom the Software is
   * furnished to do so, subject to the following conditions:
   *
   * The above copyright notice and this permission notice shall be included in
   * all copies or substantial portions of the Software.
   *
   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
   * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
   * IN THE SOFTWARE.
   *
   * omggif is a JavaScript implementation of a GIF 89a encoder and decoder,
   * including animation and compression.  It does not rely on any specific
   * underlying system, so should run in the browser, Node, or Plask.
   *)
  (**
   * @license
    Copyright (c) 2008, Adobe Systems Incorporated
    All rights reserved.
  
    Redistribution and use in source and binary forms, with or without 
    modification, are permitted provided that the following conditions are
    met:
  
    * Redistributions of source code must retain the above copyright notice, 
      this list of conditions and the following disclaimer.
    
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the 
      documentation and/or other materials provided with the distribution.
    
    * Neither the name of Adobe Systems Incorporated nor the names of its 
      contributors may be used to endorse or promote products derived from 
      this software without specific prior written permission.
  
    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
    IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 
    CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
    EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
    PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
    PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
    LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
    NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *)
  (**
   * @license
   * Copyright (c) 2017 Aras Abbasi
   *
   * Licensed under the MIT License.
   * http://opensource.org/licenses/mit-license
   *)
*/
