/******/ (function() { // webpackBootstrap
/******/ 	var __webpack_modules__ = ({

/***/ 182:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "clsx": function() { return /* binding */ clsx; }
/* harmony export */ });
function r(e) {
  var t,
      f,
      n = "";
  if ("string" == typeof e || "number" == typeof e) n += e;else if ("object" == typeof e) if (Array.isArray(e)) for (t = 0; t < e.length; t++) {
    e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
  } else for (t in e) {
    e[t] && (n && (n += " "), n += t);
  }
  return n;
}

function clsx() {
  for (var e, t, f = 0, n = ""; f < arguments.length;) {
    (e = arguments[f++]) && (t = r(e)) && (n && (n += " "), n += t);
  }

  return n;
}
/* harmony default export */ __webpack_exports__["default"] = (clsx);

/***/ }),

/***/ 959:
/***/ (function(module) {

//
// Main
//
function memoize(fn, options) {
  var cache = options && options.cache ? options.cache : cacheDefault;
  var serializer = options && options.serializer ? options.serializer : serializerDefault;
  var strategy = options && options.strategy ? options.strategy : strategyDefault;
  return strategy(fn, {
    cache: cache,
    serializer: serializer
  });
} //
// Strategy
//


function isPrimitive(value) {
  return value == null || typeof value === 'number' || typeof value === 'boolean'; // || typeof value === "string" 'unsafe' primitive for our needs
}

function monadic(fn, cache, serializer, arg) {
  var cacheKey = isPrimitive(arg) ? arg : serializer(arg);
  var computedValue = cache.get(cacheKey);

  if (typeof computedValue === 'undefined') {
    computedValue = fn.call(this, arg);
    cache.set(cacheKey, computedValue);
  }

  return computedValue;
}

function variadic(fn, cache, serializer) {
  var args = Array.prototype.slice.call(arguments, 3);
  var cacheKey = serializer(args);
  var computedValue = cache.get(cacheKey);

  if (typeof computedValue === 'undefined') {
    computedValue = fn.apply(this, args);
    cache.set(cacheKey, computedValue);
  }

  return computedValue;
}

function assemble(fn, context, strategy, cache, serialize) {
  return strategy.bind(context, fn, cache, serialize);
}

function strategyDefault(fn, options) {
  var strategy = fn.length === 1 ? monadic : variadic;
  return assemble(fn, this, strategy, options.cache.create(), options.serializer);
}

function strategyVariadic(fn, options) {
  var strategy = variadic;
  return assemble(fn, this, strategy, options.cache.create(), options.serializer);
}

function strategyMonadic(fn, options) {
  var strategy = monadic;
  return assemble(fn, this, strategy, options.cache.create(), options.serializer);
} //
// Serializer
//


function serializerDefault() {
  return JSON.stringify(arguments);
} //
// Cache
//


function ObjectWithoutPrototypeCache() {
  this.cache = Object.create(null);
}

ObjectWithoutPrototypeCache.prototype.has = function (key) {
  return key in this.cache;
};

ObjectWithoutPrototypeCache.prototype.get = function (key) {
  return this.cache[key];
};

ObjectWithoutPrototypeCache.prototype.set = function (key, value) {
  this.cache[key] = value;
};

var cacheDefault = {
  create: function create() {
    return new ObjectWithoutPrototypeCache();
  }
}; //
// API
//

module.exports = memoize;
module.exports.strategies = {
  variadic: strategyVariadic,
  monadic: strategyMonadic
};

/***/ }),

/***/ 95:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

/**
 * lodash (Custom Build) <https://lodash.com/>
 * Build: `lodash modularize exports="npm" -o ./`
 * Copyright jQuery Foundation and other contributors <https://jquery.org/>
 * Released under MIT license <https://lodash.com/license>
 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
 */

/** Used as the `TypeError` message for "Functions" methods. */
var FUNC_ERROR_TEXT = 'Expected a function';
/** Used as references for various `Number` constants. */

var NAN = 0 / 0;
/** `Object#toString` result references. */

var symbolTag = '[object Symbol]';
/** Used to match leading and trailing whitespace. */

var reTrim = /^\s+|\s+$/g;
/** Used to detect bad signed hexadecimal string values. */

var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
/** Used to detect binary string values. */

var reIsBinary = /^0b[01]+$/i;
/** Used to detect octal string values. */

var reIsOctal = /^0o[0-7]+$/i;
/** Built-in method references without a dependency on `root`. */

var freeParseInt = parseInt;
/** Detect free variable `global` from Node.js. */

var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
/** Detect free variable `self`. */

var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
/** Used as a reference to the global object. */

var root = freeGlobal || freeSelf || Function('return this')();
/** Used for built-in method references. */

var objectProto = Object.prototype;
/**
 * Used to resolve the
 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
 * of values.
 */

var objectToString = objectProto.toString;
/* Built-in method references for those with the same name as other `lodash` methods. */

var nativeMax = Math.max,
    nativeMin = Math.min;
/**
 * Gets the timestamp of the number of milliseconds that have elapsed since
 * the Unix epoch (1 January 1970 00:00:00 UTC).
 *
 * @static
 * @memberOf _
 * @since 2.4.0
 * @category Date
 * @returns {number} Returns the timestamp.
 * @example
 *
 * _.defer(function(stamp) {
 *   console.log(_.now() - stamp);
 * }, _.now());
 * // => Logs the number of milliseconds it took for the deferred invocation.
 */

var now = function now() {
  return root.Date.now();
};
/**
 * Creates a debounced function that delays invoking `func` until after `wait`
 * milliseconds have elapsed since the last time the debounced function was
 * invoked. The debounced function comes with a `cancel` method to cancel
 * delayed `func` invocations and a `flush` method to immediately invoke them.
 * Provide `options` to indicate whether `func` should be invoked on the
 * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
 * with the last arguments provided to the debounced function. Subsequent
 * calls to the debounced function return the result of the last `func`
 * invocation.
 *
 * **Note:** If `leading` and `trailing` options are `true`, `func` is
 * invoked on the trailing edge of the timeout only if the debounced function
 * is invoked more than once during the `wait` timeout.
 *
 * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
 * until to the next tick, similar to `setTimeout` with a timeout of `0`.
 *
 * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
 * for details over the differences between `_.debounce` and `_.throttle`.
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Function
 * @param {Function} func The function to debounce.
 * @param {number} [wait=0] The number of milliseconds to delay.
 * @param {Object} [options={}] The options object.
 * @param {boolean} [options.leading=false]
 *  Specify invoking on the leading edge of the timeout.
 * @param {number} [options.maxWait]
 *  The maximum time `func` is allowed to be delayed before it's invoked.
 * @param {boolean} [options.trailing=true]
 *  Specify invoking on the trailing edge of the timeout.
 * @returns {Function} Returns the new debounced function.
 * @example
 *
 * // Avoid costly calculations while the window size is in flux.
 * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
 *
 * // Invoke `sendMail` when clicked, debouncing subsequent calls.
 * jQuery(element).on('click', _.debounce(sendMail, 300, {
 *   'leading': true,
 *   'trailing': false
 * }));
 *
 * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
 * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
 * var source = new EventSource('/stream');
 * jQuery(source).on('message', debounced);
 *
 * // Cancel the trailing debounced invocation.
 * jQuery(window).on('popstate', debounced.cancel);
 */


function debounce(func, wait, options) {
  var lastArgs,
      lastThis,
      maxWait,
      result,
      timerId,
      lastCallTime,
      lastInvokeTime = 0,
      leading = false,
      maxing = false,
      trailing = true;

  if (typeof func != 'function') {
    throw new TypeError(FUNC_ERROR_TEXT);
  }

  wait = toNumber(wait) || 0;

  if (isObject(options)) {
    leading = !!options.leading;
    maxing = 'maxWait' in options;
    maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
    trailing = 'trailing' in options ? !!options.trailing : trailing;
  }

  function invokeFunc(time) {
    var args = lastArgs,
        thisArg = lastThis;
    lastArgs = lastThis = undefined;
    lastInvokeTime = time;
    result = func.apply(thisArg, args);
    return result;
  }

  function leadingEdge(time) {
    // Reset any `maxWait` timer.
    lastInvokeTime = time; // Start the timer for the trailing edge.

    timerId = setTimeout(timerExpired, wait); // Invoke the leading edge.

    return leading ? invokeFunc(time) : result;
  }

  function remainingWait(time) {
    var timeSinceLastCall = time - lastCallTime,
        timeSinceLastInvoke = time - lastInvokeTime,
        result = wait - timeSinceLastCall;
    return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;
  }

  function shouldInvoke(time) {
    var timeSinceLastCall = time - lastCallTime,
        timeSinceLastInvoke = time - lastInvokeTime; // Either this is the first call, activity has stopped and we're at the
    // trailing edge, the system time has gone backwards and we're treating
    // it as the trailing edge, or we've hit the `maxWait` limit.

    return lastCallTime === undefined || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
  }

  function timerExpired() {
    var time = now();

    if (shouldInvoke(time)) {
      return trailingEdge(time);
    } // Restart the timer.


    timerId = setTimeout(timerExpired, remainingWait(time));
  }

  function trailingEdge(time) {
    timerId = undefined; // Only invoke if we have `lastArgs` which means `func` has been
    // debounced at least once.

    if (trailing && lastArgs) {
      return invokeFunc(time);
    }

    lastArgs = lastThis = undefined;
    return result;
  }

  function cancel() {
    if (timerId !== undefined) {
      clearTimeout(timerId);
    }

    lastInvokeTime = 0;
    lastArgs = lastCallTime = lastThis = timerId = undefined;
  }

  function flush() {
    return timerId === undefined ? result : trailingEdge(now());
  }

  function debounced() {
    var time = now(),
        isInvoking = shouldInvoke(time);
    lastArgs = arguments;
    lastThis = this;
    lastCallTime = time;

    if (isInvoking) {
      if (timerId === undefined) {
        return leadingEdge(lastCallTime);
      }

      if (maxing) {
        // Handle invocations in a tight loop.
        timerId = setTimeout(timerExpired, wait);
        return invokeFunc(lastCallTime);
      }
    }

    if (timerId === undefined) {
      timerId = setTimeout(timerExpired, wait);
    }

    return result;
  }

  debounced.cancel = cancel;
  debounced.flush = flush;
  return debounced;
}
/**
 * Checks if `value` is the
 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is an object, else `false`.
 * @example
 *
 * _.isObject({});
 * // => true
 *
 * _.isObject([1, 2, 3]);
 * // => true
 *
 * _.isObject(_.noop);
 * // => true
 *
 * _.isObject(null);
 * // => false
 */


function isObject(value) {
  var type = typeof value;
  return !!value && (type == 'object' || type == 'function');
}
/**
 * Checks if `value` is object-like. A value is object-like if it's not `null`
 * and has a `typeof` result of "object".
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
 * @example
 *
 * _.isObjectLike({});
 * // => true
 *
 * _.isObjectLike([1, 2, 3]);
 * // => true
 *
 * _.isObjectLike(_.noop);
 * // => false
 *
 * _.isObjectLike(null);
 * // => false
 */


function isObjectLike(value) {
  return !!value && typeof value == 'object';
}
/**
 * Checks if `value` is classified as a `Symbol` primitive or object.
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
 * @example
 *
 * _.isSymbol(Symbol.iterator);
 * // => true
 *
 * _.isSymbol('abc');
 * // => false
 */


function isSymbol(value) {
  return typeof value == 'symbol' || isObjectLike(value) && objectToString.call(value) == symbolTag;
}
/**
 * Converts `value` to a number.
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Lang
 * @param {*} value The value to process.
 * @returns {number} Returns the number.
 * @example
 *
 * _.toNumber(3.2);
 * // => 3.2
 *
 * _.toNumber(Number.MIN_VALUE);
 * // => 5e-324
 *
 * _.toNumber(Infinity);
 * // => Infinity
 *
 * _.toNumber('3.2');
 * // => 3.2
 */


function toNumber(value) {
  if (typeof value == 'number') {
    return value;
  }

  if (isSymbol(value)) {
    return NAN;
  }

  if (isObject(value)) {
    var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
    value = isObject(other) ? other + '' : other;
  }

  if (typeof value != 'string') {
    return value === 0 ? value : +value;
  }

  value = value.replace(reTrim, '');
  var isBinary = reIsBinary.test(value);
  return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
}

module.exports = debounce;

/***/ }),

/***/ 725:
/***/ (function(module) {

"use strict";
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/

/* eslint-disable no-unused-vars */

var getOwnPropertySymbols = Object.getOwnPropertySymbols;
var hasOwnProperty = Object.prototype.hasOwnProperty;
var propIsEnumerable = Object.prototype.propertyIsEnumerable;

function toObject(val) {
  if (val === null || val === undefined) {
    throw new TypeError('Object.assign cannot be called with null or undefined');
  }

  return Object(val);
}

function shouldUseNative() {
  try {
    if (!Object.assign) {
      return false;
    } // Detect buggy property enumeration order in older V8 versions.
    // https://bugs.chromium.org/p/v8/issues/detail?id=4118


    var test1 = new String('abc'); // eslint-disable-line no-new-wrappers

    test1[5] = 'de';

    if (Object.getOwnPropertyNames(test1)[0] === '5') {
      return false;
    } // https://bugs.chromium.org/p/v8/issues/detail?id=3056


    var test2 = {};

    for (var i = 0; i < 10; i++) {
      test2['_' + String.fromCharCode(i)] = i;
    }

    var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
      return test2[n];
    });

    if (order2.join('') !== '0123456789') {
      return false;
    } // https://bugs.chromium.org/p/v8/issues/detail?id=3056


    var test3 = {};
    'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
      test3[letter] = letter;
    });

    if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') {
      return false;
    }

    return true;
  } catch (err) {
    // We don't expect any of the above to throw, but better to be safe.
    return false;
  }
}

module.exports = shouldUseNative() ? Object.assign : function (target, source) {
  var from;
  var to = toObject(target);
  var symbols;

  for (var s = 1; s < arguments.length; s++) {
    from = Object(arguments[s]);

    for (var key in from) {
      if (hasOwnProperty.call(from, key)) {
        to[key] = from[key];
      }
    }

    if (getOwnPropertySymbols) {
      symbols = getOwnPropertySymbols(from);

      for (var i = 0; i < symbols.length; i++) {
        if (propIsEnumerable.call(from, symbols[i])) {
          to[symbols[i]] = from[symbols[i]];
        }
      }
    }
  }

  return to;
};

/***/ }),

/***/ 560:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

/**
 * @licstart The following is the entire license notice for the
 * Javascript code in this page
 *
 * Copyright 2021 Mozilla Foundation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * @licend The above is the entire license notice for the
 * Javascript code in this page
 */
(function webpackUniversalModuleDefinition(root, factory) {
  if (true) module.exports = factory();else {}
})(this, function () {
  return (
    /******/
    function () {
      // webpackBootstrap

      /******/
      var __webpack_modules__ = [
        /* 0 */
      ,
      /* 1 */

      /***/
      function (__unused_webpack_module, exports, __w_pdfjs_require__) {
        "use strict";

        function _typeof(obj) {
          "@babel/helpers - typeof";

          if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
            _typeof = function _typeof(obj) {
              return typeof obj;
            };
          } else {
            _typeof = function _typeof(obj) {
              return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
            };
          }

          return _typeof(obj);
        }

        Object.defineProperty(exports, "__esModule", {
          value: true
        });
        exports.addLinkAttributes = addLinkAttributes;
        exports.deprecated = deprecated;
        exports.getFilenameFromUrl = getFilenameFromUrl;
        exports.getPdfFilenameFromUrl = getPdfFilenameFromUrl;
        exports.getXfaPageViewport = getXfaPageViewport;
        exports.isDataScheme = isDataScheme;
        exports.isPdfFile = isPdfFile;
        exports.isValidFetchUrl = isValidFetchUrl;
        exports.loadScript = loadScript;
        exports.StatTimer = exports.RenderingCancelledException = exports.PixelsPerInch = exports.PDFDateString = exports.PageViewport = exports.LinkTarget = exports.DOMSVGFactory = exports.DOMStandardFontDataFactory = exports.DOMCMapReaderFactory = exports.DOMCanvasFactory = void 0;

        var _regenerator = _interopRequireDefault(__w_pdfjs_require__(2));

        var _util = __w_pdfjs_require__(4);

        var _base_factory = __w_pdfjs_require__(118);

        function _interopRequireDefault(obj) {
          return obj && obj.__esModule ? obj : {
            "default": obj
          };
        }

        function _createForOfIteratorHelper(o, allowArrayLike) {
          var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];

          if (!it) {
            if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
              if (it) o = it;
              var i = 0;

              var F = function F() {};

              return {
                s: F,
                n: function n() {
                  if (i >= o.length) return {
                    done: true
                  };
                  return {
                    done: false,
                    value: o[i++]
                  };
                },
                e: function e(_e) {
                  throw _e;
                },
                f: F
              };
            }

            throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
          }

          var normalCompletion = true,
              didErr = false,
              err;
          return {
            s: function s() {
              it = it.call(o);
            },
            n: function n() {
              var step = it.next();
              normalCompletion = step.done;
              return step;
            },
            e: function e(_e2) {
              didErr = true;
              err = _e2;
            },
            f: function f() {
              try {
                if (!normalCompletion && it["return"] != null) it["return"]();
              } finally {
                if (didErr) throw err;
              }
            }
          };
        }

        function _unsupportedIterableToArray(o, minLen) {
          if (!o) return;
          if (typeof o === "string") return _arrayLikeToArray(o, minLen);
          var n = Object.prototype.toString.call(o).slice(8, -1);
          if (n === "Object" && o.constructor) n = o.constructor.name;
          if (n === "Map" || n === "Set") return Array.from(o);
          if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
        }

        function _arrayLikeToArray(arr, len) {
          if (len == null || len > arr.length) len = arr.length;

          for (var i = 0, arr2 = new Array(len); i < len; i++) {
            arr2[i] = arr[i];
          }

          return arr2;
        }

        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 self = this,
                args = arguments;
            return new Promise(function (resolve, reject) {
              var gen = fn.apply(self, args);

              function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
              }

              function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
              }

              _next(undefined);
            });
          };
        }

        function _classCallCheck(instance, Constructor) {
          if (!(instance instanceof Constructor)) {
            throw new TypeError("Cannot call a class as a function");
          }
        }

        function _defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];
            descriptor.enumerable = descriptor.enumerable || false;
            descriptor.configurable = true;
            if ("value" in descriptor) descriptor.writable = true;
            Object.defineProperty(target, descriptor.key, descriptor);
          }
        }

        function _createClass(Constructor, protoProps, staticProps) {
          if (protoProps) _defineProperties(Constructor.prototype, protoProps);
          if (staticProps) _defineProperties(Constructor, staticProps);
          return Constructor;
        }

        function _inherits(subClass, superClass) {
          if (typeof superClass !== "function" && superClass !== null) {
            throw new TypeError("Super expression must either be null or a function");
          }

          subClass.prototype = Object.create(superClass && superClass.prototype, {
            constructor: {
              value: subClass,
              writable: true,
              configurable: true
            }
          });
          if (superClass) _setPrototypeOf(subClass, superClass);
        }

        function _setPrototypeOf(o, p) {
          _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
            o.__proto__ = p;
            return o;
          };

          return _setPrototypeOf(o, p);
        }

        function _createSuper(Derived) {
          var hasNativeReflectConstruct = _isNativeReflectConstruct();

          return function _createSuperInternal() {
            var Super = _getPrototypeOf(Derived),
                result;

            if (hasNativeReflectConstruct) {
              var NewTarget = _getPrototypeOf(this).constructor;

              result = Reflect.construct(Super, arguments, NewTarget);
            } else {
              result = Super.apply(this, arguments);
            }

            return _possibleConstructorReturn(this, result);
          };
        }

        function _possibleConstructorReturn(self, call) {
          if (call && (_typeof(call) === "object" || typeof call === "function")) {
            return call;
          } else if (call !== void 0) {
            throw new TypeError("Derived constructors may only return object or undefined");
          }

          return _assertThisInitialized(self);
        }

        function _assertThisInitialized(self) {
          if (self === void 0) {
            throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
          }

          return self;
        }

        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 (e) {
            return false;
          }
        }

        function _getPrototypeOf(o) {
          _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
            return o.__proto__ || Object.getPrototypeOf(o);
          };
          return _getPrototypeOf(o);
        }

        var DEFAULT_LINK_REL = "noopener noreferrer nofollow";
        var SVG_NS = "http://www.w3.org/2000/svg";
        var PixelsPerInch = {
          CSS: 96.0,
          PDF: 72.0,

          get PDF_TO_CSS_UNITS() {
            return (0, _util.shadow)(this, "PDF_TO_CSS_UNITS", this.CSS / this.PDF);
          }

        };
        exports.PixelsPerInch = PixelsPerInch;

        var DOMCanvasFactory = /*#__PURE__*/function (_BaseCanvasFactory) {
          _inherits(DOMCanvasFactory, _BaseCanvasFactory);

          var _super = _createSuper(DOMCanvasFactory);

          function DOMCanvasFactory() {
            var _this;

            var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
                _ref$ownerDocument = _ref.ownerDocument,
                ownerDocument = _ref$ownerDocument === void 0 ? globalThis.document : _ref$ownerDocument;

            _classCallCheck(this, DOMCanvasFactory);

            _this = _super.call(this);
            _this._document = ownerDocument;
            return _this;
          }

          _createClass(DOMCanvasFactory, [{
            key: "_createCanvas",
            value: function _createCanvas(width, height) {
              var canvas = this._document.createElement("canvas");

              canvas.width = width;
              canvas.height = height;
              return canvas;
            }
          }]);

          return DOMCanvasFactory;
        }(_base_factory.BaseCanvasFactory);

        exports.DOMCanvasFactory = DOMCanvasFactory;

        function fetchData(_x) {
          return _fetchData.apply(this, arguments);
        }

        function _fetchData() {
          _fetchData = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee(url) {
            var asTypedArray,
                response,
                _args = arguments;
            return _regenerator["default"].wrap(function _callee$(_context) {
              while (1) {
                switch (_context.prev = _context.next) {
                  case 0:
                    asTypedArray = _args.length > 1 && _args[1] !== undefined ? _args[1] : false;

                    if (!isValidFetchUrl(url, document.baseURI)) {
                      _context.next = 21;
                      break;
                    }

                    _context.next = 4;
                    return fetch(url);

                  case 4:
                    response = _context.sent;

                    if (response.ok) {
                      _context.next = 7;
                      break;
                    }

                    throw new Error(response.statusText);

                  case 7:
                    if (!asTypedArray) {
                      _context.next = 15;
                      break;
                    }

                    _context.t1 = Uint8Array;
                    _context.next = 11;
                    return response.arrayBuffer();

                  case 11:
                    _context.t2 = _context.sent;
                    _context.t0 = new _context.t1(_context.t2);
                    _context.next = 20;
                    break;

                  case 15:
                    _context.t3 = _util.stringToBytes;
                    _context.next = 18;
                    return response.text();

                  case 18:
                    _context.t4 = _context.sent;
                    _context.t0 = (0, _context.t3)(_context.t4);

                  case 20:
                    return _context.abrupt("return", _context.t0);

                  case 21:
                    return _context.abrupt("return", new Promise(function (resolve, reject) {
                      var request = new XMLHttpRequest();
                      request.open("GET", url, true);

                      if (asTypedArray) {
                        request.responseType = "arraybuffer";
                      }

                      request.onreadystatechange = function () {
                        if (request.readyState !== XMLHttpRequest.DONE) {
                          return;
                        }

                        if (request.status === 200 || request.status === 0) {
                          var data;

                          if (asTypedArray && request.response) {
                            data = new Uint8Array(request.response);
                          } else if (!asTypedArray && request.responseText) {
                            data = (0, _util.stringToBytes)(request.responseText);
                          }

                          if (data) {
                            resolve(data);
                            return;
                          }
                        }

                        reject(new Error(request.statusText));
                      };

                      request.send(null);
                    }));

                  case 22:
                  case "end":
                    return _context.stop();
                }
              }
            }, _callee);
          }));
          return _fetchData.apply(this, arguments);
        }

        var DOMCMapReaderFactory = /*#__PURE__*/function (_BaseCMapReaderFactor) {
          _inherits(DOMCMapReaderFactory, _BaseCMapReaderFactor);

          var _super2 = _createSuper(DOMCMapReaderFactory);

          function DOMCMapReaderFactory() {
            _classCallCheck(this, DOMCMapReaderFactory);

            return _super2.apply(this, arguments);
          }

          _createClass(DOMCMapReaderFactory, [{
            key: "_fetchData",
            value: function _fetchData(url, compressionType) {
              return fetchData(url, this.isCompressed).then(function (data) {
                return {
                  cMapData: data,
                  compressionType: compressionType
                };
              });
            }
          }]);

          return DOMCMapReaderFactory;
        }(_base_factory.BaseCMapReaderFactory);

        exports.DOMCMapReaderFactory = DOMCMapReaderFactory;

        var DOMStandardFontDataFactory = /*#__PURE__*/function (_BaseStandardFontData) {
          _inherits(DOMStandardFontDataFactory, _BaseStandardFontData);

          var _super3 = _createSuper(DOMStandardFontDataFactory);

          function DOMStandardFontDataFactory() {
            _classCallCheck(this, DOMStandardFontDataFactory);

            return _super3.apply(this, arguments);
          }

          _createClass(DOMStandardFontDataFactory, [{
            key: "_fetchData",
            value: function _fetchData(url) {
              return fetchData(url, true);
            }
          }]);

          return DOMStandardFontDataFactory;
        }(_base_factory.BaseStandardFontDataFactory);

        exports.DOMStandardFontDataFactory = DOMStandardFontDataFactory;

        var DOMSVGFactory = /*#__PURE__*/function (_BaseSVGFactory) {
          _inherits(DOMSVGFactory, _BaseSVGFactory);

          var _super4 = _createSuper(DOMSVGFactory);

          function DOMSVGFactory() {
            _classCallCheck(this, DOMSVGFactory);

            return _super4.apply(this, arguments);
          }

          _createClass(DOMSVGFactory, [{
            key: "_createSVG",
            value: function _createSVG(type) {
              return document.createElementNS(SVG_NS, type);
            }
          }]);

          return DOMSVGFactory;
        }(_base_factory.BaseSVGFactory);

        exports.DOMSVGFactory = DOMSVGFactory;

        var PageViewport = /*#__PURE__*/function () {
          function PageViewport(_ref2) {
            var viewBox = _ref2.viewBox,
                scale = _ref2.scale,
                rotation = _ref2.rotation,
                _ref2$offsetX = _ref2.offsetX,
                offsetX = _ref2$offsetX === void 0 ? 0 : _ref2$offsetX,
                _ref2$offsetY = _ref2.offsetY,
                offsetY = _ref2$offsetY === void 0 ? 0 : _ref2$offsetY,
                _ref2$dontFlip = _ref2.dontFlip,
                dontFlip = _ref2$dontFlip === void 0 ? false : _ref2$dontFlip;

            _classCallCheck(this, PageViewport);

            this.viewBox = viewBox;
            this.scale = scale;
            this.rotation = rotation;
            this.offsetX = offsetX;
            this.offsetY = offsetY;
            var centerX = (viewBox[2] + viewBox[0]) / 2;
            var centerY = (viewBox[3] + viewBox[1]) / 2;
            var rotateA, rotateB, rotateC, rotateD;
            rotation %= 360;

            if (rotation < 0) {
              rotation += 360;
            }

            switch (rotation) {
              case 180:
                rotateA = -1;
                rotateB = 0;
                rotateC = 0;
                rotateD = 1;
                break;

              case 90:
                rotateA = 0;
                rotateB = 1;
                rotateC = 1;
                rotateD = 0;
                break;

              case 270:
                rotateA = 0;
                rotateB = -1;
                rotateC = -1;
                rotateD = 0;
                break;

              case 0:
                rotateA = 1;
                rotateB = 0;
                rotateC = 0;
                rotateD = -1;
                break;

              default:
                throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.");
            }

            if (dontFlip) {
              rotateC = -rotateC;
              rotateD = -rotateD;
            }

            var offsetCanvasX, offsetCanvasY;
            var width, height;

            if (rotateA === 0) {
              offsetCanvasX = Math.abs(centerY - viewBox[1]) * scale + offsetX;
              offsetCanvasY = Math.abs(centerX - viewBox[0]) * scale + offsetY;
              width = Math.abs(viewBox[3] - viewBox[1]) * scale;
              height = Math.abs(viewBox[2] - viewBox[0]) * scale;
            } else {
              offsetCanvasX = Math.abs(centerX - viewBox[0]) * scale + offsetX;
              offsetCanvasY = Math.abs(centerY - viewBox[1]) * scale + offsetY;
              width = Math.abs(viewBox[2] - viewBox[0]) * scale;
              height = Math.abs(viewBox[3] - viewBox[1]) * scale;
            }

            this.transform = [rotateA * scale, rotateB * scale, rotateC * scale, rotateD * scale, offsetCanvasX - rotateA * scale * centerX - rotateC * scale * centerY, offsetCanvasY - rotateB * scale * centerX - rotateD * scale * centerY];
            this.width = width;
            this.height = height;
          }

          _createClass(PageViewport, [{
            key: "clone",
            value: function clone() {
              var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
                  _ref3$scale = _ref3.scale,
                  scale = _ref3$scale === void 0 ? this.scale : _ref3$scale,
                  _ref3$rotation = _ref3.rotation,
                  rotation = _ref3$rotation === void 0 ? this.rotation : _ref3$rotation,
                  _ref3$offsetX = _ref3.offsetX,
                  offsetX = _ref3$offsetX === void 0 ? this.offsetX : _ref3$offsetX,
                  _ref3$offsetY = _ref3.offsetY,
                  offsetY = _ref3$offsetY === void 0 ? this.offsetY : _ref3$offsetY,
                  _ref3$dontFlip = _ref3.dontFlip,
                  dontFlip = _ref3$dontFlip === void 0 ? false : _ref3$dontFlip;

              return new PageViewport({
                viewBox: this.viewBox.slice(),
                scale: scale,
                rotation: rotation,
                offsetX: offsetX,
                offsetY: offsetY,
                dontFlip: dontFlip
              });
            }
          }, {
            key: "convertToViewportPoint",
            value: function convertToViewportPoint(x, y) {
              return _util.Util.applyTransform([x, y], this.transform);
            }
          }, {
            key: "convertToViewportRectangle",
            value: function convertToViewportRectangle(rect) {
              var topLeft = _util.Util.applyTransform([rect[0], rect[1]], this.transform);

              var bottomRight = _util.Util.applyTransform([rect[2], rect[3]], this.transform);

              return [topLeft[0], topLeft[1], bottomRight[0], bottomRight[1]];
            }
          }, {
            key: "convertToPdfPoint",
            value: function convertToPdfPoint(x, y) {
              return _util.Util.applyInverseTransform([x, y], this.transform);
            }
          }]);

          return PageViewport;
        }();

        exports.PageViewport = PageViewport;

        var RenderingCancelledException = /*#__PURE__*/function (_BaseException) {
          _inherits(RenderingCancelledException, _BaseException);

          var _super5 = _createSuper(RenderingCancelledException);

          function RenderingCancelledException(msg, type) {
            var _this2;

            _classCallCheck(this, RenderingCancelledException);

            _this2 = _super5.call(this, msg, "RenderingCancelledException");
            _this2.type = type;
            return _this2;
          }

          return RenderingCancelledException;
        }(_util.BaseException);

        exports.RenderingCancelledException = RenderingCancelledException;
        var LinkTarget = {
          NONE: 0,
          SELF: 1,
          BLANK: 2,
          PARENT: 3,
          TOP: 4
        };
        exports.LinkTarget = LinkTarget;

        function addLinkAttributes(link) {
          var _ref4 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
              url = _ref4.url,
              target = _ref4.target,
              rel = _ref4.rel,
              _ref4$enabled = _ref4.enabled,
              enabled = _ref4$enabled === void 0 ? true : _ref4$enabled;

          (0, _util.assert)(url && typeof url === "string", 'addLinkAttributes: A valid "url" parameter must provided.');
          var urlNullRemoved = (0, _util.removeNullCharacters)(url);

          if (enabled) {
            link.href = link.title = urlNullRemoved;
          } else {
            link.href = "";
            link.title = "Disabled: ".concat(urlNullRemoved);

            link.onclick = function () {
              return false;
            };
          }

          var targetStr = "";

          switch (target) {
            case LinkTarget.NONE:
              break;

            case LinkTarget.SELF:
              targetStr = "_self";
              break;

            case LinkTarget.BLANK:
              targetStr = "_blank";
              break;

            case LinkTarget.PARENT:
              targetStr = "_parent";
              break;

            case LinkTarget.TOP:
              targetStr = "_top";
              break;
          }

          link.target = targetStr;
          link.rel = typeof rel === "string" ? rel : DEFAULT_LINK_REL;
        }

        function isDataScheme(url) {
          var ii = url.length;
          var i = 0;

          while (i < ii && url[i].trim() === "") {
            i++;
          }

          return url.substring(i, i + 5).toLowerCase() === "data:";
        }

        function isPdfFile(filename) {
          return typeof filename === "string" && /\.pdf$/i.test(filename);
        }

        function getFilenameFromUrl(url) {
          var anchor = url.indexOf("#");
          var query = url.indexOf("?");
          var end = Math.min(anchor > 0 ? anchor : url.length, query > 0 ? query : url.length);
          return url.substring(url.lastIndexOf("/", end) + 1, end);
        }

        function getPdfFilenameFromUrl(url) {
          var defaultFilename = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "document.pdf";

          if (typeof url !== "string") {
            return defaultFilename;
          }

          if (isDataScheme(url)) {
            (0, _util.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.');
            return defaultFilename;
          }

          var reURI = /^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/;
          var reFilename = /[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i;
          var splitURI = reURI.exec(url);
          var suggestedFilename = reFilename.exec(splitURI[1]) || reFilename.exec(splitURI[2]) || reFilename.exec(splitURI[3]);

          if (suggestedFilename) {
            suggestedFilename = suggestedFilename[0];

            if (suggestedFilename.includes("%")) {
              try {
                suggestedFilename = reFilename.exec(decodeURIComponent(suggestedFilename))[0];
              } catch (ex) {}
            }
          }

          return suggestedFilename || defaultFilename;
        }

        var StatTimer = /*#__PURE__*/function () {
          function StatTimer() {
            _classCallCheck(this, StatTimer);

            this.started = Object.create(null);
            this.times = [];
          }

          _createClass(StatTimer, [{
            key: "time",
            value: function time(name) {
              if (name in this.started) {
                (0, _util.warn)("Timer is already running for ".concat(name));
              }

              this.started[name] = Date.now();
            }
          }, {
            key: "timeEnd",
            value: function timeEnd(name) {
              if (!(name in this.started)) {
                (0, _util.warn)("Timer has not been started for ".concat(name));
              }

              this.times.push({
                name: name,
                start: this.started[name],
                end: Date.now()
              });
              delete this.started[name];
            }
          }, {
            key: "toString",
            value: function toString() {
              var outBuf = [];
              var longest = 0;

              var _iterator = _createForOfIteratorHelper(this.times),
                  _step;

              try {
                for (_iterator.s(); !(_step = _iterator.n()).done;) {
                  var time = _step.value;
                  var name = time.name;

                  if (name.length > longest) {
                    longest = name.length;
                  }
                }
              } catch (err) {
                _iterator.e(err);
              } finally {
                _iterator.f();
              }

              var _iterator2 = _createForOfIteratorHelper(this.times),
                  _step2;

              try {
                for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
                  var _time = _step2.value;
                  var duration = _time.end - _time.start;
                  outBuf.push("".concat(_time.name.padEnd(longest), " ").concat(duration, "ms\n"));
                }
              } catch (err) {
                _iterator2.e(err);
              } finally {
                _iterator2.f();
              }

              return outBuf.join("");
            }
          }]);

          return StatTimer;
        }();

        exports.StatTimer = StatTimer;

        function isValidFetchUrl(url, baseUrl) {
          try {
            var _ref5 = baseUrl ? new URL(url, baseUrl) : new URL(url),
                protocol = _ref5.protocol;

            return protocol === "http:" || protocol === "https:";
          } catch (ex) {
            return false;
          }
        }

        function loadScript(src) {
          var removeScriptElement = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
          return new Promise(function (resolve, reject) {
            var script = document.createElement("script");
            script.src = src;

            script.onload = function (evt) {
              if (removeScriptElement) {
                script.remove();
              }

              resolve(evt);
            };

            script.onerror = function () {
              reject(new Error("Cannot load script at: ".concat(script.src)));
            };

            (document.head || document.documentElement).appendChild(script);
          });
        }

        function deprecated(details) {
          console.log("Deprecated API usage: " + details);
        }

        var pdfDateStringRegex;

        var PDFDateString = /*#__PURE__*/function () {
          function PDFDateString() {
            _classCallCheck(this, PDFDateString);
          }

          _createClass(PDFDateString, null, [{
            key: "toDateObject",
            value: function toDateObject(input) {
              if (!input || !(0, _util.isString)(input)) {
                return null;
              }

              if (!pdfDateStringRegex) {
                pdfDateStringRegex = new RegExp("^D:" + "(\\d{4})" + "(\\d{2})?" + "(\\d{2})?" + "(\\d{2})?" + "(\\d{2})?" + "(\\d{2})?" + "([Z|+|-])?" + "(\\d{2})?" + "'?" + "(\\d{2})?" + "'?");
              }

              var matches = pdfDateStringRegex.exec(input);

              if (!matches) {
                return null;
              }

              var year = parseInt(matches[1], 10);
              var month = parseInt(matches[2], 10);
              month = month >= 1 && month <= 12 ? month - 1 : 0;
              var day = parseInt(matches[3], 10);
              day = day >= 1 && day <= 31 ? day : 1;
              var hour = parseInt(matches[4], 10);
              hour = hour >= 0 && hour <= 23 ? hour : 0;
              var minute = parseInt(matches[5], 10);
              minute = minute >= 0 && minute <= 59 ? minute : 0;
              var second = parseInt(matches[6], 10);
              second = second >= 0 && second <= 59 ? second : 0;
              var universalTimeRelation = matches[7] || "Z";
              var offsetHour = parseInt(matches[8], 10);
              offsetHour = offsetHour >= 0 && offsetHour <= 23 ? offsetHour : 0;
              var offsetMinute = parseInt(matches[9], 10) || 0;
              offsetMinute = offsetMinute >= 0 && offsetMinute <= 59 ? offsetMinute : 0;

              if (universalTimeRelation === "-") {
                hour += offsetHour;
                minute += offsetMinute;
              } else if (universalTimeRelation === "+") {
                hour -= offsetHour;
                minute -= offsetMinute;
              }

              return new Date(Date.UTC(year, month, day, hour, minute, second));
            }
          }]);

          return PDFDateString;
        }();

        exports.PDFDateString = PDFDateString;

        function getXfaPageViewport(xfaPage, _ref6) {
          var _ref6$scale = _ref6.scale,
              scale = _ref6$scale === void 0 ? 1 : _ref6$scale,
              _ref6$rotation = _ref6.rotation,
              rotation = _ref6$rotation === void 0 ? 0 : _ref6$rotation;
          var _xfaPage$attributes$s = xfaPage.attributes.style,
              width = _xfaPage$attributes$s.width,
              height = _xfaPage$attributes$s.height;
          var viewBox = [0, 0, parseInt(width), parseInt(height)];
          return new PageViewport({
            viewBox: viewBox,
            scale: scale,
            rotation: rotation
          });
        }
        /***/

      },
      /* 2 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        "use strict";

        module.exports = __w_pdfjs_require__(3);
        /***/
      },
      /* 3 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        "use strict";
        /* module decorator */

        module = __w_pdfjs_require__.nmd(module);

        function _typeof(obj) {
          "@babel/helpers - typeof";

          if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
            _typeof = function _typeof(obj) {
              return typeof obj;
            };
          } else {
            _typeof = function _typeof(obj) {
              return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
            };
          }

          return _typeof(obj);
        }

        var runtime = function (exports) {
          "use strict";

          var Op = Object.prototype;
          var hasOwn = Op.hasOwnProperty;
          var undefined;
          var $Symbol = typeof Symbol === "function" ? Symbol : {};
          var iteratorSymbol = $Symbol.iterator || "@@iterator";
          var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
          var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";

          function define(obj, key, value) {
            Object.defineProperty(obj, key, {
              value: value,
              enumerable: true,
              configurable: true,
              writable: true
            });
            return obj[key];
          }

          try {
            define({}, "");
          } catch (err) {
            define = function define(obj, key, value) {
              return obj[key] = value;
            };
          }

          function wrap(innerFn, outerFn, self, tryLocsList) {
            var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
            var generator = Object.create(protoGenerator.prototype);
            var context = new Context(tryLocsList || []);
            generator._invoke = makeInvokeMethod(innerFn, self, context);
            return generator;
          }

          exports.wrap = wrap;

          function tryCatch(fn, obj, arg) {
            try {
              return {
                type: "normal",
                arg: fn.call(obj, arg)
              };
            } catch (err) {
              return {
                type: "throw",
                arg: err
              };
            }
          }

          var GenStateSuspendedStart = "suspendedStart";
          var GenStateSuspendedYield = "suspendedYield";
          var GenStateExecuting = "executing";
          var GenStateCompleted = "completed";
          var ContinueSentinel = {};

          function Generator() {}

          function GeneratorFunction() {}

          function GeneratorFunctionPrototype() {}

          var IteratorPrototype = {};
          define(IteratorPrototype, iteratorSymbol, function () {
            return this;
          });
          var getProto = Object.getPrototypeOf;
          var NativeIteratorPrototype = getProto && getProto(getProto(values([])));

          if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
            IteratorPrototype = NativeIteratorPrototype;
          }

          var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
          GeneratorFunction.prototype = GeneratorFunctionPrototype;
          define(Gp, "constructor", GeneratorFunctionPrototype);
          define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
          GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction");

          function defineIteratorMethods(prototype) {
            ["next", "throw", "return"].forEach(function (method) {
              define(prototype, method, function (arg) {
                return this._invoke(method, arg);
              });
            });
          }

          exports.isGeneratorFunction = function (genFun) {
            var ctor = typeof genFun === "function" && genFun.constructor;
            return ctor ? ctor === GeneratorFunction || (ctor.displayName || ctor.name) === "GeneratorFunction" : false;
          };

          exports.mark = function (genFun) {
            if (Object.setPrototypeOf) {
              Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
            } else {
              genFun.__proto__ = GeneratorFunctionPrototype;
              define(genFun, toStringTagSymbol, "GeneratorFunction");
            }

            genFun.prototype = Object.create(Gp);
            return genFun;
          };

          exports.awrap = function (arg) {
            return {
              __await: arg
            };
          };

          function AsyncIterator(generator, PromiseImpl) {
            function invoke(method, arg, resolve, reject) {
              var record = tryCatch(generator[method], generator, arg);

              if (record.type === "throw") {
                reject(record.arg);
              } else {
                var result = record.arg;
                var value = result.value;

                if (value && _typeof(value) === "object" && hasOwn.call(value, "__await")) {
                  return PromiseImpl.resolve(value.__await).then(function (value) {
                    invoke("next", value, resolve, reject);
                  }, function (err) {
                    invoke("throw", err, resolve, reject);
                  });
                }

                return PromiseImpl.resolve(value).then(function (unwrapped) {
                  result.value = unwrapped;
                  resolve(result);
                }, function (error) {
                  return invoke("throw", error, resolve, reject);
                });
              }
            }

            var previousPromise;

            function enqueue(method, arg) {
              function callInvokeWithMethodAndArg() {
                return new PromiseImpl(function (resolve, reject) {
                  invoke(method, arg, resolve, reject);
                });
              }

              return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
            }

            this._invoke = enqueue;
          }

          defineIteratorMethods(AsyncIterator.prototype);
          define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
            return this;
          });
          exports.AsyncIterator = AsyncIterator;

          exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
            if (PromiseImpl === void 0) PromiseImpl = Promise;
            var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
            return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
              return result.done ? result.value : iter.next();
            });
          };

          function makeInvokeMethod(innerFn, self, context) {
            var state = GenStateSuspendedStart;
            return function invoke(method, arg) {
              if (state === GenStateExecuting) {
                throw new Error("Generator is already running");
              }

              if (state === GenStateCompleted) {
                if (method === "throw") {
                  throw arg;
                }

                return doneResult();
              }

              context.method = method;
              context.arg = arg;

              while (true) {
                var delegate = context.delegate;

                if (delegate) {
                  var delegateResult = maybeInvokeDelegate(delegate, context);

                  if (delegateResult) {
                    if (delegateResult === ContinueSentinel) continue;
                    return delegateResult;
                  }
                }

                if (context.method === "next") {
                  context.sent = context._sent = context.arg;
                } else if (context.method === "throw") {
                  if (state === GenStateSuspendedStart) {
                    state = GenStateCompleted;
                    throw context.arg;
                  }

                  context.dispatchException(context.arg);
                } else if (context.method === "return") {
                  context.abrupt("return", context.arg);
                }

                state = GenStateExecuting;
                var record = tryCatch(innerFn, self, context);

                if (record.type === "normal") {
                  state = context.done ? GenStateCompleted : GenStateSuspendedYield;

                  if (record.arg === ContinueSentinel) {
                    continue;
                  }

                  return {
                    value: record.arg,
                    done: context.done
                  };
                } else if (record.type === "throw") {
                  state = GenStateCompleted;
                  context.method = "throw";
                  context.arg = record.arg;
                }
              }
            };
          }

          function maybeInvokeDelegate(delegate, context) {
            var method = delegate.iterator[context.method];

            if (method === undefined) {
              context.delegate = null;

              if (context.method === "throw") {
                if (delegate.iterator["return"]) {
                  context.method = "return";
                  context.arg = undefined;
                  maybeInvokeDelegate(delegate, context);

                  if (context.method === "throw") {
                    return ContinueSentinel;
                  }
                }

                context.method = "throw";
                context.arg = new TypeError("The iterator does not provide a 'throw' method");
              }

              return ContinueSentinel;
            }

            var record = tryCatch(method, delegate.iterator, context.arg);

            if (record.type === "throw") {
              context.method = "throw";
              context.arg = record.arg;
              context.delegate = null;
              return ContinueSentinel;
            }

            var info = record.arg;

            if (!info) {
              context.method = "throw";
              context.arg = new TypeError("iterator result is not an object");
              context.delegate = null;
              return ContinueSentinel;
            }

            if (info.done) {
              context[delegate.resultName] = info.value;
              context.next = delegate.nextLoc;

              if (context.method !== "return") {
                context.method = "next";
                context.arg = undefined;
              }
            } else {
              return info;
            }

            context.delegate = null;
            return ContinueSentinel;
          }

          defineIteratorMethods(Gp);
          define(Gp, toStringTagSymbol, "Generator");
          define(Gp, iteratorSymbol, function () {
            return this;
          });
          define(Gp, "toString", function () {
            return "[object Generator]";
          });

          function pushTryEntry(locs) {
            var entry = {
              tryLoc: locs[0]
            };

            if (1 in locs) {
              entry.catchLoc = locs[1];
            }

            if (2 in locs) {
              entry.finallyLoc = locs[2];
              entry.afterLoc = locs[3];
            }

            this.tryEntries.push(entry);
          }

          function resetTryEntry(entry) {
            var record = entry.completion || {};
            record.type = "normal";
            delete record.arg;
            entry.completion = record;
          }

          function Context(tryLocsList) {
            this.tryEntries = [{
              tryLoc: "root"
            }];
            tryLocsList.forEach(pushTryEntry, this);
            this.reset(true);
          }

          exports.keys = function (object) {
            var keys = [];

            for (var key in object) {
              keys.push(key);
            }

            keys.reverse();
            return function next() {
              while (keys.length) {
                var key = keys.pop();

                if (key in object) {
                  next.value = key;
                  next.done = false;
                  return next;
                }
              }

              next.done = true;
              return next;
            };
          };

          function values(iterable) {
            if (iterable) {
              var iteratorMethod = iterable[iteratorSymbol];

              if (iteratorMethod) {
                return iteratorMethod.call(iterable);
              }

              if (typeof iterable.next === "function") {
                return iterable;
              }

              if (!isNaN(iterable.length)) {
                var i = -1,
                    next = function next() {
                  while (++i < iterable.length) {
                    if (hasOwn.call(iterable, i)) {
                      next.value = iterable[i];
                      next.done = false;
                      return next;
                    }
                  }

                  next.value = undefined;
                  next.done = true;
                  return next;
                };

                return next.next = next;
              }
            }

            return {
              next: doneResult
            };
          }

          exports.values = values;

          function doneResult() {
            return {
              value: undefined,
              done: true
            };
          }

          Context.prototype = {
            constructor: Context,
            reset: function reset(skipTempReset) {
              this.prev = 0;
              this.next = 0;
              this.sent = this._sent = undefined;
              this.done = false;
              this.delegate = null;
              this.method = "next";
              this.arg = undefined;
              this.tryEntries.forEach(resetTryEntry);

              if (!skipTempReset) {
                for (var name in this) {
                  if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) {
                    this[name] = undefined;
                  }
                }
              }
            },
            stop: function stop() {
              this.done = true;
              var rootEntry = this.tryEntries[0];
              var rootRecord = rootEntry.completion;

              if (rootRecord.type === "throw") {
                throw rootRecord.arg;
              }

              return this.rval;
            },
            dispatchException: function dispatchException(exception) {
              if (this.done) {
                throw exception;
              }

              var context = this;

              function handle(loc, caught) {
                record.type = "throw";
                record.arg = exception;
                context.next = loc;

                if (caught) {
                  context.method = "next";
                  context.arg = undefined;
                }

                return !!caught;
              }

              for (var i = this.tryEntries.length - 1; i >= 0; --i) {
                var entry = this.tryEntries[i];
                var record = entry.completion;

                if (entry.tryLoc === "root") {
                  return handle("end");
                }

                if (entry.tryLoc <= this.prev) {
                  var hasCatch = hasOwn.call(entry, "catchLoc");
                  var hasFinally = hasOwn.call(entry, "finallyLoc");

                  if (hasCatch && hasFinally) {
                    if (this.prev < entry.catchLoc) {
                      return handle(entry.catchLoc, true);
                    } else if (this.prev < entry.finallyLoc) {
                      return handle(entry.finallyLoc);
                    }
                  } else if (hasCatch) {
                    if (this.prev < entry.catchLoc) {
                      return handle(entry.catchLoc, true);
                    }
                  } else if (hasFinally) {
                    if (this.prev < entry.finallyLoc) {
                      return handle(entry.finallyLoc);
                    }
                  } else {
                    throw new Error("try statement without catch or finally");
                  }
                }
              }
            },
            abrupt: function abrupt(type, arg) {
              for (var i = this.tryEntries.length - 1; i >= 0; --i) {
                var entry = this.tryEntries[i];

                if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
                  var finallyEntry = entry;
                  break;
                }
              }

              if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) {
                finallyEntry = null;
              }

              var record = finallyEntry ? finallyEntry.completion : {};
              record.type = type;
              record.arg = arg;

              if (finallyEntry) {
                this.method = "next";
                this.next = finallyEntry.finallyLoc;
                return ContinueSentinel;
              }

              return this.complete(record);
            },
            complete: function complete(record, afterLoc) {
              if (record.type === "throw") {
                throw record.arg;
              }

              if (record.type === "break" || record.type === "continue") {
                this.next = record.arg;
              } else if (record.type === "return") {
                this.rval = this.arg = record.arg;
                this.method = "return";
                this.next = "end";
              } else if (record.type === "normal" && afterLoc) {
                this.next = afterLoc;
              }

              return ContinueSentinel;
            },
            finish: function finish(finallyLoc) {
              for (var i = this.tryEntries.length - 1; i >= 0; --i) {
                var entry = this.tryEntries[i];

                if (entry.finallyLoc === finallyLoc) {
                  this.complete(entry.completion, entry.afterLoc);
                  resetTryEntry(entry);
                  return ContinueSentinel;
                }
              }
            },
            "catch": function _catch(tryLoc) {
              for (var i = this.tryEntries.length - 1; i >= 0; --i) {
                var entry = this.tryEntries[i];

                if (entry.tryLoc === tryLoc) {
                  var record = entry.completion;

                  if (record.type === "throw") {
                    var thrown = record.arg;
                    resetTryEntry(entry);
                  }

                  return thrown;
                }
              }

              throw new Error("illegal catch attempt");
            },
            delegateYield: function delegateYield(iterable, resultName, nextLoc) {
              this.delegate = {
                iterator: values(iterable),
                resultName: resultName,
                nextLoc: nextLoc
              };

              if (this.method === "next") {
                this.arg = undefined;
              }

              return ContinueSentinel;
            }
          };
          return exports;
        }(( false ? 0 : _typeof(module)) === "object" ? module.exports : {});

        try {
          regeneratorRuntime = runtime;
        } catch (accidentalStrictMode) {
          if ((typeof globalThis === "undefined" ? "undefined" : _typeof(globalThis)) === "object") {
            globalThis.regeneratorRuntime = runtime;
          } else {
            Function("r", "regeneratorRuntime = r")(runtime);
          }
        }
        /***/

      },
      /* 4 */

      /***/
      function (__unused_webpack_module, exports, __w_pdfjs_require__) {
        "use strict";

        Object.defineProperty(exports, "__esModule", {
          value: true
        });
        exports.arrayByteLength = arrayByteLength;
        exports.arraysToBytes = arraysToBytes;
        exports.assert = assert;
        exports.bytesToString = bytesToString;
        exports.createObjectURL = createObjectURL;
        exports.createPromiseCapability = createPromiseCapability;
        exports.createValidAbsoluteUrl = createValidAbsoluteUrl;
        exports.escapeString = escapeString;
        exports.getModificationDate = getModificationDate;
        exports.getVerbosityLevel = getVerbosityLevel;
        exports.info = info;
        exports.isArrayBuffer = isArrayBuffer;
        exports.isArrayEqual = isArrayEqual;
        exports.isAscii = isAscii;
        exports.isBool = isBool;
        exports.isNum = isNum;
        exports.isSameOrigin = isSameOrigin;
        exports.isString = isString;
        exports.objectFromMap = objectFromMap;
        exports.objectSize = objectSize;
        exports.removeNullCharacters = removeNullCharacters;
        exports.setVerbosityLevel = setVerbosityLevel;
        exports.shadow = shadow;
        exports.string32 = string32;
        exports.stringToBytes = stringToBytes;
        exports.stringToPDFString = stringToPDFString;
        exports.stringToUTF16BEString = stringToUTF16BEString;
        exports.stringToUTF8String = stringToUTF8String;
        exports.unreachable = unreachable;
        exports.utf8StringToString = utf8StringToString;
        exports.warn = warn;
        exports.VerbosityLevel = exports.Util = exports.UNSUPPORTED_FEATURES = exports.UnknownErrorException = exports.UnexpectedResponseException = exports.TextRenderingMode = exports.StreamType = exports.RenderingIntentFlag = exports.PermissionFlag = exports.PasswordResponses = exports.PasswordException = exports.PageActionEventType = exports.OPS = exports.MissingPDFException = exports.IsLittleEndianCached = exports.IsEvalSupportedCached = exports.InvalidPDFException = exports.ImageKind = exports.IDENTITY_MATRIX = exports.FormatError = exports.FontType = exports.FONT_IDENTITY_MATRIX = exports.DocumentActionEventType = exports.CMapCompressionType = exports.BaseException = exports.AnnotationType = exports.AnnotationStateModelType = exports.AnnotationReviewState = exports.AnnotationReplyType = exports.AnnotationMode = exports.AnnotationMarkedState = exports.AnnotationFlag = exports.AnnotationFieldFlag = exports.AnnotationBorderStyleType = exports.AnnotationActionEventType = exports.AbortException = void 0;

        __w_pdfjs_require__(5);

        function _defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];
            descriptor.enumerable = descriptor.enumerable || false;
            descriptor.configurable = true;
            if ("value" in descriptor) descriptor.writable = true;
            Object.defineProperty(target, descriptor.key, descriptor);
          }
        }

        function _createClass(Constructor, protoProps, staticProps) {
          if (protoProps) _defineProperties(Constructor.prototype, protoProps);
          if (staticProps) _defineProperties(Constructor, staticProps);
          return Constructor;
        }

        function _toConsumableArray(arr) {
          return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
        }

        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.");
        }

        function _iterableToArray(iter) {
          if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
        }

        function _arrayWithoutHoles(arr) {
          if (Array.isArray(arr)) return _arrayLikeToArray(arr);
        }

        function _slicedToArray(arr, i) {
          return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
        }

        function _nonIterableRest() {
          throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
        }

        function _iterableToArrayLimit(arr, i) {
          var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];

          if (_i == null) return;
          var _arr = [];
          var _n = true;
          var _d = false;

          var _s, _e;

          try {
            for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
              _arr.push(_s.value);

              if (i && _arr.length === i) break;
            }
          } catch (err) {
            _d = true;
            _e = err;
          } finally {
            try {
              if (!_n && _i["return"] != null) _i["return"]();
            } finally {
              if (_d) throw _e;
            }
          }

          return _arr;
        }

        function _arrayWithHoles(arr) {
          if (Array.isArray(arr)) return arr;
        }

        function _createForOfIteratorHelper(o, allowArrayLike) {
          var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];

          if (!it) {
            if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
              if (it) o = it;
              var i = 0;

              var F = function F() {};

              return {
                s: F,
                n: function n() {
                  if (i >= o.length) return {
                    done: true
                  };
                  return {
                    done: false,
                    value: o[i++]
                  };
                },
                e: function e(_e2) {
                  throw _e2;
                },
                f: F
              };
            }

            throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
          }

          var normalCompletion = true,
              didErr = false,
              err;
          return {
            s: function s() {
              it = it.call(o);
            },
            n: function n() {
              var step = it.next();
              normalCompletion = step.done;
              return step;
            },
            e: function e(_e3) {
              didErr = true;
              err = _e3;
            },
            f: function f() {
              try {
                if (!normalCompletion && it["return"] != null) it["return"]();
              } finally {
                if (didErr) throw err;
              }
            }
          };
        }

        function _unsupportedIterableToArray(o, minLen) {
          if (!o) return;
          if (typeof o === "string") return _arrayLikeToArray(o, minLen);
          var n = Object.prototype.toString.call(o).slice(8, -1);
          if (n === "Object" && o.constructor) n = o.constructor.name;
          if (n === "Map" || n === "Set") return Array.from(o);
          if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
        }

        function _arrayLikeToArray(arr, len) {
          if (len == null || len > arr.length) len = arr.length;

          for (var i = 0, arr2 = new Array(len); i < len; i++) {
            arr2[i] = arr[i];
          }

          return arr2;
        }

        function _typeof(obj) {
          "@babel/helpers - typeof";

          if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
            _typeof = function _typeof(obj) {
              return typeof obj;
            };
          } else {
            _typeof = function _typeof(obj) {
              return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
            };
          }

          return _typeof(obj);
        }

        function _classCallCheck(instance, Constructor) {
          if (!(instance instanceof Constructor)) {
            throw new TypeError("Cannot call a class as a function");
          }
        }

        function _inherits(subClass, superClass) {
          if (typeof superClass !== "function" && superClass !== null) {
            throw new TypeError("Super expression must either be null or a function");
          }

          subClass.prototype = Object.create(superClass && superClass.prototype, {
            constructor: {
              value: subClass,
              writable: true,
              configurable: true
            }
          });
          if (superClass) _setPrototypeOf(subClass, superClass);
        }

        function _setPrototypeOf(o, p) {
          _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
            o.__proto__ = p;
            return o;
          };

          return _setPrototypeOf(o, p);
        }

        function _createSuper(Derived) {
          var hasNativeReflectConstruct = _isNativeReflectConstruct();

          return function _createSuperInternal() {
            var Super = _getPrototypeOf(Derived),
                result;

            if (hasNativeReflectConstruct) {
              var NewTarget = _getPrototypeOf(this).constructor;

              result = Reflect.construct(Super, arguments, NewTarget);
            } else {
              result = Super.apply(this, arguments);
            }

            return _possibleConstructorReturn(this, result);
          };
        }

        function _possibleConstructorReturn(self, call) {
          if (call && (_typeof(call) === "object" || typeof call === "function")) {
            return call;
          } else if (call !== void 0) {
            throw new TypeError("Derived constructors may only return object or undefined");
          }

          return _assertThisInitialized(self);
        }

        function _assertThisInitialized(self) {
          if (self === void 0) {
            throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
          }

          return self;
        }

        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 (e) {
            return false;
          }
        }

        function _getPrototypeOf(o) {
          _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
            return o.__proto__ || Object.getPrototypeOf(o);
          };
          return _getPrototypeOf(o);
        }

        var IDENTITY_MATRIX = [1, 0, 0, 1, 0, 0];
        exports.IDENTITY_MATRIX = IDENTITY_MATRIX;
        var FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0];
        exports.FONT_IDENTITY_MATRIX = FONT_IDENTITY_MATRIX;
        var RenderingIntentFlag = {
          ANY: 0x01,
          DISPLAY: 0x02,
          PRINT: 0x04,
          ANNOTATIONS_FORMS: 0x10,
          ANNOTATIONS_STORAGE: 0x20,
          ANNOTATIONS_DISABLE: 0x40,
          OPLIST: 0x100
        };
        exports.RenderingIntentFlag = RenderingIntentFlag;
        var AnnotationMode = {
          DISABLE: 0,
          ENABLE: 1,
          ENABLE_FORMS: 2,
          ENABLE_STORAGE: 3
        };
        exports.AnnotationMode = AnnotationMode;
        var PermissionFlag = {
          PRINT: 0x04,
          MODIFY_CONTENTS: 0x08,
          COPY: 0x10,
          MODIFY_ANNOTATIONS: 0x20,
          FILL_INTERACTIVE_FORMS: 0x100,
          COPY_FOR_ACCESSIBILITY: 0x200,
          ASSEMBLE: 0x400,
          PRINT_HIGH_QUALITY: 0x800
        };
        exports.PermissionFlag = PermissionFlag;
        var TextRenderingMode = {
          FILL: 0,
          STROKE: 1,
          FILL_STROKE: 2,
          INVISIBLE: 3,
          FILL_ADD_TO_PATH: 4,
          STROKE_ADD_TO_PATH: 5,
          FILL_STROKE_ADD_TO_PATH: 6,
          ADD_TO_PATH: 7,
          FILL_STROKE_MASK: 3,
          ADD_TO_PATH_FLAG: 4
        };
        exports.TextRenderingMode = TextRenderingMode;
        var ImageKind = {
          GRAYSCALE_1BPP: 1,
          RGB_24BPP: 2,
          RGBA_32BPP: 3
        };
        exports.ImageKind = ImageKind;
        var AnnotationType = {
          TEXT: 1,
          LINK: 2,
          FREETEXT: 3,
          LINE: 4,
          SQUARE: 5,
          CIRCLE: 6,
          POLYGON: 7,
          POLYLINE: 8,
          HIGHLIGHT: 9,
          UNDERLINE: 10,
          SQUIGGLY: 11,
          STRIKEOUT: 12,
          STAMP: 13,
          CARET: 14,
          INK: 15,
          POPUP: 16,
          FILEATTACHMENT: 17,
          SOUND: 18,
          MOVIE: 19,
          WIDGET: 20,
          SCREEN: 21,
          PRINTERMARK: 22,
          TRAPNET: 23,
          WATERMARK: 24,
          THREED: 25,
          REDACT: 26
        };
        exports.AnnotationType = AnnotationType;
        var AnnotationStateModelType = {
          MARKED: "Marked",
          REVIEW: "Review"
        };
        exports.AnnotationStateModelType = AnnotationStateModelType;
        var AnnotationMarkedState = {
          MARKED: "Marked",
          UNMARKED: "Unmarked"
        };
        exports.AnnotationMarkedState = AnnotationMarkedState;
        var AnnotationReviewState = {
          ACCEPTED: "Accepted",
          REJECTED: "Rejected",
          CANCELLED: "Cancelled",
          COMPLETED: "Completed",
          NONE: "None"
        };
        exports.AnnotationReviewState = AnnotationReviewState;
        var AnnotationReplyType = {
          GROUP: "Group",
          REPLY: "R"
        };
        exports.AnnotationReplyType = AnnotationReplyType;
        var AnnotationFlag = {
          INVISIBLE: 0x01,
          HIDDEN: 0x02,
          PRINT: 0x04,
          NOZOOM: 0x08,
          NOROTATE: 0x10,
          NOVIEW: 0x20,
          READONLY: 0x40,
          LOCKED: 0x80,
          TOGGLENOVIEW: 0x100,
          LOCKEDCONTENTS: 0x200
        };
        exports.AnnotationFlag = AnnotationFlag;
        var AnnotationFieldFlag = {
          READONLY: 0x0000001,
          REQUIRED: 0x0000002,
          NOEXPORT: 0x0000004,
          MULTILINE: 0x0001000,
          PASSWORD: 0x0002000,
          NOTOGGLETOOFF: 0x0004000,
          RADIO: 0x0008000,
          PUSHBUTTON: 0x0010000,
          COMBO: 0x0020000,
          EDIT: 0x0040000,
          SORT: 0x0080000,
          FILESELECT: 0x0100000,
          MULTISELECT: 0x0200000,
          DONOTSPELLCHECK: 0x0400000,
          DONOTSCROLL: 0x0800000,
          COMB: 0x1000000,
          RICHTEXT: 0x2000000,
          RADIOSINUNISON: 0x2000000,
          COMMITONSELCHANGE: 0x4000000
        };
        exports.AnnotationFieldFlag = AnnotationFieldFlag;
        var AnnotationBorderStyleType = {
          SOLID: 1,
          DASHED: 2,
          BEVELED: 3,
          INSET: 4,
          UNDERLINE: 5
        };
        exports.AnnotationBorderStyleType = AnnotationBorderStyleType;
        var AnnotationActionEventType = {
          E: "Mouse Enter",
          X: "Mouse Exit",
          D: "Mouse Down",
          U: "Mouse Up",
          Fo: "Focus",
          Bl: "Blur",
          PO: "PageOpen",
          PC: "PageClose",
          PV: "PageVisible",
          PI: "PageInvisible",
          K: "Keystroke",
          F: "Format",
          V: "Validate",
          C: "Calculate"
        };
        exports.AnnotationActionEventType = AnnotationActionEventType;
        var DocumentActionEventType = {
          WC: "WillClose",
          WS: "WillSave",
          DS: "DidSave",
          WP: "WillPrint",
          DP: "DidPrint"
        };
        exports.DocumentActionEventType = DocumentActionEventType;
        var PageActionEventType = {
          O: "PageOpen",
          C: "PageClose"
        };
        exports.PageActionEventType = PageActionEventType;
        var StreamType = {
          UNKNOWN: "UNKNOWN",
          FLATE: "FLATE",
          LZW: "LZW",
          DCT: "DCT",
          JPX: "JPX",
          JBIG: "JBIG",
          A85: "A85",
          AHX: "AHX",
          CCF: "CCF",
          RLX: "RLX"
        };
        exports.StreamType = StreamType;
        var FontType = {
          UNKNOWN: "UNKNOWN",
          TYPE1: "TYPE1",
          TYPE1STANDARD: "TYPE1STANDARD",
          TYPE1C: "TYPE1C",
          CIDFONTTYPE0: "CIDFONTTYPE0",
          CIDFONTTYPE0C: "CIDFONTTYPE0C",
          TRUETYPE: "TRUETYPE",
          CIDFONTTYPE2: "CIDFONTTYPE2",
          TYPE3: "TYPE3",
          OPENTYPE: "OPENTYPE",
          TYPE0: "TYPE0",
          MMTYPE1: "MMTYPE1"
        };
        exports.FontType = FontType;
        var VerbosityLevel = {
          ERRORS: 0,
          WARNINGS: 1,
          INFOS: 5
        };
        exports.VerbosityLevel = VerbosityLevel;
        var CMapCompressionType = {
          NONE: 0,
          BINARY: 1,
          STREAM: 2
        };
        exports.CMapCompressionType = CMapCompressionType;
        var OPS = {
          dependency: 1,
          setLineWidth: 2,
          setLineCap: 3,
          setLineJoin: 4,
          setMiterLimit: 5,
          setDash: 6,
          setRenderingIntent: 7,
          setFlatness: 8,
          setGState: 9,
          save: 10,
          restore: 11,
          transform: 12,
          moveTo: 13,
          lineTo: 14,
          curveTo: 15,
          curveTo2: 16,
          curveTo3: 17,
          closePath: 18,
          rectangle: 19,
          stroke: 20,
          closeStroke: 21,
          fill: 22,
          eoFill: 23,
          fillStroke: 24,
          eoFillStroke: 25,
          closeFillStroke: 26,
          closeEOFillStroke: 27,
          endPath: 28,
          clip: 29,
          eoClip: 30,
          beginText: 31,
          endText: 32,
          setCharSpacing: 33,
          setWordSpacing: 34,
          setHScale: 35,
          setLeading: 36,
          setFont: 37,
          setTextRenderingMode: 38,
          setTextRise: 39,
          moveText: 40,
          setLeadingMoveText: 41,
          setTextMatrix: 42,
          nextLine: 43,
          showText: 44,
          showSpacedText: 45,
          nextLineShowText: 46,
          nextLineSetSpacingShowText: 47,
          setCharWidth: 48,
          setCharWidthAndBounds: 49,
          setStrokeColorSpace: 50,
          setFillColorSpace: 51,
          setStrokeColor: 52,
          setStrokeColorN: 53,
          setFillColor: 54,
          setFillColorN: 55,
          setStrokeGray: 56,
          setFillGray: 57,
          setStrokeRGBColor: 58,
          setFillRGBColor: 59,
          setStrokeCMYKColor: 60,
          setFillCMYKColor: 61,
          shadingFill: 62,
          beginInlineImage: 63,
          beginImageData: 64,
          endInlineImage: 65,
          paintXObject: 66,
          markPoint: 67,
          markPointProps: 68,
          beginMarkedContent: 69,
          beginMarkedContentProps: 70,
          endMarkedContent: 71,
          beginCompat: 72,
          endCompat: 73,
          paintFormXObjectBegin: 74,
          paintFormXObjectEnd: 75,
          beginGroup: 76,
          endGroup: 77,
          beginAnnotations: 78,
          endAnnotations: 79,
          beginAnnotation: 80,
          endAnnotation: 81,
          paintJpegXObject: 82,
          paintImageMaskXObject: 83,
          paintImageMaskXObjectGroup: 84,
          paintImageXObject: 85,
          paintInlineImageXObject: 86,
          paintInlineImageXObjectGroup: 87,
          paintImageXObjectRepeat: 88,
          paintImageMaskXObjectRepeat: 89,
          paintSolidColorImageMask: 90,
          constructPath: 91
        };
        exports.OPS = OPS;
        var UNSUPPORTED_FEATURES = {
          unknown: "unknown",
          forms: "forms",
          javaScript: "javaScript",
          signatures: "signatures",
          smask: "smask",
          shadingPattern: "shadingPattern",
          font: "font",
          errorTilingPattern: "errorTilingPattern",
          errorExtGState: "errorExtGState",
          errorXObject: "errorXObject",
          errorFontLoadType3: "errorFontLoadType3",
          errorFontState: "errorFontState",
          errorFontMissing: "errorFontMissing",
          errorFontTranslate: "errorFontTranslate",
          errorColorSpace: "errorColorSpace",
          errorOperatorList: "errorOperatorList",
          errorFontToUnicode: "errorFontToUnicode",
          errorFontLoadNative: "errorFontLoadNative",
          errorFontBuildPath: "errorFontBuildPath",
          errorFontGetPath: "errorFontGetPath",
          errorMarkedContent: "errorMarkedContent",
          errorContentSubStream: "errorContentSubStream"
        };
        exports.UNSUPPORTED_FEATURES = UNSUPPORTED_FEATURES;
        var PasswordResponses = {
          NEED_PASSWORD: 1,
          INCORRECT_PASSWORD: 2
        };
        exports.PasswordResponses = PasswordResponses;
        var verbosity = VerbosityLevel.WARNINGS;

        function setVerbosityLevel(level) {
          if (Number.isInteger(level)) {
            verbosity = level;
          }
        }

        function getVerbosityLevel() {
          return verbosity;
        }

        function info(msg) {
          if (verbosity >= VerbosityLevel.INFOS) {
            console.log("Info: ".concat(msg));
          }
        }

        function warn(msg) {
          if (verbosity >= VerbosityLevel.WARNINGS) {
            console.log("Warning: ".concat(msg));
          }
        }

        function unreachable(msg) {
          throw new Error(msg);
        }

        function assert(cond, msg) {
          if (!cond) {
            unreachable(msg);
          }
        }

        function isSameOrigin(baseUrl, otherUrl) {
          var base;

          try {
            base = new URL(baseUrl);

            if (!base.origin || base.origin === "null") {
              return false;
            }
          } catch (e) {
            return false;
          }

          var other = new URL(otherUrl, base);
          return base.origin === other.origin;
        }

        function _isValidProtocol(url) {
          if (!url) {
            return false;
          }

          switch (url.protocol) {
            case "http:":
            case "https:":
            case "ftp:":
            case "mailto:":
            case "tel:":
              return true;

            default:
              return false;
          }
        }

        function createValidAbsoluteUrl(url) {
          var baseUrl = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
          var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;

          if (!url) {
            return null;
          }

          try {
            if (options && typeof url === "string") {
              if (options.addDefaultProtocol && url.startsWith("www.")) {
                var dots = url.match(/\./g);

                if (dots && dots.length >= 2) {
                  url = "http://".concat(url);
                }
              }

              if (options.tryConvertEncoding) {
                try {
                  url = stringToUTF8String(url);
                } catch (ex) {}
              }
            }

            var absoluteUrl = baseUrl ? new URL(url, baseUrl) : new URL(url);

            if (_isValidProtocol(absoluteUrl)) {
              return absoluteUrl;
            }
          } catch (ex) {}

          return null;
        }

        function shadow(obj, prop, value) {
          Object.defineProperty(obj, prop, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: false
          });
          return value;
        }

        var BaseException = function BaseExceptionClosure() {
          function BaseException(message, name) {
            if (this.constructor === BaseException) {
              unreachable("Cannot initialize BaseException.");
            }

            this.message = message;
            this.name = name;
          }

          BaseException.prototype = new Error();
          BaseException.constructor = BaseException;
          return BaseException;
        }();

        exports.BaseException = BaseException;

        var PasswordException = /*#__PURE__*/function (_BaseException) {
          _inherits(PasswordException, _BaseException);

          var _super = _createSuper(PasswordException);

          function PasswordException(msg, code) {
            var _this;

            _classCallCheck(this, PasswordException);

            _this = _super.call(this, msg, "PasswordException");
            _this.code = code;
            return _this;
          }

          return PasswordException;
        }(BaseException);

        exports.PasswordException = PasswordException;

        var UnknownErrorException = /*#__PURE__*/function (_BaseException2) {
          _inherits(UnknownErrorException, _BaseException2);

          var _super2 = _createSuper(UnknownErrorException);

          function UnknownErrorException(msg, details) {
            var _this2;

            _classCallCheck(this, UnknownErrorException);

            _this2 = _super2.call(this, msg, "UnknownErrorException");
            _this2.details = details;
            return _this2;
          }

          return UnknownErrorException;
        }(BaseException);

        exports.UnknownErrorException = UnknownErrorException;

        var InvalidPDFException = /*#__PURE__*/function (_BaseException3) {
          _inherits(InvalidPDFException, _BaseException3);

          var _super3 = _createSuper(InvalidPDFException);

          function InvalidPDFException(msg) {
            _classCallCheck(this, InvalidPDFException);

            return _super3.call(this, msg, "InvalidPDFException");
          }

          return InvalidPDFException;
        }(BaseException);

        exports.InvalidPDFException = InvalidPDFException;

        var MissingPDFException = /*#__PURE__*/function (_BaseException4) {
          _inherits(MissingPDFException, _BaseException4);

          var _super4 = _createSuper(MissingPDFException);

          function MissingPDFException(msg) {
            _classCallCheck(this, MissingPDFException);

            return _super4.call(this, msg, "MissingPDFException");
          }

          return MissingPDFException;
        }(BaseException);

        exports.MissingPDFException = MissingPDFException;

        var UnexpectedResponseException = /*#__PURE__*/function (_BaseException5) {
          _inherits(UnexpectedResponseException, _BaseException5);

          var _super5 = _createSuper(UnexpectedResponseException);

          function UnexpectedResponseException(msg, status) {
            var _this3;

            _classCallCheck(this, UnexpectedResponseException);

            _this3 = _super5.call(this, msg, "UnexpectedResponseException");
            _this3.status = status;
            return _this3;
          }

          return UnexpectedResponseException;
        }(BaseException);

        exports.UnexpectedResponseException = UnexpectedResponseException;

        var FormatError = /*#__PURE__*/function (_BaseException6) {
          _inherits(FormatError, _BaseException6);

          var _super6 = _createSuper(FormatError);

          function FormatError(msg) {
            _classCallCheck(this, FormatError);

            return _super6.call(this, msg, "FormatError");
          }

          return FormatError;
        }(BaseException);

        exports.FormatError = FormatError;

        var AbortException = /*#__PURE__*/function (_BaseException7) {
          _inherits(AbortException, _BaseException7);

          var _super7 = _createSuper(AbortException);

          function AbortException(msg) {
            _classCallCheck(this, AbortException);

            return _super7.call(this, msg, "AbortException");
          }

          return AbortException;
        }(BaseException);

        exports.AbortException = AbortException;
        var NullCharactersRegExp = /\x00/g;

        function removeNullCharacters(str) {
          if (typeof str !== "string") {
            warn("The argument for removeNullCharacters must be a string.");
            return str;
          }

          return str.replace(NullCharactersRegExp, "");
        }

        function bytesToString(bytes) {
          assert(bytes !== null && _typeof(bytes) === "object" && bytes.length !== undefined, "Invalid argument for bytesToString");
          var length = bytes.length;
          var MAX_ARGUMENT_COUNT = 8192;

          if (length < MAX_ARGUMENT_COUNT) {
            return String.fromCharCode.apply(null, bytes);
          }

          var strBuf = [];

          for (var i = 0; i < length; i += MAX_ARGUMENT_COUNT) {
            var chunkEnd = Math.min(i + MAX_ARGUMENT_COUNT, length);
            var chunk = bytes.subarray(i, chunkEnd);
            strBuf.push(String.fromCharCode.apply(null, chunk));
          }

          return strBuf.join("");
        }

        function stringToBytes(str) {
          assert(typeof str === "string", "Invalid argument for stringToBytes");
          var length = str.length;
          var bytes = new Uint8Array(length);

          for (var i = 0; i < length; ++i) {
            bytes[i] = str.charCodeAt(i) & 0xff;
          }

          return bytes;
        }

        function arrayByteLength(arr) {
          if (arr.length !== undefined) {
            return arr.length;
          }

          assert(arr.byteLength !== undefined, "arrayByteLength - invalid argument.");
          return arr.byteLength;
        }

        function arraysToBytes(arr) {
          var length = arr.length;

          if (length === 1 && arr[0] instanceof Uint8Array) {
            return arr[0];
          }

          var resultLength = 0;

          for (var i = 0; i < length; i++) {
            resultLength += arrayByteLength(arr[i]);
          }

          var pos = 0;
          var data = new Uint8Array(resultLength);

          for (var _i = 0; _i < length; _i++) {
            var item = arr[_i];

            if (!(item instanceof Uint8Array)) {
              if (typeof item === "string") {
                item = stringToBytes(item);
              } else {
                item = new Uint8Array(item);
              }
            }

            var itemLength = item.byteLength;
            data.set(item, pos);
            pos += itemLength;
          }

          return data;
        }

        function string32(value) {
          return String.fromCharCode(value >> 24 & 0xff, value >> 16 & 0xff, value >> 8 & 0xff, value & 0xff);
        }

        function objectSize(obj) {
          return Object.keys(obj).length;
        }

        function objectFromMap(map) {
          var obj = Object.create(null);

          var _iterator = _createForOfIteratorHelper(map),
              _step;

          try {
            for (_iterator.s(); !(_step = _iterator.n()).done;) {
              var _step$value = _slicedToArray(_step.value, 2),
                  key = _step$value[0],
                  value = _step$value[1];

              obj[key] = value;
            }
          } catch (err) {
            _iterator.e(err);
          } finally {
            _iterator.f();
          }

          return obj;
        }

        function isLittleEndian() {
          var buffer8 = new Uint8Array(4);
          buffer8[0] = 1;
          var view32 = new Uint32Array(buffer8.buffer, 0, 1);
          return view32[0] === 1;
        }

        var IsLittleEndianCached = {
          get value() {
            return shadow(this, "value", isLittleEndian());
          }

        };
        exports.IsLittleEndianCached = IsLittleEndianCached;

        function isEvalSupported() {
          try {
            new Function("");
            return true;
          } catch (e) {
            return false;
          }
        }

        var IsEvalSupportedCached = {
          get value() {
            return shadow(this, "value", isEvalSupported());
          }

        };
        exports.IsEvalSupportedCached = IsEvalSupportedCached;

        var hexNumbers = _toConsumableArray(Array(256).keys()).map(function (n) {
          return n.toString(16).padStart(2, "0");
        });

        var Util = /*#__PURE__*/function () {
          function Util() {
            _classCallCheck(this, Util);
          }

          _createClass(Util, null, [{
            key: "makeHexColor",
            value: function makeHexColor(r, g, b) {
              return "#".concat(hexNumbers[r]).concat(hexNumbers[g]).concat(hexNumbers[b]);
            }
          }, {
            key: "transform",
            value: function transform(m1, m2) {
              return [m1[0] * m2[0] + m1[2] * m2[1], m1[1] * m2[0] + m1[3] * m2[1], m1[0] * m2[2] + m1[2] * m2[3], m1[1] * m2[2] + m1[3] * m2[3], m1[0] * m2[4] + m1[2] * m2[5] + m1[4], m1[1] * m2[4] + m1[3] * m2[5] + m1[5]];
            }
          }, {
            key: "applyTransform",
            value: function applyTransform(p, m) {
              var xt = p[0] * m[0] + p[1] * m[2] + m[4];
              var yt = p[0] * m[1] + p[1] * m[3] + m[5];
              return [xt, yt];
            }
          }, {
            key: "applyInverseTransform",
            value: function applyInverseTransform(p, m) {
              var d = m[0] * m[3] - m[1] * m[2];
              var xt = (p[0] * m[3] - p[1] * m[2] + m[2] * m[5] - m[4] * m[3]) / d;
              var yt = (-p[0] * m[1] + p[1] * m[0] + m[4] * m[1] - m[5] * m[0]) / d;
              return [xt, yt];
            }
          }, {
            key: "getAxialAlignedBoundingBox",
            value: function getAxialAlignedBoundingBox(r, m) {
              var p1 = Util.applyTransform(r, m);
              var p2 = Util.applyTransform(r.slice(2, 4), m);
              var p3 = Util.applyTransform([r[0], r[3]], m);
              var p4 = Util.applyTransform([r[2], r[1]], m);
              return [Math.min(p1[0], p2[0], p3[0], p4[0]), Math.min(p1[1], p2[1], p3[1], p4[1]), Math.max(p1[0], p2[0], p3[0], p4[0]), Math.max(p1[1], p2[1], p3[1], p4[1])];
            }
          }, {
            key: "inverseTransform",
            value: function inverseTransform(m) {
              var d = m[0] * m[3] - m[1] * m[2];
              return [m[3] / d, -m[1] / d, -m[2] / d, m[0] / d, (m[2] * m[5] - m[4] * m[3]) / d, (m[4] * m[1] - m[5] * m[0]) / d];
            }
          }, {
            key: "apply3dTransform",
            value: function apply3dTransform(m, v) {
              return [m[0] * v[0] + m[1] * v[1] + m[2] * v[2], m[3] * v[0] + m[4] * v[1] + m[5] * v[2], m[6] * v[0] + m[7] * v[1] + m[8] * v[2]];
            }
          }, {
            key: "singularValueDecompose2dScale",
            value: function singularValueDecompose2dScale(m) {
              var transpose = [m[0], m[2], m[1], m[3]];
              var a = m[0] * transpose[0] + m[1] * transpose[2];
              var b = m[0] * transpose[1] + m[1] * transpose[3];
              var c = m[2] * transpose[0] + m[3] * transpose[2];
              var d = m[2] * transpose[1] + m[3] * transpose[3];
              var first = (a + d) / 2;
              var second = Math.sqrt(Math.pow(a + d, 2) - 4 * (a * d - c * b)) / 2;
              var sx = first + second || 1;
              var sy = first - second || 1;
              return [Math.sqrt(sx), Math.sqrt(sy)];
            }
          }, {
            key: "normalizeRect",
            value: function normalizeRect(rect) {
              var r = rect.slice(0);

              if (rect[0] > rect[2]) {
                r[0] = rect[2];
                r[2] = rect[0];
              }

              if (rect[1] > rect[3]) {
                r[1] = rect[3];
                r[3] = rect[1];
              }

              return r;
            }
          }, {
            key: "intersect",
            value: function intersect(rect1, rect2) {
              function compare(a, b) {
                return a - b;
              }

              var orderedX = [rect1[0], rect1[2], rect2[0], rect2[2]].sort(compare);
              var orderedY = [rect1[1], rect1[3], rect2[1], rect2[3]].sort(compare);
              var result = [];
              rect1 = Util.normalizeRect(rect1);
              rect2 = Util.normalizeRect(rect2);

              if (orderedX[0] === rect1[0] && orderedX[1] === rect2[0] || orderedX[0] === rect2[0] && orderedX[1] === rect1[0]) {
                result[0] = orderedX[1];
                result[2] = orderedX[2];
              } else {
                return null;
              }

              if (orderedY[0] === rect1[1] && orderedY[1] === rect2[1] || orderedY[0] === rect2[1] && orderedY[1] === rect1[1]) {
                result[1] = orderedY[1];
                result[3] = orderedY[2];
              } else {
                return null;
              }

              return result;
            }
          }]);

          return Util;
        }();

        exports.Util = Util;
        var PDFStringTranslateTable = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2d8, 0x2c7, 0x2c6, 0x2d9, 0x2dd, 0x2db, 0x2da, 0x2dc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2022, 0x2020, 0x2021, 0x2026, 0x2014, 0x2013, 0x192, 0x2044, 0x2039, 0x203a, 0x2212, 0x2030, 0x201e, 0x201c, 0x201d, 0x2018, 0x2019, 0x201a, 0x2122, 0xfb01, 0xfb02, 0x141, 0x152, 0x160, 0x178, 0x17d, 0x131, 0x142, 0x153, 0x161, 0x17e, 0, 0x20ac];

        function stringToPDFString(str) {
          var length = str.length,
              strBuf = [];

          if (str[0] === "\xFE" && str[1] === "\xFF") {
            for (var i = 2; i < length; i += 2) {
              strBuf.push(String.fromCharCode(str.charCodeAt(i) << 8 | str.charCodeAt(i + 1)));
            }
          } else if (str[0] === "\xFF" && str[1] === "\xFE") {
            for (var _i2 = 2; _i2 < length; _i2 += 2) {
              strBuf.push(String.fromCharCode(str.charCodeAt(_i2 + 1) << 8 | str.charCodeAt(_i2)));
            }
          } else {
            for (var _i3 = 0; _i3 < length; ++_i3) {
              var code = PDFStringTranslateTable[str.charCodeAt(_i3)];
              strBuf.push(code ? String.fromCharCode(code) : str.charAt(_i3));
            }
          }

          return strBuf.join("");
        }

        function escapeString(str) {
          return str.replace(/([()\\\n\r])/g, function (match) {
            if (match === "\n") {
              return "\\n";
            } else if (match === "\r") {
              return "\\r";
            }

            return "\\".concat(match);
          });
        }

        function isAscii(str) {
          return /^[\x00-\x7F]*$/.test(str);
        }

        function stringToUTF16BEString(str) {
          var buf = ["\xFE\xFF"];

          for (var i = 0, ii = str.length; i < ii; i++) {
            var _char = str.charCodeAt(i);

            buf.push(String.fromCharCode(_char >> 8 & 0xff), String.fromCharCode(_char & 0xff));
          }

          return buf.join("");
        }

        function stringToUTF8String(str) {
          return decodeURIComponent(escape(str));
        }

        function utf8StringToString(str) {
          return unescape(encodeURIComponent(str));
        }

        function isBool(v) {
          return typeof v === "boolean";
        }

        function isNum(v) {
          return typeof v === "number";
        }

        function isString(v) {
          return typeof v === "string";
        }

        function isArrayBuffer(v) {
          return _typeof(v) === "object" && v !== null && v.byteLength !== undefined;
        }

        function isArrayEqual(arr1, arr2) {
          if (arr1.length !== arr2.length) {
            return false;
          }

          for (var i = 0, ii = arr1.length; i < ii; i++) {
            if (arr1[i] !== arr2[i]) {
              return false;
            }
          }

          return true;
        }

        function getModificationDate() {
          var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Date();
          var buffer = [date.getUTCFullYear().toString(), (date.getUTCMonth() + 1).toString().padStart(2, "0"), date.getUTCDate().toString().padStart(2, "0"), date.getUTCHours().toString().padStart(2, "0"), date.getUTCMinutes().toString().padStart(2, "0"), date.getUTCSeconds().toString().padStart(2, "0")];
          return buffer.join("");
        }

        function createPromiseCapability() {
          var capability = Object.create(null);
          var isSettled = false;
          Object.defineProperty(capability, "settled", {
            get: function get() {
              return isSettled;
            }
          });
          capability.promise = new Promise(function (resolve, reject) {
            capability.resolve = function (data) {
              isSettled = true;
              resolve(data);
            };

            capability.reject = function (reason) {
              isSettled = true;
              reject(reason);
            };
          });
          return capability;
        }

        function createObjectURL(data) {
          var contentType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
          var forceDataSchema = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;

          if (URL.createObjectURL && !forceDataSchema) {
            return URL.createObjectURL(new Blob([data], {
              type: contentType
            }));
          }

          var digits = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
          var buffer = "data:".concat(contentType, ";base64,");

          for (var i = 0, ii = data.length; i < ii; i += 3) {
            var b1 = data[i] & 0xff;
            var b2 = data[i + 1] & 0xff;
            var b3 = data[i + 2] & 0xff;
            var d1 = b1 >> 2,
                d2 = (b1 & 3) << 4 | b2 >> 4;
            var d3 = i + 1 < ii ? (b2 & 0xf) << 2 | b3 >> 6 : 64;
            var d4 = i + 2 < ii ? b3 & 0x3f : 64;
            buffer += digits[d1] + digits[d2] + digits[d3] + digits[d4];
          }

          return buffer;
        }
        /***/

      },
      /* 5 */

      /***/
      function (__unused_webpack_module, __unused_webpack_exports, __w_pdfjs_require__) {
        "use strict";

        var _is_node = __w_pdfjs_require__(6);

        if (typeof globalThis === "undefined" || !globalThis._pdfjsCompatibilityChecked) {
          if (typeof globalThis === "undefined" || globalThis.Math !== Math) {
            globalThis = __w_pdfjs_require__(7);
          }

          globalThis._pdfjsCompatibilityChecked = true;

          (function checkNodeBtoa() {
            if (globalThis.btoa || !_is_node.isNodeJS) {
              return;
            }

            globalThis.btoa = function (chars) {
              return Buffer.from(chars, "binary").toString("base64");
            };
          })();

          (function checkNodeAtob() {
            if (globalThis.atob || !_is_node.isNodeJS) {
              return;
            }

            globalThis.atob = function (input) {
              return Buffer.from(input, "base64").toString("binary");
            };
          })();

          (function checkDOMMatrix() {
            if (globalThis.DOMMatrix || !_is_node.isNodeJS) {
              return;
            }

            globalThis.DOMMatrix = __w_pdfjs_require__(60);
          })();

          (function checkObjectFromEntries() {
            if (Object.fromEntries) {
              return;
            }

            __w_pdfjs_require__(61);
          })();

          (function checkPromise() {
            if (globalThis.Promise.allSettled) {
              return;
            }

            globalThis.Promise = __w_pdfjs_require__(89);
          })();

          (function checkReadableStream() {
            if (globalThis.ReadableStream || !_is_node.isNodeJS) {
              return;
            }

            globalThis.ReadableStream = __w_pdfjs_require__(117).ReadableStream;
          })();
        }
        /***/

      },
      /* 6 */

      /***/
      function (__unused_webpack_module, exports) {
        "use strict";

        Object.defineProperty(exports, "__esModule", {
          value: true
        });
        exports.isNodeJS = void 0;

        function _typeof(obj) {
          "@babel/helpers - typeof";

          if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
            _typeof = function _typeof(obj) {
              return typeof obj;
            };
          } else {
            _typeof = function _typeof(obj) {
              return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
            };
          }

          return _typeof(obj);
        }

        var isNodeJS = (typeof process === "undefined" ? "undefined" : _typeof(process)) === "object" && process + "" === "[object process]" && !process.versions.nw && !(process.versions.electron && process.type && process.type !== "browser");
        exports.isNodeJS = isNodeJS;
        /***/
      },
      /* 7 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        __w_pdfjs_require__(8);

        module.exports = __w_pdfjs_require__(10);
        /***/
      },
      /* 8 */

      /***/
      function (__unused_webpack_module, __unused_webpack_exports, __w_pdfjs_require__) {
        var $ = __w_pdfjs_require__(9);

        var global = __w_pdfjs_require__(10);

        $({
          global: true
        }, {
          globalThis: global
        });
        /***/
      },
      /* 9 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var global = __w_pdfjs_require__(10);

        var getOwnPropertyDescriptor = __w_pdfjs_require__(11).f;

        var createNonEnumerableProperty = __w_pdfjs_require__(40);

        var redefine = __w_pdfjs_require__(43);

        var setGlobal = __w_pdfjs_require__(34);

        var copyConstructorProperties = __w_pdfjs_require__(49);

        var isForced = __w_pdfjs_require__(59);

        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 = global;
          } else if (STATIC) {
            target = global[TARGET] || setGlobal(TARGET, {});
          } else {
            target = (global[TARGET] || {}).prototype;
          }

          if (target) for (key in source) {
            sourceProperty = source[key];

            if (options.noTargetGet) {
              descriptor = getOwnPropertyDescriptor(target, key);
              targetProperty = descriptor && descriptor.value;
            } else targetProperty = target[key];

            FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);

            if (!FORCED && targetProperty !== undefined) {
              if (typeof sourceProperty === typeof targetProperty) continue;
              copyConstructorProperties(sourceProperty, targetProperty);
            }

            if (options.sham || targetProperty && targetProperty.sham) {
              createNonEnumerableProperty(sourceProperty, 'sham', true);
            }

            redefine(target, key, sourceProperty, options);
          }
        };
        /***/

      },
      /* 10 */

      /***/
      function (module) {
        var check = function check(it) {
          return it && it.Math == Math && it;
        };

        module.exports = check(typeof globalThis == 'object' && globalThis) || check(typeof window == 'object' && window) || check(typeof self == 'object' && self) || check(typeof __webpack_require__.g == 'object' && __webpack_require__.g) || function () {
          return this;
        }() || Function('return this')();
        /***/

      },
      /* 11 */

      /***/
      function (__unused_webpack_module, exports, __w_pdfjs_require__) {
        var DESCRIPTORS = __w_pdfjs_require__(12);

        var propertyIsEnumerableModule = __w_pdfjs_require__(14);

        var createPropertyDescriptor = __w_pdfjs_require__(15);

        var toIndexedObject = __w_pdfjs_require__(16);

        var toPropertyKey = __w_pdfjs_require__(20);

        var has = __w_pdfjs_require__(35);

        var IE8_DOM_DEFINE = __w_pdfjs_require__(38);

        var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
        exports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
          O = toIndexedObject(O);
          P = toPropertyKey(P);
          if (IE8_DOM_DEFINE) try {
            return $getOwnPropertyDescriptor(O, P);
          } catch (error) {}
          if (has(O, P)) return createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O, P), O[P]);
        };
        /***/
      },
      /* 12 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var fails = __w_pdfjs_require__(13);

        module.exports = !fails(function () {
          return Object.defineProperty({}, 1, {
            get: function get() {
              return 7;
            }
          })[1] != 7;
        });
        /***/
      },
      /* 13 */

      /***/
      function (module) {
        module.exports = function (exec) {
          try {
            return !!exec();
          } catch (error) {
            return true;
          }
        };
        /***/

      },
      /* 14 */

      /***/
      function (__unused_webpack_module, exports) {
        "use strict";

        var $propertyIsEnumerable = {}.propertyIsEnumerable;
        var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
        var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({
          1: 2
        }, 1);
        exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
          var descriptor = getOwnPropertyDescriptor(this, V);
          return !!descriptor && descriptor.enumerable;
        } : $propertyIsEnumerable;
        /***/
      },
      /* 15 */

      /***/
      function (module) {
        module.exports = function (bitmap, value) {
          return {
            enumerable: !(bitmap & 1),
            configurable: !(bitmap & 2),
            writable: !(bitmap & 4),
            value: value
          };
        };
        /***/

      },
      /* 16 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var IndexedObject = __w_pdfjs_require__(17);

        var requireObjectCoercible = __w_pdfjs_require__(19);

        module.exports = function (it) {
          return IndexedObject(requireObjectCoercible(it));
        };
        /***/

      },
      /* 17 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var fails = __w_pdfjs_require__(13);

        var classof = __w_pdfjs_require__(18);

        var split = ''.split;
        module.exports = fails(function () {
          return !Object('z').propertyIsEnumerable(0);
        }) ? function (it) {
          return classof(it) == 'String' ? split.call(it, '') : Object(it);
        } : Object;
        /***/
      },
      /* 18 */

      /***/
      function (module) {
        var toString = {}.toString;

        module.exports = function (it) {
          return toString.call(it).slice(8, -1);
        };
        /***/

      },
      /* 19 */

      /***/
      function (module) {
        module.exports = function (it) {
          if (it == undefined) throw TypeError("Can't call method on " + it);
          return it;
        };
        /***/

      },
      /* 20 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var toPrimitive = __w_pdfjs_require__(21);

        var isSymbol = __w_pdfjs_require__(23);

        module.exports = function (argument) {
          var key = toPrimitive(argument, 'string');
          return isSymbol(key) ? key : String(key);
        };
        /***/

      },
      /* 21 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var isObject = __w_pdfjs_require__(22);

        var isSymbol = __w_pdfjs_require__(23);

        var ordinaryToPrimitive = __w_pdfjs_require__(29);

        var wellKnownSymbol = __w_pdfjs_require__(30);

        var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');

        module.exports = function (input, pref) {
          if (!isObject(input) || isSymbol(input)) return input;
          var exoticToPrim = input[TO_PRIMITIVE];
          var result;

          if (exoticToPrim !== undefined) {
            if (pref === undefined) pref = 'default';
            result = exoticToPrim.call(input, pref);
            if (!isObject(result) || isSymbol(result)) return result;
            throw TypeError("Can't convert object to primitive value");
          }

          if (pref === undefined) pref = 'number';
          return ordinaryToPrimitive(input, pref);
        };
        /***/

      },
      /* 22 */

      /***/
      function (module) {
        module.exports = function (it) {
          return typeof it === 'object' ? it !== null : typeof it === 'function';
        };
        /***/

      },
      /* 23 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var getBuiltIn = __w_pdfjs_require__(24);

        var USE_SYMBOL_AS_UID = __w_pdfjs_require__(25);

        module.exports = USE_SYMBOL_AS_UID ? function (it) {
          return typeof it == 'symbol';
        } : function (it) {
          var $Symbol = getBuiltIn('Symbol');
          return typeof $Symbol == 'function' && Object(it) instanceof $Symbol;
        };
        /***/
      },
      /* 24 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var global = __w_pdfjs_require__(10);

        var aFunction = function aFunction(variable) {
          return typeof variable == 'function' ? variable : undefined;
        };

        module.exports = function (namespace, method) {
          return arguments.length < 2 ? aFunction(global[namespace]) : global[namespace] && global[namespace][method];
        };
        /***/

      },
      /* 25 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var NATIVE_SYMBOL = __w_pdfjs_require__(26);

        module.exports = NATIVE_SYMBOL && !Symbol.sham && typeof Symbol.iterator == 'symbol';
        /***/
      },
      /* 26 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var V8_VERSION = __w_pdfjs_require__(27);

        var fails = __w_pdfjs_require__(13);

        module.exports = !!Object.getOwnPropertySymbols && !fails(function () {
          var symbol = Symbol();
          return !String(symbol) || !(Object(symbol) instanceof Symbol) || !Symbol.sham && V8_VERSION && V8_VERSION < 41;
        });
        /***/
      },
      /* 27 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var global = __w_pdfjs_require__(10);

        var userAgent = __w_pdfjs_require__(28);

        var process = global.process;
        var Deno = global.Deno;
        var versions = process && process.versions || Deno && Deno.version;
        var v8 = versions && versions.v8;
        var match, version;

        if (v8) {
          match = v8.split('.');
          version = match[0] < 4 ? 1 : match[0] + match[1];
        } else if (userAgent) {
          match = userAgent.match(/Edge\/(\d+)/);

          if (!match || match[1] >= 74) {
            match = userAgent.match(/Chrome\/(\d+)/);
            if (match) version = match[1];
          }
        }

        module.exports = version && +version;
        /***/
      },
      /* 28 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var getBuiltIn = __w_pdfjs_require__(24);

        module.exports = getBuiltIn('navigator', 'userAgent') || '';
        /***/
      },
      /* 29 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var isObject = __w_pdfjs_require__(22);

        module.exports = function (input, pref) {
          var fn, val;
          if (pref === 'string' && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
          if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
          if (pref !== 'string' && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
          throw TypeError("Can't convert object to primitive value");
        };
        /***/

      },
      /* 30 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var global = __w_pdfjs_require__(10);

        var shared = __w_pdfjs_require__(31);

        var has = __w_pdfjs_require__(35);

        var uid = __w_pdfjs_require__(37);

        var NATIVE_SYMBOL = __w_pdfjs_require__(26);

        var USE_SYMBOL_AS_UID = __w_pdfjs_require__(25);

        var WellKnownSymbolsStore = shared('wks');
        var Symbol = global.Symbol;
        var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid;

        module.exports = function (name) {
          if (!has(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
            if (NATIVE_SYMBOL && has(Symbol, name)) {
              WellKnownSymbolsStore[name] = Symbol[name];
            } else {
              WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
            }
          }

          return WellKnownSymbolsStore[name];
        };
        /***/

      },
      /* 31 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var IS_PURE = __w_pdfjs_require__(32);

        var store = __w_pdfjs_require__(33);

        (module.exports = function (key, value) {
          return store[key] || (store[key] = value !== undefined ? value : {});
        })('versions', []).push({
          version: '3.17.3',
          mode: IS_PURE ? 'pure' : 'global',
          copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
        });
        /***/
      },
      /* 32 */

      /***/
      function (module) {
        module.exports = false;
        /***/
      },
      /* 33 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var global = __w_pdfjs_require__(10);

        var setGlobal = __w_pdfjs_require__(34);

        var SHARED = '__core-js_shared__';
        var store = global[SHARED] || setGlobal(SHARED, {});
        module.exports = store;
        /***/
      },
      /* 34 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var global = __w_pdfjs_require__(10);

        module.exports = function (key, value) {
          try {
            Object.defineProperty(global, key, {
              value: value,
              configurable: true,
              writable: true
            });
          } catch (error) {
            global[key] = value;
          }

          return value;
        };
        /***/

      },
      /* 35 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var toObject = __w_pdfjs_require__(36);

        var hasOwnProperty = {}.hasOwnProperty;

        module.exports = Object.hasOwn || function hasOwn(it, key) {
          return hasOwnProperty.call(toObject(it), key);
        };
        /***/

      },
      /* 36 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var requireObjectCoercible = __w_pdfjs_require__(19);

        module.exports = function (argument) {
          return Object(requireObjectCoercible(argument));
        };
        /***/

      },
      /* 37 */

      /***/
      function (module) {
        var id = 0;
        var postfix = Math.random();

        module.exports = function (key) {
          return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
        };
        /***/

      },
      /* 38 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var DESCRIPTORS = __w_pdfjs_require__(12);

        var fails = __w_pdfjs_require__(13);

        var createElement = __w_pdfjs_require__(39);

        module.exports = !DESCRIPTORS && !fails(function () {
          return Object.defineProperty(createElement('div'), 'a', {
            get: function get() {
              return 7;
            }
          }).a != 7;
        });
        /***/
      },
      /* 39 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var global = __w_pdfjs_require__(10);

        var isObject = __w_pdfjs_require__(22);

        var document = global.document;
        var EXISTS = isObject(document) && isObject(document.createElement);

        module.exports = function (it) {
          return EXISTS ? document.createElement(it) : {};
        };
        /***/

      },
      /* 40 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var DESCRIPTORS = __w_pdfjs_require__(12);

        var definePropertyModule = __w_pdfjs_require__(41);

        var createPropertyDescriptor = __w_pdfjs_require__(15);

        module.exports = DESCRIPTORS ? function (object, key, value) {
          return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
        } : function (object, key, value) {
          object[key] = value;
          return object;
        };
        /***/
      },
      /* 41 */

      /***/
      function (__unused_webpack_module, exports, __w_pdfjs_require__) {
        var DESCRIPTORS = __w_pdfjs_require__(12);

        var IE8_DOM_DEFINE = __w_pdfjs_require__(38);

        var anObject = __w_pdfjs_require__(42);

        var toPropertyKey = __w_pdfjs_require__(20);

        var $defineProperty = Object.defineProperty;
        exports.f = DESCRIPTORS ? $defineProperty : function defineProperty(O, P, Attributes) {
          anObject(O);
          P = toPropertyKey(P);
          anObject(Attributes);
          if (IE8_DOM_DEFINE) try {
            return $defineProperty(O, P, Attributes);
          } catch (error) {}
          if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
          if ('value' in Attributes) O[P] = Attributes.value;
          return O;
        };
        /***/
      },
      /* 42 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var isObject = __w_pdfjs_require__(22);

        module.exports = function (it) {
          if (!isObject(it)) {
            throw TypeError(String(it) + ' is not an object');
          }

          return it;
        };
        /***/

      },
      /* 43 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var global = __w_pdfjs_require__(10);

        var createNonEnumerableProperty = __w_pdfjs_require__(40);

        var has = __w_pdfjs_require__(35);

        var setGlobal = __w_pdfjs_require__(34);

        var inspectSource = __w_pdfjs_require__(44);

        var InternalStateModule = __w_pdfjs_require__(45);

        var getInternalState = InternalStateModule.get;
        var enforceInternalState = InternalStateModule.enforce;
        var TEMPLATE = String(String).split('String');
        (module.exports = function (O, key, value, options) {
          var unsafe = options ? !!options.unsafe : false;
          var simple = options ? !!options.enumerable : false;
          var noTargetGet = options ? !!options.noTargetGet : false;
          var state;

          if (typeof value == 'function') {
            if (typeof key == 'string' && !has(value, 'name')) {
              createNonEnumerableProperty(value, 'name', key);
            }

            state = enforceInternalState(value);

            if (!state.source) {
              state.source = TEMPLATE.join(typeof key == 'string' ? key : '');
            }
          }

          if (O === global) {
            if (simple) O[key] = value;else setGlobal(key, value);
            return;
          } else if (!unsafe) {
            delete O[key];
          } else if (!noTargetGet && O[key]) {
            simple = true;
          }

          if (simple) O[key] = value;else createNonEnumerableProperty(O, key, value);
        })(Function.prototype, 'toString', function toString() {
          return typeof this == 'function' && getInternalState(this).source || inspectSource(this);
        });
        /***/
      },
      /* 44 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var store = __w_pdfjs_require__(33);

        var functionToString = Function.toString;

        if (typeof store.inspectSource != 'function') {
          store.inspectSource = function (it) {
            return functionToString.call(it);
          };
        }

        module.exports = store.inspectSource;
        /***/
      },
      /* 45 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var NATIVE_WEAK_MAP = __w_pdfjs_require__(46);

        var global = __w_pdfjs_require__(10);

        var isObject = __w_pdfjs_require__(22);

        var createNonEnumerableProperty = __w_pdfjs_require__(40);

        var objectHas = __w_pdfjs_require__(35);

        var shared = __w_pdfjs_require__(33);

        var sharedKey = __w_pdfjs_require__(47);

        var hiddenKeys = __w_pdfjs_require__(48);

        var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
        var WeakMap = global.WeakMap;
        var set, get, has;

        var enforce = function enforce(it) {
          return has(it) ? get(it) : set(it, {});
        };

        var getterFor = function getterFor(TYPE) {
          return function (it) {
            var state;

            if (!isObject(it) || (state = get(it)).type !== TYPE) {
              throw TypeError('Incompatible receiver, ' + TYPE + ' required');
            }

            return state;
          };
        };

        if (NATIVE_WEAK_MAP || shared.state) {
          var store = shared.state || (shared.state = new WeakMap());
          var wmget = store.get;
          var wmhas = store.has;
          var wmset = store.set;

          set = function set(it, metadata) {
            if (wmhas.call(store, it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
            metadata.facade = it;
            wmset.call(store, it, metadata);
            return metadata;
          };

          get = function get(it) {
            return wmget.call(store, it) || {};
          };

          has = function has(it) {
            return wmhas.call(store, it);
          };
        } else {
          var STATE = sharedKey('state');
          hiddenKeys[STATE] = true;

          set = function set(it, metadata) {
            if (objectHas(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
            metadata.facade = it;
            createNonEnumerableProperty(it, STATE, metadata);
            return metadata;
          };

          get = function get(it) {
            return objectHas(it, STATE) ? it[STATE] : {};
          };

          has = function has(it) {
            return objectHas(it, STATE);
          };
        }

        module.exports = {
          set: set,
          get: get,
          has: has,
          enforce: enforce,
          getterFor: getterFor
        };
        /***/
      },
      /* 46 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var global = __w_pdfjs_require__(10);

        var inspectSource = __w_pdfjs_require__(44);

        var WeakMap = global.WeakMap;
        module.exports = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap));
        /***/
      },
      /* 47 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var shared = __w_pdfjs_require__(31);

        var uid = __w_pdfjs_require__(37);

        var keys = shared('keys');

        module.exports = function (key) {
          return keys[key] || (keys[key] = uid(key));
        };
        /***/

      },
      /* 48 */

      /***/
      function (module) {
        module.exports = {};
        /***/
      },
      /* 49 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var has = __w_pdfjs_require__(35);

        var ownKeys = __w_pdfjs_require__(50);

        var getOwnPropertyDescriptorModule = __w_pdfjs_require__(11);

        var definePropertyModule = __w_pdfjs_require__(41);

        module.exports = function (target, source) {
          var keys = ownKeys(source);
          var defineProperty = definePropertyModule.f;
          var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;

          for (var i = 0; i < keys.length; i++) {
            var key = keys[i];
            if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
          }
        };
        /***/

      },
      /* 50 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var getBuiltIn = __w_pdfjs_require__(24);

        var getOwnPropertyNamesModule = __w_pdfjs_require__(51);

        var getOwnPropertySymbolsModule = __w_pdfjs_require__(58);

        var anObject = __w_pdfjs_require__(42);

        module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
          var keys = getOwnPropertyNamesModule.f(anObject(it));
          var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
          return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
        };
        /***/

      },
      /* 51 */

      /***/
      function (__unused_webpack_module, exports, __w_pdfjs_require__) {
        var internalObjectKeys = __w_pdfjs_require__(52);

        var enumBugKeys = __w_pdfjs_require__(57);

        var hiddenKeys = enumBugKeys.concat('length', 'prototype');

        exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
          return internalObjectKeys(O, hiddenKeys);
        };
        /***/

      },
      /* 52 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var has = __w_pdfjs_require__(35);

        var toIndexedObject = __w_pdfjs_require__(16);

        var indexOf = __w_pdfjs_require__(53).indexOf;

        var hiddenKeys = __w_pdfjs_require__(48);

        module.exports = function (object, names) {
          var O = toIndexedObject(object);
          var i = 0;
          var result = [];
          var key;

          for (key in O) {
            !has(hiddenKeys, key) && has(O, key) && result.push(key);
          }

          while (names.length > i) {
            if (has(O, key = names[i++])) {
              ~indexOf(result, key) || result.push(key);
            }
          }

          return result;
        };
        /***/

      },
      /* 53 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var toIndexedObject = __w_pdfjs_require__(16);

        var toLength = __w_pdfjs_require__(54);

        var toAbsoluteIndex = __w_pdfjs_require__(56);

        var createMethod = function createMethod(IS_INCLUDES) {
          return function ($this, el, fromIndex) {
            var O = toIndexedObject($this);
            var length = toLength(O.length);
            var index = toAbsoluteIndex(fromIndex, length);
            var value;
            if (IS_INCLUDES && el != el) while (length > index) {
              value = O[index++];
              if (value != value) return true;
            } else for (; length > index; index++) {
              if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
            }
            return !IS_INCLUDES && -1;
          };
        };

        module.exports = {
          includes: createMethod(true),
          indexOf: createMethod(false)
        };
        /***/
      },
      /* 54 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var toInteger = __w_pdfjs_require__(55);

        var min = Math.min;

        module.exports = function (argument) {
          return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0;
        };
        /***/

      },
      /* 55 */

      /***/
      function (module) {
        var ceil = Math.ceil;
        var floor = Math.floor;

        module.exports = function (argument) {
          return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
        };
        /***/

      },
      /* 56 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var toInteger = __w_pdfjs_require__(55);

        var max = Math.max;
        var min = Math.min;

        module.exports = function (index, length) {
          var integer = toInteger(index);
          return integer < 0 ? max(integer + length, 0) : min(integer, length);
        };
        /***/

      },
      /* 57 */

      /***/
      function (module) {
        module.exports = ['constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf'];
        /***/
      },
      /* 58 */

      /***/
      function (__unused_webpack_module, exports) {
        exports.f = Object.getOwnPropertySymbols;
        /***/
      },
      /* 59 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var fails = __w_pdfjs_require__(13);

        var replacement = /#|\.prototype\./;

        var isForced = function isForced(feature, detection) {
          var value = data[normalize(feature)];
          return value == POLYFILL ? true : value == NATIVE ? false : typeof detection == 'function' ? fails(detection) : !!detection;
        };

        var normalize = isForced.normalize = function (string) {
          return String(string).replace(replacement, '.').toLowerCase();
        };

        var data = isForced.data = {};
        var NATIVE = isForced.NATIVE = 'N';
        var POLYFILL = isForced.POLYFILL = 'P';
        module.exports = isForced;
        /***/
      },
      /* 60 */

      /***/
      function (module, exports, __w_pdfjs_require__) {
        "use strict";

        var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;

        function _typeof(obj) {
          "@babel/helpers - typeof";

          if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
            _typeof = function _typeof(obj) {
              return typeof obj;
            };
          } else {
            _typeof = function _typeof(obj) {
              return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
            };
          }

          return _typeof(obj);
        }

        (function (global, factory) {
          ( false ? 0 : _typeof(exports)) === 'object' && "object" !== 'undefined' ? module.exports = factory() :  true ? !(__WEBPACK_AMD_DEFINE_FACTORY__ = factory, __WEBPACK_AMD_DEFINE_RESULT__ = typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? __WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __w_pdfjs_require__, exports, module) : __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : 0;
        })(void 0, function () {
          'use strict';

          var CSSMatrix = function CSSMatrix() {
            var args = [],
                len = arguments.length;

            while (len--) {
              args[len] = arguments[len];
            }

            this.setIdentity();
            return args && args.length && this.setMatrixValue(args);
          };

          var prototypeAccessors = {
            isIdentity: {
              configurable: true
            },
            is2D: {
              configurable: true
            }
          };

          prototypeAccessors.isIdentity.get = function () {
            var m = this;
            return m.m11 === 1 && m.m12 === 0 && m.m13 === 0 && m.m14 === 0 && m.m21 === 0 && m.m22 === 1 && m.m23 === 0 && m.m24 === 0 && m.m31 === 0 && m.m32 === 0 && m.m33 === 1 && m.m34 === 0 && m.m41 === 0 && m.m42 === 0 && m.m43 === 0 && m.m44 === 1;
          };

          prototypeAccessors.isIdentity.set = function (value) {
            this.isIdentity = value;
          };

          prototypeAccessors.is2D.get = function () {
            var m = this;
            return m.m31 === 0 && m.m32 === 0 && m.m33 === 1 && m.m34 === 0 && m.m43 === 0 && m.m44 === 1;
          };

          prototypeAccessors.is2D.set = function (value) {
            this.is2D = value;
          };

          Object.defineProperties(CSSMatrix.prototype, prototypeAccessors);
          var CSSMatrixProto = CSSMatrix.prototype;

          function Translate(x, y, z) {
            var m = new CSSMatrix();
            m.m41 = x;
            m.e = x;
            m.m42 = y;
            m.f = y;
            m.m43 = z;
            return m;
          }

          function Rotate(rx, ry, rz) {
            var m = new CSSMatrix();
            var radX = rx * Math.PI / 180;
            var radY = ry * Math.PI / 180;
            var radZ = rz * Math.PI / 180;
            var cosx = Math.cos(radX);
            var sinx = -Math.sin(radX);
            var cosy = Math.cos(radY);
            var siny = -Math.sin(radY);
            var cosz = Math.cos(radZ);
            var sinz = -Math.sin(radZ);
            var cycz = cosy * cosz;
            var cysz = -cosy * sinz;
            m.m11 = cycz;
            m.a = cycz;
            m.m12 = cysz;
            m.b = cysz;
            m.m13 = siny;
            var sxsy = sinx * siny * cosz + cosx * sinz;
            m.m21 = sxsy;
            m.c = sxsy;
            var cxcz = cosx * cosz - sinx * siny * sinz;
            m.m22 = cxcz;
            m.d = cxcz;
            m.m23 = -sinx * cosy;
            m.m31 = sinx * sinz - cosx * siny * cosz;
            m.m32 = sinx * cosz + cosx * siny * sinz;
            m.m33 = cosx * cosy;
            return m;
          }

          function RotateAxisAngle(x, y, z, angle) {
            var m = new CSSMatrix();
            var radA = angle * Math.PI / 360;
            var sinA = Math.sin(radA);
            var cosA = Math.cos(radA);
            var sinA2 = sinA * sinA;
            var length = Math.sqrt(x * x + y * y + z * z);
            var X = 0;
            var Y = 0;
            var Z = 1;

            if (length !== 0) {
              X = x / length;
              Y = y / length;
              Z = z / length;
            }

            var x2 = X * X;
            var y2 = Y * Y;
            var z2 = Z * Z;
            var m11 = 1 - 2 * (y2 + z2) * sinA2;
            m.m11 = m11;
            m.a = m11;
            var m12 = 2 * (x * y * sinA2 + z * sinA * cosA);
            m.m12 = m12;
            m.b = m12;
            m.m13 = 2 * (x * z * sinA2 - y * sinA * cosA);
            var m21 = 2 * (y * x * sinA2 - z * sinA * cosA);
            m.m21 = m21;
            m.c = m21;
            var m22 = 1 - 2 * (z2 + x2) * sinA2;
            m.m22 = m22;
            m.d = m22;
            m.m23 = 2 * (y * z * sinA2 + x * sinA * cosA);
            m.m31 = 2 * (z * x * sinA2 + y * sinA * cosA);
            m.m32 = 2 * (z * y * sinA2 - x * sinA * cosA);
            m.m33 = 1 - 2 * (x2 + y2) * sinA2;
            m.m14 = 0;
            m.m24 = 0;
            m.m34 = 0;
            m.m41 = 0;
            m.e = 0;
            m.m42 = 0;
            m.f = 0;
            m.m43 = 0;
            m.m44 = 1;
            return m;
          }

          function Scale(x, y, z) {
            var m = new CSSMatrix();
            m.m11 = x;
            m.a = x;
            m.m22 = y;
            m.d = y;
            m.m33 = z;
            return m;
          }

          function SkewX(angle) {
            var radA = angle * Math.PI / 180;
            var m = new CSSMatrix();
            var t = Math.tan(radA);
            m.m21 = t;
            m.c = t;
            return m;
          }

          function SkewY(angle) {
            var radA = angle * Math.PI / 180;
            var m = new CSSMatrix();
            var t = Math.tan(radA);
            m.m12 = t;
            m.b = t;
            return m;
          }

          function Multiply(m1, m2) {
            var m11 = m2.m11 * m1.m11 + m2.m12 * m1.m21 + m2.m13 * m1.m31 + m2.m14 * m1.m41;
            var m12 = m2.m11 * m1.m12 + m2.m12 * m1.m22 + m2.m13 * m1.m32 + m2.m14 * m1.m42;
            var m13 = m2.m11 * m1.m13 + m2.m12 * m1.m23 + m2.m13 * m1.m33 + m2.m14 * m1.m43;
            var m14 = m2.m11 * m1.m14 + m2.m12 * m1.m24 + m2.m13 * m1.m34 + m2.m14 * m1.m44;
            var m21 = m2.m21 * m1.m11 + m2.m22 * m1.m21 + m2.m23 * m1.m31 + m2.m24 * m1.m41;
            var m22 = m2.m21 * m1.m12 + m2.m22 * m1.m22 + m2.m23 * m1.m32 + m2.m24 * m1.m42;
            var m23 = m2.m21 * m1.m13 + m2.m22 * m1.m23 + m2.m23 * m1.m33 + m2.m24 * m1.m43;
            var m24 = m2.m21 * m1.m14 + m2.m22 * m1.m24 + m2.m23 * m1.m34 + m2.m24 * m1.m44;
            var m31 = m2.m31 * m1.m11 + m2.m32 * m1.m21 + m2.m33 * m1.m31 + m2.m34 * m1.m41;
            var m32 = m2.m31 * m1.m12 + m2.m32 * m1.m22 + m2.m33 * m1.m32 + m2.m34 * m1.m42;
            var m33 = m2.m31 * m1.m13 + m2.m32 * m1.m23 + m2.m33 * m1.m33 + m2.m34 * m1.m43;
            var m34 = m2.m31 * m1.m14 + m2.m32 * m1.m24 + m2.m33 * m1.m34 + m2.m34 * m1.m44;
            var m41 = m2.m41 * m1.m11 + m2.m42 * m1.m21 + m2.m43 * m1.m31 + m2.m44 * m1.m41;
            var m42 = m2.m41 * m1.m12 + m2.m42 * m1.m22 + m2.m43 * m1.m32 + m2.m44 * m1.m42;
            var m43 = m2.m41 * m1.m13 + m2.m42 * m1.m23 + m2.m43 * m1.m33 + m2.m44 * m1.m43;
            var m44 = m2.m41 * m1.m14 + m2.m42 * m1.m24 + m2.m43 * m1.m34 + m2.m44 * m1.m44;
            return new CSSMatrix([m11, m21, m31, m41, m12, m22, m32, m42, m13, m23, m33, m43, m14, m24, m34, m44]);
          }

          function fromMatrix(m) {
            return new CSSMatrix([m.m11, m.m21, m.m31, m.m41, m.m12, m.m22, m.m32, m.m42, m.m13, m.m23, m.m33, m.m43, m.m14, m.m24, m.m34, m.m44]);
          }

          function feedFromArray(m, array) {
            var a = Array.from(array);

            if (a.length === 16) {
              var m11 = a[0];
              var m21 = a[1];
              var m31 = a[2];
              var m41 = a[3];
              var m12 = a[4];
              var m22 = a[5];
              var m32 = a[6];
              var m42 = a[7];
              var m13 = a[8];
              var m23 = a[9];
              var m33 = a[10];
              var m43 = a[11];
              var m14 = a[12];
              var m24 = a[13];
              var m34 = a[14];
              var m44 = a[15];
              m.m11 = m11;
              m.a = m11;
              m.m21 = m21;
              m.c = m21;
              m.m31 = m31;
              m.m41 = m41;
              m.e = m41;
              m.m12 = m12;
              m.b = m12;
              m.m22 = m22;
              m.d = m22;
              m.m32 = m32;
              m.m42 = m42;
              m.f = m42;
              m.m13 = m13;
              m.m23 = m23;
              m.m33 = m33;
              m.m43 = m43;
              m.m14 = m14;
              m.m24 = m24;
              m.m34 = m34;
              m.m44 = m44;
            } else if (a.length === 6) {
              var m11$1 = a[0];
              var m12$1 = a[1];
              var m21$1 = a[2];
              var m22$1 = a[3];
              var m14$1 = a[4];
              var m24$1 = a[5];
              m.m11 = m11$1;
              m.a = m11$1;
              m.m12 = m12$1;
              m.b = m12$1;
              m.m21 = m21$1;
              m.c = m21$1;
              m.m22 = m22$1;
              m.d = m22$1;
              m.m14 = m14$1;
              m.e = m14$1;
              m.m24 = m24$1;
              m.f = m24$1;
            } else {
              throw new TypeError('CSSMatrix: expecting a 6/16 values Array');
            }

            return m;
          }

          function fromArray(a) {
            return feedFromArray(new CSSMatrix(), a);
          }

          CSSMatrixProto.setMatrixValue = function setMatrixValue(source) {
            var m = this;

            if (!source || !source.length) {
              return m;
            }

            if (source.length && typeof source[0] === 'string' && source[0].length) {
              var string = String(source[0]).trim();
              var type = '';
              var values = [];

              if (string === 'none') {
                return m;
              }

              type = string.slice(0, string.indexOf('('));
              values = string.slice(type === 'matrix' ? 7 : 9, -1).split(',').map(function (n) {
                return Math.abs(n) < 1e-6 ? 0 : +n;
              });

              if ([6, 16].indexOf(values.length) > -1) {
                feedFromArray(m, values);
              } else {
                throw new TypeError('CSSMatrix: expecting valid CSS matrix() / matrix3d() syntax');
              }
            } else if (source[0] instanceof CSSMatrix) {
              feedFromArray(m, source[0].toArray());
            } else if (Array.isArray(source[0])) {
              feedFromArray(m, source[0]);
            } else if (Array.isArray(source)) {
              feedFromArray(m, source);
            }

            return m;
          };

          CSSMatrixProto.toString = function toString() {
            var m = this;
            var type = m.is2D ? 'matrix' : 'matrix3d';
            return type + "(" + m.toArray(1).join(',') + ")";
          };

          CSSMatrixProto.toArray = function toArray(transposed) {
            var m = this;
            var result;

            if (m.is2D) {
              result = [m.a, m.b, m.c, m.d, m.e, m.f];
            } else if (transposed) {
              result = [m.m11, m.m12, m.m13, m.m14, m.m21, m.m22, m.m23, m.m24, m.m31, m.m32, m.m33, m.m34, m.m41, m.m42, m.m43, m.m44];
            } else {
              result = [m.m11, m.m21, m.m31, m.m41, m.m12, m.m22, m.m32, m.m42, m.m13, m.m23, m.m33, m.m43, m.m14, m.m24, m.m34, m.m44];
            }

            return result;
          };

          CSSMatrixProto.multiply = function multiply(m2) {
            return Multiply(this, m2);
          };

          CSSMatrixProto.translate = function translate(x, y, z) {
            var X = x;
            var Y = y;
            var Z = z;

            if (Z == null) {
              Z = 0;
            }

            if (Y == null) {
              Y = 0;
            }

            return Multiply(this, Translate(X, Y, Z));
          };

          CSSMatrixProto.scale = function scale(x, y, z) {
            var X = x;
            var Y = y;
            var Z = z;

            if (Y == null) {
              Y = x;
            }

            if (Z == null) {
              Z = x;
            }

            return Multiply(this, Scale(X, Y, Z));
          };

          CSSMatrixProto.rotate = function rotate(rx, ry, rz) {
            var RX = rx;
            var RY = ry;
            var RZ = rz;

            if (RY == null) {
              RY = 0;
            }

            if (RZ == null) {
              RZ = RX;
              RX = 0;
            }

            return Multiply(this, Rotate(RX, RY, RZ));
          };

          CSSMatrixProto.rotateAxisAngle = function rotateAxisAngle(x, y, z, angle) {
            if (arguments.length !== 4) {
              throw new TypeError('CSSMatrix: expecting 4 values');
            }

            return Multiply(this, RotateAxisAngle(x, y, z, angle));
          };

          CSSMatrixProto.skewX = function skewX(angle) {
            return Multiply(this, SkewX(angle));
          };

          CSSMatrixProto.skewY = function skewY(angle) {
            return Multiply(this, SkewY(angle));
          };

          CSSMatrixProto.setIdentity = function setIdentity() {
            var identity = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
            return feedFromArray(this, identity);
          };

          CSSMatrixProto.transformPoint = function transformPoint(v) {
            var M = this;
            var m = Translate(v.x, v.y, v.z);
            m.m44 = v.w || 1;
            m = M.multiply(m);
            return {
              x: m.m41,
              y: m.m42,
              z: m.m43,
              w: m.m44
            };
          };

          CSSMatrixProto.transform = function transform(t) {
            var m = this;
            var x = m.m11 * t.x + m.m12 * t.y + m.m13 * t.z + m.m14 * t.w;
            var y = m.m21 * t.x + m.m22 * t.y + m.m23 * t.z + m.m24 * t.w;
            var z = m.m31 * t.x + m.m32 * t.y + m.m33 * t.z + m.m34 * t.w;
            var w = m.m41 * t.x + m.m42 * t.y + m.m43 * t.z + m.m44 * t.w;
            return {
              x: x / w,
              y: y / w,
              z: z / w,
              w: w
            };
          };

          CSSMatrix.Translate = Translate;
          CSSMatrix.Rotate = Rotate;
          CSSMatrix.RotateAxisAngle = RotateAxisAngle;
          CSSMatrix.Scale = Scale;
          CSSMatrix.SkewX = SkewX;
          CSSMatrix.SkewY = SkewY;
          CSSMatrix.Multiply = Multiply;
          CSSMatrix.fromMatrix = fromMatrix;
          CSSMatrix.fromArray = fromArray;
          CSSMatrix.feedFromArray = feedFromArray;
          return CSSMatrix;
        });
        /***/

      },
      /* 61 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        __w_pdfjs_require__(62);

        __w_pdfjs_require__(77);

        var path = __w_pdfjs_require__(88);

        module.exports = path.Object.fromEntries;
        /***/
      },
      /* 62 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        "use strict";

        var toIndexedObject = __w_pdfjs_require__(16);

        var addToUnscopables = __w_pdfjs_require__(63);

        var Iterators = __w_pdfjs_require__(68);

        var InternalStateModule = __w_pdfjs_require__(45);

        var defineIterator = __w_pdfjs_require__(69);

        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),
            index: 0,
            kind: kind
          });
        }, function () {
          var state = getInternalState(this);
          var target = state.target;
          var kind = state.kind;
          var index = state.index++;

          if (!target || index >= target.length) {
            state.target = undefined;
            return {
              value: undefined,
              done: true
            };
          }

          if (kind == 'keys') return {
            value: index,
            done: false
          };
          if (kind == 'values') return {
            value: target[index],
            done: false
          };
          return {
            value: [index, target[index]],
            done: false
          };
        }, 'values');
        Iterators.Arguments = Iterators.Array;
        addToUnscopables('keys');
        addToUnscopables('values');
        addToUnscopables('entries');
        /***/
      },
      /* 63 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var wellKnownSymbol = __w_pdfjs_require__(30);

        var create = __w_pdfjs_require__(64);

        var definePropertyModule = __w_pdfjs_require__(41);

        var UNSCOPABLES = wellKnownSymbol('unscopables');
        var ArrayPrototype = Array.prototype;

        if (ArrayPrototype[UNSCOPABLES] == undefined) {
          definePropertyModule.f(ArrayPrototype, UNSCOPABLES, {
            configurable: true,
            value: create(null)
          });
        }

        module.exports = function (key) {
          ArrayPrototype[UNSCOPABLES][key] = true;
        };
        /***/

      },
      /* 64 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var anObject = __w_pdfjs_require__(42);

        var defineProperties = __w_pdfjs_require__(65);

        var enumBugKeys = __w_pdfjs_require__(57);

        var hiddenKeys = __w_pdfjs_require__(48);

        var html = __w_pdfjs_require__(67);

        var documentCreateElement = __w_pdfjs_require__(39);

        var sharedKey = __w_pdfjs_require__(47);

        var GT = '>';
        var LT = '<';
        var PROTOTYPE = 'prototype';
        var SCRIPT = 'script';
        var IE_PROTO = sharedKey('IE_PROTO');

        var EmptyConstructor = function EmptyConstructor() {};

        var scriptTag = function scriptTag(content) {
          return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
        };

        var NullProtoObjectViaActiveX = function NullProtoObjectViaActiveX(activeXDocument) {
          activeXDocument.write(scriptTag(''));
          activeXDocument.close();
          var temp = activeXDocument.parentWindow.Object;
          activeXDocument = null;
          return temp;
        };

        var NullProtoObjectViaIFrame = function NullProtoObjectViaIFrame() {
          var iframe = documentCreateElement('iframe');
          var JS = 'java' + SCRIPT + ':';
          var iframeDocument;
          iframe.style.display = 'none';
          html.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 NullProtoObject() {
          try {
            activeXDocument = new ActiveXObject('htmlfile');
          } catch (error) {}

          _NullProtoObject = typeof document != 'undefined' ? document.domain && activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame() : NullProtoObjectViaActiveX(activeXDocument);
          var length = enumBugKeys.length;

          while (length--) {
            delete _NullProtoObject[PROTOTYPE][enumBugKeys[length]];
          }

          return _NullProtoObject();
        };

        hiddenKeys[IE_PROTO] = true;

        module.exports = Object.create || function create(O, Properties) {
          var result;

          if (O !== null) {
            EmptyConstructor[PROTOTYPE] = anObject(O);
            result = new EmptyConstructor();
            EmptyConstructor[PROTOTYPE] = null;
            result[IE_PROTO] = O;
          } else result = _NullProtoObject();

          return Properties === undefined ? result : defineProperties(result, Properties);
        };
        /***/

      },
      /* 65 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var DESCRIPTORS = __w_pdfjs_require__(12);

        var definePropertyModule = __w_pdfjs_require__(41);

        var anObject = __w_pdfjs_require__(42);

        var objectKeys = __w_pdfjs_require__(66);

        module.exports = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) {
          anObject(O);
          var keys = objectKeys(Properties);
          var length = keys.length;
          var index = 0;
          var key;

          while (length > index) {
            definePropertyModule.f(O, key = keys[index++], Properties[key]);
          }

          return O;
        };
        /***/
      },
      /* 66 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var internalObjectKeys = __w_pdfjs_require__(52);

        var enumBugKeys = __w_pdfjs_require__(57);

        module.exports = Object.keys || function keys(O) {
          return internalObjectKeys(O, enumBugKeys);
        };
        /***/

      },
      /* 67 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var getBuiltIn = __w_pdfjs_require__(24);

        module.exports = getBuiltIn('document', 'documentElement');
        /***/
      },
      /* 68 */

      /***/
      function (module) {
        module.exports = {};
        /***/
      },
      /* 69 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        "use strict";

        var $ = __w_pdfjs_require__(9);

        var createIteratorConstructor = __w_pdfjs_require__(70);

        var getPrototypeOf = __w_pdfjs_require__(72);

        var setPrototypeOf = __w_pdfjs_require__(75);

        var setToStringTag = __w_pdfjs_require__(74);

        var createNonEnumerableProperty = __w_pdfjs_require__(40);

        var redefine = __w_pdfjs_require__(43);

        var wellKnownSymbol = __w_pdfjs_require__(30);

        var IS_PURE = __w_pdfjs_require__(32);

        var Iterators = __w_pdfjs_require__(68);

        var IteratorsCore = __w_pdfjs_require__(71);

        var IteratorPrototype = IteratorsCore.IteratorPrototype;
        var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
        var ITERATOR = wellKnownSymbol('iterator');
        var KEYS = 'keys';
        var VALUES = 'values';
        var ENTRIES = 'entries';

        var returnThis = function returnThis() {
          return this;
        };

        module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
          createIteratorConstructor(IteratorConstructor, NAME, next);

          var getIterationMethod = function getIterationMethod(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_TAG = NAME + ' Iterator';
          var INCORRECT_VALUES_NAME = false;
          var IterablePrototype = Iterable.prototype;
          var nativeIterator = IterablePrototype[ITERATOR] || IterablePrototype['@@iterator'] || DEFAULT && IterablePrototype[DEFAULT];
          var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
          var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
          var CurrentIteratorPrototype, methods, KEY;

          if (anyNativeIterator) {
            CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));

            if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
              if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
                if (setPrototypeOf) {
                  setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
                } else if (typeof CurrentIteratorPrototype[ITERATOR] != 'function') {
                  createNonEnumerableProperty(CurrentIteratorPrototype, ITERATOR, returnThis);
                }
              }

              setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);
              if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis;
            }
          }

          if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
            INCORRECT_VALUES_NAME = true;

            defaultIterator = function values() {
              return nativeIterator.call(this);
            };
          }

          if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {
            createNonEnumerableProperty(IterablePrototype, ITERATOR, defaultIterator);
          }

          Iterators[NAME] = defaultIterator;

          if (DEFAULT) {
            methods = {
              values: getIterationMethod(VALUES),
              keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
              entries: getIterationMethod(ENTRIES)
            };
            if (FORCED) for (KEY in methods) {
              if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
                redefine(IterablePrototype, KEY, methods[KEY]);
              }
            } else $({
              target: NAME,
              proto: true,
              forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME
            }, methods);
          }

          return methods;
        };
        /***/

      },
      /* 70 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        "use strict";

        var IteratorPrototype = __w_pdfjs_require__(71).IteratorPrototype;

        var create = __w_pdfjs_require__(64);

        var createPropertyDescriptor = __w_pdfjs_require__(15);

        var setToStringTag = __w_pdfjs_require__(74);

        var Iterators = __w_pdfjs_require__(68);

        var returnThis = function returnThis() {
          return this;
        };

        module.exports = function (IteratorConstructor, NAME, next) {
          var TO_STRING_TAG = NAME + ' Iterator';
          IteratorConstructor.prototype = create(IteratorPrototype, {
            next: createPropertyDescriptor(1, next)
          });
          setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);
          Iterators[TO_STRING_TAG] = returnThis;
          return IteratorConstructor;
        };
        /***/

      },
      /* 71 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        "use strict";

        var fails = __w_pdfjs_require__(13);

        var create = __w_pdfjs_require__(64);

        var getPrototypeOf = __w_pdfjs_require__(72);

        var createNonEnumerableProperty = __w_pdfjs_require__(40);

        var wellKnownSymbol = __w_pdfjs_require__(30);

        var IS_PURE = __w_pdfjs_require__(32);

        var ITERATOR = wellKnownSymbol('iterator');
        var BUGGY_SAFARI_ITERATORS = false;
        var IteratorPrototype, PrototypeOfArrayIteratorPrototype, 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 = IteratorPrototype == undefined || fails(function () {
          var test = {};
          return IteratorPrototype[ITERATOR].call(test) !== test;
        });
        if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {};else if (IS_PURE) IteratorPrototype = create(IteratorPrototype);

        if (typeof IteratorPrototype[ITERATOR] !== 'function') {
          createNonEnumerableProperty(IteratorPrototype, ITERATOR, function () {
            return this;
          });
        }

        module.exports = {
          IteratorPrototype: IteratorPrototype,
          BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
        };
        /***/
      },
      /* 72 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var has = __w_pdfjs_require__(35);

        var toObject = __w_pdfjs_require__(36);

        var sharedKey = __w_pdfjs_require__(47);

        var CORRECT_PROTOTYPE_GETTER = __w_pdfjs_require__(73);

        var IE_PROTO = sharedKey('IE_PROTO');
        var ObjectPrototype = Object.prototype;
        module.exports = CORRECT_PROTOTYPE_GETTER ? Object.getPrototypeOf : function (O) {
          O = toObject(O);
          if (has(O, IE_PROTO)) return O[IE_PROTO];

          if (typeof O.constructor == 'function' && O instanceof O.constructor) {
            return O.constructor.prototype;
          }

          return O instanceof Object ? ObjectPrototype : null;
        };
        /***/
      },
      /* 73 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var fails = __w_pdfjs_require__(13);

        module.exports = !fails(function () {
          function F() {}

          F.prototype.constructor = null;
          return Object.getPrototypeOf(new F()) !== F.prototype;
        });
        /***/
      },
      /* 74 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var defineProperty = __w_pdfjs_require__(41).f;

        var has = __w_pdfjs_require__(35);

        var wellKnownSymbol = __w_pdfjs_require__(30);

        var TO_STRING_TAG = wellKnownSymbol('toStringTag');

        module.exports = function (it, TAG, STATIC) {
          if (it && !has(it = STATIC ? it : it.prototype, TO_STRING_TAG)) {
            defineProperty(it, TO_STRING_TAG, {
              configurable: true,
              value: TAG
            });
          }
        };
        /***/

      },
      /* 75 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var anObject = __w_pdfjs_require__(42);

        var aPossiblePrototype = __w_pdfjs_require__(76);

        module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {
          var CORRECT_SETTER = false;
          var test = {};
          var setter;

          try {
            setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set;
            setter.call(test, []);
            CORRECT_SETTER = test instanceof Array;
          } catch (error) {}

          return function setPrototypeOf(O, proto) {
            anObject(O);
            aPossiblePrototype(proto);
            if (CORRECT_SETTER) setter.call(O, proto);else O.__proto__ = proto;
            return O;
          };
        }() : undefined);
        /***/
      },
      /* 76 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var isObject = __w_pdfjs_require__(22);

        module.exports = function (it) {
          if (!isObject(it) && it !== null) {
            throw TypeError("Can't set " + String(it) + ' as a prototype');
          }

          return it;
        };
        /***/

      },
      /* 77 */

      /***/
      function (__unused_webpack_module, __unused_webpack_exports, __w_pdfjs_require__) {
        var $ = __w_pdfjs_require__(9);

        var iterate = __w_pdfjs_require__(78);

        var createProperty = __w_pdfjs_require__(87);

        $({
          target: 'Object',
          stat: true
        }, {
          fromEntries: function fromEntries(iterable) {
            var obj = {};
            iterate(iterable, function (k, v) {
              createProperty(obj, k, v);
            }, {
              AS_ENTRIES: true
            });
            return obj;
          }
        });
        /***/
      },
      /* 78 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var anObject = __w_pdfjs_require__(42);

        var isArrayIteratorMethod = __w_pdfjs_require__(79);

        var toLength = __w_pdfjs_require__(54);

        var bind = __w_pdfjs_require__(80);

        var getIterator = __w_pdfjs_require__(82);

        var getIteratorMethod = __w_pdfjs_require__(83);

        var iteratorClose = __w_pdfjs_require__(86);

        var Result = function Result(stopped, result) {
          this.stopped = stopped;
          this.result = result;
        };

        module.exports = function (iterable, unboundFunction, options) {
          var that = options && options.that;
          var AS_ENTRIES = !!(options && options.AS_ENTRIES);
          var IS_ITERATOR = !!(options && options.IS_ITERATOR);
          var INTERRUPTED = !!(options && options.INTERRUPTED);
          var fn = bind(unboundFunction, that, 1 + AS_ENTRIES + INTERRUPTED);
          var iterator, iterFn, index, length, result, next, step;

          var stop = function stop(condition) {
            if (iterator) iteratorClose(iterator, 'normal', condition);
            return new Result(true, condition);
          };

          var callFn = function callFn(value) {
            if (AS_ENTRIES) {
              anObject(value);
              return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
            }

            return INTERRUPTED ? fn(value, stop) : fn(value);
          };

          if (IS_ITERATOR) {
            iterator = iterable;
          } else {
            iterFn = getIteratorMethod(iterable);
            if (typeof iterFn != 'function') throw TypeError('Target is not iterable');

            if (isArrayIteratorMethod(iterFn)) {
              for (index = 0, length = toLength(iterable.length); length > index; index++) {
                result = callFn(iterable[index]);
                if (result && result instanceof Result) return result;
              }

              return new Result(false);
            }

            iterator = getIterator(iterable, iterFn);
          }

          next = iterator.next;

          while (!(step = next.call(iterator)).done) {
            try {
              result = callFn(step.value);
            } catch (error) {
              iteratorClose(iterator, 'throw', error);
            }

            if (typeof result == 'object' && result && result instanceof Result) return result;
          }

          return new Result(false);
        };
        /***/

      },
      /* 79 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var wellKnownSymbol = __w_pdfjs_require__(30);

        var Iterators = __w_pdfjs_require__(68);

        var ITERATOR = wellKnownSymbol('iterator');
        var ArrayPrototype = Array.prototype;

        module.exports = function (it) {
          return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);
        };
        /***/

      },
      /* 80 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var aFunction = __w_pdfjs_require__(81);

        module.exports = function (fn, that, length) {
          aFunction(fn);
          if (that === undefined) return fn;

          switch (length) {
            case 0:
              return function () {
                return fn.call(that);
              };

            case 1:
              return function (a) {
                return fn.call(that, a);
              };

            case 2:
              return function (a, b) {
                return fn.call(that, a, b);
              };

            case 3:
              return function (a, b, c) {
                return fn.call(that, a, b, c);
              };
          }

          return function () {
            return fn.apply(that, arguments);
          };
        };
        /***/

      },
      /* 81 */

      /***/
      function (module) {
        module.exports = function (it) {
          if (typeof it != 'function') {
            throw TypeError(String(it) + ' is not a function');
          }

          return it;
        };
        /***/

      },
      /* 82 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var anObject = __w_pdfjs_require__(42);

        var getIteratorMethod = __w_pdfjs_require__(83);

        module.exports = function (it, usingIterator) {
          var iteratorMethod = arguments.length < 2 ? getIteratorMethod(it) : usingIterator;

          if (typeof iteratorMethod != 'function') {
            throw TypeError(String(it) + ' is not iterable');
          }

          return anObject(iteratorMethod.call(it));
        };
        /***/

      },
      /* 83 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var classof = __w_pdfjs_require__(84);

        var Iterators = __w_pdfjs_require__(68);

        var wellKnownSymbol = __w_pdfjs_require__(30);

        var ITERATOR = wellKnownSymbol('iterator');

        module.exports = function (it) {
          if (it != undefined) return it[ITERATOR] || it['@@iterator'] || Iterators[classof(it)];
        };
        /***/

      },
      /* 84 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var TO_STRING_TAG_SUPPORT = __w_pdfjs_require__(85);

        var classofRaw = __w_pdfjs_require__(18);

        var wellKnownSymbol = __w_pdfjs_require__(30);

        var TO_STRING_TAG = wellKnownSymbol('toStringTag');
        var CORRECT_ARGUMENTS = classofRaw(function () {
          return arguments;
        }()) == 'Arguments';

        var tryGet = function tryGet(it, key) {
          try {
            return it[key];
          } catch (error) {}
        };

        module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
          var O, tag, result;
          return it === undefined ? 'Undefined' : it === null ? 'Null' : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag : CORRECT_ARGUMENTS ? classofRaw(O) : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;
        };
        /***/
      },
      /* 85 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var wellKnownSymbol = __w_pdfjs_require__(30);

        var TO_STRING_TAG = wellKnownSymbol('toStringTag');
        var test = {};
        test[TO_STRING_TAG] = 'z';
        module.exports = String(test) === '[object z]';
        /***/
      },
      /* 86 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var anObject = __w_pdfjs_require__(42);

        module.exports = function (iterator, kind, value) {
          var innerResult, innerError;
          anObject(iterator);

          try {
            innerResult = iterator['return'];

            if (innerResult === undefined) {
              if (kind === 'throw') throw value;
              return value;
            }

            innerResult = innerResult.call(iterator);
          } catch (error) {
            innerError = true;
            innerResult = error;
          }

          if (kind === 'throw') throw value;
          if (innerError) throw innerResult;
          anObject(innerResult);
          return value;
        };
        /***/

      },
      /* 87 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        "use strict";

        var toPropertyKey = __w_pdfjs_require__(20);

        var definePropertyModule = __w_pdfjs_require__(41);

        var createPropertyDescriptor = __w_pdfjs_require__(15);

        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;
        };
        /***/

      },
      /* 88 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var global = __w_pdfjs_require__(10);

        module.exports = global;
        /***/
      },
      /* 89 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        __w_pdfjs_require__(90);

        __w_pdfjs_require__(62);

        __w_pdfjs_require__(92);

        __w_pdfjs_require__(94);

        __w_pdfjs_require__(112);

        __w_pdfjs_require__(113);

        __w_pdfjs_require__(114);

        __w_pdfjs_require__(115);

        var path = __w_pdfjs_require__(88);

        module.exports = path.Promise;
        /***/
      },
      /* 90 */

      /***/
      function (__unused_webpack_module, __unused_webpack_exports, __w_pdfjs_require__) {
        "use strict";

        var $ = __w_pdfjs_require__(9);

        var getPrototypeOf = __w_pdfjs_require__(72);

        var setPrototypeOf = __w_pdfjs_require__(75);

        var create = __w_pdfjs_require__(64);

        var createNonEnumerableProperty = __w_pdfjs_require__(40);

        var createPropertyDescriptor = __w_pdfjs_require__(15);

        var iterate = __w_pdfjs_require__(78);

        var toString = __w_pdfjs_require__(91);

        var $AggregateError = function AggregateError(errors, message) {
          var that = this;
          if (!(that instanceof $AggregateError)) return new $AggregateError(errors, message);

          if (setPrototypeOf) {
            that = setPrototypeOf(new Error(undefined), getPrototypeOf(that));
          }

          if (message !== undefined) createNonEnumerableProperty(that, 'message', toString(message));
          var errorsArray = [];
          iterate(errors, errorsArray.push, {
            that: errorsArray
          });
          createNonEnumerableProperty(that, 'errors', errorsArray);
          return that;
        };

        $AggregateError.prototype = create(Error.prototype, {
          constructor: createPropertyDescriptor(5, $AggregateError),
          message: createPropertyDescriptor(5, ''),
          name: createPropertyDescriptor(5, 'AggregateError')
        });
        $({
          global: true
        }, {
          AggregateError: $AggregateError
        });
        /***/
      },
      /* 91 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var isSymbol = __w_pdfjs_require__(23);

        module.exports = function (argument) {
          if (isSymbol(argument)) throw TypeError('Cannot convert a Symbol value to a string');
          return String(argument);
        };
        /***/

      },
      /* 92 */

      /***/
      function (__unused_webpack_module, __unused_webpack_exports, __w_pdfjs_require__) {
        var TO_STRING_TAG_SUPPORT = __w_pdfjs_require__(85);

        var redefine = __w_pdfjs_require__(43);

        var toString = __w_pdfjs_require__(93);

        if (!TO_STRING_TAG_SUPPORT) {
          redefine(Object.prototype, 'toString', toString, {
            unsafe: true
          });
        }
        /***/

      },
      /* 93 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        "use strict";

        var TO_STRING_TAG_SUPPORT = __w_pdfjs_require__(85);

        var classof = __w_pdfjs_require__(84);

        module.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() {
          return '[object ' + classof(this) + ']';
        };
        /***/
      },
      /* 94 */

      /***/
      function (__unused_webpack_module, __unused_webpack_exports, __w_pdfjs_require__) {
        "use strict";

        var $ = __w_pdfjs_require__(9);

        var IS_PURE = __w_pdfjs_require__(32);

        var global = __w_pdfjs_require__(10);

        var getBuiltIn = __w_pdfjs_require__(24);

        var NativePromise = __w_pdfjs_require__(95);

        var redefine = __w_pdfjs_require__(43);

        var redefineAll = __w_pdfjs_require__(96);

        var setPrototypeOf = __w_pdfjs_require__(75);

        var setToStringTag = __w_pdfjs_require__(74);

        var setSpecies = __w_pdfjs_require__(97);

        var isObject = __w_pdfjs_require__(22);

        var aFunction = __w_pdfjs_require__(81);

        var anInstance = __w_pdfjs_require__(98);

        var inspectSource = __w_pdfjs_require__(44);

        var iterate = __w_pdfjs_require__(78);

        var checkCorrectnessOfIteration = __w_pdfjs_require__(99);

        var speciesConstructor = __w_pdfjs_require__(100);

        var task = __w_pdfjs_require__(101).set;

        var microtask = __w_pdfjs_require__(104);

        var promiseResolve = __w_pdfjs_require__(107);

        var hostReportErrors = __w_pdfjs_require__(109);

        var newPromiseCapabilityModule = __w_pdfjs_require__(108);

        var perform = __w_pdfjs_require__(110);

        var InternalStateModule = __w_pdfjs_require__(45);

        var isForced = __w_pdfjs_require__(59);

        var wellKnownSymbol = __w_pdfjs_require__(30);

        var IS_BROWSER = __w_pdfjs_require__(111);

        var IS_NODE = __w_pdfjs_require__(103);

        var V8_VERSION = __w_pdfjs_require__(27);

        var SPECIES = wellKnownSymbol('species');
        var PROMISE = 'Promise';
        var getInternalState = InternalStateModule.get;
        var setInternalState = InternalStateModule.set;
        var getInternalPromiseState = InternalStateModule.getterFor(PROMISE);
        var NativePromisePrototype = NativePromise && NativePromise.prototype;
        var PromiseConstructor = NativePromise;
        var PromiseConstructorPrototype = NativePromisePrototype;
        var TypeError = global.TypeError;
        var document = global.document;
        var process = global.process;
        var newPromiseCapability = newPromiseCapabilityModule.f;
        var newGenericPromiseCapability = newPromiseCapability;
        var DISPATCH_EVENT = !!(document && document.createEvent && global.dispatchEvent);
        var NATIVE_REJECTION_EVENT = typeof PromiseRejectionEvent == 'function';
        var UNHANDLED_REJECTION = 'unhandledrejection';
        var REJECTION_HANDLED = 'rejectionhandled';
        var PENDING = 0;
        var FULFILLED = 1;
        var REJECTED = 2;
        var HANDLED = 1;
        var UNHANDLED = 2;
        var SUBCLASSING = false;
        var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
        var FORCED = isForced(PROMISE, function () {
          var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(PromiseConstructor);
          var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(PromiseConstructor);
          if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true;
          if (IS_PURE && !PromiseConstructorPrototype['finally']) return true;
          if (V8_VERSION >= 51 && /native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) return false;
          var promise = new PromiseConstructor(function (resolve) {
            resolve(1);
          });

          var FakePromise = function FakePromise(exec) {
            exec(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 && !NATIVE_REJECTION_EVENT;
        });
        var INCORRECT_ITERATION = FORCED || !checkCorrectnessOfIteration(function (iterable) {
          PromiseConstructor.all(iterable)['catch'](function () {});
        });

        var isThenable = function isThenable(it) {
          var then;
          return isObject(it) && typeof (then = it.then) == 'function' ? then : false;
        };

        var notify = function notify(state, isReject) {
          if (state.notified) return;
          state.notified = true;
          var chain = state.reactions;
          microtask(function () {
            var value = state.value;
            var ok = state.state == FULFILLED;
            var index = 0;

            while (chain.length > index) {
              var reaction = chain[index++];
              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(TypeError('Promise-chain cycle'));
                  } else if (then = isThenable(result)) {
                    then.call(result, resolve, reject);
                  } else resolve(result);
                } else reject(value);
              } catch (error) {
                if (domain && !exited) domain.exit();
                reject(error);
              }
            }

            state.reactions = [];
            state.notified = false;
            if (isReject && !state.rejection) onUnhandled(state);
          });
        };

        var dispatchEvent = function dispatchEvent(name, promise, reason) {
          var event, handler;

          if (DISPATCH_EVENT) {
            event = document.createEvent('Event');
            event.promise = promise;
            event.reason = reason;
            event.initEvent(name, false, true);
            global.dispatchEvent(event);
          } else event = {
            promise: promise,
            reason: reason
          };

          if (!NATIVE_REJECTION_EVENT && (handler = global['on' + name])) handler(event);else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
        };

        var onUnhandled = function onUnhandled(state) {
          task.call(global, function () {
            var promise = state.facade;
            var value = state.value;
            var IS_UNHANDLED = isUnhandled(state);
            var result;

            if (IS_UNHANDLED) {
              result = perform(function () {
                if (IS_NODE) {
                  process.emit('unhandledRejection', value, promise);
                } else dispatchEvent(UNHANDLED_REJECTION, promise, value);
              });
              state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;
              if (result.error) throw result.value;
            }
          });
        };

        var isUnhandled = function isUnhandled(state) {
          return state.rejection !== HANDLED && !state.parent;
        };

        var onHandleUnhandled = function onHandleUnhandled(state) {
          task.call(global, function () {
            var promise = state.facade;

            if (IS_NODE) {
              process.emit('rejectionHandled', promise);
            } else dispatchEvent(REJECTION_HANDLED, promise, state.value);
          });
        };

        var bind = function bind(fn, state, unwrap) {
          return function (value) {
            fn(state, value, unwrap);
          };
        };

        var internalReject = function internalReject(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 internalResolve(state, value, unwrap) {
          if (state.done) return;
          state.done = true;
          if (unwrap) state = unwrap;

          try {
            if (state.facade === value) throw TypeError("Promise can't be resolved itself");
            var then = isThenable(value);

            if (then) {
              microtask(function () {
                var wrapper = {
                  done: false
                };

                try {
                  then.call(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) {
          PromiseConstructor = function Promise(executor) {
            anInstance(this, PromiseConstructor, PROMISE);
            aFunction(executor);
            Internal.call(this);
            var state = getInternalState(this);

            try {
              executor(bind(internalResolve, state), bind(internalReject, state));
            } catch (error) {
              internalReject(state, error);
            }
          };

          PromiseConstructorPrototype = PromiseConstructor.prototype;

          Internal = function Promise(executor) {
            setInternalState(this, {
              type: PROMISE,
              done: false,
              notified: false,
              parent: false,
              reactions: [],
              rejection: false,
              state: PENDING,
              value: undefined
            });
          };

          Internal.prototype = redefineAll(PromiseConstructorPrototype, {
            then: function then(onFulfilled, onRejected) {
              var state = getInternalPromiseState(this);
              var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor));
              reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;
              reaction.fail = typeof onRejected == 'function' && onRejected;
              reaction.domain = IS_NODE ? process.domain : undefined;
              state.parent = true;
              state.reactions.push(reaction);
              if (state.state != PENDING) notify(state, false);
              return reaction.promise;
            },
            'catch': function _catch(onRejected) {
              return this.then(undefined, onRejected);
            }
          });

          OwnPromiseCapability = function OwnPromiseCapability() {
            var promise = new Internal();
            var state = getInternalState(promise);
            this.promise = promise;
            this.resolve = bind(internalResolve, state);
            this.reject = bind(internalReject, state);
          };

          newPromiseCapabilityModule.f = newPromiseCapability = function newPromiseCapability(C) {
            return C === PromiseConstructor || C === PromiseWrapper ? new OwnPromiseCapability(C) : newGenericPromiseCapability(C);
          };

          if (!IS_PURE && typeof NativePromise == 'function' && NativePromisePrototype !== Object.prototype) {
            nativeThen = NativePromisePrototype.then;

            if (!SUBCLASSING) {
              redefine(NativePromisePrototype, 'then', function then(onFulfilled, onRejected) {
                var that = this;
                return new PromiseConstructor(function (resolve, reject) {
                  nativeThen.call(that, resolve, reject);
                }).then(onFulfilled, onRejected);
              }, {
                unsafe: true
              });
              redefine(NativePromisePrototype, 'catch', PromiseConstructorPrototype['catch'], {
                unsafe: true
              });
            }

            try {
              delete NativePromisePrototype.constructor;
            } catch (error) {}

            if (setPrototypeOf) {
              setPrototypeOf(NativePromisePrototype, PromiseConstructorPrototype);
            }
          }
        }

        $({
          global: true,
          wrap: true,
          forced: FORCED
        }, {
          Promise: PromiseConstructor
        });
        setToStringTag(PromiseConstructor, PROMISE, false, true);
        setSpecies(PROMISE);
        PromiseWrapper = getBuiltIn(PROMISE);
        $({
          target: PROMISE,
          stat: true,
          forced: FORCED
        }, {
          reject: function reject(r) {
            var capability = newPromiseCapability(this);
            capability.reject.call(undefined, r);
            return capability.promise;
          }
        });
        $({
          target: PROMISE,
          stat: true,
          forced: IS_PURE || FORCED
        }, {
          resolve: function resolve(x) {
            return promiseResolve(IS_PURE && this === PromiseWrapper ? PromiseConstructor : this, x);
          }
        });
        $({
          target: PROMISE,
          stat: true,
          forced: INCORRECT_ITERATION
        }, {
          all: function all(iterable) {
            var C = this;
            var capability = newPromiseCapability(C);
            var resolve = capability.resolve;
            var reject = capability.reject;
            var result = perform(function () {
              var $promiseResolve = aFunction(C.resolve);
              var values = [];
              var counter = 0;
              var remaining = 1;
              iterate(iterable, function (promise) {
                var index = counter++;
                var alreadyCalled = false;
                values.push(undefined);
                remaining++;
                $promiseResolve.call(C, promise).then(function (value) {
                  if (alreadyCalled) return;
                  alreadyCalled = true;
                  values[index] = value;
                  --remaining || resolve(values);
                }, reject);
              });
              --remaining || resolve(values);
            });
            if (result.error) reject(result.value);
            return capability.promise;
          },
          race: function race(iterable) {
            var C = this;
            var capability = newPromiseCapability(C);
            var reject = capability.reject;
            var result = perform(function () {
              var $promiseResolve = aFunction(C.resolve);
              iterate(iterable, function (promise) {
                $promiseResolve.call(C, promise).then(capability.resolve, reject);
              });
            });
            if (result.error) reject(result.value);
            return capability.promise;
          }
        });
        /***/
      },
      /* 95 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var global = __w_pdfjs_require__(10);

        module.exports = global.Promise;
        /***/
      },
      /* 96 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var redefine = __w_pdfjs_require__(43);

        module.exports = function (target, src, options) {
          for (var key in src) {
            redefine(target, key, src[key], options);
          }

          return target;
        };
        /***/

      },
      /* 97 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        "use strict";

        var getBuiltIn = __w_pdfjs_require__(24);

        var definePropertyModule = __w_pdfjs_require__(41);

        var wellKnownSymbol = __w_pdfjs_require__(30);

        var DESCRIPTORS = __w_pdfjs_require__(12);

        var SPECIES = wellKnownSymbol('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 get() {
                return this;
              }
            });
          }
        };
        /***/

      },
      /* 98 */

      /***/
      function (module) {
        module.exports = function (it, Constructor, name) {
          if (!(it instanceof Constructor)) {
            throw TypeError('Incorrect ' + (name ? name + ' ' : '') + 'invocation');
          }

          return it;
        };
        /***/

      },
      /* 99 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var wellKnownSymbol = __w_pdfjs_require__(30);

        var ITERATOR = wellKnownSymbol('iterator');
        var SAFE_CLOSING = false;

        try {
          var called = 0;
          var iteratorWithReturn = {
            next: function next() {
              return {
                done: !!called++
              };
            },
            'return': function _return() {
              SAFE_CLOSING = true;
            }
          };

          iteratorWithReturn[ITERATOR] = function () {
            return this;
          };

          Array.from(iteratorWithReturn, function () {
            throw 2;
          });
        } catch (error) {}

        module.exports = function (exec, SKIP_CLOSING) {
          if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
          var ITERATION_SUPPORT = false;

          try {
            var object = {};

            object[ITERATOR] = function () {
              return {
                next: function next() {
                  return {
                    done: ITERATION_SUPPORT = true
                  };
                }
              };
            };

            exec(object);
          } catch (error) {}

          return ITERATION_SUPPORT;
        };
        /***/

      },
      /* 100 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var anObject = __w_pdfjs_require__(42);

        var aFunction = __w_pdfjs_require__(81);

        var wellKnownSymbol = __w_pdfjs_require__(30);

        var SPECIES = wellKnownSymbol('species');

        module.exports = function (O, defaultConstructor) {
          var C = anObject(O).constructor;
          var S;
          return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? defaultConstructor : aFunction(S);
        };
        /***/

      },
      /* 101 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var global = __w_pdfjs_require__(10);

        var fails = __w_pdfjs_require__(13);

        var bind = __w_pdfjs_require__(80);

        var html = __w_pdfjs_require__(67);

        var createElement = __w_pdfjs_require__(39);

        var IS_IOS = __w_pdfjs_require__(102);

        var IS_NODE = __w_pdfjs_require__(103);

        var set = global.setImmediate;
        var clear = global.clearImmediate;
        var process = global.process;
        var MessageChannel = global.MessageChannel;
        var Dispatch = global.Dispatch;
        var counter = 0;
        var queue = {};
        var ONREADYSTATECHANGE = 'onreadystatechange';
        var location, defer, channel, port;

        try {
          location = global.location;
        } catch (error) {}

        var run = function run(id) {
          if (queue.hasOwnProperty(id)) {
            var fn = queue[id];
            delete queue[id];
            fn();
          }
        };

        var runner = function runner(id) {
          return function () {
            run(id);
          };
        };

        var listener = function listener(event) {
          run(event.data);
        };

        var post = function post(id) {
          global.postMessage(String(id), location.protocol + '//' + location.host);
        };

        if (!set || !clear) {
          set = function setImmediate(fn) {
            var args = [];
            var argumentsLength = arguments.length;
            var i = 1;

            while (argumentsLength > i) {
              args.push(arguments[i++]);
            }

            queue[++counter] = function () {
              (typeof fn == 'function' ? fn : Function(fn)).apply(undefined, args);
            };

            defer(counter);
            return counter;
          };

          clear = function clearImmediate(id) {
            delete queue[id];
          };

          if (IS_NODE) {
            defer = function defer(id) {
              process.nextTick(runner(id));
            };
          } else if (Dispatch && Dispatch.now) {
            defer = function defer(id) {
              Dispatch.now(runner(id));
            };
          } else if (MessageChannel && !IS_IOS) {
            channel = new MessageChannel();
            port = channel.port2;
            channel.port1.onmessage = listener;
            defer = bind(port.postMessage, port, 1);
          } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts && location && location.protocol !== 'file:' && !fails(post)) {
            defer = post;
            global.addEventListener('message', listener, false);
          } else if (ONREADYSTATECHANGE in createElement('script')) {
            defer = function defer(id) {
              html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {
                html.removeChild(this);
                run(id);
              };
            };
          } else {
            defer = function defer(id) {
              setTimeout(runner(id), 0);
            };
          }
        }

        module.exports = {
          set: set,
          clear: clear
        };
        /***/
      },
      /* 102 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var userAgent = __w_pdfjs_require__(28);

        module.exports = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent);
        /***/
      },
      /* 103 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var classof = __w_pdfjs_require__(18);

        var global = __w_pdfjs_require__(10);

        module.exports = classof(global.process) == 'process';
        /***/
      },
      /* 104 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var global = __w_pdfjs_require__(10);

        var getOwnPropertyDescriptor = __w_pdfjs_require__(11).f;

        var macrotask = __w_pdfjs_require__(101).set;

        var IS_IOS = __w_pdfjs_require__(102);

        var IS_IOS_PEBBLE = __w_pdfjs_require__(105);

        var IS_WEBOS_WEBKIT = __w_pdfjs_require__(106);

        var IS_NODE = __w_pdfjs_require__(103);

        var MutationObserver = global.MutationObserver || global.WebKitMutationObserver;
        var document = global.document;
        var process = global.process;
        var Promise = global.Promise;
        var queueMicrotaskDescriptor = getOwnPropertyDescriptor(global, 'queueMicrotask');
        var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
        var flush, head, last, notify, toggle, node, promise, then;

        if (!queueMicrotask) {
          flush = function flush() {
            var parent, fn;
            if (IS_NODE && (parent = process.domain)) parent.exit();

            while (head) {
              fn = head.fn;
              head = head.next;

              try {
                fn();
              } catch (error) {
                if (head) notify();else last = undefined;
                throw error;
              }
            }

            last = undefined;
            if (parent) parent.enter();
          };

          if (!IS_IOS && !IS_NODE && !IS_WEBOS_WEBKIT && MutationObserver && document) {
            toggle = true;
            node = document.createTextNode('');
            new MutationObserver(flush).observe(node, {
              characterData: true
            });

            notify = function notify() {
              node.data = toggle = !toggle;
            };
          } else if (!IS_IOS_PEBBLE && Promise && Promise.resolve) {
            promise = Promise.resolve(undefined);
            promise.constructor = Promise;
            then = promise.then;

            notify = function notify() {
              then.call(promise, flush);
            };
          } else if (IS_NODE) {
            notify = function notify() {
              process.nextTick(flush);
            };
          } else {
            notify = function notify() {
              macrotask.call(global, flush);
            };
          }
        }

        module.exports = queueMicrotask || function (fn) {
          var task = {
            fn: fn,
            next: undefined
          };
          if (last) last.next = task;

          if (!head) {
            head = task;
            notify();
          }

          last = task;
        };
        /***/

      },
      /* 105 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var userAgent = __w_pdfjs_require__(28);

        var global = __w_pdfjs_require__(10);

        module.exports = /ipad|iphone|ipod/i.test(userAgent) && global.Pebble !== undefined;
        /***/
      },
      /* 106 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var userAgent = __w_pdfjs_require__(28);

        module.exports = /web0s(?!.*chrome)/i.test(userAgent);
        /***/
      },
      /* 107 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var anObject = __w_pdfjs_require__(42);

        var isObject = __w_pdfjs_require__(22);

        var newPromiseCapability = __w_pdfjs_require__(108);

        module.exports = function (C, x) {
          anObject(C);
          if (isObject(x) && x.constructor === C) return x;
          var promiseCapability = newPromiseCapability.f(C);
          var resolve = promiseCapability.resolve;
          resolve(x);
          return promiseCapability.promise;
        };
        /***/

      },
      /* 108 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        "use strict";

        var aFunction = __w_pdfjs_require__(81);

        var PromiseCapability = function PromiseCapability(C) {
          var resolve, reject;
          this.promise = new C(function ($$resolve, $$reject) {
            if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
            resolve = $$resolve;
            reject = $$reject;
          });
          this.resolve = aFunction(resolve);
          this.reject = aFunction(reject);
        };

        module.exports.f = function (C) {
          return new PromiseCapability(C);
        };
        /***/

      },
      /* 109 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var global = __w_pdfjs_require__(10);

        module.exports = function (a, b) {
          var console = global.console;

          if (console && console.error) {
            arguments.length === 1 ? console.error(a) : console.error(a, b);
          }
        };
        /***/

      },
      /* 110 */

      /***/
      function (module) {
        module.exports = function (exec) {
          try {
            return {
              error: false,
              value: exec()
            };
          } catch (error) {
            return {
              error: true,
              value: error
            };
          }
        };
        /***/

      },
      /* 111 */

      /***/
      function (module) {
        module.exports = typeof window == 'object';
        /***/
      },
      /* 112 */

      /***/
      function (__unused_webpack_module, __unused_webpack_exports, __w_pdfjs_require__) {
        "use strict";

        var $ = __w_pdfjs_require__(9);

        var aFunction = __w_pdfjs_require__(81);

        var newPromiseCapabilityModule = __w_pdfjs_require__(108);

        var perform = __w_pdfjs_require__(110);

        var iterate = __w_pdfjs_require__(78);

        $({
          target: 'Promise',
          stat: true
        }, {
          allSettled: function allSettled(iterable) {
            var C = this;
            var capability = newPromiseCapabilityModule.f(C);
            var resolve = capability.resolve;
            var reject = capability.reject;
            var result = perform(function () {
              var promiseResolve = aFunction(C.resolve);
              var values = [];
              var counter = 0;
              var remaining = 1;
              iterate(iterable, function (promise) {
                var index = counter++;
                var alreadyCalled = false;
                values.push(undefined);
                remaining++;
                promiseResolve.call(C, promise).then(function (value) {
                  if (alreadyCalled) return;
                  alreadyCalled = true;
                  values[index] = {
                    status: 'fulfilled',
                    value: value
                  };
                  --remaining || resolve(values);
                }, function (error) {
                  if (alreadyCalled) return;
                  alreadyCalled = true;
                  values[index] = {
                    status: 'rejected',
                    reason: error
                  };
                  --remaining || resolve(values);
                });
              });
              --remaining || resolve(values);
            });
            if (result.error) reject(result.value);
            return capability.promise;
          }
        });
        /***/
      },
      /* 113 */

      /***/
      function (__unused_webpack_module, __unused_webpack_exports, __w_pdfjs_require__) {
        "use strict";

        var $ = __w_pdfjs_require__(9);

        var aFunction = __w_pdfjs_require__(81);

        var getBuiltIn = __w_pdfjs_require__(24);

        var newPromiseCapabilityModule = __w_pdfjs_require__(108);

        var perform = __w_pdfjs_require__(110);

        var iterate = __w_pdfjs_require__(78);

        var PROMISE_ANY_ERROR = 'No one promise resolved';
        $({
          target: 'Promise',
          stat: true
        }, {
          any: function any(iterable) {
            var C = this;
            var capability = newPromiseCapabilityModule.f(C);
            var resolve = capability.resolve;
            var reject = capability.reject;
            var result = perform(function () {
              var promiseResolve = aFunction(C.resolve);
              var errors = [];
              var counter = 0;
              var remaining = 1;
              var alreadyResolved = false;
              iterate(iterable, function (promise) {
                var index = counter++;
                var alreadyRejected = false;
                errors.push(undefined);
                remaining++;
                promiseResolve.call(C, promise).then(function (value) {
                  if (alreadyRejected || alreadyResolved) return;
                  alreadyResolved = true;
                  resolve(value);
                }, function (error) {
                  if (alreadyRejected || alreadyResolved) return;
                  alreadyRejected = true;
                  errors[index] = error;
                  --remaining || reject(new (getBuiltIn('AggregateError'))(errors, PROMISE_ANY_ERROR));
                });
              });
              --remaining || reject(new (getBuiltIn('AggregateError'))(errors, PROMISE_ANY_ERROR));
            });
            if (result.error) reject(result.value);
            return capability.promise;
          }
        });
        /***/
      },
      /* 114 */

      /***/
      function (__unused_webpack_module, __unused_webpack_exports, __w_pdfjs_require__) {
        "use strict";

        var $ = __w_pdfjs_require__(9);

        var IS_PURE = __w_pdfjs_require__(32);

        var NativePromise = __w_pdfjs_require__(95);

        var fails = __w_pdfjs_require__(13);

        var getBuiltIn = __w_pdfjs_require__(24);

        var speciesConstructor = __w_pdfjs_require__(100);

        var promiseResolve = __w_pdfjs_require__(107);

        var redefine = __w_pdfjs_require__(43);

        var NON_GENERIC = !!NativePromise && fails(function () {
          NativePromise.prototype['finally'].call({
            then: function then() {}
          }, function () {});
        });
        $({
          target: 'Promise',
          proto: true,
          real: true,
          forced: NON_GENERIC
        }, {
          'finally': function _finally(onFinally) {
            var C = speciesConstructor(this, getBuiltIn('Promise'));
            var isFunction = typeof onFinally == 'function';
            return this.then(isFunction ? function (x) {
              return promiseResolve(C, onFinally()).then(function () {
                return x;
              });
            } : onFinally, isFunction ? function (e) {
              return promiseResolve(C, onFinally()).then(function () {
                throw e;
              });
            } : onFinally);
          }
        });

        if (!IS_PURE && typeof NativePromise == 'function') {
          var method = getBuiltIn('Promise').prototype['finally'];

          if (NativePromise.prototype['finally'] !== method) {
            redefine(NativePromise.prototype, 'finally', method, {
              unsafe: true
            });
          }
        }
        /***/

      },
      /* 115 */

      /***/
      function (__unused_webpack_module, __unused_webpack_exports, __w_pdfjs_require__) {
        "use strict";

        var charAt = __w_pdfjs_require__(116).charAt;

        var toString = __w_pdfjs_require__(91);

        var InternalStateModule = __w_pdfjs_require__(45);

        var defineIterator = __w_pdfjs_require__(69);

        var STRING_ITERATOR = 'String Iterator';
        var setInternalState = InternalStateModule.set;
        var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR);
        defineIterator(String, 'String', function (iterated) {
          setInternalState(this, {
            type: STRING_ITERATOR,
            string: toString(iterated),
            index: 0
          });
        }, function next() {
          var state = getInternalState(this);
          var string = state.string;
          var index = state.index;
          var point;
          if (index >= string.length) return {
            value: undefined,
            done: true
          };
          point = charAt(string, index);
          state.index += point.length;
          return {
            value: point,
            done: false
          };
        });
        /***/
      },
      /* 116 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        var toInteger = __w_pdfjs_require__(55);

        var toString = __w_pdfjs_require__(91);

        var requireObjectCoercible = __w_pdfjs_require__(19);

        var createMethod = function createMethod(CONVERT_TO_STRING) {
          return function ($this, pos) {
            var S = toString(requireObjectCoercible($this));
            var position = toInteger(pos);
            var size = S.length;
            var first, second;
            if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
            first = S.charCodeAt(position);
            return first < 0xD800 || first > 0xDBFF || position + 1 === size || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF ? CONVERT_TO_STRING ? S.charAt(position) : first : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
          };
        };

        module.exports = {
          codeAt: createMethod(false),
          charAt: createMethod(true)
        };
        /***/
      },
      /* 117 */

      /***/
      function (__unused_webpack_module, exports) {
        (function (global, factory) {
           true ? factory(exports) : 0;
        })(this, function (exports) {
          'use strict';

          var SymbolPolyfill = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol : function (description) {
            return "Symbol(" + description + ")";
          };

          function noop() {
            return undefined;
          }

          function getGlobals() {
            if (typeof self !== 'undefined') {
              return self;
            } else if (typeof window !== 'undefined') {
              return window;
            } else if (typeof __webpack_require__.g !== 'undefined') {
              return __webpack_require__.g;
            }

            return undefined;
          }

          var globals = getGlobals();

          function typeIsObject(x) {
            return typeof x === 'object' && x !== null || typeof x === 'function';
          }

          var rethrowAssertionErrorRejection = noop;
          var originalPromise = Promise;
          var originalPromiseThen = Promise.prototype.then;
          var originalPromiseResolve = Promise.resolve.bind(originalPromise);
          var originalPromiseReject = Promise.reject.bind(originalPromise);

          function newPromise(executor) {
            return new originalPromise(executor);
          }

          function promiseResolvedWith(value) {
            return originalPromiseResolve(value);
          }

          function promiseRejectedWith(reason) {
            return originalPromiseReject(reason);
          }

          function PerformPromiseThen(promise, onFulfilled, onRejected) {
            return originalPromiseThen.call(promise, onFulfilled, onRejected);
          }

          function uponPromise(promise, onFulfilled, onRejected) {
            PerformPromiseThen(PerformPromiseThen(promise, onFulfilled, onRejected), undefined, rethrowAssertionErrorRejection);
          }

          function uponFulfillment(promise, onFulfilled) {
            uponPromise(promise, onFulfilled);
          }

          function uponRejection(promise, onRejected) {
            uponPromise(promise, undefined, onRejected);
          }

          function transformPromiseWith(promise, fulfillmentHandler, rejectionHandler) {
            return PerformPromiseThen(promise, fulfillmentHandler, rejectionHandler);
          }

          function setPromiseIsHandledToTrue(promise) {
            PerformPromiseThen(promise, undefined, rethrowAssertionErrorRejection);
          }

          var queueMicrotask = function () {
            var globalQueueMicrotask = globals && globals.queueMicrotask;

            if (typeof globalQueueMicrotask === 'function') {
              return globalQueueMicrotask;
            }

            var resolvedPromise = promiseResolvedWith(undefined);
            return function (fn) {
              return PerformPromiseThen(resolvedPromise, fn);
            };
          }();

          function reflectCall(F, V, args) {
            if (typeof F !== 'function') {
              throw new TypeError('Argument is not a function');
            }

            return Function.prototype.apply.call(F, V, args);
          }

          function promiseCall(F, V, args) {
            try {
              return promiseResolvedWith(reflectCall(F, V, args));
            } catch (value) {
              return promiseRejectedWith(value);
            }
          }

          var QUEUE_MAX_ARRAY_SIZE = 16384;

          var SimpleQueue = function () {
            function SimpleQueue() {
              this._cursor = 0;
              this._size = 0;
              this._front = {
                _elements: [],
                _next: undefined
              };
              this._back = this._front;
              this._cursor = 0;
              this._size = 0;
            }

            Object.defineProperty(SimpleQueue.prototype, "length", {
              get: function get() {
                return this._size;
              },
              enumerable: false,
              configurable: true
            });

            SimpleQueue.prototype.push = function (element) {
              var oldBack = this._back;
              var newBack = oldBack;

              if (oldBack._elements.length === QUEUE_MAX_ARRAY_SIZE - 1) {
                newBack = {
                  _elements: [],
                  _next: undefined
                };
              }

              oldBack._elements.push(element);

              if (newBack !== oldBack) {
                this._back = newBack;
                oldBack._next = newBack;
              }

              ++this._size;
            };

            SimpleQueue.prototype.shift = function () {
              var oldFront = this._front;
              var newFront = oldFront;
              var oldCursor = this._cursor;
              var newCursor = oldCursor + 1;
              var elements = oldFront._elements;
              var element = elements[oldCursor];

              if (newCursor === QUEUE_MAX_ARRAY_SIZE) {
                newFront = oldFront._next;
                newCursor = 0;
              }

              --this._size;
              this._cursor = newCursor;

              if (oldFront !== newFront) {
                this._front = newFront;
              }

              elements[oldCursor] = undefined;
              return element;
            };

            SimpleQueue.prototype.forEach = function (callback) {
              var i = this._cursor;
              var node = this._front;
              var elements = node._elements;

              while (i !== elements.length || node._next !== undefined) {
                if (i === elements.length) {
                  node = node._next;
                  elements = node._elements;
                  i = 0;

                  if (elements.length === 0) {
                    break;
                  }
                }

                callback(elements[i]);
                ++i;
              }
            };

            SimpleQueue.prototype.peek = function () {
              var front = this._front;
              var cursor = this._cursor;
              return front._elements[cursor];
            };

            return SimpleQueue;
          }();

          function ReadableStreamReaderGenericInitialize(reader, stream) {
            reader._ownerReadableStream = stream;
            stream._reader = reader;

            if (stream._state === 'readable') {
              defaultReaderClosedPromiseInitialize(reader);
            } else if (stream._state === 'closed') {
              defaultReaderClosedPromiseInitializeAsResolved(reader);
            } else {
              defaultReaderClosedPromiseInitializeAsRejected(reader, stream._storedError);
            }
          }

          function ReadableStreamReaderGenericCancel(reader, reason) {
            var stream = reader._ownerReadableStream;
            return ReadableStreamCancel(stream, reason);
          }

          function ReadableStreamReaderGenericRelease(reader) {
            if (reader._ownerReadableStream._state === 'readable') {
              defaultReaderClosedPromiseReject(reader, new TypeError("Reader was released and can no longer be used to monitor the stream's closedness"));
            } else {
              defaultReaderClosedPromiseResetToRejected(reader, new TypeError("Reader was released and can no longer be used to monitor the stream's closedness"));
            }

            reader._ownerReadableStream._reader = undefined;
            reader._ownerReadableStream = undefined;
          }

          function readerLockException(name) {
            return new TypeError('Cannot ' + name + ' a stream using a released reader');
          }

          function defaultReaderClosedPromiseInitialize(reader) {
            reader._closedPromise = newPromise(function (resolve, reject) {
              reader._closedPromise_resolve = resolve;
              reader._closedPromise_reject = reject;
            });
          }

          function defaultReaderClosedPromiseInitializeAsRejected(reader, reason) {
            defaultReaderClosedPromiseInitialize(reader);
            defaultReaderClosedPromiseReject(reader, reason);
          }

          function defaultReaderClosedPromiseInitializeAsResolved(reader) {
            defaultReaderClosedPromiseInitialize(reader);
            defaultReaderClosedPromiseResolve(reader);
          }

          function defaultReaderClosedPromiseReject(reader, reason) {
            if (reader._closedPromise_reject === undefined) {
              return;
            }

            setPromiseIsHandledToTrue(reader._closedPromise);

            reader._closedPromise_reject(reason);

            reader._closedPromise_resolve = undefined;
            reader._closedPromise_reject = undefined;
          }

          function defaultReaderClosedPromiseResetToRejected(reader, reason) {
            defaultReaderClosedPromiseInitializeAsRejected(reader, reason);
          }

          function defaultReaderClosedPromiseResolve(reader) {
            if (reader._closedPromise_resolve === undefined) {
              return;
            }

            reader._closedPromise_resolve(undefined);

            reader._closedPromise_resolve = undefined;
            reader._closedPromise_reject = undefined;
          }

          var AbortSteps = SymbolPolyfill('[[AbortSteps]]');
          var ErrorSteps = SymbolPolyfill('[[ErrorSteps]]');
          var CancelSteps = SymbolPolyfill('[[CancelSteps]]');
          var PullSteps = SymbolPolyfill('[[PullSteps]]');

          var NumberIsFinite = Number.isFinite || function (x) {
            return typeof x === 'number' && isFinite(x);
          };

          var MathTrunc = Math.trunc || function (v) {
            return v < 0 ? Math.ceil(v) : Math.floor(v);
          };

          function isDictionary(x) {
            return typeof x === 'object' || typeof x === 'function';
          }

          function assertDictionary(obj, context) {
            if (obj !== undefined && !isDictionary(obj)) {
              throw new TypeError(context + " is not an object.");
            }
          }

          function assertFunction(x, context) {
            if (typeof x !== 'function') {
              throw new TypeError(context + " is not a function.");
            }
          }

          function isObject(x) {
            return typeof x === 'object' && x !== null || typeof x === 'function';
          }

          function assertObject(x, context) {
            if (!isObject(x)) {
              throw new TypeError(context + " is not an object.");
            }
          }

          function assertRequiredArgument(x, position, context) {
            if (x === undefined) {
              throw new TypeError("Parameter " + position + " is required in '" + context + "'.");
            }
          }

          function assertRequiredField(x, field, context) {
            if (x === undefined) {
              throw new TypeError(field + " is required in '" + context + "'.");
            }
          }

          function convertUnrestrictedDouble(value) {
            return Number(value);
          }

          function censorNegativeZero(x) {
            return x === 0 ? 0 : x;
          }

          function integerPart(x) {
            return censorNegativeZero(MathTrunc(x));
          }

          function convertUnsignedLongLongWithEnforceRange(value, context) {
            var lowerBound = 0;
            var upperBound = Number.MAX_SAFE_INTEGER;
            var x = Number(value);
            x = censorNegativeZero(x);

            if (!NumberIsFinite(x)) {
              throw new TypeError(context + " is not a finite number");
            }

            x = integerPart(x);

            if (x < lowerBound || x > upperBound) {
              throw new TypeError(context + " is outside the accepted range of " + lowerBound + " to " + upperBound + ", inclusive");
            }

            if (!NumberIsFinite(x) || x === 0) {
              return 0;
            }

            return x;
          }

          function assertReadableStream(x, context) {
            if (!IsReadableStream(x)) {
              throw new TypeError(context + " is not a ReadableStream.");
            }
          }

          function AcquireReadableStreamDefaultReader(stream) {
            return new ReadableStreamDefaultReader(stream);
          }

          function ReadableStreamAddReadRequest(stream, readRequest) {
            stream._reader._readRequests.push(readRequest);
          }

          function ReadableStreamFulfillReadRequest(stream, chunk, done) {
            var reader = stream._reader;

            var readRequest = reader._readRequests.shift();

            if (done) {
              readRequest._closeSteps();
            } else {
              readRequest._chunkSteps(chunk);
            }
          }

          function ReadableStreamGetNumReadRequests(stream) {
            return stream._reader._readRequests.length;
          }

          function ReadableStreamHasDefaultReader(stream) {
            var reader = stream._reader;

            if (reader === undefined) {
              return false;
            }

            if (!IsReadableStreamDefaultReader(reader)) {
              return false;
            }

            return true;
          }

          var ReadableStreamDefaultReader = function () {
            function ReadableStreamDefaultReader(stream) {
              assertRequiredArgument(stream, 1, 'ReadableStreamDefaultReader');
              assertReadableStream(stream, 'First parameter');

              if (IsReadableStreamLocked(stream)) {
                throw new TypeError('This stream has already been locked for exclusive reading by another reader');
              }

              ReadableStreamReaderGenericInitialize(this, stream);
              this._readRequests = new SimpleQueue();
            }

            Object.defineProperty(ReadableStreamDefaultReader.prototype, "closed", {
              get: function get() {
                if (!IsReadableStreamDefaultReader(this)) {
                  return promiseRejectedWith(defaultReaderBrandCheckException('closed'));
                }

                return this._closedPromise;
              },
              enumerable: false,
              configurable: true
            });

            ReadableStreamDefaultReader.prototype.cancel = function (reason) {
              if (reason === void 0) {
                reason = undefined;
              }

              if (!IsReadableStreamDefaultReader(this)) {
                return promiseRejectedWith(defaultReaderBrandCheckException('cancel'));
              }

              if (this._ownerReadableStream === undefined) {
                return promiseRejectedWith(readerLockException('cancel'));
              }

              return ReadableStreamReaderGenericCancel(this, reason);
            };

            ReadableStreamDefaultReader.prototype.read = function () {
              if (!IsReadableStreamDefaultReader(this)) {
                return promiseRejectedWith(defaultReaderBrandCheckException('read'));
              }

              if (this._ownerReadableStream === undefined) {
                return promiseRejectedWith(readerLockException('read from'));
              }

              var resolvePromise;
              var rejectPromise;
              var promise = newPromise(function (resolve, reject) {
                resolvePromise = resolve;
                rejectPromise = reject;
              });
              var readRequest = {
                _chunkSteps: function _chunkSteps(chunk) {
                  return resolvePromise({
                    value: chunk,
                    done: false
                  });
                },
                _closeSteps: function _closeSteps() {
                  return resolvePromise({
                    value: undefined,
                    done: true
                  });
                },
                _errorSteps: function _errorSteps(e) {
                  return rejectPromise(e);
                }
              };
              ReadableStreamDefaultReaderRead(this, readRequest);
              return promise;
            };

            ReadableStreamDefaultReader.prototype.releaseLock = function () {
              if (!IsReadableStreamDefaultReader(this)) {
                throw defaultReaderBrandCheckException('releaseLock');
              }

              if (this._ownerReadableStream === undefined) {
                return;
              }

              if (this._readRequests.length > 0) {
                throw new TypeError('Tried to release a reader lock when that reader has pending read() calls un-settled');
              }

              ReadableStreamReaderGenericRelease(this);
            };

            return ReadableStreamDefaultReader;
          }();

          Object.defineProperties(ReadableStreamDefaultReader.prototype, {
            cancel: {
              enumerable: true
            },
            read: {
              enumerable: true
            },
            releaseLock: {
              enumerable: true
            },
            closed: {
              enumerable: true
            }
          });

          if (typeof SymbolPolyfill.toStringTag === 'symbol') {
            Object.defineProperty(ReadableStreamDefaultReader.prototype, SymbolPolyfill.toStringTag, {
              value: 'ReadableStreamDefaultReader',
              configurable: true
            });
          }

          function IsReadableStreamDefaultReader(x) {
            if (!typeIsObject(x)) {
              return false;
            }

            if (!Object.prototype.hasOwnProperty.call(x, '_readRequests')) {
              return false;
            }

            return x instanceof ReadableStreamDefaultReader;
          }

          function ReadableStreamDefaultReaderRead(reader, readRequest) {
            var stream = reader._ownerReadableStream;
            stream._disturbed = true;

            if (stream._state === 'closed') {
              readRequest._closeSteps();
            } else if (stream._state === 'errored') {
              readRequest._errorSteps(stream._storedError);
            } else {
              stream._readableStreamController[PullSteps](readRequest);
            }
          }

          function defaultReaderBrandCheckException(name) {
            return new TypeError("ReadableStreamDefaultReader.prototype." + name + " can only be used on a ReadableStreamDefaultReader");
          }

          var _a;

          var AsyncIteratorPrototype;

          if (typeof SymbolPolyfill.asyncIterator === 'symbol') {
            AsyncIteratorPrototype = (_a = {}, _a[SymbolPolyfill.asyncIterator] = function () {
              return this;
            }, _a);
            Object.defineProperty(AsyncIteratorPrototype, SymbolPolyfill.asyncIterator, {
              enumerable: false
            });
          }

          var ReadableStreamAsyncIteratorImpl = function () {
            function ReadableStreamAsyncIteratorImpl(reader, preventCancel) {
              this._ongoingPromise = undefined;
              this._isFinished = false;
              this._reader = reader;
              this._preventCancel = preventCancel;
            }

            ReadableStreamAsyncIteratorImpl.prototype.next = function () {
              var _this = this;

              var nextSteps = function nextSteps() {
                return _this._nextSteps();
              };

              this._ongoingPromise = this._ongoingPromise ? transformPromiseWith(this._ongoingPromise, nextSteps, nextSteps) : nextSteps();
              return this._ongoingPromise;
            };

            ReadableStreamAsyncIteratorImpl.prototype.return = function (value) {
              var _this = this;

              var returnSteps = function returnSteps() {
                return _this._returnSteps(value);
              };

              return this._ongoingPromise ? transformPromiseWith(this._ongoingPromise, returnSteps, returnSteps) : returnSteps();
            };

            ReadableStreamAsyncIteratorImpl.prototype._nextSteps = function () {
              var _this = this;

              if (this._isFinished) {
                return Promise.resolve({
                  value: undefined,
                  done: true
                });
              }

              var reader = this._reader;

              if (reader._ownerReadableStream === undefined) {
                return promiseRejectedWith(readerLockException('iterate'));
              }

              var resolvePromise;
              var rejectPromise;
              var promise = newPromise(function (resolve, reject) {
                resolvePromise = resolve;
                rejectPromise = reject;
              });
              var readRequest = {
                _chunkSteps: function _chunkSteps(chunk) {
                  _this._ongoingPromise = undefined;
                  queueMicrotask(function () {
                    return resolvePromise({
                      value: chunk,
                      done: false
                    });
                  });
                },
                _closeSteps: function _closeSteps() {
                  _this._ongoingPromise = undefined;
                  _this._isFinished = true;
                  ReadableStreamReaderGenericRelease(reader);
                  resolvePromise({
                    value: undefined,
                    done: true
                  });
                },
                _errorSteps: function _errorSteps(reason) {
                  _this._ongoingPromise = undefined;
                  _this._isFinished = true;
                  ReadableStreamReaderGenericRelease(reader);
                  rejectPromise(reason);
                }
              };
              ReadableStreamDefaultReaderRead(reader, readRequest);
              return promise;
            };

            ReadableStreamAsyncIteratorImpl.prototype._returnSteps = function (value) {
              if (this._isFinished) {
                return Promise.resolve({
                  value: value,
                  done: true
                });
              }

              this._isFinished = true;
              var reader = this._reader;

              if (reader._ownerReadableStream === undefined) {
                return promiseRejectedWith(readerLockException('finish iterating'));
              }

              if (!this._preventCancel) {
                var result = ReadableStreamReaderGenericCancel(reader, value);
                ReadableStreamReaderGenericRelease(reader);
                return transformPromiseWith(result, function () {
                  return {
                    value: value,
                    done: true
                  };
                });
              }

              ReadableStreamReaderGenericRelease(reader);
              return promiseResolvedWith({
                value: value,
                done: true
              });
            };

            return ReadableStreamAsyncIteratorImpl;
          }();

          var ReadableStreamAsyncIteratorPrototype = {
            next: function next() {
              if (!IsReadableStreamAsyncIterator(this)) {
                return promiseRejectedWith(streamAsyncIteratorBrandCheckException('next'));
              }

              return this._asyncIteratorImpl.next();
            },
            return: function _return(value) {
              if (!IsReadableStreamAsyncIterator(this)) {
                return promiseRejectedWith(streamAsyncIteratorBrandCheckException('return'));
              }

              return this._asyncIteratorImpl.return(value);
            }
          };

          if (AsyncIteratorPrototype !== undefined) {
            Object.setPrototypeOf(ReadableStreamAsyncIteratorPrototype, AsyncIteratorPrototype);
          }

          function AcquireReadableStreamAsyncIterator(stream, preventCancel) {
            var reader = AcquireReadableStreamDefaultReader(stream);
            var impl = new ReadableStreamAsyncIteratorImpl(reader, preventCancel);
            var iterator = Object.create(ReadableStreamAsyncIteratorPrototype);
            iterator._asyncIteratorImpl = impl;
            return iterator;
          }

          function IsReadableStreamAsyncIterator(x) {
            if (!typeIsObject(x)) {
              return false;
            }

            if (!Object.prototype.hasOwnProperty.call(x, '_asyncIteratorImpl')) {
              return false;
            }

            try {
              return x._asyncIteratorImpl instanceof ReadableStreamAsyncIteratorImpl;
            } catch (_a) {
              return false;
            }
          }

          function streamAsyncIteratorBrandCheckException(name) {
            return new TypeError("ReadableStreamAsyncIterator." + name + " can only be used on a ReadableSteamAsyncIterator");
          }

          var NumberIsNaN = Number.isNaN || function (x) {
            return x !== x;
          };

          function CreateArrayFromList(elements) {
            return elements.slice();
          }

          function CopyDataBlockBytes(dest, destOffset, src, srcOffset, n) {
            new Uint8Array(dest).set(new Uint8Array(src, srcOffset, n), destOffset);
          }

          function TransferArrayBuffer(O) {
            return O;
          }

          function IsDetachedBuffer(O) {
            return false;
          }

          function ArrayBufferSlice(buffer, begin, end) {
            if (buffer.slice) {
              return buffer.slice(begin, end);
            }

            var length = end - begin;
            var slice = new ArrayBuffer(length);
            CopyDataBlockBytes(slice, 0, buffer, begin, length);
            return slice;
          }

          function IsNonNegativeNumber(v) {
            if (typeof v !== 'number') {
              return false;
            }

            if (NumberIsNaN(v)) {
              return false;
            }

            if (v < 0) {
              return false;
            }

            return true;
          }

          function CloneAsUint8Array(O) {
            var buffer = ArrayBufferSlice(O.buffer, O.byteOffset, O.byteOffset + O.byteLength);
            return new Uint8Array(buffer);
          }

          function DequeueValue(container) {
            var pair = container._queue.shift();

            container._queueTotalSize -= pair.size;

            if (container._queueTotalSize < 0) {
              container._queueTotalSize = 0;
            }

            return pair.value;
          }

          function EnqueueValueWithSize(container, value, size) {
            if (!IsNonNegativeNumber(size) || size === Infinity) {
              throw new RangeError('Size must be a finite, non-NaN, non-negative number.');
            }

            container._queue.push({
              value: value,
              size: size
            });

            container._queueTotalSize += size;
          }

          function PeekQueueValue(container) {
            var pair = container._queue.peek();

            return pair.value;
          }

          function ResetQueue(container) {
            container._queue = new SimpleQueue();
            container._queueTotalSize = 0;
          }

          var ReadableStreamBYOBRequest = function () {
            function ReadableStreamBYOBRequest() {
              throw new TypeError('Illegal constructor');
            }

            Object.defineProperty(ReadableStreamBYOBRequest.prototype, "view", {
              get: function get() {
                if (!IsReadableStreamBYOBRequest(this)) {
                  throw byobRequestBrandCheckException('view');
                }

                return this._view;
              },
              enumerable: false,
              configurable: true
            });

            ReadableStreamBYOBRequest.prototype.respond = function (bytesWritten) {
              if (!IsReadableStreamBYOBRequest(this)) {
                throw byobRequestBrandCheckException('respond');
              }

              assertRequiredArgument(bytesWritten, 1, 'respond');
              bytesWritten = convertUnsignedLongLongWithEnforceRange(bytesWritten, 'First parameter');

              if (this._associatedReadableByteStreamController === undefined) {
                throw new TypeError('This BYOB request has been invalidated');
              }

              if (IsDetachedBuffer(this._view.buffer)) ;
              ReadableByteStreamControllerRespond(this._associatedReadableByteStreamController, bytesWritten);
            };

            ReadableStreamBYOBRequest.prototype.respondWithNewView = function (view) {
              if (!IsReadableStreamBYOBRequest(this)) {
                throw byobRequestBrandCheckException('respondWithNewView');
              }

              assertRequiredArgument(view, 1, 'respondWithNewView');

              if (!ArrayBuffer.isView(view)) {
                throw new TypeError('You can only respond with array buffer views');
              }

              if (this._associatedReadableByteStreamController === undefined) {
                throw new TypeError('This BYOB request has been invalidated');
              }

              if (IsDetachedBuffer(view.buffer)) ;
              ReadableByteStreamControllerRespondWithNewView(this._associatedReadableByteStreamController, view);
            };

            return ReadableStreamBYOBRequest;
          }();

          Object.defineProperties(ReadableStreamBYOBRequest.prototype, {
            respond: {
              enumerable: true
            },
            respondWithNewView: {
              enumerable: true
            },
            view: {
              enumerable: true
            }
          });

          if (typeof SymbolPolyfill.toStringTag === 'symbol') {
            Object.defineProperty(ReadableStreamBYOBRequest.prototype, SymbolPolyfill.toStringTag, {
              value: 'ReadableStreamBYOBRequest',
              configurable: true
            });
          }

          var ReadableByteStreamController = function () {
            function ReadableByteStreamController() {
              throw new TypeError('Illegal constructor');
            }

            Object.defineProperty(ReadableByteStreamController.prototype, "byobRequest", {
              get: function get() {
                if (!IsReadableByteStreamController(this)) {
                  throw byteStreamControllerBrandCheckException('byobRequest');
                }

                return ReadableByteStreamControllerGetBYOBRequest(this);
              },
              enumerable: false,
              configurable: true
            });
            Object.defineProperty(ReadableByteStreamController.prototype, "desiredSize", {
              get: function get() {
                if (!IsReadableByteStreamController(this)) {
                  throw byteStreamControllerBrandCheckException('desiredSize');
                }

                return ReadableByteStreamControllerGetDesiredSize(this);
              },
              enumerable: false,
              configurable: true
            });

            ReadableByteStreamController.prototype.close = function () {
              if (!IsReadableByteStreamController(this)) {
                throw byteStreamControllerBrandCheckException('close');
              }

              if (this._closeRequested) {
                throw new TypeError('The stream has already been closed; do not close it again!');
              }

              var state = this._controlledReadableByteStream._state;

              if (state !== 'readable') {
                throw new TypeError("The stream (in " + state + " state) is not in the readable state and cannot be closed");
              }

              ReadableByteStreamControllerClose(this);
            };

            ReadableByteStreamController.prototype.enqueue = function (chunk) {
              if (!IsReadableByteStreamController(this)) {
                throw byteStreamControllerBrandCheckException('enqueue');
              }

              assertRequiredArgument(chunk, 1, 'enqueue');

              if (!ArrayBuffer.isView(chunk)) {
                throw new TypeError('chunk must be an array buffer view');
              }

              if (chunk.byteLength === 0) {
                throw new TypeError('chunk must have non-zero byteLength');
              }

              if (chunk.buffer.byteLength === 0) {
                throw new TypeError("chunk's buffer must have non-zero byteLength");
              }

              if (this._closeRequested) {
                throw new TypeError('stream is closed or draining');
              }

              var state = this._controlledReadableByteStream._state;

              if (state !== 'readable') {
                throw new TypeError("The stream (in " + state + " state) is not in the readable state and cannot be enqueued to");
              }

              ReadableByteStreamControllerEnqueue(this, chunk);
            };

            ReadableByteStreamController.prototype.error = function (e) {
              if (e === void 0) {
                e = undefined;
              }

              if (!IsReadableByteStreamController(this)) {
                throw byteStreamControllerBrandCheckException('error');
              }

              ReadableByteStreamControllerError(this, e);
            };

            ReadableByteStreamController.prototype[CancelSteps] = function (reason) {
              ReadableByteStreamControllerClearPendingPullIntos(this);
              ResetQueue(this);

              var result = this._cancelAlgorithm(reason);

              ReadableByteStreamControllerClearAlgorithms(this);
              return result;
            };

            ReadableByteStreamController.prototype[PullSteps] = function (readRequest) {
              var stream = this._controlledReadableByteStream;

              if (this._queueTotalSize > 0) {
                var entry = this._queue.shift();

                this._queueTotalSize -= entry.byteLength;
                ReadableByteStreamControllerHandleQueueDrain(this);
                var view = new Uint8Array(entry.buffer, entry.byteOffset, entry.byteLength);

                readRequest._chunkSteps(view);

                return;
              }

              var autoAllocateChunkSize = this._autoAllocateChunkSize;

              if (autoAllocateChunkSize !== undefined) {
                var buffer = void 0;

                try {
                  buffer = new ArrayBuffer(autoAllocateChunkSize);
                } catch (bufferE) {
                  readRequest._errorSteps(bufferE);

                  return;
                }

                var pullIntoDescriptor = {
                  buffer: buffer,
                  bufferByteLength: autoAllocateChunkSize,
                  byteOffset: 0,
                  byteLength: autoAllocateChunkSize,
                  bytesFilled: 0,
                  elementSize: 1,
                  viewConstructor: Uint8Array,
                  readerType: 'default'
                };

                this._pendingPullIntos.push(pullIntoDescriptor);
              }

              ReadableStreamAddReadRequest(stream, readRequest);
              ReadableByteStreamControllerCallPullIfNeeded(this);
            };

            return ReadableByteStreamController;
          }();

          Object.defineProperties(ReadableByteStreamController.prototype, {
            close: {
              enumerable: true
            },
            enqueue: {
              enumerable: true
            },
            error: {
              enumerable: true
            },
            byobRequest: {
              enumerable: true
            },
            desiredSize: {
              enumerable: true
            }
          });

          if (typeof SymbolPolyfill.toStringTag === 'symbol') {
            Object.defineProperty(ReadableByteStreamController.prototype, SymbolPolyfill.toStringTag, {
              value: 'ReadableByteStreamController',
              configurable: true
            });
          }

          function IsReadableByteStreamController(x) {
            if (!typeIsObject(x)) {
              return false;
            }

            if (!Object.prototype.hasOwnProperty.call(x, '_controlledReadableByteStream')) {
              return false;
            }

            return x instanceof ReadableByteStreamController;
          }

          function IsReadableStreamBYOBRequest(x) {
            if (!typeIsObject(x)) {
              return false;
            }

            if (!Object.prototype.hasOwnProperty.call(x, '_associatedReadableByteStreamController')) {
              return false;
            }

            return x instanceof ReadableStreamBYOBRequest;
          }

          function ReadableByteStreamControllerCallPullIfNeeded(controller) {
            var shouldPull = ReadableByteStreamControllerShouldCallPull(controller);

            if (!shouldPull) {
              return;
            }

            if (controller._pulling) {
              controller._pullAgain = true;
              return;
            }

            controller._pulling = true;

            var pullPromise = controller._pullAlgorithm();

            uponPromise(pullPromise, function () {
              controller._pulling = false;

              if (controller._pullAgain) {
                controller._pullAgain = false;
                ReadableByteStreamControllerCallPullIfNeeded(controller);
              }
            }, function (e) {
              ReadableByteStreamControllerError(controller, e);
            });
          }

          function ReadableByteStreamControllerClearPendingPullIntos(controller) {
            ReadableByteStreamControllerInvalidateBYOBRequest(controller);
            controller._pendingPullIntos = new SimpleQueue();
          }

          function ReadableByteStreamControllerCommitPullIntoDescriptor(stream, pullIntoDescriptor) {
            var done = false;

            if (stream._state === 'closed') {
              done = true;
            }

            var filledView = ReadableByteStreamControllerConvertPullIntoDescriptor(pullIntoDescriptor);

            if (pullIntoDescriptor.readerType === 'default') {
              ReadableStreamFulfillReadRequest(stream, filledView, done);
            } else {
              ReadableStreamFulfillReadIntoRequest(stream, filledView, done);
            }
          }

          function ReadableByteStreamControllerConvertPullIntoDescriptor(pullIntoDescriptor) {
            var bytesFilled = pullIntoDescriptor.bytesFilled;
            var elementSize = pullIntoDescriptor.elementSize;
            return new pullIntoDescriptor.viewConstructor(pullIntoDescriptor.buffer, pullIntoDescriptor.byteOffset, bytesFilled / elementSize);
          }

          function ReadableByteStreamControllerEnqueueChunkToQueue(controller, buffer, byteOffset, byteLength) {
            controller._queue.push({
              buffer: buffer,
              byteOffset: byteOffset,
              byteLength: byteLength
            });

            controller._queueTotalSize += byteLength;
          }

          function ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller, pullIntoDescriptor) {
            var elementSize = pullIntoDescriptor.elementSize;
            var currentAlignedBytes = pullIntoDescriptor.bytesFilled - pullIntoDescriptor.bytesFilled % elementSize;
            var maxBytesToCopy = Math.min(controller._queueTotalSize, pullIntoDescriptor.byteLength - pullIntoDescriptor.bytesFilled);
            var maxBytesFilled = pullIntoDescriptor.bytesFilled + maxBytesToCopy;
            var maxAlignedBytes = maxBytesFilled - maxBytesFilled % elementSize;
            var totalBytesToCopyRemaining = maxBytesToCopy;
            var ready = false;

            if (maxAlignedBytes > currentAlignedBytes) {
              totalBytesToCopyRemaining = maxAlignedBytes - pullIntoDescriptor.bytesFilled;
              ready = true;
            }

            var queue = controller._queue;

            while (totalBytesToCopyRemaining > 0) {
              var headOfQueue = queue.peek();
              var bytesToCopy = Math.min(totalBytesToCopyRemaining, headOfQueue.byteLength);
              var destStart = pullIntoDescriptor.byteOffset + pullIntoDescriptor.bytesFilled;
              CopyDataBlockBytes(pullIntoDescriptor.buffer, destStart, headOfQueue.buffer, headOfQueue.byteOffset, bytesToCopy);

              if (headOfQueue.byteLength === bytesToCopy) {
                queue.shift();
              } else {
                headOfQueue.byteOffset += bytesToCopy;
                headOfQueue.byteLength -= bytesToCopy;
              }

              controller._queueTotalSize -= bytesToCopy;
              ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, bytesToCopy, pullIntoDescriptor);
              totalBytesToCopyRemaining -= bytesToCopy;
            }

            return ready;
          }

          function ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, size, pullIntoDescriptor) {
            pullIntoDescriptor.bytesFilled += size;
          }

          function ReadableByteStreamControllerHandleQueueDrain(controller) {
            if (controller._queueTotalSize === 0 && controller._closeRequested) {
              ReadableByteStreamControllerClearAlgorithms(controller);
              ReadableStreamClose(controller._controlledReadableByteStream);
            } else {
              ReadableByteStreamControllerCallPullIfNeeded(controller);
            }
          }

          function ReadableByteStreamControllerInvalidateBYOBRequest(controller) {
            if (controller._byobRequest === null) {
              return;
            }

            controller._byobRequest._associatedReadableByteStreamController = undefined;
            controller._byobRequest._view = null;
            controller._byobRequest = null;
          }

          function ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller) {
            while (controller._pendingPullIntos.length > 0) {
              if (controller._queueTotalSize === 0) {
                return;
              }

              var pullIntoDescriptor = controller._pendingPullIntos.peek();

              if (ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller, pullIntoDescriptor)) {
                ReadableByteStreamControllerShiftPendingPullInto(controller);
                ReadableByteStreamControllerCommitPullIntoDescriptor(controller._controlledReadableByteStream, pullIntoDescriptor);
              }
            }
          }

          function ReadableByteStreamControllerPullInto(controller, view, readIntoRequest) {
            var stream = controller._controlledReadableByteStream;
            var elementSize = 1;

            if (view.constructor !== DataView) {
              elementSize = view.constructor.BYTES_PER_ELEMENT;
            }

            var ctor = view.constructor;
            var buffer = TransferArrayBuffer(view.buffer);
            var pullIntoDescriptor = {
              buffer: buffer,
              bufferByteLength: buffer.byteLength,
              byteOffset: view.byteOffset,
              byteLength: view.byteLength,
              bytesFilled: 0,
              elementSize: elementSize,
              viewConstructor: ctor,
              readerType: 'byob'
            };

            if (controller._pendingPullIntos.length > 0) {
              controller._pendingPullIntos.push(pullIntoDescriptor);

              ReadableStreamAddReadIntoRequest(stream, readIntoRequest);
              return;
            }

            if (stream._state === 'closed') {
              var emptyView = new ctor(pullIntoDescriptor.buffer, pullIntoDescriptor.byteOffset, 0);

              readIntoRequest._closeSteps(emptyView);

              return;
            }

            if (controller._queueTotalSize > 0) {
              if (ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller, pullIntoDescriptor)) {
                var filledView = ReadableByteStreamControllerConvertPullIntoDescriptor(pullIntoDescriptor);
                ReadableByteStreamControllerHandleQueueDrain(controller);

                readIntoRequest._chunkSteps(filledView);

                return;
              }

              if (controller._closeRequested) {
                var e = new TypeError('Insufficient bytes to fill elements in the given buffer');
                ReadableByteStreamControllerError(controller, e);

                readIntoRequest._errorSteps(e);

                return;
              }
            }

            controller._pendingPullIntos.push(pullIntoDescriptor);

            ReadableStreamAddReadIntoRequest(stream, readIntoRequest);
            ReadableByteStreamControllerCallPullIfNeeded(controller);
          }

          function ReadableByteStreamControllerRespondInClosedState(controller, firstDescriptor) {
            var stream = controller._controlledReadableByteStream;

            if (ReadableStreamHasBYOBReader(stream)) {
              while (ReadableStreamGetNumReadIntoRequests(stream) > 0) {
                var pullIntoDescriptor = ReadableByteStreamControllerShiftPendingPullInto(controller);
                ReadableByteStreamControllerCommitPullIntoDescriptor(stream, pullIntoDescriptor);
              }
            }
          }

          function ReadableByteStreamControllerRespondInReadableState(controller, bytesWritten, pullIntoDescriptor) {
            ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, bytesWritten, pullIntoDescriptor);

            if (pullIntoDescriptor.bytesFilled < pullIntoDescriptor.elementSize) {
              return;
            }

            ReadableByteStreamControllerShiftPendingPullInto(controller);
            var remainderSize = pullIntoDescriptor.bytesFilled % pullIntoDescriptor.elementSize;

            if (remainderSize > 0) {
              var end = pullIntoDescriptor.byteOffset + pullIntoDescriptor.bytesFilled;
              var remainder = ArrayBufferSlice(pullIntoDescriptor.buffer, end - remainderSize, end);
              ReadableByteStreamControllerEnqueueChunkToQueue(controller, remainder, 0, remainder.byteLength);
            }

            pullIntoDescriptor.bytesFilled -= remainderSize;
            ReadableByteStreamControllerCommitPullIntoDescriptor(controller._controlledReadableByteStream, pullIntoDescriptor);
            ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller);
          }

          function ReadableByteStreamControllerRespondInternal(controller, bytesWritten) {
            var firstDescriptor = controller._pendingPullIntos.peek();

            ReadableByteStreamControllerInvalidateBYOBRequest(controller);
            var state = controller._controlledReadableByteStream._state;

            if (state === 'closed') {
              ReadableByteStreamControllerRespondInClosedState(controller);
            } else {
              ReadableByteStreamControllerRespondInReadableState(controller, bytesWritten, firstDescriptor);
            }

            ReadableByteStreamControllerCallPullIfNeeded(controller);
          }

          function ReadableByteStreamControllerShiftPendingPullInto(controller) {
            var descriptor = controller._pendingPullIntos.shift();

            return descriptor;
          }

          function ReadableByteStreamControllerShouldCallPull(controller) {
            var stream = controller._controlledReadableByteStream;

            if (stream._state !== 'readable') {
              return false;
            }

            if (controller._closeRequested) {
              return false;
            }

            if (!controller._started) {
              return false;
            }

            if (ReadableStreamHasDefaultReader(stream) && ReadableStreamGetNumReadRequests(stream) > 0) {
              return true;
            }

            if (ReadableStreamHasBYOBReader(stream) && ReadableStreamGetNumReadIntoRequests(stream) > 0) {
              return true;
            }

            var desiredSize = ReadableByteStreamControllerGetDesiredSize(controller);

            if (desiredSize > 0) {
              return true;
            }

            return false;
          }

          function ReadableByteStreamControllerClearAlgorithms(controller) {
            controller._pullAlgorithm = undefined;
            controller._cancelAlgorithm = undefined;
          }

          function ReadableByteStreamControllerClose(controller) {
            var stream = controller._controlledReadableByteStream;

            if (controller._closeRequested || stream._state !== 'readable') {
              return;
            }

            if (controller._queueTotalSize > 0) {
              controller._closeRequested = true;
              return;
            }

            if (controller._pendingPullIntos.length > 0) {
              var firstPendingPullInto = controller._pendingPullIntos.peek();

              if (firstPendingPullInto.bytesFilled > 0) {
                var e = new TypeError('Insufficient bytes to fill elements in the given buffer');
                ReadableByteStreamControllerError(controller, e);
                throw e;
              }
            }

            ReadableByteStreamControllerClearAlgorithms(controller);
            ReadableStreamClose(stream);
          }

          function ReadableByteStreamControllerEnqueue(controller, chunk) {
            var stream = controller._controlledReadableByteStream;

            if (controller._closeRequested || stream._state !== 'readable') {
              return;
            }

            var buffer = chunk.buffer;
            var byteOffset = chunk.byteOffset;
            var byteLength = chunk.byteLength;
            var transferredBuffer = TransferArrayBuffer(buffer);

            if (controller._pendingPullIntos.length > 0) {
              var firstPendingPullInto = controller._pendingPullIntos.peek();

              if (IsDetachedBuffer(firstPendingPullInto.buffer)) ;
              firstPendingPullInto.buffer = TransferArrayBuffer(firstPendingPullInto.buffer);
            }

            ReadableByteStreamControllerInvalidateBYOBRequest(controller);

            if (ReadableStreamHasDefaultReader(stream)) {
              if (ReadableStreamGetNumReadRequests(stream) === 0) {
                ReadableByteStreamControllerEnqueueChunkToQueue(controller, transferredBuffer, byteOffset, byteLength);
              } else {
                var transferredView = new Uint8Array(transferredBuffer, byteOffset, byteLength);
                ReadableStreamFulfillReadRequest(stream, transferredView, false);
              }
            } else if (ReadableStreamHasBYOBReader(stream)) {
              ReadableByteStreamControllerEnqueueChunkToQueue(controller, transferredBuffer, byteOffset, byteLength);
              ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller);
            } else {
              ReadableByteStreamControllerEnqueueChunkToQueue(controller, transferredBuffer, byteOffset, byteLength);
            }

            ReadableByteStreamControllerCallPullIfNeeded(controller);
          }

          function ReadableByteStreamControllerError(controller, e) {
            var stream = controller._controlledReadableByteStream;

            if (stream._state !== 'readable') {
              return;
            }

            ReadableByteStreamControllerClearPendingPullIntos(controller);
            ResetQueue(controller);
            ReadableByteStreamControllerClearAlgorithms(controller);
            ReadableStreamError(stream, e);
          }

          function ReadableByteStreamControllerGetBYOBRequest(controller) {
            if (controller._byobRequest === null && controller._pendingPullIntos.length > 0) {
              var firstDescriptor = controller._pendingPullIntos.peek();

              var view = new Uint8Array(firstDescriptor.buffer, firstDescriptor.byteOffset + firstDescriptor.bytesFilled, firstDescriptor.byteLength - firstDescriptor.bytesFilled);
              var byobRequest = Object.create(ReadableStreamBYOBRequest.prototype);
              SetUpReadableStreamBYOBRequest(byobRequest, controller, view);
              controller._byobRequest = byobRequest;
            }

            return controller._byobRequest;
          }

          function ReadableByteStreamControllerGetDesiredSize(controller) {
            var state = controller._controlledReadableByteStream._state;

            if (state === 'errored') {
              return null;
            }

            if (state === 'closed') {
              return 0;
            }

            return controller._strategyHWM - controller._queueTotalSize;
          }

          function ReadableByteStreamControllerRespond(controller, bytesWritten) {
            var firstDescriptor = controller._pendingPullIntos.peek();

            var state = controller._controlledReadableByteStream._state;

            if (state === 'closed') {
              if (bytesWritten !== 0) {
                throw new TypeError('bytesWritten must be 0 when calling respond() on a closed stream');
              }
            } else {
              if (bytesWritten === 0) {
                throw new TypeError('bytesWritten must be greater than 0 when calling respond() on a readable stream');
              }

              if (firstDescriptor.bytesFilled + bytesWritten > firstDescriptor.byteLength) {
                throw new RangeError('bytesWritten out of range');
              }
            }

            firstDescriptor.buffer = TransferArrayBuffer(firstDescriptor.buffer);
            ReadableByteStreamControllerRespondInternal(controller, bytesWritten);
          }

          function ReadableByteStreamControllerRespondWithNewView(controller, view) {
            var firstDescriptor = controller._pendingPullIntos.peek();

            var state = controller._controlledReadableByteStream._state;

            if (state === 'closed') {
              if (view.byteLength !== 0) {
                throw new TypeError('The view\'s length must be 0 when calling respondWithNewView() on a closed stream');
              }
            } else {
              if (view.byteLength === 0) {
                throw new TypeError('The view\'s length must be greater than 0 when calling respondWithNewView() on a readable stream');
              }
            }

            if (firstDescriptor.byteOffset + firstDescriptor.bytesFilled !== view.byteOffset) {
              throw new RangeError('The region specified by view does not match byobRequest');
            }

            if (firstDescriptor.bufferByteLength !== view.buffer.byteLength) {
              throw new RangeError('The buffer of view has different capacity than byobRequest');
            }

            if (firstDescriptor.bytesFilled + view.byteLength > firstDescriptor.byteLength) {
              throw new RangeError('The region specified by view is larger than byobRequest');
            }

            firstDescriptor.buffer = TransferArrayBuffer(view.buffer);
            ReadableByteStreamControllerRespondInternal(controller, view.byteLength);
          }

          function SetUpReadableByteStreamController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, autoAllocateChunkSize) {
            controller._controlledReadableByteStream = stream;
            controller._pullAgain = false;
            controller._pulling = false;
            controller._byobRequest = null;
            controller._queue = controller._queueTotalSize = undefined;
            ResetQueue(controller);
            controller._closeRequested = false;
            controller._started = false;
            controller._strategyHWM = highWaterMark;
            controller._pullAlgorithm = pullAlgorithm;
            controller._cancelAlgorithm = cancelAlgorithm;
            controller._autoAllocateChunkSize = autoAllocateChunkSize;
            controller._pendingPullIntos = new SimpleQueue();
            stream._readableStreamController = controller;
            var startResult = startAlgorithm();
            uponPromise(promiseResolvedWith(startResult), function () {
              controller._started = true;
              ReadableByteStreamControllerCallPullIfNeeded(controller);
            }, function (r) {
              ReadableByteStreamControllerError(controller, r);
            });
          }

          function SetUpReadableByteStreamControllerFromUnderlyingSource(stream, underlyingByteSource, highWaterMark) {
            var controller = Object.create(ReadableByteStreamController.prototype);

            var startAlgorithm = function startAlgorithm() {
              return undefined;
            };

            var pullAlgorithm = function pullAlgorithm() {
              return promiseResolvedWith(undefined);
            };

            var cancelAlgorithm = function cancelAlgorithm() {
              return promiseResolvedWith(undefined);
            };

            if (underlyingByteSource.start !== undefined) {
              startAlgorithm = function startAlgorithm() {
                return underlyingByteSource.start(controller);
              };
            }

            if (underlyingByteSource.pull !== undefined) {
              pullAlgorithm = function pullAlgorithm() {
                return underlyingByteSource.pull(controller);
              };
            }

            if (underlyingByteSource.cancel !== undefined) {
              cancelAlgorithm = function cancelAlgorithm(reason) {
                return underlyingByteSource.cancel(reason);
              };
            }

            var autoAllocateChunkSize = underlyingByteSource.autoAllocateChunkSize;

            if (autoAllocateChunkSize === 0) {
              throw new TypeError('autoAllocateChunkSize must be greater than 0');
            }

            SetUpReadableByteStreamController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, autoAllocateChunkSize);
          }

          function SetUpReadableStreamBYOBRequest(request, controller, view) {
            request._associatedReadableByteStreamController = controller;
            request._view = view;
          }

          function byobRequestBrandCheckException(name) {
            return new TypeError("ReadableStreamBYOBRequest.prototype." + name + " can only be used on a ReadableStreamBYOBRequest");
          }

          function byteStreamControllerBrandCheckException(name) {
            return new TypeError("ReadableByteStreamController.prototype." + name + " can only be used on a ReadableByteStreamController");
          }

          function AcquireReadableStreamBYOBReader(stream) {
            return new ReadableStreamBYOBReader(stream);
          }

          function ReadableStreamAddReadIntoRequest(stream, readIntoRequest) {
            stream._reader._readIntoRequests.push(readIntoRequest);
          }

          function ReadableStreamFulfillReadIntoRequest(stream, chunk, done) {
            var reader = stream._reader;

            var readIntoRequest = reader._readIntoRequests.shift();

            if (done) {
              readIntoRequest._closeSteps(chunk);
            } else {
              readIntoRequest._chunkSteps(chunk);
            }
          }

          function ReadableStreamGetNumReadIntoRequests(stream) {
            return stream._reader._readIntoRequests.length;
          }

          function ReadableStreamHasBYOBReader(stream) {
            var reader = stream._reader;

            if (reader === undefined) {
              return false;
            }

            if (!IsReadableStreamBYOBReader(reader)) {
              return false;
            }

            return true;
          }

          var ReadableStreamBYOBReader = function () {
            function ReadableStreamBYOBReader(stream) {
              assertRequiredArgument(stream, 1, 'ReadableStreamBYOBReader');
              assertReadableStream(stream, 'First parameter');

              if (IsReadableStreamLocked(stream)) {
                throw new TypeError('This stream has already been locked for exclusive reading by another reader');
              }

              if (!IsReadableByteStreamController(stream._readableStreamController)) {
                throw new TypeError('Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte ' + 'source');
              }

              ReadableStreamReaderGenericInitialize(this, stream);
              this._readIntoRequests = new SimpleQueue();
            }

            Object.defineProperty(ReadableStreamBYOBReader.prototype, "closed", {
              get: function get() {
                if (!IsReadableStreamBYOBReader(this)) {
                  return promiseRejectedWith(byobReaderBrandCheckException('closed'));
                }

                return this._closedPromise;
              },
              enumerable: false,
              configurable: true
            });

            ReadableStreamBYOBReader.prototype.cancel = function (reason) {
              if (reason === void 0) {
                reason = undefined;
              }

              if (!IsReadableStreamBYOBReader(this)) {
                return promiseRejectedWith(byobReaderBrandCheckException('cancel'));
              }

              if (this._ownerReadableStream === undefined) {
                return promiseRejectedWith(readerLockException('cancel'));
              }

              return ReadableStreamReaderGenericCancel(this, reason);
            };

            ReadableStreamBYOBReader.prototype.read = function (view) {
              if (!IsReadableStreamBYOBReader(this)) {
                return promiseRejectedWith(byobReaderBrandCheckException('read'));
              }

              if (!ArrayBuffer.isView(view)) {
                return promiseRejectedWith(new TypeError('view must be an array buffer view'));
              }

              if (view.byteLength === 0) {
                return promiseRejectedWith(new TypeError('view must have non-zero byteLength'));
              }

              if (view.buffer.byteLength === 0) {
                return promiseRejectedWith(new TypeError("view's buffer must have non-zero byteLength"));
              }

              if (IsDetachedBuffer(view.buffer)) ;

              if (this._ownerReadableStream === undefined) {
                return promiseRejectedWith(readerLockException('read from'));
              }

              var resolvePromise;
              var rejectPromise;
              var promise = newPromise(function (resolve, reject) {
                resolvePromise = resolve;
                rejectPromise = reject;
              });
              var readIntoRequest = {
                _chunkSteps: function _chunkSteps(chunk) {
                  return resolvePromise({
                    value: chunk,
                    done: false
                  });
                },
                _closeSteps: function _closeSteps(chunk) {
                  return resolvePromise({
                    value: chunk,
                    done: true
                  });
                },
                _errorSteps: function _errorSteps(e) {
                  return rejectPromise(e);
                }
              };
              ReadableStreamBYOBReaderRead(this, view, readIntoRequest);
              return promise;
            };

            ReadableStreamBYOBReader.prototype.releaseLock = function () {
              if (!IsReadableStreamBYOBReader(this)) {
                throw byobReaderBrandCheckException('releaseLock');
              }

              if (this._ownerReadableStream === undefined) {
                return;
              }

              if (this._readIntoRequests.length > 0) {
                throw new TypeError('Tried to release a reader lock when that reader has pending read() calls un-settled');
              }

              ReadableStreamReaderGenericRelease(this);
            };

            return ReadableStreamBYOBReader;
          }();

          Object.defineProperties(ReadableStreamBYOBReader.prototype, {
            cancel: {
              enumerable: true
            },
            read: {
              enumerable: true
            },
            releaseLock: {
              enumerable: true
            },
            closed: {
              enumerable: true
            }
          });

          if (typeof SymbolPolyfill.toStringTag === 'symbol') {
            Object.defineProperty(ReadableStreamBYOBReader.prototype, SymbolPolyfill.toStringTag, {
              value: 'ReadableStreamBYOBReader',
              configurable: true
            });
          }

          function IsReadableStreamBYOBReader(x) {
            if (!typeIsObject(x)) {
              return false;
            }

            if (!Object.prototype.hasOwnProperty.call(x, '_readIntoRequests')) {
              return false;
            }

            return x instanceof ReadableStreamBYOBReader;
          }

          function ReadableStreamBYOBReaderRead(reader, view, readIntoRequest) {
            var stream = reader._ownerReadableStream;
            stream._disturbed = true;

            if (stream._state === 'errored') {
              readIntoRequest._errorSteps(stream._storedError);
            } else {
              ReadableByteStreamControllerPullInto(stream._readableStreamController, view, readIntoRequest);
            }
          }

          function byobReaderBrandCheckException(name) {
            return new TypeError("ReadableStreamBYOBReader.prototype." + name + " can only be used on a ReadableStreamBYOBReader");
          }

          function ExtractHighWaterMark(strategy, defaultHWM) {
            var highWaterMark = strategy.highWaterMark;

            if (highWaterMark === undefined) {
              return defaultHWM;
            }

            if (NumberIsNaN(highWaterMark) || highWaterMark < 0) {
              throw new RangeError('Invalid highWaterMark');
            }

            return highWaterMark;
          }

          function ExtractSizeAlgorithm(strategy) {
            var size = strategy.size;

            if (!size) {
              return function () {
                return 1;
              };
            }

            return size;
          }

          function convertQueuingStrategy(init, context) {
            assertDictionary(init, context);
            var highWaterMark = init === null || init === void 0 ? void 0 : init.highWaterMark;
            var size = init === null || init === void 0 ? void 0 : init.size;
            return {
              highWaterMark: highWaterMark === undefined ? undefined : convertUnrestrictedDouble(highWaterMark),
              size: size === undefined ? undefined : convertQueuingStrategySize(size, context + " has member 'size' that")
            };
          }

          function convertQueuingStrategySize(fn, context) {
            assertFunction(fn, context);
            return function (chunk) {
              return convertUnrestrictedDouble(fn(chunk));
            };
          }

          function convertUnderlyingSink(original, context) {
            assertDictionary(original, context);
            var abort = original === null || original === void 0 ? void 0 : original.abort;
            var close = original === null || original === void 0 ? void 0 : original.close;
            var start = original === null || original === void 0 ? void 0 : original.start;
            var type = original === null || original === void 0 ? void 0 : original.type;
            var write = original === null || original === void 0 ? void 0 : original.write;
            return {
              abort: abort === undefined ? undefined : convertUnderlyingSinkAbortCallback(abort, original, context + " has member 'abort' that"),
              close: close === undefined ? undefined : convertUnderlyingSinkCloseCallback(close, original, context + " has member 'close' that"),
              start: start === undefined ? undefined : convertUnderlyingSinkStartCallback(start, original, context + " has member 'start' that"),
              write: write === undefined ? undefined : convertUnderlyingSinkWriteCallback(write, original, context + " has member 'write' that"),
              type: type
            };
          }

          function convertUnderlyingSinkAbortCallback(fn, original, context) {
            assertFunction(fn, context);
            return function (reason) {
              return promiseCall(fn, original, [reason]);
            };
          }

          function convertUnderlyingSinkCloseCallback(fn, original, context) {
            assertFunction(fn, context);
            return function () {
              return promiseCall(fn, original, []);
            };
          }

          function convertUnderlyingSinkStartCallback(fn, original, context) {
            assertFunction(fn, context);
            return function (controller) {
              return reflectCall(fn, original, [controller]);
            };
          }

          function convertUnderlyingSinkWriteCallback(fn, original, context) {
            assertFunction(fn, context);
            return function (chunk, controller) {
              return promiseCall(fn, original, [chunk, controller]);
            };
          }

          function assertWritableStream(x, context) {
            if (!IsWritableStream(x)) {
              throw new TypeError(context + " is not a WritableStream.");
            }
          }

          function isAbortSignal(value) {
            if (typeof value !== 'object' || value === null) {
              return false;
            }

            try {
              return typeof value.aborted === 'boolean';
            } catch (_a) {
              return false;
            }
          }

          var supportsAbortController = typeof AbortController === 'function';

          function createAbortController() {
            if (supportsAbortController) {
              return new AbortController();
            }

            return undefined;
          }

          var WritableStream = function () {
            function WritableStream(rawUnderlyingSink, rawStrategy) {
              if (rawUnderlyingSink === void 0) {
                rawUnderlyingSink = {};
              }

              if (rawStrategy === void 0) {
                rawStrategy = {};
              }

              if (rawUnderlyingSink === undefined) {
                rawUnderlyingSink = null;
              } else {
                assertObject(rawUnderlyingSink, 'First parameter');
              }

              var strategy = convertQueuingStrategy(rawStrategy, 'Second parameter');
              var underlyingSink = convertUnderlyingSink(rawUnderlyingSink, 'First parameter');
              InitializeWritableStream(this);
              var type = underlyingSink.type;

              if (type !== undefined) {
                throw new RangeError('Invalid type is specified');
              }

              var sizeAlgorithm = ExtractSizeAlgorithm(strategy);
              var highWaterMark = ExtractHighWaterMark(strategy, 1);
              SetUpWritableStreamDefaultControllerFromUnderlyingSink(this, underlyingSink, highWaterMark, sizeAlgorithm);
            }

            Object.defineProperty(WritableStream.prototype, "locked", {
              get: function get() {
                if (!IsWritableStream(this)) {
                  throw streamBrandCheckException$2('locked');
                }

                return IsWritableStreamLocked(this);
              },
              enumerable: false,
              configurable: true
            });

            WritableStream.prototype.abort = function (reason) {
              if (reason === void 0) {
                reason = undefined;
              }

              if (!IsWritableStream(this)) {
                return promiseRejectedWith(streamBrandCheckException$2('abort'));
              }

              if (IsWritableStreamLocked(this)) {
                return promiseRejectedWith(new TypeError('Cannot abort a stream that already has a writer'));
              }

              return WritableStreamAbort(this, reason);
            };

            WritableStream.prototype.close = function () {
              if (!IsWritableStream(this)) {
                return promiseRejectedWith(streamBrandCheckException$2('close'));
              }

              if (IsWritableStreamLocked(this)) {
                return promiseRejectedWith(new TypeError('Cannot close a stream that already has a writer'));
              }

              if (WritableStreamCloseQueuedOrInFlight(this)) {
                return promiseRejectedWith(new TypeError('Cannot close an already-closing stream'));
              }

              return WritableStreamClose(this);
            };

            WritableStream.prototype.getWriter = function () {
              if (!IsWritableStream(this)) {
                throw streamBrandCheckException$2('getWriter');
              }

              return AcquireWritableStreamDefaultWriter(this);
            };

            return WritableStream;
          }();

          Object.defineProperties(WritableStream.prototype, {
            abort: {
              enumerable: true
            },
            close: {
              enumerable: true
            },
            getWriter: {
              enumerable: true
            },
            locked: {
              enumerable: true
            }
          });

          if (typeof SymbolPolyfill.toStringTag === 'symbol') {
            Object.defineProperty(WritableStream.prototype, SymbolPolyfill.toStringTag, {
              value: 'WritableStream',
              configurable: true
            });
          }

          function AcquireWritableStreamDefaultWriter(stream) {
            return new WritableStreamDefaultWriter(stream);
          }

          function CreateWritableStream(startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm) {
            if (highWaterMark === void 0) {
              highWaterMark = 1;
            }

            if (sizeAlgorithm === void 0) {
              sizeAlgorithm = function sizeAlgorithm() {
                return 1;
              };
            }

            var stream = Object.create(WritableStream.prototype);
            InitializeWritableStream(stream);
            var controller = Object.create(WritableStreamDefaultController.prototype);
            SetUpWritableStreamDefaultController(stream, controller, startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm);
            return stream;
          }

          function InitializeWritableStream(stream) {
            stream._state = 'writable';
            stream._storedError = undefined;
            stream._writer = undefined;
            stream._writableStreamController = undefined;
            stream._writeRequests = new SimpleQueue();
            stream._inFlightWriteRequest = undefined;
            stream._closeRequest = undefined;
            stream._inFlightCloseRequest = undefined;
            stream._pendingAbortRequest = undefined;
            stream._backpressure = false;
          }

          function IsWritableStream(x) {
            if (!typeIsObject(x)) {
              return false;
            }

            if (!Object.prototype.hasOwnProperty.call(x, '_writableStreamController')) {
              return false;
            }

            return x instanceof WritableStream;
          }

          function IsWritableStreamLocked(stream) {
            if (stream._writer === undefined) {
              return false;
            }

            return true;
          }

          function WritableStreamAbort(stream, reason) {
            var _a;

            if (stream._state === 'closed' || stream._state === 'errored') {
              return promiseResolvedWith(undefined);
            }

            stream._writableStreamController._abortReason = reason;
            (_a = stream._writableStreamController._abortController) === null || _a === void 0 ? void 0 : _a.abort();
            var state = stream._state;

            if (state === 'closed' || state === 'errored') {
              return promiseResolvedWith(undefined);
            }

            if (stream._pendingAbortRequest !== undefined) {
              return stream._pendingAbortRequest._promise;
            }

            var wasAlreadyErroring = false;

            if (state === 'erroring') {
              wasAlreadyErroring = true;
              reason = undefined;
            }

            var promise = newPromise(function (resolve, reject) {
              stream._pendingAbortRequest = {
                _promise: undefined,
                _resolve: resolve,
                _reject: reject,
                _reason: reason,
                _wasAlreadyErroring: wasAlreadyErroring
              };
            });
            stream._pendingAbortRequest._promise = promise;

            if (!wasAlreadyErroring) {
              WritableStreamStartErroring(stream, reason);
            }

            return promise;
          }

          function WritableStreamClose(stream) {
            var state = stream._state;

            if (state === 'closed' || state === 'errored') {
              return promiseRejectedWith(new TypeError("The stream (in " + state + " state) is not in the writable state and cannot be closed"));
            }

            var promise = newPromise(function (resolve, reject) {
              var closeRequest = {
                _resolve: resolve,
                _reject: reject
              };
              stream._closeRequest = closeRequest;
            });
            var writer = stream._writer;

            if (writer !== undefined && stream._backpressure && state === 'writable') {
              defaultWriterReadyPromiseResolve(writer);
            }

            WritableStreamDefaultControllerClose(stream._writableStreamController);
            return promise;
          }

          function WritableStreamAddWriteRequest(stream) {
            var promise = newPromise(function (resolve, reject) {
              var writeRequest = {
                _resolve: resolve,
                _reject: reject
              };

              stream._writeRequests.push(writeRequest);
            });
            return promise;
          }

          function WritableStreamDealWithRejection(stream, error) {
            var state = stream._state;

            if (state === 'writable') {
              WritableStreamStartErroring(stream, error);
              return;
            }

            WritableStreamFinishErroring(stream);
          }

          function WritableStreamStartErroring(stream, reason) {
            var controller = stream._writableStreamController;
            stream._state = 'erroring';
            stream._storedError = reason;
            var writer = stream._writer;

            if (writer !== undefined) {
              WritableStreamDefaultWriterEnsureReadyPromiseRejected(writer, reason);
            }

            if (!WritableStreamHasOperationMarkedInFlight(stream) && controller._started) {
              WritableStreamFinishErroring(stream);
            }
          }

          function WritableStreamFinishErroring(stream) {
            stream._state = 'errored';

            stream._writableStreamController[ErrorSteps]();

            var storedError = stream._storedError;

            stream._writeRequests.forEach(function (writeRequest) {
              writeRequest._reject(storedError);
            });

            stream._writeRequests = new SimpleQueue();

            if (stream._pendingAbortRequest === undefined) {
              WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream);
              return;
            }

            var abortRequest = stream._pendingAbortRequest;
            stream._pendingAbortRequest = undefined;

            if (abortRequest._wasAlreadyErroring) {
              abortRequest._reject(storedError);

              WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream);
              return;
            }

            var promise = stream._writableStreamController[AbortSteps](abortRequest._reason);

            uponPromise(promise, function () {
              abortRequest._resolve();

              WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream);
            }, function (reason) {
              abortRequest._reject(reason);

              WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream);
            });
          }

          function WritableStreamFinishInFlightWrite(stream) {
            stream._inFlightWriteRequest._resolve(undefined);

            stream._inFlightWriteRequest = undefined;
          }

          function WritableStreamFinishInFlightWriteWithError(stream, error) {
            stream._inFlightWriteRequest._reject(error);

            stream._inFlightWriteRequest = undefined;
            WritableStreamDealWithRejection(stream, error);
          }

          function WritableStreamFinishInFlightClose(stream) {
            stream._inFlightCloseRequest._resolve(undefined);

            stream._inFlightCloseRequest = undefined;
            var state = stream._state;

            if (state === 'erroring') {
              stream._storedError = undefined;

              if (stream._pendingAbortRequest !== undefined) {
                stream._pendingAbortRequest._resolve();

                stream._pendingAbortRequest = undefined;
              }
            }

            stream._state = 'closed';
            var writer = stream._writer;

            if (writer !== undefined) {
              defaultWriterClosedPromiseResolve(writer);
            }
          }

          function WritableStreamFinishInFlightCloseWithError(stream, error) {
            stream._inFlightCloseRequest._reject(error);

            stream._inFlightCloseRequest = undefined;

            if (stream._pendingAbortRequest !== undefined) {
              stream._pendingAbortRequest._reject(error);

              stream._pendingAbortRequest = undefined;
            }

            WritableStreamDealWithRejection(stream, error);
          }

          function WritableStreamCloseQueuedOrInFlight(stream) {
            if (stream._closeRequest === undefined && stream._inFlightCloseRequest === undefined) {
              return false;
            }

            return true;
          }

          function WritableStreamHasOperationMarkedInFlight(stream) {
            if (stream._inFlightWriteRequest === undefined && stream._inFlightCloseRequest === undefined) {
              return false;
            }

            return true;
          }

          function WritableStreamMarkCloseRequestInFlight(stream) {
            stream._inFlightCloseRequest = stream._closeRequest;
            stream._closeRequest = undefined;
          }

          function WritableStreamMarkFirstWriteRequestInFlight(stream) {
            stream._inFlightWriteRequest = stream._writeRequests.shift();
          }

          function WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream) {
            if (stream._closeRequest !== undefined) {
              stream._closeRequest._reject(stream._storedError);

              stream._closeRequest = undefined;
            }

            var writer = stream._writer;

            if (writer !== undefined) {
              defaultWriterClosedPromiseReject(writer, stream._storedError);
            }
          }

          function WritableStreamUpdateBackpressure(stream, backpressure) {
            var writer = stream._writer;

            if (writer !== undefined && backpressure !== stream._backpressure) {
              if (backpressure) {
                defaultWriterReadyPromiseReset(writer);
              } else {
                defaultWriterReadyPromiseResolve(writer);
              }
            }

            stream._backpressure = backpressure;
          }

          var WritableStreamDefaultWriter = function () {
            function WritableStreamDefaultWriter(stream) {
              assertRequiredArgument(stream, 1, 'WritableStreamDefaultWriter');
              assertWritableStream(stream, 'First parameter');

              if (IsWritableStreamLocked(stream)) {
                throw new TypeError('This stream has already been locked for exclusive writing by another writer');
              }

              this._ownerWritableStream = stream;
              stream._writer = this;
              var state = stream._state;

              if (state === 'writable') {
                if (!WritableStreamCloseQueuedOrInFlight(stream) && stream._backpressure) {
                  defaultWriterReadyPromiseInitialize(this);
                } else {
                  defaultWriterReadyPromiseInitializeAsResolved(this);
                }

                defaultWriterClosedPromiseInitialize(this);
              } else if (state === 'erroring') {
                defaultWriterReadyPromiseInitializeAsRejected(this, stream._storedError);
                defaultWriterClosedPromiseInitialize(this);
              } else if (state === 'closed') {
                defaultWriterReadyPromiseInitializeAsResolved(this);
                defaultWriterClosedPromiseInitializeAsResolved(this);
              } else {
                var storedError = stream._storedError;
                defaultWriterReadyPromiseInitializeAsRejected(this, storedError);
                defaultWriterClosedPromiseInitializeAsRejected(this, storedError);
              }
            }

            Object.defineProperty(WritableStreamDefaultWriter.prototype, "closed", {
              get: function get() {
                if (!IsWritableStreamDefaultWriter(this)) {
                  return promiseRejectedWith(defaultWriterBrandCheckException('closed'));
                }

                return this._closedPromise;
              },
              enumerable: false,
              configurable: true
            });
            Object.defineProperty(WritableStreamDefaultWriter.prototype, "desiredSize", {
              get: function get() {
                if (!IsWritableStreamDefaultWriter(this)) {
                  throw defaultWriterBrandCheckException('desiredSize');
                }

                if (this._ownerWritableStream === undefined) {
                  throw defaultWriterLockException('desiredSize');
                }

                return WritableStreamDefaultWriterGetDesiredSize(this);
              },
              enumerable: false,
              configurable: true
            });
            Object.defineProperty(WritableStreamDefaultWriter.prototype, "ready", {
              get: function get() {
                if (!IsWritableStreamDefaultWriter(this)) {
                  return promiseRejectedWith(defaultWriterBrandCheckException('ready'));
                }

                return this._readyPromise;
              },
              enumerable: false,
              configurable: true
            });

            WritableStreamDefaultWriter.prototype.abort = function (reason) {
              if (reason === void 0) {
                reason = undefined;
              }

              if (!IsWritableStreamDefaultWriter(this)) {
                return promiseRejectedWith(defaultWriterBrandCheckException('abort'));
              }

              if (this._ownerWritableStream === undefined) {
                return promiseRejectedWith(defaultWriterLockException('abort'));
              }

              return WritableStreamDefaultWriterAbort(this, reason);
            };

            WritableStreamDefaultWriter.prototype.close = function () {
              if (!IsWritableStreamDefaultWriter(this)) {
                return promiseRejectedWith(defaultWriterBrandCheckException('close'));
              }

              var stream = this._ownerWritableStream;

              if (stream === undefined) {
                return promiseRejectedWith(defaultWriterLockException('close'));
              }

              if (WritableStreamCloseQueuedOrInFlight(stream)) {
                return promiseRejectedWith(new TypeError('Cannot close an already-closing stream'));
              }

              return WritableStreamDefaultWriterClose(this);
            };

            WritableStreamDefaultWriter.prototype.releaseLock = function () {
              if (!IsWritableStreamDefaultWriter(this)) {
                throw defaultWriterBrandCheckException('releaseLock');
              }

              var stream = this._ownerWritableStream;

              if (stream === undefined) {
                return;
              }

              WritableStreamDefaultWriterRelease(this);
            };

            WritableStreamDefaultWriter.prototype.write = function (chunk) {
              if (chunk === void 0) {
                chunk = undefined;
              }

              if (!IsWritableStreamDefaultWriter(this)) {
                return promiseRejectedWith(defaultWriterBrandCheckException('write'));
              }

              if (this._ownerWritableStream === undefined) {
                return promiseRejectedWith(defaultWriterLockException('write to'));
              }

              return WritableStreamDefaultWriterWrite(this, chunk);
            };

            return WritableStreamDefaultWriter;
          }();

          Object.defineProperties(WritableStreamDefaultWriter.prototype, {
            abort: {
              enumerable: true
            },
            close: {
              enumerable: true
            },
            releaseLock: {
              enumerable: true
            },
            write: {
              enumerable: true
            },
            closed: {
              enumerable: true
            },
            desiredSize: {
              enumerable: true
            },
            ready: {
              enumerable: true
            }
          });

          if (typeof SymbolPolyfill.toStringTag === 'symbol') {
            Object.defineProperty(WritableStreamDefaultWriter.prototype, SymbolPolyfill.toStringTag, {
              value: 'WritableStreamDefaultWriter',
              configurable: true
            });
          }

          function IsWritableStreamDefaultWriter(x) {
            if (!typeIsObject(x)) {
              return false;
            }

            if (!Object.prototype.hasOwnProperty.call(x, '_ownerWritableStream')) {
              return false;
            }

            return x instanceof WritableStreamDefaultWriter;
          }

          function WritableStreamDefaultWriterAbort(writer, reason) {
            var stream = writer._ownerWritableStream;
            return WritableStreamAbort(stream, reason);
          }

          function WritableStreamDefaultWriterClose(writer) {
            var stream = writer._ownerWritableStream;
            return WritableStreamClose(stream);
          }

          function WritableStreamDefaultWriterCloseWithErrorPropagation(writer) {
            var stream = writer._ownerWritableStream;
            var state = stream._state;

            if (WritableStreamCloseQueuedOrInFlight(stream) || state === 'closed') {
              return promiseResolvedWith(undefined);
            }

            if (state === 'errored') {
              return promiseRejectedWith(stream._storedError);
            }

            return WritableStreamDefaultWriterClose(writer);
          }

          function WritableStreamDefaultWriterEnsureClosedPromiseRejected(writer, error) {
            if (writer._closedPromiseState === 'pending') {
              defaultWriterClosedPromiseReject(writer, error);
            } else {
              defaultWriterClosedPromiseResetToRejected(writer, error);
            }
          }

          function WritableStreamDefaultWriterEnsureReadyPromiseRejected(writer, error) {
            if (writer._readyPromiseState === 'pending') {
              defaultWriterReadyPromiseReject(writer, error);
            } else {
              defaultWriterReadyPromiseResetToRejected(writer, error);
            }
          }

          function WritableStreamDefaultWriterGetDesiredSize(writer) {
            var stream = writer._ownerWritableStream;
            var state = stream._state;

            if (state === 'errored' || state === 'erroring') {
              return null;
            }

            if (state === 'closed') {
              return 0;
            }

            return WritableStreamDefaultControllerGetDesiredSize(stream._writableStreamController);
          }

          function WritableStreamDefaultWriterRelease(writer) {
            var stream = writer._ownerWritableStream;
            var releasedError = new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");
            WritableStreamDefaultWriterEnsureReadyPromiseRejected(writer, releasedError);
            WritableStreamDefaultWriterEnsureClosedPromiseRejected(writer, releasedError);
            stream._writer = undefined;
            writer._ownerWritableStream = undefined;
          }

          function WritableStreamDefaultWriterWrite(writer, chunk) {
            var stream = writer._ownerWritableStream;
            var controller = stream._writableStreamController;
            var chunkSize = WritableStreamDefaultControllerGetChunkSize(controller, chunk);

            if (stream !== writer._ownerWritableStream) {
              return promiseRejectedWith(defaultWriterLockException('write to'));
            }

            var state = stream._state;

            if (state === 'errored') {
              return promiseRejectedWith(stream._storedError);
            }

            if (WritableStreamCloseQueuedOrInFlight(stream) || state === 'closed') {
              return promiseRejectedWith(new TypeError('The stream is closing or closed and cannot be written to'));
            }

            if (state === 'erroring') {
              return promiseRejectedWith(stream._storedError);
            }

            var promise = WritableStreamAddWriteRequest(stream);
            WritableStreamDefaultControllerWrite(controller, chunk, chunkSize);
            return promise;
          }

          var closeSentinel = {};

          var WritableStreamDefaultController = function () {
            function WritableStreamDefaultController() {
              throw new TypeError('Illegal constructor');
            }

            Object.defineProperty(WritableStreamDefaultController.prototype, "abortReason", {
              get: function get() {
                if (!IsWritableStreamDefaultController(this)) {
                  throw defaultControllerBrandCheckException$2('abortReason');
                }

                return this._abortReason;
              },
              enumerable: false,
              configurable: true
            });
            Object.defineProperty(WritableStreamDefaultController.prototype, "signal", {
              get: function get() {
                if (!IsWritableStreamDefaultController(this)) {
                  throw defaultControllerBrandCheckException$2('signal');
                }

                if (this._abortController === undefined) {
                  throw new TypeError('WritableStreamDefaultController.prototype.signal is not supported');
                }

                return this._abortController.signal;
              },
              enumerable: false,
              configurable: true
            });

            WritableStreamDefaultController.prototype.error = function (e) {
              if (e === void 0) {
                e = undefined;
              }

              if (!IsWritableStreamDefaultController(this)) {
                throw defaultControllerBrandCheckException$2('error');
              }

              var state = this._controlledWritableStream._state;

              if (state !== 'writable') {
                return;
              }

              WritableStreamDefaultControllerError(this, e);
            };

            WritableStreamDefaultController.prototype[AbortSteps] = function (reason) {
              var result = this._abortAlgorithm(reason);

              WritableStreamDefaultControllerClearAlgorithms(this);
              return result;
            };

            WritableStreamDefaultController.prototype[ErrorSteps] = function () {
              ResetQueue(this);
            };

            return WritableStreamDefaultController;
          }();

          Object.defineProperties(WritableStreamDefaultController.prototype, {
            error: {
              enumerable: true
            }
          });

          if (typeof SymbolPolyfill.toStringTag === 'symbol') {
            Object.defineProperty(WritableStreamDefaultController.prototype, SymbolPolyfill.toStringTag, {
              value: 'WritableStreamDefaultController',
              configurable: true
            });
          }

          function IsWritableStreamDefaultController(x) {
            if (!typeIsObject(x)) {
              return false;
            }

            if (!Object.prototype.hasOwnProperty.call(x, '_controlledWritableStream')) {
              return false;
            }

            return x instanceof WritableStreamDefaultController;
          }

          function SetUpWritableStreamDefaultController(stream, controller, startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm) {
            controller._controlledWritableStream = stream;
            stream._writableStreamController = controller;
            controller._queue = undefined;
            controller._queueTotalSize = undefined;
            ResetQueue(controller);
            controller._abortReason = undefined;
            controller._abortController = createAbortController();
            controller._started = false;
            controller._strategySizeAlgorithm = sizeAlgorithm;
            controller._strategyHWM = highWaterMark;
            controller._writeAlgorithm = writeAlgorithm;
            controller._closeAlgorithm = closeAlgorithm;
            controller._abortAlgorithm = abortAlgorithm;
            var backpressure = WritableStreamDefaultControllerGetBackpressure(controller);
            WritableStreamUpdateBackpressure(stream, backpressure);
            var startResult = startAlgorithm();
            var startPromise = promiseResolvedWith(startResult);
            uponPromise(startPromise, function () {
              controller._started = true;
              WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller);
            }, function (r) {
              controller._started = true;
              WritableStreamDealWithRejection(stream, r);
            });
          }

          function SetUpWritableStreamDefaultControllerFromUnderlyingSink(stream, underlyingSink, highWaterMark, sizeAlgorithm) {
            var controller = Object.create(WritableStreamDefaultController.prototype);

            var startAlgorithm = function startAlgorithm() {
              return undefined;
            };

            var writeAlgorithm = function writeAlgorithm() {
              return promiseResolvedWith(undefined);
            };

            var closeAlgorithm = function closeAlgorithm() {
              return promiseResolvedWith(undefined);
            };

            var abortAlgorithm = function abortAlgorithm() {
              return promiseResolvedWith(undefined);
            };

            if (underlyingSink.start !== undefined) {
              startAlgorithm = function startAlgorithm() {
                return underlyingSink.start(controller);
              };
            }

            if (underlyingSink.write !== undefined) {
              writeAlgorithm = function writeAlgorithm(chunk) {
                return underlyingSink.write(chunk, controller);
              };
            }

            if (underlyingSink.close !== undefined) {
              closeAlgorithm = function closeAlgorithm() {
                return underlyingSink.close();
              };
            }

            if (underlyingSink.abort !== undefined) {
              abortAlgorithm = function abortAlgorithm(reason) {
                return underlyingSink.abort(reason);
              };
            }

            SetUpWritableStreamDefaultController(stream, controller, startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm);
          }

          function WritableStreamDefaultControllerClearAlgorithms(controller) {
            controller._writeAlgorithm = undefined;
            controller._closeAlgorithm = undefined;
            controller._abortAlgorithm = undefined;
            controller._strategySizeAlgorithm = undefined;
          }

          function WritableStreamDefaultControllerClose(controller) {
            EnqueueValueWithSize(controller, closeSentinel, 0);
            WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller);
          }

          function WritableStreamDefaultControllerGetChunkSize(controller, chunk) {
            try {
              return controller._strategySizeAlgorithm(chunk);
            } catch (chunkSizeE) {
              WritableStreamDefaultControllerErrorIfNeeded(controller, chunkSizeE);
              return 1;
            }
          }

          function WritableStreamDefaultControllerGetDesiredSize(controller) {
            return controller._strategyHWM - controller._queueTotalSize;
          }

          function WritableStreamDefaultControllerWrite(controller, chunk, chunkSize) {
            try {
              EnqueueValueWithSize(controller, chunk, chunkSize);
            } catch (enqueueE) {
              WritableStreamDefaultControllerErrorIfNeeded(controller, enqueueE);
              return;
            }

            var stream = controller._controlledWritableStream;

            if (!WritableStreamCloseQueuedOrInFlight(stream) && stream._state === 'writable') {
              var backpressure = WritableStreamDefaultControllerGetBackpressure(controller);
              WritableStreamUpdateBackpressure(stream, backpressure);
            }

            WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller);
          }

          function WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller) {
            var stream = controller._controlledWritableStream;

            if (!controller._started) {
              return;
            }

            if (stream._inFlightWriteRequest !== undefined) {
              return;
            }

            var state = stream._state;

            if (state === 'erroring') {
              WritableStreamFinishErroring(stream);
              return;
            }

            if (controller._queue.length === 0) {
              return;
            }

            var value = PeekQueueValue(controller);

            if (value === closeSentinel) {
              WritableStreamDefaultControllerProcessClose(controller);
            } else {
              WritableStreamDefaultControllerProcessWrite(controller, value);
            }
          }

          function WritableStreamDefaultControllerErrorIfNeeded(controller, error) {
            if (controller._controlledWritableStream._state === 'writable') {
              WritableStreamDefaultControllerError(controller, error);
            }
          }

          function WritableStreamDefaultControllerProcessClose(controller) {
            var stream = controller._controlledWritableStream;
            WritableStreamMarkCloseRequestInFlight(stream);
            DequeueValue(controller);

            var sinkClosePromise = controller._closeAlgorithm();

            WritableStreamDefaultControllerClearAlgorithms(controller);
            uponPromise(sinkClosePromise, function () {
              WritableStreamFinishInFlightClose(stream);
            }, function (reason) {
              WritableStreamFinishInFlightCloseWithError(stream, reason);
            });
          }

          function WritableStreamDefaultControllerProcessWrite(controller, chunk) {
            var stream = controller._controlledWritableStream;
            WritableStreamMarkFirstWriteRequestInFlight(stream);

            var sinkWritePromise = controller._writeAlgorithm(chunk);

            uponPromise(sinkWritePromise, function () {
              WritableStreamFinishInFlightWrite(stream);
              var state = stream._state;
              DequeueValue(controller);

              if (!WritableStreamCloseQueuedOrInFlight(stream) && state === 'writable') {
                var backpressure = WritableStreamDefaultControllerGetBackpressure(controller);
                WritableStreamUpdateBackpressure(stream, backpressure);
              }

              WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller);
            }, function (reason) {
              if (stream._state === 'writable') {
                WritableStreamDefaultControllerClearAlgorithms(controller);
              }

              WritableStreamFinishInFlightWriteWithError(stream, reason);
            });
          }

          function WritableStreamDefaultControllerGetBackpressure(controller) {
            var desiredSize = WritableStreamDefaultControllerGetDesiredSize(controller);
            return desiredSize <= 0;
          }

          function WritableStreamDefaultControllerError(controller, error) {
            var stream = controller._controlledWritableStream;
            WritableStreamDefaultControllerClearAlgorithms(controller);
            WritableStreamStartErroring(stream, error);
          }

          function streamBrandCheckException$2(name) {
            return new TypeError("WritableStream.prototype." + name + " can only be used on a WritableStream");
          }

          function defaultControllerBrandCheckException$2(name) {
            return new TypeError("WritableStreamDefaultController.prototype." + name + " can only be used on a WritableStreamDefaultController");
          }

          function defaultWriterBrandCheckException(name) {
            return new TypeError("WritableStreamDefaultWriter.prototype." + name + " can only be used on a WritableStreamDefaultWriter");
          }

          function defaultWriterLockException(name) {
            return new TypeError('Cannot ' + name + ' a stream using a released writer');
          }

          function defaultWriterClosedPromiseInitialize(writer) {
            writer._closedPromise = newPromise(function (resolve, reject) {
              writer._closedPromise_resolve = resolve;
              writer._closedPromise_reject = reject;
              writer._closedPromiseState = 'pending';
            });
          }

          function defaultWriterClosedPromiseInitializeAsRejected(writer, reason) {
            defaultWriterClosedPromiseInitialize(writer);
            defaultWriterClosedPromiseReject(writer, reason);
          }

          function defaultWriterClosedPromiseInitializeAsResolved(writer) {
            defaultWriterClosedPromiseInitialize(writer);
            defaultWriterClosedPromiseResolve(writer);
          }

          function defaultWriterClosedPromiseReject(writer, reason) {
            if (writer._closedPromise_reject === undefined) {
              return;
            }

            setPromiseIsHandledToTrue(writer._closedPromise);

            writer._closedPromise_reject(reason);

            writer._closedPromise_resolve = undefined;
            writer._closedPromise_reject = undefined;
            writer._closedPromiseState = 'rejected';
          }

          function defaultWriterClosedPromiseResetToRejected(writer, reason) {
            defaultWriterClosedPromiseInitializeAsRejected(writer, reason);
          }

          function defaultWriterClosedPromiseResolve(writer) {
            if (writer._closedPromise_resolve === undefined) {
              return;
            }

            writer._closedPromise_resolve(undefined);

            writer._closedPromise_resolve = undefined;
            writer._closedPromise_reject = undefined;
            writer._closedPromiseState = 'resolved';
          }

          function defaultWriterReadyPromiseInitialize(writer) {
            writer._readyPromise = newPromise(function (resolve, reject) {
              writer._readyPromise_resolve = resolve;
              writer._readyPromise_reject = reject;
            });
            writer._readyPromiseState = 'pending';
          }

          function defaultWriterReadyPromiseInitializeAsRejected(writer, reason) {
            defaultWriterReadyPromiseInitialize(writer);
            defaultWriterReadyPromiseReject(writer, reason);
          }

          function defaultWriterReadyPromiseInitializeAsResolved(writer) {
            defaultWriterReadyPromiseInitialize(writer);
            defaultWriterReadyPromiseResolve(writer);
          }

          function defaultWriterReadyPromiseReject(writer, reason) {
            if (writer._readyPromise_reject === undefined) {
              return;
            }

            setPromiseIsHandledToTrue(writer._readyPromise);

            writer._readyPromise_reject(reason);

            writer._readyPromise_resolve = undefined;
            writer._readyPromise_reject = undefined;
            writer._readyPromiseState = 'rejected';
          }

          function defaultWriterReadyPromiseReset(writer) {
            defaultWriterReadyPromiseInitialize(writer);
          }

          function defaultWriterReadyPromiseResetToRejected(writer, reason) {
            defaultWriterReadyPromiseInitializeAsRejected(writer, reason);
          }

          function defaultWriterReadyPromiseResolve(writer) {
            if (writer._readyPromise_resolve === undefined) {
              return;
            }

            writer._readyPromise_resolve(undefined);

            writer._readyPromise_resolve = undefined;
            writer._readyPromise_reject = undefined;
            writer._readyPromiseState = 'fulfilled';
          }

          var NativeDOMException = typeof DOMException !== 'undefined' ? DOMException : undefined;

          function isDOMExceptionConstructor(ctor) {
            if (!(typeof ctor === 'function' || typeof ctor === 'object')) {
              return false;
            }

            try {
              new ctor();
              return true;
            } catch (_a) {
              return false;
            }
          }

          function createDOMExceptionPolyfill() {
            var ctor = function DOMException(message, name) {
              this.message = message || '';
              this.name = name || 'Error';

              if (Error.captureStackTrace) {
                Error.captureStackTrace(this, this.constructor);
              }
            };

            ctor.prototype = Object.create(Error.prototype);
            Object.defineProperty(ctor.prototype, 'constructor', {
              value: ctor,
              writable: true,
              configurable: true
            });
            return ctor;
          }

          var DOMException$1 = isDOMExceptionConstructor(NativeDOMException) ? NativeDOMException : createDOMExceptionPolyfill();

          function ReadableStreamPipeTo(source, dest, preventClose, preventAbort, preventCancel, signal) {
            var reader = AcquireReadableStreamDefaultReader(source);
            var writer = AcquireWritableStreamDefaultWriter(dest);
            source._disturbed = true;
            var shuttingDown = false;
            var currentWrite = promiseResolvedWith(undefined);
            return newPromise(function (resolve, reject) {
              var abortAlgorithm;

              if (signal !== undefined) {
                abortAlgorithm = function abortAlgorithm() {
                  var error = new DOMException$1('Aborted', 'AbortError');
                  var actions = [];

                  if (!preventAbort) {
                    actions.push(function () {
                      if (dest._state === 'writable') {
                        return WritableStreamAbort(dest, error);
                      }

                      return promiseResolvedWith(undefined);
                    });
                  }

                  if (!preventCancel) {
                    actions.push(function () {
                      if (source._state === 'readable') {
                        return ReadableStreamCancel(source, error);
                      }

                      return promiseResolvedWith(undefined);
                    });
                  }

                  shutdownWithAction(function () {
                    return Promise.all(actions.map(function (action) {
                      return action();
                    }));
                  }, true, error);
                };

                if (signal.aborted) {
                  abortAlgorithm();
                  return;
                }

                signal.addEventListener('abort', abortAlgorithm);
              }

              function pipeLoop() {
                return newPromise(function (resolveLoop, rejectLoop) {
                  function next(done) {
                    if (done) {
                      resolveLoop();
                    } else {
                      PerformPromiseThen(pipeStep(), next, rejectLoop);
                    }
                  }

                  next(false);
                });
              }

              function pipeStep() {
                if (shuttingDown) {
                  return promiseResolvedWith(true);
                }

                return PerformPromiseThen(writer._readyPromise, function () {
                  return newPromise(function (resolveRead, rejectRead) {
                    ReadableStreamDefaultReaderRead(reader, {
                      _chunkSteps: function _chunkSteps(chunk) {
                        currentWrite = PerformPromiseThen(WritableStreamDefaultWriterWrite(writer, chunk), undefined, noop);
                        resolveRead(false);
                      },
                      _closeSteps: function _closeSteps() {
                        return resolveRead(true);
                      },
                      _errorSteps: rejectRead
                    });
                  });
                });
              }

              isOrBecomesErrored(source, reader._closedPromise, function (storedError) {
                if (!preventAbort) {
                  shutdownWithAction(function () {
                    return WritableStreamAbort(dest, storedError);
                  }, true, storedError);
                } else {
                  shutdown(true, storedError);
                }
              });
              isOrBecomesErrored(dest, writer._closedPromise, function (storedError) {
                if (!preventCancel) {
                  shutdownWithAction(function () {
                    return ReadableStreamCancel(source, storedError);
                  }, true, storedError);
                } else {
                  shutdown(true, storedError);
                }
              });
              isOrBecomesClosed(source, reader._closedPromise, function () {
                if (!preventClose) {
                  shutdownWithAction(function () {
                    return WritableStreamDefaultWriterCloseWithErrorPropagation(writer);
                  });
                } else {
                  shutdown();
                }
              });

              if (WritableStreamCloseQueuedOrInFlight(dest) || dest._state === 'closed') {
                var destClosed_1 = new TypeError('the destination writable stream closed before all data could be piped to it');

                if (!preventCancel) {
                  shutdownWithAction(function () {
                    return ReadableStreamCancel(source, destClosed_1);
                  }, true, destClosed_1);
                } else {
                  shutdown(true, destClosed_1);
                }
              }

              setPromiseIsHandledToTrue(pipeLoop());

              function waitForWritesToFinish() {
                var oldCurrentWrite = currentWrite;
                return PerformPromiseThen(currentWrite, function () {
                  return oldCurrentWrite !== currentWrite ? waitForWritesToFinish() : undefined;
                });
              }

              function isOrBecomesErrored(stream, promise, action) {
                if (stream._state === 'errored') {
                  action(stream._storedError);
                } else {
                  uponRejection(promise, action);
                }
              }

              function isOrBecomesClosed(stream, promise, action) {
                if (stream._state === 'closed') {
                  action();
                } else {
                  uponFulfillment(promise, action);
                }
              }

              function shutdownWithAction(action, originalIsError, originalError) {
                if (shuttingDown) {
                  return;
                }

                shuttingDown = true;

                if (dest._state === 'writable' && !WritableStreamCloseQueuedOrInFlight(dest)) {
                  uponFulfillment(waitForWritesToFinish(), doTheRest);
                } else {
                  doTheRest();
                }

                function doTheRest() {
                  uponPromise(action(), function () {
                    return finalize(originalIsError, originalError);
                  }, function (newError) {
                    return finalize(true, newError);
                  });
                }
              }

              function shutdown(isError, error) {
                if (shuttingDown) {
                  return;
                }

                shuttingDown = true;

                if (dest._state === 'writable' && !WritableStreamCloseQueuedOrInFlight(dest)) {
                  uponFulfillment(waitForWritesToFinish(), function () {
                    return finalize(isError, error);
                  });
                } else {
                  finalize(isError, error);
                }
              }

              function finalize(isError, error) {
                WritableStreamDefaultWriterRelease(writer);
                ReadableStreamReaderGenericRelease(reader);

                if (signal !== undefined) {
                  signal.removeEventListener('abort', abortAlgorithm);
                }

                if (isError) {
                  reject(error);
                } else {
                  resolve(undefined);
                }
              }
            });
          }

          var ReadableStreamDefaultController = function () {
            function ReadableStreamDefaultController() {
              throw new TypeError('Illegal constructor');
            }

            Object.defineProperty(ReadableStreamDefaultController.prototype, "desiredSize", {
              get: function get() {
                if (!IsReadableStreamDefaultController(this)) {
                  throw defaultControllerBrandCheckException$1('desiredSize');
                }

                return ReadableStreamDefaultControllerGetDesiredSize(this);
              },
              enumerable: false,
              configurable: true
            });

            ReadableStreamDefaultController.prototype.close = function () {
              if (!IsReadableStreamDefaultController(this)) {
                throw defaultControllerBrandCheckException$1('close');
              }

              if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(this)) {
                throw new TypeError('The stream is not in a state that permits close');
              }

              ReadableStreamDefaultControllerClose(this);
            };

            ReadableStreamDefaultController.prototype.enqueue = function (chunk) {
              if (chunk === void 0) {
                chunk = undefined;
              }

              if (!IsReadableStreamDefaultController(this)) {
                throw defaultControllerBrandCheckException$1('enqueue');
              }

              if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(this)) {
                throw new TypeError('The stream is not in a state that permits enqueue');
              }

              return ReadableStreamDefaultControllerEnqueue(this, chunk);
            };

            ReadableStreamDefaultController.prototype.error = function (e) {
              if (e === void 0) {
                e = undefined;
              }

              if (!IsReadableStreamDefaultController(this)) {
                throw defaultControllerBrandCheckException$1('error');
              }

              ReadableStreamDefaultControllerError(this, e);
            };

            ReadableStreamDefaultController.prototype[CancelSteps] = function (reason) {
              ResetQueue(this);

              var result = this._cancelAlgorithm(reason);

              ReadableStreamDefaultControllerClearAlgorithms(this);
              return result;
            };

            ReadableStreamDefaultController.prototype[PullSteps] = function (readRequest) {
              var stream = this._controlledReadableStream;

              if (this._queue.length > 0) {
                var chunk = DequeueValue(this);

                if (this._closeRequested && this._queue.length === 0) {
                  ReadableStreamDefaultControllerClearAlgorithms(this);
                  ReadableStreamClose(stream);
                } else {
                  ReadableStreamDefaultControllerCallPullIfNeeded(this);
                }

                readRequest._chunkSteps(chunk);
              } else {
                ReadableStreamAddReadRequest(stream, readRequest);
                ReadableStreamDefaultControllerCallPullIfNeeded(this);
              }
            };

            return ReadableStreamDefaultController;
          }();

          Object.defineProperties(ReadableStreamDefaultController.prototype, {
            close: {
              enumerable: true
            },
            enqueue: {
              enumerable: true
            },
            error: {
              enumerable: true
            },
            desiredSize: {
              enumerable: true
            }
          });

          if (typeof SymbolPolyfill.toStringTag === 'symbol') {
            Object.defineProperty(ReadableStreamDefaultController.prototype, SymbolPolyfill.toStringTag, {
              value: 'ReadableStreamDefaultController',
              configurable: true
            });
          }

          function IsReadableStreamDefaultController(x) {
            if (!typeIsObject(x)) {
              return false;
            }

            if (!Object.prototype.hasOwnProperty.call(x, '_controlledReadableStream')) {
              return false;
            }

            return x instanceof ReadableStreamDefaultController;
          }

          function ReadableStreamDefaultControllerCallPullIfNeeded(controller) {
            var shouldPull = ReadableStreamDefaultControllerShouldCallPull(controller);

            if (!shouldPull) {
              return;
            }

            if (controller._pulling) {
              controller._pullAgain = true;
              return;
            }

            controller._pulling = true;

            var pullPromise = controller._pullAlgorithm();

            uponPromise(pullPromise, function () {
              controller._pulling = false;

              if (controller._pullAgain) {
                controller._pullAgain = false;
                ReadableStreamDefaultControllerCallPullIfNeeded(controller);
              }
            }, function (e) {
              ReadableStreamDefaultControllerError(controller, e);
            });
          }

          function ReadableStreamDefaultControllerShouldCallPull(controller) {
            var stream = controller._controlledReadableStream;

            if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(controller)) {
              return false;
            }

            if (!controller._started) {
              return false;
            }

            if (IsReadableStreamLocked(stream) && ReadableStreamGetNumReadRequests(stream) > 0) {
              return true;
            }

            var desiredSize = ReadableStreamDefaultControllerGetDesiredSize(controller);

            if (desiredSize > 0) {
              return true;
            }

            return false;
          }

          function ReadableStreamDefaultControllerClearAlgorithms(controller) {
            controller._pullAlgorithm = undefined;
            controller._cancelAlgorithm = undefined;
            controller._strategySizeAlgorithm = undefined;
          }

          function ReadableStreamDefaultControllerClose(controller) {
            if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(controller)) {
              return;
            }

            var stream = controller._controlledReadableStream;
            controller._closeRequested = true;

            if (controller._queue.length === 0) {
              ReadableStreamDefaultControllerClearAlgorithms(controller);
              ReadableStreamClose(stream);
            }
          }

          function ReadableStreamDefaultControllerEnqueue(controller, chunk) {
            if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(controller)) {
              return;
            }

            var stream = controller._controlledReadableStream;

            if (IsReadableStreamLocked(stream) && ReadableStreamGetNumReadRequests(stream) > 0) {
              ReadableStreamFulfillReadRequest(stream, chunk, false);
            } else {
              var chunkSize = void 0;

              try {
                chunkSize = controller._strategySizeAlgorithm(chunk);
              } catch (chunkSizeE) {
                ReadableStreamDefaultControllerError(controller, chunkSizeE);
                throw chunkSizeE;
              }

              try {
                EnqueueValueWithSize(controller, chunk, chunkSize);
              } catch (enqueueE) {
                ReadableStreamDefaultControllerError(controller, enqueueE);
                throw enqueueE;
              }
            }

            ReadableStreamDefaultControllerCallPullIfNeeded(controller);
          }

          function ReadableStreamDefaultControllerError(controller, e) {
            var stream = controller._controlledReadableStream;

            if (stream._state !== 'readable') {
              return;
            }

            ResetQueue(controller);
            ReadableStreamDefaultControllerClearAlgorithms(controller);
            ReadableStreamError(stream, e);
          }

          function ReadableStreamDefaultControllerGetDesiredSize(controller) {
            var state = controller._controlledReadableStream._state;

            if (state === 'errored') {
              return null;
            }

            if (state === 'closed') {
              return 0;
            }

            return controller._strategyHWM - controller._queueTotalSize;
          }

          function ReadableStreamDefaultControllerHasBackpressure(controller) {
            if (ReadableStreamDefaultControllerShouldCallPull(controller)) {
              return false;
            }

            return true;
          }

          function ReadableStreamDefaultControllerCanCloseOrEnqueue(controller) {
            var state = controller._controlledReadableStream._state;

            if (!controller._closeRequested && state === 'readable') {
              return true;
            }

            return false;
          }

          function SetUpReadableStreamDefaultController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm) {
            controller._controlledReadableStream = stream;
            controller._queue = undefined;
            controller._queueTotalSize = undefined;
            ResetQueue(controller);
            controller._started = false;
            controller._closeRequested = false;
            controller._pullAgain = false;
            controller._pulling = false;
            controller._strategySizeAlgorithm = sizeAlgorithm;
            controller._strategyHWM = highWaterMark;
            controller._pullAlgorithm = pullAlgorithm;
            controller._cancelAlgorithm = cancelAlgorithm;
            stream._readableStreamController = controller;
            var startResult = startAlgorithm();
            uponPromise(promiseResolvedWith(startResult), function () {
              controller._started = true;
              ReadableStreamDefaultControllerCallPullIfNeeded(controller);
            }, function (r) {
              ReadableStreamDefaultControllerError(controller, r);
            });
          }

          function SetUpReadableStreamDefaultControllerFromUnderlyingSource(stream, underlyingSource, highWaterMark, sizeAlgorithm) {
            var controller = Object.create(ReadableStreamDefaultController.prototype);

            var startAlgorithm = function startAlgorithm() {
              return undefined;
            };

            var pullAlgorithm = function pullAlgorithm() {
              return promiseResolvedWith(undefined);
            };

            var cancelAlgorithm = function cancelAlgorithm() {
              return promiseResolvedWith(undefined);
            };

            if (underlyingSource.start !== undefined) {
              startAlgorithm = function startAlgorithm() {
                return underlyingSource.start(controller);
              };
            }

            if (underlyingSource.pull !== undefined) {
              pullAlgorithm = function pullAlgorithm() {
                return underlyingSource.pull(controller);
              };
            }

            if (underlyingSource.cancel !== undefined) {
              cancelAlgorithm = function cancelAlgorithm(reason) {
                return underlyingSource.cancel(reason);
              };
            }

            SetUpReadableStreamDefaultController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm);
          }

          function defaultControllerBrandCheckException$1(name) {
            return new TypeError("ReadableStreamDefaultController.prototype." + name + " can only be used on a ReadableStreamDefaultController");
          }

          function ReadableStreamTee(stream, cloneForBranch2) {
            if (IsReadableByteStreamController(stream._readableStreamController)) {
              return ReadableByteStreamTee(stream);
            }

            return ReadableStreamDefaultTee(stream);
          }

          function ReadableStreamDefaultTee(stream, cloneForBranch2) {
            var reader = AcquireReadableStreamDefaultReader(stream);
            var reading = false;
            var canceled1 = false;
            var canceled2 = false;
            var reason1;
            var reason2;
            var branch1;
            var branch2;
            var resolveCancelPromise;
            var cancelPromise = newPromise(function (resolve) {
              resolveCancelPromise = resolve;
            });

            function pullAlgorithm() {
              if (reading) {
                return promiseResolvedWith(undefined);
              }

              reading = true;
              var readRequest = {
                _chunkSteps: function _chunkSteps(chunk) {
                  queueMicrotask(function () {
                    reading = false;
                    var chunk1 = chunk;
                    var chunk2 = chunk;

                    if (!canceled1) {
                      ReadableStreamDefaultControllerEnqueue(branch1._readableStreamController, chunk1);
                    }

                    if (!canceled2) {
                      ReadableStreamDefaultControllerEnqueue(branch2._readableStreamController, chunk2);
                    }
                  });
                },
                _closeSteps: function _closeSteps() {
                  reading = false;

                  if (!canceled1) {
                    ReadableStreamDefaultControllerClose(branch1._readableStreamController);
                  }

                  if (!canceled2) {
                    ReadableStreamDefaultControllerClose(branch2._readableStreamController);
                  }

                  if (!canceled1 || !canceled2) {
                    resolveCancelPromise(undefined);
                  }
                },
                _errorSteps: function _errorSteps() {
                  reading = false;
                }
              };
              ReadableStreamDefaultReaderRead(reader, readRequest);
              return promiseResolvedWith(undefined);
            }

            function cancel1Algorithm(reason) {
              canceled1 = true;
              reason1 = reason;

              if (canceled2) {
                var compositeReason = CreateArrayFromList([reason1, reason2]);
                var cancelResult = ReadableStreamCancel(stream, compositeReason);
                resolveCancelPromise(cancelResult);
              }

              return cancelPromise;
            }

            function cancel2Algorithm(reason) {
              canceled2 = true;
              reason2 = reason;

              if (canceled1) {
                var compositeReason = CreateArrayFromList([reason1, reason2]);
                var cancelResult = ReadableStreamCancel(stream, compositeReason);
                resolveCancelPromise(cancelResult);
              }

              return cancelPromise;
            }

            function startAlgorithm() {}

            branch1 = CreateReadableStream(startAlgorithm, pullAlgorithm, cancel1Algorithm);
            branch2 = CreateReadableStream(startAlgorithm, pullAlgorithm, cancel2Algorithm);
            uponRejection(reader._closedPromise, function (r) {
              ReadableStreamDefaultControllerError(branch1._readableStreamController, r);
              ReadableStreamDefaultControllerError(branch2._readableStreamController, r);

              if (!canceled1 || !canceled2) {
                resolveCancelPromise(undefined);
              }
            });
            return [branch1, branch2];
          }

          function ReadableByteStreamTee(stream) {
            var reader = AcquireReadableStreamDefaultReader(stream);
            var reading = false;
            var canceled1 = false;
            var canceled2 = false;
            var reason1;
            var reason2;
            var branch1;
            var branch2;
            var resolveCancelPromise;
            var cancelPromise = newPromise(function (resolve) {
              resolveCancelPromise = resolve;
            });

            function forwardReaderError(thisReader) {
              uponRejection(thisReader._closedPromise, function (r) {
                if (thisReader !== reader) {
                  return;
                }

                ReadableByteStreamControllerError(branch1._readableStreamController, r);
                ReadableByteStreamControllerError(branch2._readableStreamController, r);

                if (!canceled1 || !canceled2) {
                  resolveCancelPromise(undefined);
                }
              });
            }

            function pullWithDefaultReader() {
              if (IsReadableStreamBYOBReader(reader)) {
                ReadableStreamReaderGenericRelease(reader);
                reader = AcquireReadableStreamDefaultReader(stream);
                forwardReaderError(reader);
              }

              var readRequest = {
                _chunkSteps: function _chunkSteps(chunk) {
                  queueMicrotask(function () {
                    reading = false;
                    var chunk1 = chunk;
                    var chunk2 = chunk;

                    if (!canceled1 && !canceled2) {
                      try {
                        chunk2 = CloneAsUint8Array(chunk);
                      } catch (cloneE) {
                        ReadableByteStreamControllerError(branch1._readableStreamController, cloneE);
                        ReadableByteStreamControllerError(branch2._readableStreamController, cloneE);
                        resolveCancelPromise(ReadableStreamCancel(stream, cloneE));
                        return;
                      }
                    }

                    if (!canceled1) {
                      ReadableByteStreamControllerEnqueue(branch1._readableStreamController, chunk1);
                    }

                    if (!canceled2) {
                      ReadableByteStreamControllerEnqueue(branch2._readableStreamController, chunk2);
                    }
                  });
                },
                _closeSteps: function _closeSteps() {
                  reading = false;

                  if (!canceled1) {
                    ReadableByteStreamControllerClose(branch1._readableStreamController);
                  }

                  if (!canceled2) {
                    ReadableByteStreamControllerClose(branch2._readableStreamController);
                  }

                  if (branch1._readableStreamController._pendingPullIntos.length > 0) {
                    ReadableByteStreamControllerRespond(branch1._readableStreamController, 0);
                  }

                  if (branch2._readableStreamController._pendingPullIntos.length > 0) {
                    ReadableByteStreamControllerRespond(branch2._readableStreamController, 0);
                  }

                  if (!canceled1 || !canceled2) {
                    resolveCancelPromise(undefined);
                  }
                },
                _errorSteps: function _errorSteps() {
                  reading = false;
                }
              };
              ReadableStreamDefaultReaderRead(reader, readRequest);
            }

            function pullWithBYOBReader(view, forBranch2) {
              if (IsReadableStreamDefaultReader(reader)) {
                ReadableStreamReaderGenericRelease(reader);
                reader = AcquireReadableStreamBYOBReader(stream);
                forwardReaderError(reader);
              }

              var byobBranch = forBranch2 ? branch2 : branch1;
              var otherBranch = forBranch2 ? branch1 : branch2;
              var readIntoRequest = {
                _chunkSteps: function _chunkSteps(chunk) {
                  queueMicrotask(function () {
                    reading = false;
                    var byobCanceled = forBranch2 ? canceled2 : canceled1;
                    var otherCanceled = forBranch2 ? canceled1 : canceled2;

                    if (!otherCanceled) {
                      var clonedChunk = void 0;

                      try {
                        clonedChunk = CloneAsUint8Array(chunk);
                      } catch (cloneE) {
                        ReadableByteStreamControllerError(byobBranch._readableStreamController, cloneE);
                        ReadableByteStreamControllerError(otherBranch._readableStreamController, cloneE);
                        resolveCancelPromise(ReadableStreamCancel(stream, cloneE));
                        return;
                      }

                      if (!byobCanceled) {
                        ReadableByteStreamControllerRespondWithNewView(byobBranch._readableStreamController, chunk);
                      }

                      ReadableByteStreamControllerEnqueue(otherBranch._readableStreamController, clonedChunk);
                    } else if (!byobCanceled) {
                      ReadableByteStreamControllerRespondWithNewView(byobBranch._readableStreamController, chunk);
                    }
                  });
                },
                _closeSteps: function _closeSteps(chunk) {
                  reading = false;
                  var byobCanceled = forBranch2 ? canceled2 : canceled1;
                  var otherCanceled = forBranch2 ? canceled1 : canceled2;

                  if (!byobCanceled) {
                    ReadableByteStreamControllerClose(byobBranch._readableStreamController);
                  }

                  if (!otherCanceled) {
                    ReadableByteStreamControllerClose(otherBranch._readableStreamController);
                  }

                  if (chunk !== undefined) {
                    if (!byobCanceled) {
                      ReadableByteStreamControllerRespondWithNewView(byobBranch._readableStreamController, chunk);
                    }

                    if (!otherCanceled && otherBranch._readableStreamController._pendingPullIntos.length > 0) {
                      ReadableByteStreamControllerRespond(otherBranch._readableStreamController, 0);
                    }
                  }

                  if (!byobCanceled || !otherCanceled) {
                    resolveCancelPromise(undefined);
                  }
                },
                _errorSteps: function _errorSteps() {
                  reading = false;
                }
              };
              ReadableStreamBYOBReaderRead(reader, view, readIntoRequest);
            }

            function pull1Algorithm() {
              if (reading) {
                return promiseResolvedWith(undefined);
              }

              reading = true;
              var byobRequest = ReadableByteStreamControllerGetBYOBRequest(branch1._readableStreamController);

              if (byobRequest === null) {
                pullWithDefaultReader();
              } else {
                pullWithBYOBReader(byobRequest._view, false);
              }

              return promiseResolvedWith(undefined);
            }

            function pull2Algorithm() {
              if (reading) {
                return promiseResolvedWith(undefined);
              }

              reading = true;
              var byobRequest = ReadableByteStreamControllerGetBYOBRequest(branch2._readableStreamController);

              if (byobRequest === null) {
                pullWithDefaultReader();
              } else {
                pullWithBYOBReader(byobRequest._view, true);
              }

              return promiseResolvedWith(undefined);
            }

            function cancel1Algorithm(reason) {
              canceled1 = true;
              reason1 = reason;

              if (canceled2) {
                var compositeReason = CreateArrayFromList([reason1, reason2]);
                var cancelResult = ReadableStreamCancel(stream, compositeReason);
                resolveCancelPromise(cancelResult);
              }

              return cancelPromise;
            }

            function cancel2Algorithm(reason) {
              canceled2 = true;
              reason2 = reason;

              if (canceled1) {
                var compositeReason = CreateArrayFromList([reason1, reason2]);
                var cancelResult = ReadableStreamCancel(stream, compositeReason);
                resolveCancelPromise(cancelResult);
              }

              return cancelPromise;
            }

            function startAlgorithm() {}

            branch1 = CreateReadableByteStream(startAlgorithm, pull1Algorithm, cancel1Algorithm);
            branch2 = CreateReadableByteStream(startAlgorithm, pull2Algorithm, cancel2Algorithm);
            forwardReaderError(reader);
            return [branch1, branch2];
          }

          function convertUnderlyingDefaultOrByteSource(source, context) {
            assertDictionary(source, context);
            var original = source;
            var autoAllocateChunkSize = original === null || original === void 0 ? void 0 : original.autoAllocateChunkSize;
            var cancel = original === null || original === void 0 ? void 0 : original.cancel;
            var pull = original === null || original === void 0 ? void 0 : original.pull;
            var start = original === null || original === void 0 ? void 0 : original.start;
            var type = original === null || original === void 0 ? void 0 : original.type;
            return {
              autoAllocateChunkSize: autoAllocateChunkSize === undefined ? undefined : convertUnsignedLongLongWithEnforceRange(autoAllocateChunkSize, context + " has member 'autoAllocateChunkSize' that"),
              cancel: cancel === undefined ? undefined : convertUnderlyingSourceCancelCallback(cancel, original, context + " has member 'cancel' that"),
              pull: pull === undefined ? undefined : convertUnderlyingSourcePullCallback(pull, original, context + " has member 'pull' that"),
              start: start === undefined ? undefined : convertUnderlyingSourceStartCallback(start, original, context + " has member 'start' that"),
              type: type === undefined ? undefined : convertReadableStreamType(type, context + " has member 'type' that")
            };
          }

          function convertUnderlyingSourceCancelCallback(fn, original, context) {
            assertFunction(fn, context);
            return function (reason) {
              return promiseCall(fn, original, [reason]);
            };
          }

          function convertUnderlyingSourcePullCallback(fn, original, context) {
            assertFunction(fn, context);
            return function (controller) {
              return promiseCall(fn, original, [controller]);
            };
          }

          function convertUnderlyingSourceStartCallback(fn, original, context) {
            assertFunction(fn, context);
            return function (controller) {
              return reflectCall(fn, original, [controller]);
            };
          }

          function convertReadableStreamType(type, context) {
            type = "" + type;

            if (type !== 'bytes') {
              throw new TypeError(context + " '" + type + "' is not a valid enumeration value for ReadableStreamType");
            }

            return type;
          }

          function convertReaderOptions(options, context) {
            assertDictionary(options, context);
            var mode = options === null || options === void 0 ? void 0 : options.mode;
            return {
              mode: mode === undefined ? undefined : convertReadableStreamReaderMode(mode, context + " has member 'mode' that")
            };
          }

          function convertReadableStreamReaderMode(mode, context) {
            mode = "" + mode;

            if (mode !== 'byob') {
              throw new TypeError(context + " '" + mode + "' is not a valid enumeration value for ReadableStreamReaderMode");
            }

            return mode;
          }

          function convertIteratorOptions(options, context) {
            assertDictionary(options, context);
            var preventCancel = options === null || options === void 0 ? void 0 : options.preventCancel;
            return {
              preventCancel: Boolean(preventCancel)
            };
          }

          function convertPipeOptions(options, context) {
            assertDictionary(options, context);
            var preventAbort = options === null || options === void 0 ? void 0 : options.preventAbort;
            var preventCancel = options === null || options === void 0 ? void 0 : options.preventCancel;
            var preventClose = options === null || options === void 0 ? void 0 : options.preventClose;
            var signal = options === null || options === void 0 ? void 0 : options.signal;

            if (signal !== undefined) {
              assertAbortSignal(signal, context + " has member 'signal' that");
            }

            return {
              preventAbort: Boolean(preventAbort),
              preventCancel: Boolean(preventCancel),
              preventClose: Boolean(preventClose),
              signal: signal
            };
          }

          function assertAbortSignal(signal, context) {
            if (!isAbortSignal(signal)) {
              throw new TypeError(context + " is not an AbortSignal.");
            }
          }

          function convertReadableWritablePair(pair, context) {
            assertDictionary(pair, context);
            var readable = pair === null || pair === void 0 ? void 0 : pair.readable;
            assertRequiredField(readable, 'readable', 'ReadableWritablePair');
            assertReadableStream(readable, context + " has member 'readable' that");
            var writable = pair === null || pair === void 0 ? void 0 : pair.writable;
            assertRequiredField(writable, 'writable', 'ReadableWritablePair');
            assertWritableStream(writable, context + " has member 'writable' that");
            return {
              readable: readable,
              writable: writable
            };
          }

          var ReadableStream = function () {
            function ReadableStream(rawUnderlyingSource, rawStrategy) {
              if (rawUnderlyingSource === void 0) {
                rawUnderlyingSource = {};
              }

              if (rawStrategy === void 0) {
                rawStrategy = {};
              }

              if (rawUnderlyingSource === undefined) {
                rawUnderlyingSource = null;
              } else {
                assertObject(rawUnderlyingSource, 'First parameter');
              }

              var strategy = convertQueuingStrategy(rawStrategy, 'Second parameter');
              var underlyingSource = convertUnderlyingDefaultOrByteSource(rawUnderlyingSource, 'First parameter');
              InitializeReadableStream(this);

              if (underlyingSource.type === 'bytes') {
                if (strategy.size !== undefined) {
                  throw new RangeError('The strategy for a byte stream cannot have a size function');
                }

                var highWaterMark = ExtractHighWaterMark(strategy, 0);
                SetUpReadableByteStreamControllerFromUnderlyingSource(this, underlyingSource, highWaterMark);
              } else {
                var sizeAlgorithm = ExtractSizeAlgorithm(strategy);
                var highWaterMark = ExtractHighWaterMark(strategy, 1);
                SetUpReadableStreamDefaultControllerFromUnderlyingSource(this, underlyingSource, highWaterMark, sizeAlgorithm);
              }
            }

            Object.defineProperty(ReadableStream.prototype, "locked", {
              get: function get() {
                if (!IsReadableStream(this)) {
                  throw streamBrandCheckException$1('locked');
                }

                return IsReadableStreamLocked(this);
              },
              enumerable: false,
              configurable: true
            });

            ReadableStream.prototype.cancel = function (reason) {
              if (reason === void 0) {
                reason = undefined;
              }

              if (!IsReadableStream(this)) {
                return promiseRejectedWith(streamBrandCheckException$1('cancel'));
              }

              if (IsReadableStreamLocked(this)) {
                return promiseRejectedWith(new TypeError('Cannot cancel a stream that already has a reader'));
              }

              return ReadableStreamCancel(this, reason);
            };

            ReadableStream.prototype.getReader = function (rawOptions) {
              if (rawOptions === void 0) {
                rawOptions = undefined;
              }

              if (!IsReadableStream(this)) {
                throw streamBrandCheckException$1('getReader');
              }

              var options = convertReaderOptions(rawOptions, 'First parameter');

              if (options.mode === undefined) {
                return AcquireReadableStreamDefaultReader(this);
              }

              return AcquireReadableStreamBYOBReader(this);
            };

            ReadableStream.prototype.pipeThrough = function (rawTransform, rawOptions) {
              if (rawOptions === void 0) {
                rawOptions = {};
              }

              if (!IsReadableStream(this)) {
                throw streamBrandCheckException$1('pipeThrough');
              }

              assertRequiredArgument(rawTransform, 1, 'pipeThrough');
              var transform = convertReadableWritablePair(rawTransform, 'First parameter');
              var options = convertPipeOptions(rawOptions, 'Second parameter');

              if (IsReadableStreamLocked(this)) {
                throw new TypeError('ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream');
              }

              if (IsWritableStreamLocked(transform.writable)) {
                throw new TypeError('ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream');
              }

              var promise = ReadableStreamPipeTo(this, transform.writable, options.preventClose, options.preventAbort, options.preventCancel, options.signal);
              setPromiseIsHandledToTrue(promise);
              return transform.readable;
            };

            ReadableStream.prototype.pipeTo = function (destination, rawOptions) {
              if (rawOptions === void 0) {
                rawOptions = {};
              }

              if (!IsReadableStream(this)) {
                return promiseRejectedWith(streamBrandCheckException$1('pipeTo'));
              }

              if (destination === undefined) {
                return promiseRejectedWith("Parameter 1 is required in 'pipeTo'.");
              }

              if (!IsWritableStream(destination)) {
                return promiseRejectedWith(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));
              }

              var options;

              try {
                options = convertPipeOptions(rawOptions, 'Second parameter');
              } catch (e) {
                return promiseRejectedWith(e);
              }

              if (IsReadableStreamLocked(this)) {
                return promiseRejectedWith(new TypeError('ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream'));
              }

              if (IsWritableStreamLocked(destination)) {
                return promiseRejectedWith(new TypeError('ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream'));
              }

              return ReadableStreamPipeTo(this, destination, options.preventClose, options.preventAbort, options.preventCancel, options.signal);
            };

            ReadableStream.prototype.tee = function () {
              if (!IsReadableStream(this)) {
                throw streamBrandCheckException$1('tee');
              }

              var branches = ReadableStreamTee(this);
              return CreateArrayFromList(branches);
            };

            ReadableStream.prototype.values = function (rawOptions) {
              if (rawOptions === void 0) {
                rawOptions = undefined;
              }

              if (!IsReadableStream(this)) {
                throw streamBrandCheckException$1('values');
              }

              var options = convertIteratorOptions(rawOptions, 'First parameter');
              return AcquireReadableStreamAsyncIterator(this, options.preventCancel);
            };

            return ReadableStream;
          }();

          Object.defineProperties(ReadableStream.prototype, {
            cancel: {
              enumerable: true
            },
            getReader: {
              enumerable: true
            },
            pipeThrough: {
              enumerable: true
            },
            pipeTo: {
              enumerable: true
            },
            tee: {
              enumerable: true
            },
            values: {
              enumerable: true
            },
            locked: {
              enumerable: true
            }
          });

          if (typeof SymbolPolyfill.toStringTag === 'symbol') {
            Object.defineProperty(ReadableStream.prototype, SymbolPolyfill.toStringTag, {
              value: 'ReadableStream',
              configurable: true
            });
          }

          if (typeof SymbolPolyfill.asyncIterator === 'symbol') {
            Object.defineProperty(ReadableStream.prototype, SymbolPolyfill.asyncIterator, {
              value: ReadableStream.prototype.values,
              writable: true,
              configurable: true
            });
          }

          function CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm) {
            if (highWaterMark === void 0) {
              highWaterMark = 1;
            }

            if (sizeAlgorithm === void 0) {
              sizeAlgorithm = function sizeAlgorithm() {
                return 1;
              };
            }

            var stream = Object.create(ReadableStream.prototype);
            InitializeReadableStream(stream);
            var controller = Object.create(ReadableStreamDefaultController.prototype);
            SetUpReadableStreamDefaultController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm);
            return stream;
          }

          function CreateReadableByteStream(startAlgorithm, pullAlgorithm, cancelAlgorithm) {
            var stream = Object.create(ReadableStream.prototype);
            InitializeReadableStream(stream);
            var controller = Object.create(ReadableByteStreamController.prototype);
            SetUpReadableByteStreamController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, 0, undefined);
            return stream;
          }

          function InitializeReadableStream(stream) {
            stream._state = 'readable';
            stream._reader = undefined;
            stream._storedError = undefined;
            stream._disturbed = false;
          }

          function IsReadableStream(x) {
            if (!typeIsObject(x)) {
              return false;
            }

            if (!Object.prototype.hasOwnProperty.call(x, '_readableStreamController')) {
              return false;
            }

            return x instanceof ReadableStream;
          }

          function IsReadableStreamLocked(stream) {
            if (stream._reader === undefined) {
              return false;
            }

            return true;
          }

          function ReadableStreamCancel(stream, reason) {
            stream._disturbed = true;

            if (stream._state === 'closed') {
              return promiseResolvedWith(undefined);
            }

            if (stream._state === 'errored') {
              return promiseRejectedWith(stream._storedError);
            }

            ReadableStreamClose(stream);
            var reader = stream._reader;

            if (reader !== undefined && IsReadableStreamBYOBReader(reader)) {
              reader._readIntoRequests.forEach(function (readIntoRequest) {
                readIntoRequest._closeSteps(undefined);
              });

              reader._readIntoRequests = new SimpleQueue();
            }

            var sourceCancelPromise = stream._readableStreamController[CancelSteps](reason);

            return transformPromiseWith(sourceCancelPromise, noop);
          }

          function ReadableStreamClose(stream) {
            stream._state = 'closed';
            var reader = stream._reader;

            if (reader === undefined) {
              return;
            }

            defaultReaderClosedPromiseResolve(reader);

            if (IsReadableStreamDefaultReader(reader)) {
              reader._readRequests.forEach(function (readRequest) {
                readRequest._closeSteps();
              });

              reader._readRequests = new SimpleQueue();
            }
          }

          function ReadableStreamError(stream, e) {
            stream._state = 'errored';
            stream._storedError = e;
            var reader = stream._reader;

            if (reader === undefined) {
              return;
            }

            defaultReaderClosedPromiseReject(reader, e);

            if (IsReadableStreamDefaultReader(reader)) {
              reader._readRequests.forEach(function (readRequest) {
                readRequest._errorSteps(e);
              });

              reader._readRequests = new SimpleQueue();
            } else {
              reader._readIntoRequests.forEach(function (readIntoRequest) {
                readIntoRequest._errorSteps(e);
              });

              reader._readIntoRequests = new SimpleQueue();
            }
          }

          function streamBrandCheckException$1(name) {
            return new TypeError("ReadableStream.prototype." + name + " can only be used on a ReadableStream");
          }

          function convertQueuingStrategyInit(init, context) {
            assertDictionary(init, context);
            var highWaterMark = init === null || init === void 0 ? void 0 : init.highWaterMark;
            assertRequiredField(highWaterMark, 'highWaterMark', 'QueuingStrategyInit');
            return {
              highWaterMark: convertUnrestrictedDouble(highWaterMark)
            };
          }

          var byteLengthSizeFunction = function byteLengthSizeFunction(chunk) {
            return chunk.byteLength;
          };

          Object.defineProperty(byteLengthSizeFunction, 'name', {
            value: 'size',
            configurable: true
          });

          var ByteLengthQueuingStrategy = function () {
            function ByteLengthQueuingStrategy(options) {
              assertRequiredArgument(options, 1, 'ByteLengthQueuingStrategy');
              options = convertQueuingStrategyInit(options, 'First parameter');
              this._byteLengthQueuingStrategyHighWaterMark = options.highWaterMark;
            }

            Object.defineProperty(ByteLengthQueuingStrategy.prototype, "highWaterMark", {
              get: function get() {
                if (!IsByteLengthQueuingStrategy(this)) {
                  throw byteLengthBrandCheckException('highWaterMark');
                }

                return this._byteLengthQueuingStrategyHighWaterMark;
              },
              enumerable: false,
              configurable: true
            });
            Object.defineProperty(ByteLengthQueuingStrategy.prototype, "size", {
              get: function get() {
                if (!IsByteLengthQueuingStrategy(this)) {
                  throw byteLengthBrandCheckException('size');
                }

                return byteLengthSizeFunction;
              },
              enumerable: false,
              configurable: true
            });
            return ByteLengthQueuingStrategy;
          }();

          Object.defineProperties(ByteLengthQueuingStrategy.prototype, {
            highWaterMark: {
              enumerable: true
            },
            size: {
              enumerable: true
            }
          });

          if (typeof SymbolPolyfill.toStringTag === 'symbol') {
            Object.defineProperty(ByteLengthQueuingStrategy.prototype, SymbolPolyfill.toStringTag, {
              value: 'ByteLengthQueuingStrategy',
              configurable: true
            });
          }

          function byteLengthBrandCheckException(name) {
            return new TypeError("ByteLengthQueuingStrategy.prototype." + name + " can only be used on a ByteLengthQueuingStrategy");
          }

          function IsByteLengthQueuingStrategy(x) {
            if (!typeIsObject(x)) {
              return false;
            }

            if (!Object.prototype.hasOwnProperty.call(x, '_byteLengthQueuingStrategyHighWaterMark')) {
              return false;
            }

            return x instanceof ByteLengthQueuingStrategy;
          }

          var countSizeFunction = function countSizeFunction() {
            return 1;
          };

          Object.defineProperty(countSizeFunction, 'name', {
            value: 'size',
            configurable: true
          });

          var CountQueuingStrategy = function () {
            function CountQueuingStrategy(options) {
              assertRequiredArgument(options, 1, 'CountQueuingStrategy');
              options = convertQueuingStrategyInit(options, 'First parameter');
              this._countQueuingStrategyHighWaterMark = options.highWaterMark;
            }

            Object.defineProperty(CountQueuingStrategy.prototype, "highWaterMark", {
              get: function get() {
                if (!IsCountQueuingStrategy(this)) {
                  throw countBrandCheckException('highWaterMark');
                }

                return this._countQueuingStrategyHighWaterMark;
              },
              enumerable: false,
              configurable: true
            });
            Object.defineProperty(CountQueuingStrategy.prototype, "size", {
              get: function get() {
                if (!IsCountQueuingStrategy(this)) {
                  throw countBrandCheckException('size');
                }

                return countSizeFunction;
              },
              enumerable: false,
              configurable: true
            });
            return CountQueuingStrategy;
          }();

          Object.defineProperties(CountQueuingStrategy.prototype, {
            highWaterMark: {
              enumerable: true
            },
            size: {
              enumerable: true
            }
          });

          if (typeof SymbolPolyfill.toStringTag === 'symbol') {
            Object.defineProperty(CountQueuingStrategy.prototype, SymbolPolyfill.toStringTag, {
              value: 'CountQueuingStrategy',
              configurable: true
            });
          }

          function countBrandCheckException(name) {
            return new TypeError("CountQueuingStrategy.prototype." + name + " can only be used on a CountQueuingStrategy");
          }

          function IsCountQueuingStrategy(x) {
            if (!typeIsObject(x)) {
              return false;
            }

            if (!Object.prototype.hasOwnProperty.call(x, '_countQueuingStrategyHighWaterMark')) {
              return false;
            }

            return x instanceof CountQueuingStrategy;
          }

          function convertTransformer(original, context) {
            assertDictionary(original, context);
            var flush = original === null || original === void 0 ? void 0 : original.flush;
            var readableType = original === null || original === void 0 ? void 0 : original.readableType;
            var start = original === null || original === void 0 ? void 0 : original.start;
            var transform = original === null || original === void 0 ? void 0 : original.transform;
            var writableType = original === null || original === void 0 ? void 0 : original.writableType;
            return {
              flush: flush === undefined ? undefined : convertTransformerFlushCallback(flush, original, context + " has member 'flush' that"),
              readableType: readableType,
              start: start === undefined ? undefined : convertTransformerStartCallback(start, original, context + " has member 'start' that"),
              transform: transform === undefined ? undefined : convertTransformerTransformCallback(transform, original, context + " has member 'transform' that"),
              writableType: writableType
            };
          }

          function convertTransformerFlushCallback(fn, original, context) {
            assertFunction(fn, context);
            return function (controller) {
              return promiseCall(fn, original, [controller]);
            };
          }

          function convertTransformerStartCallback(fn, original, context) {
            assertFunction(fn, context);
            return function (controller) {
              return reflectCall(fn, original, [controller]);
            };
          }

          function convertTransformerTransformCallback(fn, original, context) {
            assertFunction(fn, context);
            return function (chunk, controller) {
              return promiseCall(fn, original, [chunk, controller]);
            };
          }

          var TransformStream = function () {
            function TransformStream(rawTransformer, rawWritableStrategy, rawReadableStrategy) {
              if (rawTransformer === void 0) {
                rawTransformer = {};
              }

              if (rawWritableStrategy === void 0) {
                rawWritableStrategy = {};
              }

              if (rawReadableStrategy === void 0) {
                rawReadableStrategy = {};
              }

              if (rawTransformer === undefined) {
                rawTransformer = null;
              }

              var writableStrategy = convertQueuingStrategy(rawWritableStrategy, 'Second parameter');
              var readableStrategy = convertQueuingStrategy(rawReadableStrategy, 'Third parameter');
              var transformer = convertTransformer(rawTransformer, 'First parameter');

              if (transformer.readableType !== undefined) {
                throw new RangeError('Invalid readableType specified');
              }

              if (transformer.writableType !== undefined) {
                throw new RangeError('Invalid writableType specified');
              }

              var readableHighWaterMark = ExtractHighWaterMark(readableStrategy, 0);
              var readableSizeAlgorithm = ExtractSizeAlgorithm(readableStrategy);
              var writableHighWaterMark = ExtractHighWaterMark(writableStrategy, 1);
              var writableSizeAlgorithm = ExtractSizeAlgorithm(writableStrategy);
              var startPromise_resolve;
              var startPromise = newPromise(function (resolve) {
                startPromise_resolve = resolve;
              });
              InitializeTransformStream(this, startPromise, writableHighWaterMark, writableSizeAlgorithm, readableHighWaterMark, readableSizeAlgorithm);
              SetUpTransformStreamDefaultControllerFromTransformer(this, transformer);

              if (transformer.start !== undefined) {
                startPromise_resolve(transformer.start(this._transformStreamController));
              } else {
                startPromise_resolve(undefined);
              }
            }

            Object.defineProperty(TransformStream.prototype, "readable", {
              get: function get() {
                if (!IsTransformStream(this)) {
                  throw streamBrandCheckException('readable');
                }

                return this._readable;
              },
              enumerable: false,
              configurable: true
            });
            Object.defineProperty(TransformStream.prototype, "writable", {
              get: function get() {
                if (!IsTransformStream(this)) {
                  throw streamBrandCheckException('writable');
                }

                return this._writable;
              },
              enumerable: false,
              configurable: true
            });
            return TransformStream;
          }();

          Object.defineProperties(TransformStream.prototype, {
            readable: {
              enumerable: true
            },
            writable: {
              enumerable: true
            }
          });

          if (typeof SymbolPolyfill.toStringTag === 'symbol') {
            Object.defineProperty(TransformStream.prototype, SymbolPolyfill.toStringTag, {
              value: 'TransformStream',
              configurable: true
            });
          }

          function InitializeTransformStream(stream, startPromise, writableHighWaterMark, writableSizeAlgorithm, readableHighWaterMark, readableSizeAlgorithm) {
            function startAlgorithm() {
              return startPromise;
            }

            function writeAlgorithm(chunk) {
              return TransformStreamDefaultSinkWriteAlgorithm(stream, chunk);
            }

            function abortAlgorithm(reason) {
              return TransformStreamDefaultSinkAbortAlgorithm(stream, reason);
            }

            function closeAlgorithm() {
              return TransformStreamDefaultSinkCloseAlgorithm(stream);
            }

            stream._writable = CreateWritableStream(startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, writableHighWaterMark, writableSizeAlgorithm);

            function pullAlgorithm() {
              return TransformStreamDefaultSourcePullAlgorithm(stream);
            }

            function cancelAlgorithm(reason) {
              TransformStreamErrorWritableAndUnblockWrite(stream, reason);
              return promiseResolvedWith(undefined);
            }

            stream._readable = CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, readableHighWaterMark, readableSizeAlgorithm);
            stream._backpressure = undefined;
            stream._backpressureChangePromise = undefined;
            stream._backpressureChangePromise_resolve = undefined;
            TransformStreamSetBackpressure(stream, true);
            stream._transformStreamController = undefined;
          }

          function IsTransformStream(x) {
            if (!typeIsObject(x)) {
              return false;
            }

            if (!Object.prototype.hasOwnProperty.call(x, '_transformStreamController')) {
              return false;
            }

            return x instanceof TransformStream;
          }

          function TransformStreamError(stream, e) {
            ReadableStreamDefaultControllerError(stream._readable._readableStreamController, e);
            TransformStreamErrorWritableAndUnblockWrite(stream, e);
          }

          function TransformStreamErrorWritableAndUnblockWrite(stream, e) {
            TransformStreamDefaultControllerClearAlgorithms(stream._transformStreamController);
            WritableStreamDefaultControllerErrorIfNeeded(stream._writable._writableStreamController, e);

            if (stream._backpressure) {
              TransformStreamSetBackpressure(stream, false);
            }
          }

          function TransformStreamSetBackpressure(stream, backpressure) {
            if (stream._backpressureChangePromise !== undefined) {
              stream._backpressureChangePromise_resolve();
            }

            stream._backpressureChangePromise = newPromise(function (resolve) {
              stream._backpressureChangePromise_resolve = resolve;
            });
            stream._backpressure = backpressure;
          }

          var TransformStreamDefaultController = function () {
            function TransformStreamDefaultController() {
              throw new TypeError('Illegal constructor');
            }

            Object.defineProperty(TransformStreamDefaultController.prototype, "desiredSize", {
              get: function get() {
                if (!IsTransformStreamDefaultController(this)) {
                  throw defaultControllerBrandCheckException('desiredSize');
                }

                var readableController = this._controlledTransformStream._readable._readableStreamController;
                return ReadableStreamDefaultControllerGetDesiredSize(readableController);
              },
              enumerable: false,
              configurable: true
            });

            TransformStreamDefaultController.prototype.enqueue = function (chunk) {
              if (chunk === void 0) {
                chunk = undefined;
              }

              if (!IsTransformStreamDefaultController(this)) {
                throw defaultControllerBrandCheckException('enqueue');
              }

              TransformStreamDefaultControllerEnqueue(this, chunk);
            };

            TransformStreamDefaultController.prototype.error = function (reason) {
              if (reason === void 0) {
                reason = undefined;
              }

              if (!IsTransformStreamDefaultController(this)) {
                throw defaultControllerBrandCheckException('error');
              }

              TransformStreamDefaultControllerError(this, reason);
            };

            TransformStreamDefaultController.prototype.terminate = function () {
              if (!IsTransformStreamDefaultController(this)) {
                throw defaultControllerBrandCheckException('terminate');
              }

              TransformStreamDefaultControllerTerminate(this);
            };

            return TransformStreamDefaultController;
          }();

          Object.defineProperties(TransformStreamDefaultController.prototype, {
            enqueue: {
              enumerable: true
            },
            error: {
              enumerable: true
            },
            terminate: {
              enumerable: true
            },
            desiredSize: {
              enumerable: true
            }
          });

          if (typeof SymbolPolyfill.toStringTag === 'symbol') {
            Object.defineProperty(TransformStreamDefaultController.prototype, SymbolPolyfill.toStringTag, {
              value: 'TransformStreamDefaultController',
              configurable: true
            });
          }

          function IsTransformStreamDefaultController(x) {
            if (!typeIsObject(x)) {
              return false;
            }

            if (!Object.prototype.hasOwnProperty.call(x, '_controlledTransformStream')) {
              return false;
            }

            return x instanceof TransformStreamDefaultController;
          }

          function SetUpTransformStreamDefaultController(stream, controller, transformAlgorithm, flushAlgorithm) {
            controller._controlledTransformStream = stream;
            stream._transformStreamController = controller;
            controller._transformAlgorithm = transformAlgorithm;
            controller._flushAlgorithm = flushAlgorithm;
          }

          function SetUpTransformStreamDefaultControllerFromTransformer(stream, transformer) {
            var controller = Object.create(TransformStreamDefaultController.prototype);

            var transformAlgorithm = function transformAlgorithm(chunk) {
              try {
                TransformStreamDefaultControllerEnqueue(controller, chunk);
                return promiseResolvedWith(undefined);
              } catch (transformResultE) {
                return promiseRejectedWith(transformResultE);
              }
            };

            var flushAlgorithm = function flushAlgorithm() {
              return promiseResolvedWith(undefined);
            };

            if (transformer.transform !== undefined) {
              transformAlgorithm = function transformAlgorithm(chunk) {
                return transformer.transform(chunk, controller);
              };
            }

            if (transformer.flush !== undefined) {
              flushAlgorithm = function flushAlgorithm() {
                return transformer.flush(controller);
              };
            }

            SetUpTransformStreamDefaultController(stream, controller, transformAlgorithm, flushAlgorithm);
          }

          function TransformStreamDefaultControllerClearAlgorithms(controller) {
            controller._transformAlgorithm = undefined;
            controller._flushAlgorithm = undefined;
          }

          function TransformStreamDefaultControllerEnqueue(controller, chunk) {
            var stream = controller._controlledTransformStream;
            var readableController = stream._readable._readableStreamController;

            if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(readableController)) {
              throw new TypeError('Readable side is not in a state that permits enqueue');
            }

            try {
              ReadableStreamDefaultControllerEnqueue(readableController, chunk);
            } catch (e) {
              TransformStreamErrorWritableAndUnblockWrite(stream, e);
              throw stream._readable._storedError;
            }

            var backpressure = ReadableStreamDefaultControllerHasBackpressure(readableController);

            if (backpressure !== stream._backpressure) {
              TransformStreamSetBackpressure(stream, true);
            }
          }

          function TransformStreamDefaultControllerError(controller, e) {
            TransformStreamError(controller._controlledTransformStream, e);
          }

          function TransformStreamDefaultControllerPerformTransform(controller, chunk) {
            var transformPromise = controller._transformAlgorithm(chunk);

            return transformPromiseWith(transformPromise, undefined, function (r) {
              TransformStreamError(controller._controlledTransformStream, r);
              throw r;
            });
          }

          function TransformStreamDefaultControllerTerminate(controller) {
            var stream = controller._controlledTransformStream;
            var readableController = stream._readable._readableStreamController;
            ReadableStreamDefaultControllerClose(readableController);
            var error = new TypeError('TransformStream terminated');
            TransformStreamErrorWritableAndUnblockWrite(stream, error);
          }

          function TransformStreamDefaultSinkWriteAlgorithm(stream, chunk) {
            var controller = stream._transformStreamController;

            if (stream._backpressure) {
              var backpressureChangePromise = stream._backpressureChangePromise;
              return transformPromiseWith(backpressureChangePromise, function () {
                var writable = stream._writable;
                var state = writable._state;

                if (state === 'erroring') {
                  throw writable._storedError;
                }

                return TransformStreamDefaultControllerPerformTransform(controller, chunk);
              });
            }

            return TransformStreamDefaultControllerPerformTransform(controller, chunk);
          }

          function TransformStreamDefaultSinkAbortAlgorithm(stream, reason) {
            TransformStreamError(stream, reason);
            return promiseResolvedWith(undefined);
          }

          function TransformStreamDefaultSinkCloseAlgorithm(stream) {
            var readable = stream._readable;
            var controller = stream._transformStreamController;

            var flushPromise = controller._flushAlgorithm();

            TransformStreamDefaultControllerClearAlgorithms(controller);
            return transformPromiseWith(flushPromise, function () {
              if (readable._state === 'errored') {
                throw readable._storedError;
              }

              ReadableStreamDefaultControllerClose(readable._readableStreamController);
            }, function (r) {
              TransformStreamError(stream, r);
              throw readable._storedError;
            });
          }

          function TransformStreamDefaultSourcePullAlgorithm(stream) {
            TransformStreamSetBackpressure(stream, false);
            return stream._backpressureChangePromise;
          }

          function defaultControllerBrandCheckException(name) {
            return new TypeError("TransformStreamDefaultController.prototype." + name + " can only be used on a TransformStreamDefaultController");
          }

          function streamBrandCheckException(name) {
            return new TypeError("TransformStream.prototype." + name + " can only be used on a TransformStream");
          }

          exports.ByteLengthQueuingStrategy = ByteLengthQueuingStrategy;
          exports.CountQueuingStrategy = CountQueuingStrategy;
          exports.ReadableByteStreamController = ReadableByteStreamController;
          exports.ReadableStream = ReadableStream;
          exports.ReadableStreamBYOBReader = ReadableStreamBYOBReader;
          exports.ReadableStreamBYOBRequest = ReadableStreamBYOBRequest;
          exports.ReadableStreamDefaultController = ReadableStreamDefaultController;
          exports.ReadableStreamDefaultReader = ReadableStreamDefaultReader;
          exports.TransformStream = TransformStream;
          exports.TransformStreamDefaultController = TransformStreamDefaultController;
          exports.WritableStream = WritableStream;
          exports.WritableStreamDefaultController = WritableStreamDefaultController;
          exports.WritableStreamDefaultWriter = WritableStreamDefaultWriter;
          Object.defineProperty(exports, '__esModule', {
            value: true
          });
        });
        /***/

      },
      /* 118 */

      /***/
      function (__unused_webpack_module, exports, __w_pdfjs_require__) {
        "use strict";

        Object.defineProperty(exports, "__esModule", {
          value: true
        });
        exports.BaseSVGFactory = exports.BaseStandardFontDataFactory = exports.BaseCMapReaderFactory = exports.BaseCanvasFactory = void 0;

        var _regenerator = _interopRequireDefault(__w_pdfjs_require__(2));

        var _util = __w_pdfjs_require__(4);

        function _interopRequireDefault(obj) {
          return obj && obj.__esModule ? obj : {
            "default": obj
          };
        }

        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 self = this,
                args = arguments;
            return new Promise(function (resolve, reject) {
              var gen = fn.apply(self, args);

              function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
              }

              function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
              }

              _next(undefined);
            });
          };
        }

        function _classCallCheck(instance, Constructor) {
          if (!(instance instanceof Constructor)) {
            throw new TypeError("Cannot call a class as a function");
          }
        }

        function _defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];
            descriptor.enumerable = descriptor.enumerable || false;
            descriptor.configurable = true;
            if ("value" in descriptor) descriptor.writable = true;
            Object.defineProperty(target, descriptor.key, descriptor);
          }
        }

        function _createClass(Constructor, protoProps, staticProps) {
          if (protoProps) _defineProperties(Constructor.prototype, protoProps);
          if (staticProps) _defineProperties(Constructor, staticProps);
          return Constructor;
        }

        var BaseCanvasFactory = /*#__PURE__*/function () {
          function BaseCanvasFactory() {
            _classCallCheck(this, BaseCanvasFactory);

            if (this.constructor === BaseCanvasFactory) {
              (0, _util.unreachable)("Cannot initialize BaseCanvasFactory.");
            }
          }

          _createClass(BaseCanvasFactory, [{
            key: "create",
            value: function create(width, height) {
              if (width <= 0 || height <= 0) {
                throw new Error("Invalid canvas size");
              }

              var canvas = this._createCanvas(width, height);

              return {
                canvas: canvas,
                context: canvas.getContext("2d")
              };
            }
          }, {
            key: "reset",
            value: function reset(canvasAndContext, width, height) {
              if (!canvasAndContext.canvas) {
                throw new Error("Canvas is not specified");
              }

              if (width <= 0 || height <= 0) {
                throw new Error("Invalid canvas size");
              }

              canvasAndContext.canvas.width = width;
              canvasAndContext.canvas.height = height;
            }
          }, {
            key: "destroy",
            value: function destroy(canvasAndContext) {
              if (!canvasAndContext.canvas) {
                throw new Error("Canvas is not specified");
              }

              canvasAndContext.canvas.width = 0;
              canvasAndContext.canvas.height = 0;
              canvasAndContext.canvas = null;
              canvasAndContext.context = null;
            }
          }, {
            key: "_createCanvas",
            value: function _createCanvas(width, height) {
              (0, _util.unreachable)("Abstract method `_createCanvas` called.");
            }
          }]);

          return BaseCanvasFactory;
        }();

        exports.BaseCanvasFactory = BaseCanvasFactory;

        var BaseCMapReaderFactory = /*#__PURE__*/function () {
          function BaseCMapReaderFactory(_ref) {
            var _ref$baseUrl = _ref.baseUrl,
                baseUrl = _ref$baseUrl === void 0 ? null : _ref$baseUrl,
                _ref$isCompressed = _ref.isCompressed,
                isCompressed = _ref$isCompressed === void 0 ? false : _ref$isCompressed;

            _classCallCheck(this, BaseCMapReaderFactory);

            if (this.constructor === BaseCMapReaderFactory) {
              (0, _util.unreachable)("Cannot initialize BaseCMapReaderFactory.");
            }

            this.baseUrl = baseUrl;
            this.isCompressed = isCompressed;
          }

          _createClass(BaseCMapReaderFactory, [{
            key: "fetch",
            value: function () {
              var _fetch = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee(_ref2) {
                var _this = this;

                var name, url, compressionType;
                return _regenerator["default"].wrap(function _callee$(_context) {
                  while (1) {
                    switch (_context.prev = _context.next) {
                      case 0:
                        name = _ref2.name;

                        if (this.baseUrl) {
                          _context.next = 3;
                          break;
                        }

                        throw new Error('The CMap "baseUrl" parameter must be specified, ensure that ' + 'the "cMapUrl" and "cMapPacked" API parameters are provided.');

                      case 3:
                        if (name) {
                          _context.next = 5;
                          break;
                        }

                        throw new Error("CMap name must be specified.");

                      case 5:
                        url = this.baseUrl + name + (this.isCompressed ? ".bcmap" : "");
                        compressionType = this.isCompressed ? _util.CMapCompressionType.BINARY : _util.CMapCompressionType.NONE;
                        return _context.abrupt("return", this._fetchData(url, compressionType)["catch"](function (reason) {
                          throw new Error("Unable to load ".concat(_this.isCompressed ? "binary " : "", "CMap at: ").concat(url));
                        }));

                      case 8:
                      case "end":
                        return _context.stop();
                    }
                  }
                }, _callee, this);
              }));

              function fetch(_x) {
                return _fetch.apply(this, arguments);
              }

              return fetch;
            }()
          }, {
            key: "_fetchData",
            value: function _fetchData(url, compressionType) {
              (0, _util.unreachable)("Abstract method `_fetchData` called.");
            }
          }]);

          return BaseCMapReaderFactory;
        }();

        exports.BaseCMapReaderFactory = BaseCMapReaderFactory;

        var BaseStandardFontDataFactory = /*#__PURE__*/function () {
          function BaseStandardFontDataFactory(_ref3) {
            var _ref3$baseUrl = _ref3.baseUrl,
                baseUrl = _ref3$baseUrl === void 0 ? null : _ref3$baseUrl;

            _classCallCheck(this, BaseStandardFontDataFactory);

            if (this.constructor === BaseStandardFontDataFactory) {
              (0, _util.unreachable)("Cannot initialize BaseStandardFontDataFactory.");
            }

            this.baseUrl = baseUrl;
          }

          _createClass(BaseStandardFontDataFactory, [{
            key: "fetch",
            value: function () {
              var _fetch2 = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee2(_ref4) {
                var filename, url;
                return _regenerator["default"].wrap(function _callee2$(_context2) {
                  while (1) {
                    switch (_context2.prev = _context2.next) {
                      case 0:
                        filename = _ref4.filename;

                        if (this.baseUrl) {
                          _context2.next = 3;
                          break;
                        }

                        throw new Error('The standard font "baseUrl" parameter must be specified, ensure that ' + 'the "standardFontDataUrl" API parameter is provided.');

                      case 3:
                        if (filename) {
                          _context2.next = 5;
                          break;
                        }

                        throw new Error("Font filename must be specified.");

                      case 5:
                        url = "".concat(this.baseUrl).concat(filename);
                        return _context2.abrupt("return", this._fetchData(url)["catch"](function (reason) {
                          throw new Error("Unable to load font data at: ".concat(url));
                        }));

                      case 7:
                      case "end":
                        return _context2.stop();
                    }
                  }
                }, _callee2, this);
              }));

              function fetch(_x2) {
                return _fetch2.apply(this, arguments);
              }

              return fetch;
            }()
          }, {
            key: "_fetchData",
            value: function _fetchData(url) {
              (0, _util.unreachable)("Abstract method `_fetchData` called.");
            }
          }]);

          return BaseStandardFontDataFactory;
        }();

        exports.BaseStandardFontDataFactory = BaseStandardFontDataFactory;

        var BaseSVGFactory = /*#__PURE__*/function () {
          function BaseSVGFactory() {
            _classCallCheck(this, BaseSVGFactory);

            if (this.constructor === BaseSVGFactory) {
              (0, _util.unreachable)("Cannot initialize BaseSVGFactory.");
            }
          }

          _createClass(BaseSVGFactory, [{
            key: "create",
            value: function create(width, height) {
              if (width <= 0 || height <= 0) {
                throw new Error("Invalid SVG dimensions");
              }

              var svg = this._createSVG("svg:svg");

              svg.setAttribute("version", "1.1");
              svg.setAttribute("width", "".concat(width, "px"));
              svg.setAttribute("height", "".concat(height, "px"));
              svg.setAttribute("preserveAspectRatio", "none");
              svg.setAttribute("viewBox", "0 0 ".concat(width, " ").concat(height));
              return svg;
            }
          }, {
            key: "createElement",
            value: function createElement(type) {
              if (typeof type !== "string") {
                throw new Error("Invalid SVG element type");
              }

              return this._createSVG(type);
            }
          }, {
            key: "_createSVG",
            value: function _createSVG(type) {
              (0, _util.unreachable)("Abstract method `_createSVG` called.");
            }
          }]);

          return BaseSVGFactory;
        }();

        exports.BaseSVGFactory = BaseSVGFactory;
        /***/
      },
      /* 119 */

      /***/
      function (__unused_webpack_module, exports, __w_pdfjs_require__) {
        "use strict";

        Object.defineProperty(exports, "__esModule", {
          value: true
        });
        exports.getDocument = getDocument;
        exports.setPDFNetworkStreamFactory = setPDFNetworkStreamFactory;
        exports.version = exports.RenderTask = exports.PDFWorker = exports.PDFPageProxy = exports.PDFDocumentProxy = exports.PDFDocumentLoadingTask = exports.PDFDataRangeTransport = exports.LoopbackPort = exports.DefaultStandardFontDataFactory = exports.DefaultCMapReaderFactory = exports.DefaultCanvasFactory = exports.build = void 0;

        var _regenerator = _interopRequireDefault(__w_pdfjs_require__(2));

        var _util = __w_pdfjs_require__(4);

        var _display_utils = __w_pdfjs_require__(1);

        var _font_loader = __w_pdfjs_require__(120);

        var _node_utils = __w_pdfjs_require__(121);

        var _annotation_storage = __w_pdfjs_require__(122);

        var _canvas = __w_pdfjs_require__(123);

        var _worker_options = __w_pdfjs_require__(125);

        var _is_node = __w_pdfjs_require__(6);

        var _message_handler = __w_pdfjs_require__(126);

        var _metadata = __w_pdfjs_require__(127);

        var _optional_content_config = __w_pdfjs_require__(128);

        var _transport_stream = __w_pdfjs_require__(129);

        var _xfa_text = __w_pdfjs_require__(130);

        function _interopRequireDefault(obj) {
          return obj && obj.__esModule ? obj : {
            "default": obj
          };
        }

        function _toConsumableArray(arr) {
          return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
        }

        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.");
        }

        function _iterableToArray(iter) {
          if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
        }

        function _arrayWithoutHoles(arr) {
          if (Array.isArray(arr)) return _arrayLikeToArray(arr);
        }

        function _createForOfIteratorHelper(o, allowArrayLike) {
          var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];

          if (!it) {
            if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
              if (it) o = it;
              var i = 0;

              var F = function F() {};

              return {
                s: F,
                n: function n() {
                  if (i >= o.length) return {
                    done: true
                  };
                  return {
                    done: false,
                    value: o[i++]
                  };
                },
                e: function e(_e2) {
                  throw _e2;
                },
                f: F
              };
            }

            throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
          }

          var normalCompletion = true,
              didErr = false,
              err;
          return {
            s: function s() {
              it = it.call(o);
            },
            n: function n() {
              var step = it.next();
              normalCompletion = step.done;
              return step;
            },
            e: function e(_e3) {
              didErr = true;
              err = _e3;
            },
            f: function f() {
              try {
                if (!normalCompletion && it["return"] != null) it["return"]();
              } finally {
                if (didErr) throw err;
              }
            }
          };
        }

        function _classCallCheck(instance, Constructor) {
          if (!(instance instanceof Constructor)) {
            throw new TypeError("Cannot call a class as a function");
          }
        }

        function _defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];
            descriptor.enumerable = descriptor.enumerable || false;
            descriptor.configurable = true;
            if ("value" in descriptor) descriptor.writable = true;
            Object.defineProperty(target, descriptor.key, descriptor);
          }
        }

        function _createClass(Constructor, protoProps, staticProps) {
          if (protoProps) _defineProperties(Constructor.prototype, protoProps);
          if (staticProps) _defineProperties(Constructor, staticProps);
          return Constructor;
        }

        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 self = this,
                args = arguments;
            return new Promise(function (resolve, reject) {
              var gen = fn.apply(self, args);

              function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
              }

              function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
              }

              _next(undefined);
            });
          };
        }

        function _slicedToArray(arr, i) {
          return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
        }

        function _nonIterableRest() {
          throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
        }

        function _unsupportedIterableToArray(o, minLen) {
          if (!o) return;
          if (typeof o === "string") return _arrayLikeToArray(o, minLen);
          var n = Object.prototype.toString.call(o).slice(8, -1);
          if (n === "Object" && o.constructor) n = o.constructor.name;
          if (n === "Map" || n === "Set") return Array.from(o);
          if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
        }

        function _arrayLikeToArray(arr, len) {
          if (len == null || len > arr.length) len = arr.length;

          for (var i = 0, arr2 = new Array(len); i < len; i++) {
            arr2[i] = arr[i];
          }

          return arr2;
        }

        function _iterableToArrayLimit(arr, i) {
          var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];

          if (_i == null) return;
          var _arr = [];
          var _n = true;
          var _d = false;

          var _s, _e;

          try {
            for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
              _arr.push(_s.value);

              if (i && _arr.length === i) break;
            }
          } catch (err) {
            _d = true;
            _e = err;
          } finally {
            try {
              if (!_n && _i["return"] != null) _i["return"]();
            } finally {
              if (_d) throw _e;
            }
          }

          return _arr;
        }

        function _arrayWithHoles(arr) {
          if (Array.isArray(arr)) return arr;
        }

        function _typeof(obj) {
          "@babel/helpers - typeof";

          if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
            _typeof = function _typeof(obj) {
              return typeof obj;
            };
          } else {
            _typeof = function _typeof(obj) {
              return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
            };
          }

          return _typeof(obj);
        }

        var DEFAULT_RANGE_CHUNK_SIZE = 65536;
        var RENDERING_CANCELLED_TIMEOUT = 100;
        var DefaultCanvasFactory = _is_node.isNodeJS ? _node_utils.NodeCanvasFactory : _display_utils.DOMCanvasFactory;
        exports.DefaultCanvasFactory = DefaultCanvasFactory;
        var DefaultCMapReaderFactory = _is_node.isNodeJS ? _node_utils.NodeCMapReaderFactory : _display_utils.DOMCMapReaderFactory;
        exports.DefaultCMapReaderFactory = DefaultCMapReaderFactory;
        var DefaultStandardFontDataFactory = _is_node.isNodeJS ? _node_utils.NodeStandardFontDataFactory : _display_utils.DOMStandardFontDataFactory;
        exports.DefaultStandardFontDataFactory = DefaultStandardFontDataFactory;
        var createPDFNetworkStream;

        function setPDFNetworkStreamFactory(pdfNetworkStreamFactory) {
          createPDFNetworkStream = pdfNetworkStreamFactory;
        }

        function getDocument(src) {
          var task = new PDFDocumentLoadingTask();
          var source;

          if (typeof src === "string" || src instanceof URL) {
            source = {
              url: src
            };
          } else if ((0, _util.isArrayBuffer)(src)) {
            source = {
              data: src
            };
          } else if (src instanceof PDFDataRangeTransport) {
            source = {
              range: src
            };
          } else {
            if (_typeof(src) !== "object") {
              throw new Error("Invalid parameter in getDocument, " + "need either string, URL, Uint8Array, or parameter object.");
            }

            if (!src.url && !src.data && !src.range) {
              throw new Error("Invalid parameter object: need either .data, .range or .url");
            }

            source = src;
          }

          var params = Object.create(null);
          var rangeTransport = null,
              worker = null;

          for (var key in source) {
            var value = source[key];

            switch (key) {
              case "url":
                if (typeof window !== "undefined") {
                  try {
                    params[key] = new URL(value, window.location).href;
                    continue;
                  } catch (ex) {
                    (0, _util.warn)("Cannot create valid URL: \"".concat(ex, "\"."));
                  }
                } else if (typeof value === "string" || value instanceof URL) {
                  params[key] = value.toString();
                  continue;
                }

                throw new Error("Invalid PDF url data: " + "either string or URL-object is expected in the url property.");

              case "range":
                rangeTransport = value;
                continue;

              case "worker":
                worker = value;
                continue;

              case "data":
                if (_is_node.isNodeJS && typeof Buffer !== "undefined" && value instanceof Buffer) {
                  params[key] = new Uint8Array(value);
                } else if (value instanceof Uint8Array) {
                  break;
                } else if (typeof value === "string") {
                  params[key] = (0, _util.stringToBytes)(value);
                } else if (_typeof(value) === "object" && value !== null && !isNaN(value.length)) {
                  params[key] = new Uint8Array(value);
                } else if ((0, _util.isArrayBuffer)(value)) {
                  params[key] = new Uint8Array(value);
                } else {
                  throw new Error("Invalid PDF binary data: either typed array, " + "string, or array-like object is expected in the data property.");
                }

                continue;
            }

            params[key] = value;
          }

          params.rangeChunkSize = params.rangeChunkSize || DEFAULT_RANGE_CHUNK_SIZE;
          params.CMapReaderFactory = params.CMapReaderFactory || DefaultCMapReaderFactory;
          params.StandardFontDataFactory = params.StandardFontDataFactory || DefaultStandardFontDataFactory;
          params.ignoreErrors = params.stopAtErrors !== true;
          params.fontExtraProperties = params.fontExtraProperties === true;
          params.pdfBug = params.pdfBug === true;
          params.enableXfa = params.enableXfa === true;

          if (typeof params.docBaseUrl !== "string" || (0, _display_utils.isDataScheme)(params.docBaseUrl)) {
            params.docBaseUrl = null;
          }

          if (!Number.isInteger(params.maxImageSize)) {
            params.maxImageSize = -1;
          }

          if (typeof params.useWorkerFetch !== "boolean") {
            params.useWorkerFetch = params.CMapReaderFactory === _display_utils.DOMCMapReaderFactory && params.StandardFontDataFactory === _display_utils.DOMStandardFontDataFactory;
          }

          if (typeof params.isEvalSupported !== "boolean") {
            params.isEvalSupported = true;
          }

          if (typeof params.disableFontFace !== "boolean") {
            params.disableFontFace = _is_node.isNodeJS;
          }

          if (typeof params.useSystemFonts !== "boolean") {
            params.useSystemFonts = !_is_node.isNodeJS && !params.disableFontFace;
          }

          if (typeof params.ownerDocument === "undefined") {
            params.ownerDocument = globalThis.document;
          }

          if (typeof params.disableRange !== "boolean") {
            params.disableRange = false;
          }

          if (typeof params.disableStream !== "boolean") {
            params.disableStream = false;
          }

          if (typeof params.disableAutoFetch !== "boolean") {
            params.disableAutoFetch = false;
          }

          (0, _util.setVerbosityLevel)(params.verbosity);

          if (!worker) {
            var workerParams = {
              verbosity: params.verbosity,
              port: _worker_options.GlobalWorkerOptions.workerPort
            };
            worker = workerParams.port ? PDFWorker.fromPort(workerParams) : new PDFWorker(workerParams);
            task._worker = worker;
          }

          var docId = task.docId;
          worker.promise.then(function () {
            if (task.destroyed) {
              throw new Error("Loading aborted");
            }

            var workerIdPromise = _fetchDocument(worker, params, rangeTransport, docId);

            var networkStreamPromise = new Promise(function (resolve) {
              var networkStream;

              if (rangeTransport) {
                networkStream = new _transport_stream.PDFDataTransportStream({
                  length: params.length,
                  initialData: params.initialData,
                  progressiveDone: params.progressiveDone,
                  contentDispositionFilename: params.contentDispositionFilename,
                  disableRange: params.disableRange,
                  disableStream: params.disableStream
                }, rangeTransport);
              } else if (!params.data) {
                networkStream = createPDFNetworkStream({
                  url: params.url,
                  length: params.length,
                  httpHeaders: params.httpHeaders,
                  withCredentials: params.withCredentials,
                  rangeChunkSize: params.rangeChunkSize,
                  disableRange: params.disableRange,
                  disableStream: params.disableStream
                });
              }

              resolve(networkStream);
            });
            return Promise.all([workerIdPromise, networkStreamPromise]).then(function (_ref) {
              var _ref2 = _slicedToArray(_ref, 2),
                  workerId = _ref2[0],
                  networkStream = _ref2[1];

              if (task.destroyed) {
                throw new Error("Loading aborted");
              }

              var messageHandler = new _message_handler.MessageHandler(docId, workerId, worker.port);
              messageHandler.postMessageTransfers = worker.postMessageTransfers;
              var transport = new WorkerTransport(messageHandler, task, networkStream, params);
              task._transport = transport;
              messageHandler.send("Ready", null);
            });
          })["catch"](task._capability.reject);
          return task;
        }

        function _fetchDocument(_x, _x2, _x3, _x4) {
          return _fetchDocument2.apply(this, arguments);
        }

        function _fetchDocument2() {
          _fetchDocument2 = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee6(worker, source, pdfDataRangeTransport, docId) {
            var workerId;
            return _regenerator["default"].wrap(function _callee6$(_context6) {
              while (1) {
                switch (_context6.prev = _context6.next) {
                  case 0:
                    if (!worker.destroyed) {
                      _context6.next = 2;
                      break;
                    }

                    throw new Error("Worker was destroyed");

                  case 2:
                    if (pdfDataRangeTransport) {
                      source.length = pdfDataRangeTransport.length;
                      source.initialData = pdfDataRangeTransport.initialData;
                      source.progressiveDone = pdfDataRangeTransport.progressiveDone;
                      source.contentDispositionFilename = pdfDataRangeTransport.contentDispositionFilename;
                    }

                    _context6.next = 5;
                    return worker.messageHandler.sendWithPromise("GetDocRequest", {
                      docId: docId,
                      apiVersion: '2.11.338',
                      source: {
                        data: source.data,
                        url: source.url,
                        password: source.password,
                        disableAutoFetch: source.disableAutoFetch,
                        rangeChunkSize: source.rangeChunkSize,
                        length: source.length
                      },
                      maxImageSize: source.maxImageSize,
                      disableFontFace: source.disableFontFace,
                      postMessageTransfers: worker.postMessageTransfers,
                      docBaseUrl: source.docBaseUrl,
                      ignoreErrors: source.ignoreErrors,
                      isEvalSupported: source.isEvalSupported,
                      fontExtraProperties: source.fontExtraProperties,
                      enableXfa: source.enableXfa,
                      useSystemFonts: source.useSystemFonts,
                      cMapUrl: source.useWorkerFetch ? source.cMapUrl : null,
                      standardFontDataUrl: source.useWorkerFetch ? source.standardFontDataUrl : null
                    });

                  case 5:
                    workerId = _context6.sent;

                    if (!worker.destroyed) {
                      _context6.next = 8;
                      break;
                    }

                    throw new Error("Worker was destroyed");

                  case 8:
                    return _context6.abrupt("return", workerId);

                  case 9:
                  case "end":
                    return _context6.stop();
                }
              }
            }, _callee6);
          }));
          return _fetchDocument2.apply(this, arguments);
        }

        var PDFDocumentLoadingTask = /*#__PURE__*/function () {
          function PDFDocumentLoadingTask() {
            _classCallCheck(this, PDFDocumentLoadingTask);

            this._capability = (0, _util.createPromiseCapability)();
            this._transport = null;
            this._worker = null;
            this.docId = "d".concat(PDFDocumentLoadingTask.idCounters.doc++);
            this.destroyed = false;
            this.onPassword = null;
            this.onProgress = null;
            this.onUnsupportedFeature = null;
          }

          _createClass(PDFDocumentLoadingTask, [{
            key: "promise",
            get: function get() {
              return this._capability.promise;
            }
          }, {
            key: "destroy",
            value: function () {
              var _destroy = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
                var _this$_transport;

                return _regenerator["default"].wrap(function _callee$(_context) {
                  while (1) {
                    switch (_context.prev = _context.next) {
                      case 0:
                        this.destroyed = true;
                        _context.next = 3;
                        return (_this$_transport = this._transport) === null || _this$_transport === void 0 ? void 0 : _this$_transport.destroy();

                      case 3:
                        this._transport = null;

                        if (this._worker) {
                          this._worker.destroy();

                          this._worker = null;
                        }

                      case 5:
                      case "end":
                        return _context.stop();
                    }
                  }
                }, _callee, this);
              }));

              function destroy() {
                return _destroy.apply(this, arguments);
              }

              return destroy;
            }()
          }], [{
            key: "idCounters",
            get: function get() {
              return (0, _util.shadow)(this, "idCounters", {
                doc: 0
              });
            }
          }]);

          return PDFDocumentLoadingTask;
        }();

        exports.PDFDocumentLoadingTask = PDFDocumentLoadingTask;

        var PDFDataRangeTransport = /*#__PURE__*/function () {
          function PDFDataRangeTransport(length, initialData) {
            var progressiveDone = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
            var contentDispositionFilename = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;

            _classCallCheck(this, PDFDataRangeTransport);

            this.length = length;
            this.initialData = initialData;
            this.progressiveDone = progressiveDone;
            this.contentDispositionFilename = contentDispositionFilename;
            this._rangeListeners = [];
            this._progressListeners = [];
            this._progressiveReadListeners = [];
            this._progressiveDoneListeners = [];
            this._readyCapability = (0, _util.createPromiseCapability)();
          }

          _createClass(PDFDataRangeTransport, [{
            key: "addRangeListener",
            value: function addRangeListener(listener) {
              this._rangeListeners.push(listener);
            }
          }, {
            key: "addProgressListener",
            value: function addProgressListener(listener) {
              this._progressListeners.push(listener);
            }
          }, {
            key: "addProgressiveReadListener",
            value: function addProgressiveReadListener(listener) {
              this._progressiveReadListeners.push(listener);
            }
          }, {
            key: "addProgressiveDoneListener",
            value: function addProgressiveDoneListener(listener) {
              this._progressiveDoneListeners.push(listener);
            }
          }, {
            key: "onDataRange",
            value: function onDataRange(begin, chunk) {
              var _iterator = _createForOfIteratorHelper(this._rangeListeners),
                  _step;

              try {
                for (_iterator.s(); !(_step = _iterator.n()).done;) {
                  var listener = _step.value;
                  listener(begin, chunk);
                }
              } catch (err) {
                _iterator.e(err);
              } finally {
                _iterator.f();
              }
            }
          }, {
            key: "onDataProgress",
            value: function onDataProgress(loaded, total) {
              var _this = this;

              this._readyCapability.promise.then(function () {
                var _iterator2 = _createForOfIteratorHelper(_this._progressListeners),
                    _step2;

                try {
                  for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
                    var listener = _step2.value;
                    listener(loaded, total);
                  }
                } catch (err) {
                  _iterator2.e(err);
                } finally {
                  _iterator2.f();
                }
              });
            }
          }, {
            key: "onDataProgressiveRead",
            value: function onDataProgressiveRead(chunk) {
              var _this2 = this;

              this._readyCapability.promise.then(function () {
                var _iterator3 = _createForOfIteratorHelper(_this2._progressiveReadListeners),
                    _step3;

                try {
                  for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
                    var listener = _step3.value;
                    listener(chunk);
                  }
                } catch (err) {
                  _iterator3.e(err);
                } finally {
                  _iterator3.f();
                }
              });
            }
          }, {
            key: "onDataProgressiveDone",
            value: function onDataProgressiveDone() {
              var _this3 = this;

              this._readyCapability.promise.then(function () {
                var _iterator4 = _createForOfIteratorHelper(_this3._progressiveDoneListeners),
                    _step4;

                try {
                  for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
                    var listener = _step4.value;
                    listener();
                  }
                } catch (err) {
                  _iterator4.e(err);
                } finally {
                  _iterator4.f();
                }
              });
            }
          }, {
            key: "transportReady",
            value: function transportReady() {
              this._readyCapability.resolve();
            }
          }, {
            key: "requestDataRange",
            value: function requestDataRange(begin, end) {
              (0, _util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange");
            }
          }, {
            key: "abort",
            value: function abort() {}
          }]);

          return PDFDataRangeTransport;
        }();

        exports.PDFDataRangeTransport = PDFDataRangeTransport;

        var PDFDocumentProxy = /*#__PURE__*/function () {
          function PDFDocumentProxy(pdfInfo, transport) {
            _classCallCheck(this, PDFDocumentProxy);

            this._pdfInfo = pdfInfo;
            this._transport = transport;
            Object.defineProperty(this, "fingerprint", {
              get: function get() {
                (0, _display_utils.deprecated)("`PDFDocumentProxy.fingerprint`, " + "please use `PDFDocumentProxy.fingerprints` instead.");
                return this.fingerprints[0];
              }
            });
          }

          _createClass(PDFDocumentProxy, [{
            key: "annotationStorage",
            get: function get() {
              return this._transport.annotationStorage;
            }
          }, {
            key: "numPages",
            get: function get() {
              return this._pdfInfo.numPages;
            }
          }, {
            key: "fingerprints",
            get: function get() {
              return this._pdfInfo.fingerprints;
            }
          }, {
            key: "isPureXfa",
            get: function get() {
              return !!this._transport._htmlForXfa;
            }
          }, {
            key: "allXfaHtml",
            get: function get() {
              return this._transport._htmlForXfa;
            }
          }, {
            key: "getPage",
            value: function getPage(pageNumber) {
              return this._transport.getPage(pageNumber);
            }
          }, {
            key: "getPageIndex",
            value: function getPageIndex(ref) {
              return this._transport.getPageIndex(ref);
            }
          }, {
            key: "getDestinations",
            value: function getDestinations() {
              return this._transport.getDestinations();
            }
          }, {
            key: "getDestination",
            value: function getDestination(id) {
              return this._transport.getDestination(id);
            }
          }, {
            key: "getPageLabels",
            value: function getPageLabels() {
              return this._transport.getPageLabels();
            }
          }, {
            key: "getPageLayout",
            value: function getPageLayout() {
              return this._transport.getPageLayout();
            }
          }, {
            key: "getPageMode",
            value: function getPageMode() {
              return this._transport.getPageMode();
            }
          }, {
            key: "getViewerPreferences",
            value: function getViewerPreferences() {
              return this._transport.getViewerPreferences();
            }
          }, {
            key: "getOpenAction",
            value: function getOpenAction() {
              return this._transport.getOpenAction();
            }
          }, {
            key: "getAttachments",
            value: function getAttachments() {
              return this._transport.getAttachments();
            }
          }, {
            key: "getJavaScript",
            value: function getJavaScript() {
              return this._transport.getJavaScript();
            }
          }, {
            key: "getJSActions",
            value: function getJSActions() {
              return this._transport.getDocJSActions();
            }
          }, {
            key: "getOutline",
            value: function getOutline() {
              return this._transport.getOutline();
            }
          }, {
            key: "getOptionalContentConfig",
            value: function getOptionalContentConfig() {
              return this._transport.getOptionalContentConfig();
            }
          }, {
            key: "getPermissions",
            value: function getPermissions() {
              return this._transport.getPermissions();
            }
          }, {
            key: "getMetadata",
            value: function getMetadata() {
              return this._transport.getMetadata();
            }
          }, {
            key: "getMarkInfo",
            value: function getMarkInfo() {
              return this._transport.getMarkInfo();
            }
          }, {
            key: "getData",
            value: function getData() {
              return this._transport.getData();
            }
          }, {
            key: "getDownloadInfo",
            value: function getDownloadInfo() {
              return this._transport.downloadInfoCapability.promise;
            }
          }, {
            key: "getStats",
            value: function getStats() {
              return this._transport.getStats();
            }
          }, {
            key: "cleanup",
            value: function cleanup() {
              var keepLoadedFonts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
              return this._transport.startCleanup(keepLoadedFonts || this.isPureXfa);
            }
          }, {
            key: "destroy",
            value: function destroy() {
              return this.loadingTask.destroy();
            }
          }, {
            key: "loadingParams",
            get: function get() {
              return this._transport.loadingParams;
            }
          }, {
            key: "loadingTask",
            get: function get() {
              return this._transport.loadingTask;
            }
          }, {
            key: "saveDocument",
            value: function saveDocument() {
              if (this._transport.annotationStorage.size <= 0) {
                (0, _display_utils.deprecated)("saveDocument called while `annotationStorage` is empty, " + "please use the getData-method instead.");
              }

              return this._transport.saveDocument();
            }
          }, {
            key: "getFieldObjects",
            value: function getFieldObjects() {
              return this._transport.getFieldObjects();
            }
          }, {
            key: "hasJSActions",
            value: function hasJSActions() {
              return this._transport.hasJSActions();
            }
          }, {
            key: "getCalculationOrderIds",
            value: function getCalculationOrderIds() {
              return this._transport.getCalculationOrderIds();
            }
          }]);

          return PDFDocumentProxy;
        }();

        exports.PDFDocumentProxy = PDFDocumentProxy;

        var PDFPageProxy = /*#__PURE__*/function () {
          function PDFPageProxy(pageIndex, pageInfo, transport, ownerDocument) {
            var pdfBug = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;

            _classCallCheck(this, PDFPageProxy);

            this._pageIndex = pageIndex;
            this._pageInfo = pageInfo;
            this._ownerDocument = ownerDocument;
            this._transport = transport;
            this._stats = pdfBug ? new _display_utils.StatTimer() : null;
            this._pdfBug = pdfBug;
            this.commonObjs = transport.commonObjs;
            this.objs = new PDFObjects();
            this.cleanupAfterRender = false;
            this.pendingCleanup = false;
            this._intentStates = new Map();
            this._annotationPromises = new Map();
            this.destroyed = false;
          }

          _createClass(PDFPageProxy, [{
            key: "pageNumber",
            get: function get() {
              return this._pageIndex + 1;
            }
          }, {
            key: "rotate",
            get: function get() {
              return this._pageInfo.rotate;
            }
          }, {
            key: "ref",
            get: function get() {
              return this._pageInfo.ref;
            }
          }, {
            key: "userUnit",
            get: function get() {
              return this._pageInfo.userUnit;
            }
          }, {
            key: "view",
            get: function get() {
              return this._pageInfo.view;
            }
          }, {
            key: "getViewport",
            value: function getViewport() {
              var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
                  scale = _ref3.scale,
                  _ref3$rotation = _ref3.rotation,
                  rotation = _ref3$rotation === void 0 ? this.rotate : _ref3$rotation,
                  _ref3$offsetX = _ref3.offsetX,
                  offsetX = _ref3$offsetX === void 0 ? 0 : _ref3$offsetX,
                  _ref3$offsetY = _ref3.offsetY,
                  offsetY = _ref3$offsetY === void 0 ? 0 : _ref3$offsetY,
                  _ref3$dontFlip = _ref3.dontFlip,
                  dontFlip = _ref3$dontFlip === void 0 ? false : _ref3$dontFlip;

              return new _display_utils.PageViewport({
                viewBox: this.view,
                scale: scale,
                rotation: rotation,
                offsetX: offsetX,
                offsetY: offsetY,
                dontFlip: dontFlip
              });
            }
          }, {
            key: "getAnnotations",
            value: function getAnnotations() {
              var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
                  _ref4$intent = _ref4.intent,
                  intent = _ref4$intent === void 0 ? "display" : _ref4$intent;

              var intentArgs = this._transport.getRenderingIntent(intent);

              var promise = this._annotationPromises.get(intentArgs.cacheKey);

              if (!promise) {
                promise = this._transport.getAnnotations(this._pageIndex, intentArgs.renderingIntent);

                this._annotationPromises.set(intentArgs.cacheKey, promise);

                promise = promise.then(function (annotations) {
                  var _iterator5 = _createForOfIteratorHelper(annotations),
                      _step5;

                  try {
                    var _loop = function _loop() {
                      var annotation = _step5.value;

                      if (annotation.titleObj !== undefined) {
                        Object.defineProperty(annotation, "title", {
                          get: function get() {
                            (0, _display_utils.deprecated)("`title`-property on annotation, please use `titleObj` instead.");
                            return annotation.titleObj.str;
                          }
                        });
                      }

                      if (annotation.contentsObj !== undefined) {
                        Object.defineProperty(annotation, "contents", {
                          get: function get() {
                            (0, _display_utils.deprecated)("`contents`-property on annotation, please use `contentsObj` instead.");
                            return annotation.contentsObj.str;
                          }
                        });
                      }
                    };

                    for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
                      _loop();
                    }
                  } catch (err) {
                    _iterator5.e(err);
                  } finally {
                    _iterator5.f();
                  }

                  return annotations;
                });
              }

              return promise;
            }
          }, {
            key: "getJSActions",
            value: function getJSActions() {
              return this._jsActionsPromise || (this._jsActionsPromise = this._transport.getPageJSActions(this._pageIndex));
            }
          }, {
            key: "getXfa",
            value: function () {
              var _getXfa = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
                var _this$_transport$_htm;

                return _regenerator["default"].wrap(function _callee2$(_context2) {
                  while (1) {
                    switch (_context2.prev = _context2.next) {
                      case 0:
                        return _context2.abrupt("return", ((_this$_transport$_htm = this._transport._htmlForXfa) === null || _this$_transport$_htm === void 0 ? void 0 : _this$_transport$_htm.children[this._pageIndex]) || null);

                      case 1:
                      case "end":
                        return _context2.stop();
                    }
                  }
                }, _callee2, this);
              }));

              function getXfa() {
                return _getXfa.apply(this, arguments);
              }

              return getXfa;
            }()
          }, {
            key: "render",
            value: function render(_ref5) {
              var _arguments$,
                  _arguments$2,
                  _this4 = this,
                  _intentState;

              var canvasContext = _ref5.canvasContext,
                  viewport = _ref5.viewport,
                  _ref5$intent = _ref5.intent,
                  intent = _ref5$intent === void 0 ? "display" : _ref5$intent,
                  _ref5$annotationMode = _ref5.annotationMode,
                  annotationMode = _ref5$annotationMode === void 0 ? _util.AnnotationMode.ENABLE : _ref5$annotationMode,
                  _ref5$transform = _ref5.transform,
                  transform = _ref5$transform === void 0 ? null : _ref5$transform,
                  _ref5$imageLayer = _ref5.imageLayer,
                  imageLayer = _ref5$imageLayer === void 0 ? null : _ref5$imageLayer,
                  _ref5$canvasFactory = _ref5.canvasFactory,
                  canvasFactory = _ref5$canvasFactory === void 0 ? null : _ref5$canvasFactory,
                  _ref5$background = _ref5.background,
                  background = _ref5$background === void 0 ? null : _ref5$background,
                  _ref5$optionalContent = _ref5.optionalContentConfigPromise,
                  optionalContentConfigPromise = _ref5$optionalContent === void 0 ? null : _ref5$optionalContent;

              if (((_arguments$ = arguments[0]) === null || _arguments$ === void 0 ? void 0 : _arguments$.renderInteractiveForms) !== undefined) {
                (0, _display_utils.deprecated)("render no longer accepts the `renderInteractiveForms`-option, " + "please use the `annotationMode`-option instead.");

                if (arguments[0].renderInteractiveForms === true && annotationMode === _util.AnnotationMode.ENABLE) {
                  annotationMode = _util.AnnotationMode.ENABLE_FORMS;
                }
              }

              if (((_arguments$2 = arguments[0]) === null || _arguments$2 === void 0 ? void 0 : _arguments$2.includeAnnotationStorage) !== undefined) {
                (0, _display_utils.deprecated)("render no longer accepts the `includeAnnotationStorage`-option, " + "please use the `annotationMode`-option instead.");

                if (arguments[0].includeAnnotationStorage === true && annotationMode === _util.AnnotationMode.ENABLE) {
                  annotationMode = _util.AnnotationMode.ENABLE_STORAGE;
                }
              }

              if (this._stats) {
                this._stats.time("Overall");
              }

              var intentArgs = this._transport.getRenderingIntent(intent, annotationMode);

              this.pendingCleanup = false;

              if (!optionalContentConfigPromise) {
                optionalContentConfigPromise = this._transport.getOptionalContentConfig();
              }

              var intentState = this._intentStates.get(intentArgs.cacheKey);

              if (!intentState) {
                intentState = Object.create(null);

                this._intentStates.set(intentArgs.cacheKey, intentState);
              }

              if (intentState.streamReaderCancelTimeout) {
                clearTimeout(intentState.streamReaderCancelTimeout);
                intentState.streamReaderCancelTimeout = null;
              }

              var canvasFactoryInstance = canvasFactory || new DefaultCanvasFactory({
                ownerDocument: this._ownerDocument
              });
              var intentPrint = !!(intentArgs.renderingIntent & _util.RenderingIntentFlag.PRINT);

              if (!intentState.displayReadyCapability) {
                intentState.displayReadyCapability = (0, _util.createPromiseCapability)();
                intentState.operatorList = {
                  fnArray: [],
                  argsArray: [],
                  lastChunk: false
                };

                if (this._stats) {
                  this._stats.time("Page Request");
                }

                this._pumpOperatorList(intentArgs);
              }

              var complete = function complete(error) {
                intentState.renderTasks["delete"](internalRenderTask);

                if (_this4.cleanupAfterRender || intentPrint) {
                  _this4.pendingCleanup = true;
                }

                _this4._tryCleanup();

                if (error) {
                  internalRenderTask.capability.reject(error);

                  _this4._abortOperatorList({
                    intentState: intentState,
                    reason: error instanceof Error ? error : new Error(error)
                  });
                } else {
                  internalRenderTask.capability.resolve();
                }

                if (_this4._stats) {
                  _this4._stats.timeEnd("Rendering");

                  _this4._stats.timeEnd("Overall");
                }
              };

              var internalRenderTask = new InternalRenderTask({
                callback: complete,
                params: {
                  canvasContext: canvasContext,
                  viewport: viewport,
                  transform: transform,
                  imageLayer: imageLayer,
                  background: background
                },
                objs: this.objs,
                commonObjs: this.commonObjs,
                operatorList: intentState.operatorList,
                pageIndex: this._pageIndex,
                canvasFactory: canvasFactoryInstance,
                useRequestAnimationFrame: !intentPrint,
                pdfBug: this._pdfBug
              });
              ((_intentState = intentState).renderTasks || (_intentState.renderTasks = new Set())).add(internalRenderTask);
              var renderTask = internalRenderTask.task;
              Promise.all([intentState.displayReadyCapability.promise, optionalContentConfigPromise]).then(function (_ref6) {
                var _ref7 = _slicedToArray(_ref6, 2),
                    transparency = _ref7[0],
                    optionalContentConfig = _ref7[1];

                if (_this4.pendingCleanup) {
                  complete();
                  return;
                }

                if (_this4._stats) {
                  _this4._stats.time("Rendering");
                }

                internalRenderTask.initializeGraphics({
                  transparency: transparency,
                  optionalContentConfig: optionalContentConfig
                });
                internalRenderTask.operatorListChanged();
              })["catch"](complete);
              return renderTask;
            }
          }, {
            key: "getOperatorList",
            value: function getOperatorList() {
              var _ref8 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
                  _ref8$intent = _ref8.intent,
                  intent = _ref8$intent === void 0 ? "display" : _ref8$intent,
                  _ref8$annotationMode = _ref8.annotationMode,
                  annotationMode = _ref8$annotationMode === void 0 ? _util.AnnotationMode.ENABLE : _ref8$annotationMode;

              function operatorListChanged() {
                if (intentState.operatorList.lastChunk) {
                  intentState.opListReadCapability.resolve(intentState.operatorList);
                  intentState.renderTasks["delete"](opListTask);
                }
              }

              var intentArgs = this._transport.getRenderingIntent(intent, annotationMode, true);

              var intentState = this._intentStates.get(intentArgs.cacheKey);

              if (!intentState) {
                intentState = Object.create(null);

                this._intentStates.set(intentArgs.cacheKey, intentState);
              }

              var opListTask;

              if (!intentState.opListReadCapability) {
                var _intentState2;

                opListTask = Object.create(null);
                opListTask.operatorListChanged = operatorListChanged;
                intentState.opListReadCapability = (0, _util.createPromiseCapability)();
                ((_intentState2 = intentState).renderTasks || (_intentState2.renderTasks = new Set())).add(opListTask);
                intentState.operatorList = {
                  fnArray: [],
                  argsArray: [],
                  lastChunk: false
                };

                if (this._stats) {
                  this._stats.time("Page Request");
                }

                this._pumpOperatorList(intentArgs);
              }

              return intentState.opListReadCapability.promise;
            }
          }, {
            key: "streamTextContent",
            value: function streamTextContent() {
              var _ref9 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
                  _ref9$normalizeWhites = _ref9.normalizeWhitespace,
                  normalizeWhitespace = _ref9$normalizeWhites === void 0 ? false : _ref9$normalizeWhites,
                  _ref9$disableCombineT = _ref9.disableCombineTextItems,
                  disableCombineTextItems = _ref9$disableCombineT === void 0 ? false : _ref9$disableCombineT,
                  _ref9$includeMarkedCo = _ref9.includeMarkedContent,
                  includeMarkedContent = _ref9$includeMarkedCo === void 0 ? false : _ref9$includeMarkedCo;

              var TEXT_CONTENT_CHUNK_SIZE = 100;
              return this._transport.messageHandler.sendWithStream("GetTextContent", {
                pageIndex: this._pageIndex,
                normalizeWhitespace: normalizeWhitespace === true,
                combineTextItems: disableCombineTextItems !== true,
                includeMarkedContent: includeMarkedContent === true
              }, {
                highWaterMark: TEXT_CONTENT_CHUNK_SIZE,
                size: function size(textContent) {
                  return textContent.items.length;
                }
              });
            }
          }, {
            key: "getTextContent",
            value: function getTextContent() {
              var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

              if (this._transport._htmlForXfa) {
                return this.getXfa().then(function (xfa) {
                  return _xfa_text.XfaText.textContent(xfa);
                });
              }

              var readableStream = this.streamTextContent(params);
              return new Promise(function (resolve, reject) {
                function pump() {
                  reader.read().then(function (_ref10) {
                    var _textContent$items;

                    var value = _ref10.value,
                        done = _ref10.done;

                    if (done) {
                      resolve(textContent);
                      return;
                    }

                    Object.assign(textContent.styles, value.styles);

                    (_textContent$items = textContent.items).push.apply(_textContent$items, _toConsumableArray(value.items));

                    pump();
                  }, reject);
                }

                var reader = readableStream.getReader();
                var textContent = {
                  items: [],
                  styles: Object.create(null)
                };
                pump();
              });
            }
          }, {
            key: "getStructTree",
            value: function getStructTree() {
              return this._structTreePromise || (this._structTreePromise = this._transport.getStructTree(this._pageIndex));
            }
          }, {
            key: "_destroy",
            value: function _destroy() {
              this.destroyed = true;
              this._transport.pageCache[this._pageIndex] = null;
              var waitOn = [];

              var _iterator6 = _createForOfIteratorHelper(this._intentStates.values()),
                  _step6;

              try {
                for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
                  var intentState = _step6.value;

                  this._abortOperatorList({
                    intentState: intentState,
                    reason: new Error("Page was destroyed."),
                    force: true
                  });

                  if (intentState.opListReadCapability) {
                    continue;
                  }

                  var _iterator7 = _createForOfIteratorHelper(intentState.renderTasks),
                      _step7;

                  try {
                    for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
                      var internalRenderTask = _step7.value;
                      waitOn.push(internalRenderTask.completed);
                      internalRenderTask.cancel();
                    }
                  } catch (err) {
                    _iterator7.e(err);
                  } finally {
                    _iterator7.f();
                  }
                }
              } catch (err) {
                _iterator6.e(err);
              } finally {
                _iterator6.f();
              }

              this.objs.clear();

              this._annotationPromises.clear();

              this._jsActionsPromise = null;
              this._structTreePromise = null;
              this.pendingCleanup = false;
              return Promise.all(waitOn);
            }
          }, {
            key: "cleanup",
            value: function cleanup() {
              var resetStats = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
              this.pendingCleanup = true;
              return this._tryCleanup(resetStats);
            }
          }, {
            key: "_tryCleanup",
            value: function _tryCleanup() {
              var resetStats = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;

              if (!this.pendingCleanup) {
                return false;
              }

              var _iterator8 = _createForOfIteratorHelper(this._intentStates.values()),
                  _step8;

              try {
                for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
                  var _step8$value = _step8.value,
                      renderTasks = _step8$value.renderTasks,
                      operatorList = _step8$value.operatorList;

                  if (renderTasks.size > 0 || !operatorList.lastChunk) {
                    return false;
                  }
                }
              } catch (err) {
                _iterator8.e(err);
              } finally {
                _iterator8.f();
              }

              this._intentStates.clear();

              this.objs.clear();

              this._annotationPromises.clear();

              this._jsActionsPromise = null;
              this._structTreePromise = null;

              if (resetStats && this._stats) {
                this._stats = new _display_utils.StatTimer();
              }

              this.pendingCleanup = false;
              return true;
            }
          }, {
            key: "_startRenderPage",
            value: function _startRenderPage(transparency, cacheKey) {
              var intentState = this._intentStates.get(cacheKey);

              if (!intentState) {
                return;
              }

              if (this._stats) {
                this._stats.timeEnd("Page Request");
              }

              if (intentState.displayReadyCapability) {
                intentState.displayReadyCapability.resolve(transparency);
              }
            }
          }, {
            key: "_renderPageChunk",
            value: function _renderPageChunk(operatorListChunk, intentState) {
              for (var i = 0, ii = operatorListChunk.length; i < ii; i++) {
                intentState.operatorList.fnArray.push(operatorListChunk.fnArray[i]);
                intentState.operatorList.argsArray.push(operatorListChunk.argsArray[i]);
              }

              intentState.operatorList.lastChunk = operatorListChunk.lastChunk;

              var _iterator9 = _createForOfIteratorHelper(intentState.renderTasks),
                  _step9;

              try {
                for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
                  var internalRenderTask = _step9.value;
                  internalRenderTask.operatorListChanged();
                }
              } catch (err) {
                _iterator9.e(err);
              } finally {
                _iterator9.f();
              }

              if (operatorListChunk.lastChunk) {
                this._tryCleanup();
              }
            }
          }, {
            key: "_pumpOperatorList",
            value: function _pumpOperatorList(_ref11) {
              var _this5 = this;

              var renderingIntent = _ref11.renderingIntent,
                  cacheKey = _ref11.cacheKey;

              var readableStream = this._transport.messageHandler.sendWithStream("GetOperatorList", {
                pageIndex: this._pageIndex,
                intent: renderingIntent,
                cacheKey: cacheKey,
                annotationStorage: renderingIntent & _util.RenderingIntentFlag.ANNOTATIONS_STORAGE ? this._transport.annotationStorage.serializable : null
              });

              var reader = readableStream.getReader();

              var intentState = this._intentStates.get(cacheKey);

              intentState.streamReader = reader;

              var pump = function pump() {
                reader.read().then(function (_ref12) {
                  var value = _ref12.value,
                      done = _ref12.done;

                  if (done) {
                    intentState.streamReader = null;
                    return;
                  }

                  if (_this5._transport.destroyed) {
                    return;
                  }

                  _this5._renderPageChunk(value, intentState);

                  pump();
                }, function (reason) {
                  intentState.streamReader = null;

                  if (_this5._transport.destroyed) {
                    return;
                  }

                  if (intentState.operatorList) {
                    intentState.operatorList.lastChunk = true;

                    var _iterator10 = _createForOfIteratorHelper(intentState.renderTasks),
                        _step10;

                    try {
                      for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
                        var internalRenderTask = _step10.value;
                        internalRenderTask.operatorListChanged();
                      }
                    } catch (err) {
                      _iterator10.e(err);
                    } finally {
                      _iterator10.f();
                    }

                    _this5._tryCleanup();
                  }

                  if (intentState.displayReadyCapability) {
                    intentState.displayReadyCapability.reject(reason);
                  } else if (intentState.opListReadCapability) {
                    intentState.opListReadCapability.reject(reason);
                  } else {
                    throw reason;
                  }
                });
              };

              pump();
            }
          }, {
            key: "_abortOperatorList",
            value: function _abortOperatorList(_ref13) {
              var _this6 = this;

              var intentState = _ref13.intentState,
                  reason = _ref13.reason,
                  _ref13$force = _ref13.force,
                  force = _ref13$force === void 0 ? false : _ref13$force;

              if (!intentState.streamReader) {
                return;
              }

              if (!force) {
                if (intentState.renderTasks.size > 0) {
                  return;
                }

                if (reason instanceof _display_utils.RenderingCancelledException) {
                  intentState.streamReaderCancelTimeout = setTimeout(function () {
                    _this6._abortOperatorList({
                      intentState: intentState,
                      reason: reason,
                      force: true
                    });

                    intentState.streamReaderCancelTimeout = null;
                  }, RENDERING_CANCELLED_TIMEOUT);
                  return;
                }
              }

              intentState.streamReader.cancel(new _util.AbortException(reason.message))["catch"](function () {});
              intentState.streamReader = null;

              if (this._transport.destroyed) {
                return;
              }

              var _iterator11 = _createForOfIteratorHelper(this._intentStates),
                  _step11;

              try {
                for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
                  var _step11$value = _slicedToArray(_step11.value, 2),
                      curCacheKey = _step11$value[0],
                      curIntentState = _step11$value[1];

                  if (curIntentState === intentState) {
                    this._intentStates["delete"](curCacheKey);

                    break;
                  }
                }
              } catch (err) {
                _iterator11.e(err);
              } finally {
                _iterator11.f();
              }

              this.cleanup();
            }
          }, {
            key: "stats",
            get: function get() {
              return this._stats;
            }
          }]);

          return PDFPageProxy;
        }();

        exports.PDFPageProxy = PDFPageProxy;

        var LoopbackPort = /*#__PURE__*/function () {
          function LoopbackPort() {
            _classCallCheck(this, LoopbackPort);

            this._listeners = [];
            this._deferred = Promise.resolve(undefined);
          }

          _createClass(LoopbackPort, [{
            key: "postMessage",
            value: function postMessage(obj, transfers) {
              var _this7 = this;

              function cloneValue(value) {
                if (typeof value === "function" || _typeof(value) === "symbol" || value instanceof URL) {
                  throw new Error("LoopbackPort.postMessage - cannot clone: ".concat(value === null || value === void 0 ? void 0 : value.toString()));
                }

                if (_typeof(value) !== "object" || value === null) {
                  return value;
                }

                if (cloned.has(value)) {
                  return cloned.get(value);
                }

                var buffer, result;

                if ((buffer = value.buffer) && (0, _util.isArrayBuffer)(buffer)) {
                  if (transfers !== null && transfers !== void 0 && transfers.includes(buffer)) {
                    result = new value.constructor(buffer, value.byteOffset, value.byteLength);
                  } else {
                    result = new value.constructor(value);
                  }

                  cloned.set(value, result);
                  return result;
                }

                if (value instanceof Map) {
                  result = new Map();
                  cloned.set(value, result);

                  var _iterator12 = _createForOfIteratorHelper(value),
                      _step12;

                  try {
                    for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
                      var _step12$value = _slicedToArray(_step12.value, 2),
                          key = _step12$value[0],
                          val = _step12$value[1];

                      result.set(key, cloneValue(val));
                    }
                  } catch (err) {
                    _iterator12.e(err);
                  } finally {
                    _iterator12.f();
                  }

                  return result;
                }

                if (value instanceof Set) {
                  result = new Set();
                  cloned.set(value, result);

                  var _iterator13 = _createForOfIteratorHelper(value),
                      _step13;

                  try {
                    for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
                      var _val = _step13.value;
                      result.add(cloneValue(_val));
                    }
                  } catch (err) {
                    _iterator13.e(err);
                  } finally {
                    _iterator13.f();
                  }

                  return result;
                }

                result = Array.isArray(value) ? [] : Object.create(null);
                cloned.set(value, result);

                for (var i in value) {
                  var _value$hasOwnProperty;

                  var desc = void 0,
                      p = value;

                  while (!(desc = Object.getOwnPropertyDescriptor(p, i))) {
                    p = Object.getPrototypeOf(p);
                  }

                  if (typeof desc.value === "undefined") {
                    continue;
                  }

                  if (typeof desc.value === "function" && !((_value$hasOwnProperty = value.hasOwnProperty) !== null && _value$hasOwnProperty !== void 0 && _value$hasOwnProperty.call(value, i))) {
                    continue;
                  }

                  result[i] = cloneValue(desc.value);
                }

                return result;
              }

              var cloned = new WeakMap();
              var event = {
                data: cloneValue(obj)
              };

              this._deferred.then(function () {
                var _iterator14 = _createForOfIteratorHelper(_this7._listeners),
                    _step14;

                try {
                  for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) {
                    var listener = _step14.value;
                    listener.call(_this7, event);
                  }
                } catch (err) {
                  _iterator14.e(err);
                } finally {
                  _iterator14.f();
                }
              });
            }
          }, {
            key: "addEventListener",
            value: function addEventListener(name, listener) {
              this._listeners.push(listener);
            }
          }, {
            key: "removeEventListener",
            value: function removeEventListener(name, listener) {
              var i = this._listeners.indexOf(listener);

              this._listeners.splice(i, 1);
            }
          }, {
            key: "terminate",
            value: function terminate() {
              this._listeners.length = 0;
            }
          }]);

          return LoopbackPort;
        }();

        exports.LoopbackPort = LoopbackPort;
        var PDFWorkerUtil = {
          isWorkerDisabled: false,
          fallbackWorkerSrc: null,
          fakeWorkerId: 0
        };
        {
          if (_is_node.isNodeJS && "function" === "function") {
            PDFWorkerUtil.isWorkerDisabled = true;
            PDFWorkerUtil.fallbackWorkerSrc = "./pdf.worker.js";
          } else if ((typeof document === "undefined" ? "undefined" : _typeof(document)) === "object") {
            var _document, _document$currentScri;

            var pdfjsFilePath = (_document = document) === null || _document === void 0 ? void 0 : (_document$currentScri = _document.currentScript) === null || _document$currentScri === void 0 ? void 0 : _document$currentScri.src;

            if (pdfjsFilePath) {
              PDFWorkerUtil.fallbackWorkerSrc = pdfjsFilePath.replace(/(\.(?:min\.)?js)(\?.*)?$/i, ".worker$1$2");
            }
          }

          PDFWorkerUtil.createCDNWrapper = function (url) {
            var wrapper = "importScripts(\"".concat(url, "\");");
            return URL.createObjectURL(new Blob([wrapper]));
          };
        }

        var PDFWorker = /*#__PURE__*/function () {
          function PDFWorker() {
            var _ref14 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
                _ref14$name = _ref14.name,
                name = _ref14$name === void 0 ? null : _ref14$name,
                _ref14$port = _ref14.port,
                port = _ref14$port === void 0 ? null : _ref14$port,
                _ref14$verbosity = _ref14.verbosity,
                verbosity = _ref14$verbosity === void 0 ? (0, _util.getVerbosityLevel)() : _ref14$verbosity;

            _classCallCheck(this, PDFWorker);

            if (port && PDFWorker._workerPorts.has(port)) {
              throw new Error("Cannot use more than one PDFWorker per port.");
            }

            this.name = name;
            this.destroyed = false;
            this.postMessageTransfers = true;
            this.verbosity = verbosity;
            this._readyCapability = (0, _util.createPromiseCapability)();
            this._port = null;
            this._webWorker = null;
            this._messageHandler = null;

            if (port) {
              PDFWorker._workerPorts.set(port, this);

              this._initializeFromPort(port);

              return;
            }

            this._initialize();
          }

          _createClass(PDFWorker, [{
            key: "promise",
            get: function get() {
              return this._readyCapability.promise;
            }
          }, {
            key: "port",
            get: function get() {
              return this._port;
            }
          }, {
            key: "messageHandler",
            get: function get() {
              return this._messageHandler;
            }
          }, {
            key: "_initializeFromPort",
            value: function _initializeFromPort(port) {
              this._port = port;
              this._messageHandler = new _message_handler.MessageHandler("main", "worker", port);

              this._messageHandler.on("ready", function () {});

              this._readyCapability.resolve();
            }
          }, {
            key: "_initialize",
            value: function _initialize() {
              var _this8 = this;

              if (typeof Worker !== "undefined" && !PDFWorkerUtil.isWorkerDisabled && !PDFWorker._mainThreadWorkerMessageHandler) {
                var workerSrc = PDFWorker.workerSrc;

                try {
                  if (!(0, _util.isSameOrigin)(window.location.href, workerSrc)) {
                    workerSrc = PDFWorkerUtil.createCDNWrapper(new URL(workerSrc, window.location).href);
                  }

                  var worker = new Worker(workerSrc);
                  var messageHandler = new _message_handler.MessageHandler("main", "worker", worker);

                  var terminateEarly = function terminateEarly() {
                    worker.removeEventListener("error", onWorkerError);
                    messageHandler.destroy();
                    worker.terminate();

                    if (_this8.destroyed) {
                      _this8._readyCapability.reject(new Error("Worker was destroyed"));
                    } else {
                      _this8._setupFakeWorker();
                    }
                  };

                  var onWorkerError = function onWorkerError() {
                    if (!_this8._webWorker) {
                      terminateEarly();
                    }
                  };

                  worker.addEventListener("error", onWorkerError);
                  messageHandler.on("test", function (data) {
                    worker.removeEventListener("error", onWorkerError);

                    if (_this8.destroyed) {
                      terminateEarly();
                      return;
                    }

                    if (data) {
                      _this8._messageHandler = messageHandler;
                      _this8._port = worker;
                      _this8._webWorker = worker;

                      if (!data.supportTransfers) {
                        _this8.postMessageTransfers = false;
                      }

                      _this8._readyCapability.resolve();

                      messageHandler.send("configure", {
                        verbosity: _this8.verbosity
                      });
                    } else {
                      _this8._setupFakeWorker();

                      messageHandler.destroy();
                      worker.terminate();
                    }
                  });
                  messageHandler.on("ready", function (data) {
                    worker.removeEventListener("error", onWorkerError);

                    if (_this8.destroyed) {
                      terminateEarly();
                      return;
                    }

                    try {
                      sendTest();
                    } catch (e) {
                      _this8._setupFakeWorker();
                    }
                  });

                  var sendTest = function sendTest() {
                    var testObj = new Uint8Array([_this8.postMessageTransfers ? 255 : 0]);

                    try {
                      messageHandler.send("test", testObj, [testObj.buffer]);
                    } catch (ex) {
                      (0, _util.warn)("Cannot use postMessage transfers.");
                      testObj[0] = 0;
                      messageHandler.send("test", testObj);
                    }
                  };

                  sendTest();
                  return;
                } catch (e) {
                  (0, _util.info)("The worker has been disabled.");
                }
              }

              this._setupFakeWorker();
            }
          }, {
            key: "_setupFakeWorker",
            value: function _setupFakeWorker() {
              var _this9 = this;

              if (!PDFWorkerUtil.isWorkerDisabled) {
                (0, _util.warn)("Setting up fake worker.");
                PDFWorkerUtil.isWorkerDisabled = true;
              }

              PDFWorker._setupFakeWorkerGlobal.then(function (WorkerMessageHandler) {
                if (_this9.destroyed) {
                  _this9._readyCapability.reject(new Error("Worker was destroyed"));

                  return;
                }

                var port = new LoopbackPort();
                _this9._port = port;
                var id = "fake".concat(PDFWorkerUtil.fakeWorkerId++);
                var workerHandler = new _message_handler.MessageHandler(id + "_worker", id, port);
                WorkerMessageHandler.setup(workerHandler, port);
                var messageHandler = new _message_handler.MessageHandler(id, id + "_worker", port);
                _this9._messageHandler = messageHandler;

                _this9._readyCapability.resolve();

                messageHandler.send("configure", {
                  verbosity: _this9.verbosity
                });
              })["catch"](function (reason) {
                _this9._readyCapability.reject(new Error("Setting up fake worker failed: \"".concat(reason.message, "\".")));
              });
            }
          }, {
            key: "destroy",
            value: function destroy() {
              this.destroyed = true;

              if (this._webWorker) {
                this._webWorker.terminate();

                this._webWorker = null;
              }

              PDFWorker._workerPorts["delete"](this._port);

              this._port = null;

              if (this._messageHandler) {
                this._messageHandler.destroy();

                this._messageHandler = null;
              }
            }
          }], [{
            key: "_workerPorts",
            get: function get() {
              return (0, _util.shadow)(this, "_workerPorts", new WeakMap());
            }
          }, {
            key: "fromPort",
            value: function fromPort(params) {
              if (!(params !== null && params !== void 0 && params.port)) {
                throw new Error("PDFWorker.fromPort - invalid method signature.");
              }

              if (this._workerPorts.has(params.port)) {
                return this._workerPorts.get(params.port);
              }

              return new PDFWorker(params);
            }
          }, {
            key: "workerSrc",
            get: function get() {
              if (_worker_options.GlobalWorkerOptions.workerSrc) {
                return _worker_options.GlobalWorkerOptions.workerSrc;
              }

              if (PDFWorkerUtil.fallbackWorkerSrc !== null) {
                if (!_is_node.isNodeJS) {
                  (0, _display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.');
                }

                return PDFWorkerUtil.fallbackWorkerSrc;
              }

              throw new Error('No "GlobalWorkerOptions.workerSrc" specified.');
            }
          }, {
            key: "_mainThreadWorkerMessageHandler",
            get: function get() {
              try {
                var _globalThis$pdfjsWork;

                return ((_globalThis$pdfjsWork = globalThis.pdfjsWorker) === null || _globalThis$pdfjsWork === void 0 ? void 0 : _globalThis$pdfjsWork.WorkerMessageHandler) || null;
              } catch (ex) {
                return null;
              }
            }
          }, {
            key: "_setupFakeWorkerGlobal",
            get: function get() {
              var _this10 = this;

              var loader = /*#__PURE__*/function () {
                var _ref15 = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
                  var mainWorkerMessageHandler, worker;
                  return _regenerator["default"].wrap(function _callee3$(_context3) {
                    while (1) {
                      switch (_context3.prev = _context3.next) {
                        case 0:
                          mainWorkerMessageHandler = _this10._mainThreadWorkerMessageHandler;

                          if (!mainWorkerMessageHandler) {
                            _context3.next = 3;
                            break;
                          }

                          return _context3.abrupt("return", mainWorkerMessageHandler);

                        case 3:
                          if (!(_is_node.isNodeJS && "function" === "function")) {
                            _context3.next = 6;
                            break;
                          }

                          worker = eval("require")(_this10.workerSrc);
                          return _context3.abrupt("return", worker.WorkerMessageHandler);

                        case 6:
                          _context3.next = 8;
                          return (0, _display_utils.loadScript)(_this10.workerSrc);

                        case 8:
                          return _context3.abrupt("return", window.pdfjsWorker.WorkerMessageHandler);

                        case 9:
                        case "end":
                          return _context3.stop();
                      }
                    }
                  }, _callee3);
                }));

                return function loader() {
                  return _ref15.apply(this, arguments);
                };
              }();

              return (0, _util.shadow)(this, "_setupFakeWorkerGlobal", loader());
            }
          }]);

          return PDFWorker;
        }();

        exports.PDFWorker = PDFWorker;
        {
          PDFWorker.getWorkerSrc = function () {
            (0, _display_utils.deprecated)("`PDFWorker.getWorkerSrc()`, please use `PDFWorker.workerSrc` instead.");
            return this.workerSrc;
          };
        }

        var WorkerTransport = /*#__PURE__*/function () {
          function WorkerTransport(messageHandler, loadingTask, networkStream, params) {
            _classCallCheck(this, WorkerTransport);

            this.messageHandler = messageHandler;
            this.loadingTask = loadingTask;
            this.commonObjs = new PDFObjects();
            this.fontLoader = new _font_loader.FontLoader({
              docId: loadingTask.docId,
              onUnsupportedFeature: this._onUnsupportedFeature.bind(this),
              ownerDocument: params.ownerDocument,
              styleElement: params.styleElement
            });
            this._params = params;

            if (!params.useWorkerFetch) {
              this.CMapReaderFactory = new params.CMapReaderFactory({
                baseUrl: params.cMapUrl,
                isCompressed: params.cMapPacked
              });
              this.StandardFontDataFactory = new params.StandardFontDataFactory({
                baseUrl: params.standardFontDataUrl
              });
            }

            this.destroyed = false;
            this.destroyCapability = null;
            this._passwordCapability = null;
            this._networkStream = networkStream;
            this._fullReader = null;
            this._lastProgress = null;
            this.pageCache = [];
            this.pagePromises = [];
            this.downloadInfoCapability = (0, _util.createPromiseCapability)();
            this.setupMessageHandler();
          }

          _createClass(WorkerTransport, [{
            key: "annotationStorage",
            get: function get() {
              return (0, _util.shadow)(this, "annotationStorage", new _annotation_storage.AnnotationStorage());
            }
          }, {
            key: "getRenderingIntent",
            value: function getRenderingIntent(intent) {
              var annotationMode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _util.AnnotationMode.ENABLE;
              var isOpList = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
              var renderingIntent = _util.RenderingIntentFlag.DISPLAY;
              var lastModified = "";

              switch (intent) {
                case "any":
                  renderingIntent = _util.RenderingIntentFlag.ANY;
                  break;

                case "display":
                  break;

                case "print":
                  renderingIntent = _util.RenderingIntentFlag.PRINT;
                  break;

                default:
                  (0, _util.warn)("getRenderingIntent - invalid intent: ".concat(intent));
              }

              switch (annotationMode) {
                case _util.AnnotationMode.DISABLE:
                  renderingIntent += _util.RenderingIntentFlag.ANNOTATIONS_DISABLE;
                  break;

                case _util.AnnotationMode.ENABLE:
                  break;

                case _util.AnnotationMode.ENABLE_FORMS:
                  renderingIntent += _util.RenderingIntentFlag.ANNOTATIONS_FORMS;
                  break;

                case _util.AnnotationMode.ENABLE_STORAGE:
                  renderingIntent += _util.RenderingIntentFlag.ANNOTATIONS_STORAGE;
                  lastModified = this.annotationStorage.lastModified;
                  break;

                default:
                  (0, _util.warn)("getRenderingIntent - invalid annotationMode: ".concat(annotationMode));
              }

              if (isOpList) {
                renderingIntent += _util.RenderingIntentFlag.OPLIST;
              }

              return {
                renderingIntent: renderingIntent,
                cacheKey: "".concat(renderingIntent, "_").concat(lastModified)
              };
            }
          }, {
            key: "destroy",
            value: function destroy() {
              var _this11 = this;

              if (this.destroyCapability) {
                return this.destroyCapability.promise;
              }

              this.destroyed = true;
              this.destroyCapability = (0, _util.createPromiseCapability)();

              if (this._passwordCapability) {
                this._passwordCapability.reject(new Error("Worker was destroyed during onPassword callback"));
              }

              var waitOn = [];

              var _iterator15 = _createForOfIteratorHelper(this.pageCache),
                  _step15;

              try {
                for (_iterator15.s(); !(_step15 = _iterator15.n()).done;) {
                  var page = _step15.value;

                  if (page) {
                    waitOn.push(page._destroy());
                  }
                }
              } catch (err) {
                _iterator15.e(err);
              } finally {
                _iterator15.f();
              }

              this.pageCache.length = 0;
              this.pagePromises.length = 0;

              if (this.hasOwnProperty("annotationStorage")) {
                this.annotationStorage.resetModified();
              }

              var terminated = this.messageHandler.sendWithPromise("Terminate", null);
              waitOn.push(terminated);
              Promise.all(waitOn).then(function () {
                _this11.commonObjs.clear();

                _this11.fontLoader.clear();

                _this11._getFieldObjectsPromise = null;
                _this11._hasJSActionsPromise = null;

                if (_this11._networkStream) {
                  _this11._networkStream.cancelAllRequests(new _util.AbortException("Worker was terminated."));
                }

                if (_this11.messageHandler) {
                  _this11.messageHandler.destroy();

                  _this11.messageHandler = null;
                }

                _this11.destroyCapability.resolve();
              }, this.destroyCapability.reject);
              return this.destroyCapability.promise;
            }
          }, {
            key: "setupMessageHandler",
            value: function setupMessageHandler() {
              var _this12 = this;

              var messageHandler = this.messageHandler,
                  loadingTask = this.loadingTask;
              messageHandler.on("GetReader", function (data, sink) {
                (0, _util.assert)(_this12._networkStream, "GetReader - no `IPDFStream` instance available.");
                _this12._fullReader = _this12._networkStream.getFullReader();

                _this12._fullReader.onProgress = function (evt) {
                  _this12._lastProgress = {
                    loaded: evt.loaded,
                    total: evt.total
                  };
                };

                sink.onPull = function () {
                  _this12._fullReader.read().then(function (_ref16) {
                    var value = _ref16.value,
                        done = _ref16.done;

                    if (done) {
                      sink.close();
                      return;
                    }

                    (0, _util.assert)((0, _util.isArrayBuffer)(value), "GetReader - expected an ArrayBuffer.");
                    sink.enqueue(new Uint8Array(value), 1, [value]);
                  })["catch"](function (reason) {
                    sink.error(reason);
                  });
                };

                sink.onCancel = function (reason) {
                  _this12._fullReader.cancel(reason);

                  sink.ready["catch"](function (readyReason) {
                    if (_this12.destroyed) {
                      return;
                    }

                    throw readyReason;
                  });
                };
              });
              messageHandler.on("ReaderHeadersReady", function (data) {
                var headersCapability = (0, _util.createPromiseCapability)();
                var fullReader = _this12._fullReader;
                fullReader.headersReady.then(function () {
                  if (!fullReader.isStreamingSupported || !fullReader.isRangeSupported) {
                    if (_this12._lastProgress && loadingTask.onProgress) {
                      loadingTask.onProgress(_this12._lastProgress);
                    }

                    fullReader.onProgress = function (evt) {
                      if (loadingTask.onProgress) {
                        loadingTask.onProgress({
                          loaded: evt.loaded,
                          total: evt.total
                        });
                      }
                    };
                  }

                  headersCapability.resolve({
                    isStreamingSupported: fullReader.isStreamingSupported,
                    isRangeSupported: fullReader.isRangeSupported,
                    contentLength: fullReader.contentLength
                  });
                }, headersCapability.reject);
                return headersCapability.promise;
              });
              messageHandler.on("GetRangeReader", function (data, sink) {
                (0, _util.assert)(_this12._networkStream, "GetRangeReader - no `IPDFStream` instance available.");

                var rangeReader = _this12._networkStream.getRangeReader(data.begin, data.end);

                if (!rangeReader) {
                  sink.close();
                  return;
                }

                sink.onPull = function () {
                  rangeReader.read().then(function (_ref17) {
                    var value = _ref17.value,
                        done = _ref17.done;

                    if (done) {
                      sink.close();
                      return;
                    }

                    (0, _util.assert)((0, _util.isArrayBuffer)(value), "GetRangeReader - expected an ArrayBuffer.");
                    sink.enqueue(new Uint8Array(value), 1, [value]);
                  })["catch"](function (reason) {
                    sink.error(reason);
                  });
                };

                sink.onCancel = function (reason) {
                  rangeReader.cancel(reason);
                  sink.ready["catch"](function (readyReason) {
                    if (_this12.destroyed) {
                      return;
                    }

                    throw readyReason;
                  });
                };
              });
              messageHandler.on("GetDoc", function (_ref18) {
                var pdfInfo = _ref18.pdfInfo;
                _this12._numPages = pdfInfo.numPages;
                _this12._htmlForXfa = pdfInfo.htmlForXfa;
                delete pdfInfo.htmlForXfa;

                loadingTask._capability.resolve(new PDFDocumentProxy(pdfInfo, _this12));
              });
              messageHandler.on("DocException", function (ex) {
                var reason;

                switch (ex.name) {
                  case "PasswordException":
                    reason = new _util.PasswordException(ex.message, ex.code);
                    break;

                  case "InvalidPDFException":
                    reason = new _util.InvalidPDFException(ex.message);
                    break;

                  case "MissingPDFException":
                    reason = new _util.MissingPDFException(ex.message);
                    break;

                  case "UnexpectedResponseException":
                    reason = new _util.UnexpectedResponseException(ex.message, ex.status);
                    break;

                  case "UnknownErrorException":
                    reason = new _util.UnknownErrorException(ex.message, ex.details);
                    break;

                  default:
                    (0, _util.unreachable)("DocException - expected a valid Error.");
                }

                loadingTask._capability.reject(reason);
              });
              messageHandler.on("PasswordRequest", function (exception) {
                _this12._passwordCapability = (0, _util.createPromiseCapability)();

                if (loadingTask.onPassword) {
                  var updatePassword = function updatePassword(password) {
                    _this12._passwordCapability.resolve({
                      password: password
                    });
                  };

                  try {
                    loadingTask.onPassword(updatePassword, exception.code);
                  } catch (ex) {
                    _this12._passwordCapability.reject(ex);
                  }
                } else {
                  _this12._passwordCapability.reject(new _util.PasswordException(exception.message, exception.code));
                }

                return _this12._passwordCapability.promise;
              });
              messageHandler.on("DataLoaded", function (data) {
                if (loadingTask.onProgress) {
                  loadingTask.onProgress({
                    loaded: data.length,
                    total: data.length
                  });
                }

                _this12.downloadInfoCapability.resolve(data);
              });
              messageHandler.on("StartRenderPage", function (data) {
                if (_this12.destroyed) {
                  return;
                }

                var page = _this12.pageCache[data.pageIndex];

                page._startRenderPage(data.transparency, data.cacheKey);
              });
              messageHandler.on("commonobj", function (data) {
                var _globalThis$FontInspe;

                if (_this12.destroyed) {
                  return;
                }

                var _data = _slicedToArray(data, 3),
                    id = _data[0],
                    type = _data[1],
                    exportedData = _data[2];

                if (_this12.commonObjs.has(id)) {
                  return;
                }

                switch (type) {
                  case "Font":
                    var params = _this12._params;

                    if ("error" in exportedData) {
                      var exportedError = exportedData.error;
                      (0, _util.warn)("Error during font loading: ".concat(exportedError));

                      _this12.commonObjs.resolve(id, exportedError);

                      break;
                    }

                    var fontRegistry = null;

                    if (params.pdfBug && (_globalThis$FontInspe = globalThis.FontInspector) !== null && _globalThis$FontInspe !== void 0 && _globalThis$FontInspe.enabled) {
                      fontRegistry = {
                        registerFont: function registerFont(font, url) {
                          globalThis.FontInspector.fontAdded(font, url);
                        }
                      };
                    }

                    var font = new _font_loader.FontFaceObject(exportedData, {
                      isEvalSupported: params.isEvalSupported,
                      disableFontFace: params.disableFontFace,
                      ignoreErrors: params.ignoreErrors,
                      onUnsupportedFeature: _this12._onUnsupportedFeature.bind(_this12),
                      fontRegistry: fontRegistry
                    });

                    _this12.fontLoader.bind(font)["catch"](function (reason) {
                      return messageHandler.sendWithPromise("FontFallback", {
                        id: id
                      });
                    })["finally"](function () {
                      if (!params.fontExtraProperties && font.data) {
                        font.data = null;
                      }

                      _this12.commonObjs.resolve(id, font);
                    });

                    break;

                  case "FontPath":
                  case "Image":
                    _this12.commonObjs.resolve(id, exportedData);

                    break;

                  default:
                    throw new Error("Got unknown common object type ".concat(type));
                }
              });
              messageHandler.on("obj", function (data) {
                var _imageData$data;

                if (_this12.destroyed) {
                  return undefined;
                }

                var _data2 = _slicedToArray(data, 4),
                    id = _data2[0],
                    pageIndex = _data2[1],
                    type = _data2[2],
                    imageData = _data2[3];

                var pageProxy = _this12.pageCache[pageIndex];

                if (pageProxy.objs.has(id)) {
                  return undefined;
                }

                switch (type) {
                  case "Image":
                    pageProxy.objs.resolve(id, imageData);
                    var MAX_IMAGE_SIZE_TO_STORE = 8000000;

                    if ((imageData === null || imageData === void 0 ? void 0 : (_imageData$data = imageData.data) === null || _imageData$data === void 0 ? void 0 : _imageData$data.length) > MAX_IMAGE_SIZE_TO_STORE) {
                      pageProxy.cleanupAfterRender = true;
                    }

                    break;

                  case "Pattern":
                    pageProxy.objs.resolve(id, imageData);
                    break;

                  default:
                    throw new Error("Got unknown object type ".concat(type));
                }

                return undefined;
              });
              messageHandler.on("DocProgress", function (data) {
                if (_this12.destroyed) {
                  return;
                }

                if (loadingTask.onProgress) {
                  loadingTask.onProgress({
                    loaded: data.loaded,
                    total: data.total
                  });
                }
              });
              messageHandler.on("UnsupportedFeature", this._onUnsupportedFeature.bind(this));
              messageHandler.on("FetchBuiltInCMap", function (data) {
                if (_this12.destroyed) {
                  return Promise.reject(new Error("Worker was destroyed."));
                }

                if (!_this12.CMapReaderFactory) {
                  return Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."));
                }

                return _this12.CMapReaderFactory.fetch(data);
              });
              messageHandler.on("FetchStandardFontData", function (data) {
                if (_this12.destroyed) {
                  return Promise.reject(new Error("Worker was destroyed."));
                }

                if (!_this12.StandardFontDataFactory) {
                  return Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter."));
                }

                return _this12.StandardFontDataFactory.fetch(data);
              });
            }
          }, {
            key: "_onUnsupportedFeature",
            value: function _onUnsupportedFeature(_ref19) {
              var featureId = _ref19.featureId;

              if (this.destroyed) {
                return;
              }

              if (this.loadingTask.onUnsupportedFeature) {
                this.loadingTask.onUnsupportedFeature(featureId);
              }
            }
          }, {
            key: "getData",
            value: function getData() {
              return this.messageHandler.sendWithPromise("GetData", null);
            }
          }, {
            key: "getPage",
            value: function getPage(pageNumber) {
              var _this13 = this;

              if (!Number.isInteger(pageNumber) || pageNumber <= 0 || pageNumber > this._numPages) {
                return Promise.reject(new Error("Invalid page request"));
              }

              var pageIndex = pageNumber - 1;

              if (pageIndex in this.pagePromises) {
                return this.pagePromises[pageIndex];
              }

              var promise = this.messageHandler.sendWithPromise("GetPage", {
                pageIndex: pageIndex
              }).then(function (pageInfo) {
                if (_this13.destroyed) {
                  throw new Error("Transport destroyed");
                }

                var page = new PDFPageProxy(pageIndex, pageInfo, _this13, _this13._params.ownerDocument, _this13._params.pdfBug);
                _this13.pageCache[pageIndex] = page;
                return page;
              });
              this.pagePromises[pageIndex] = promise;
              return promise;
            }
          }, {
            key: "getPageIndex",
            value: function getPageIndex(ref) {
              return this.messageHandler.sendWithPromise("GetPageIndex", {
                ref: ref
              });
            }
          }, {
            key: "getAnnotations",
            value: function getAnnotations(pageIndex, intent) {
              return this.messageHandler.sendWithPromise("GetAnnotations", {
                pageIndex: pageIndex,
                intent: intent
              });
            }
          }, {
            key: "saveDocument",
            value: function saveDocument() {
              var _this$_fullReader$fil,
                  _this$_fullReader,
                  _this14 = this;

              return this.messageHandler.sendWithPromise("SaveDocument", {
                isPureXfa: !!this._htmlForXfa,
                numPages: this._numPages,
                annotationStorage: this.annotationStorage.serializable,
                filename: (_this$_fullReader$fil = (_this$_fullReader = this._fullReader) === null || _this$_fullReader === void 0 ? void 0 : _this$_fullReader.filename) !== null && _this$_fullReader$fil !== void 0 ? _this$_fullReader$fil : null
              })["finally"](function () {
                _this14.annotationStorage.resetModified();
              });
            }
          }, {
            key: "getFieldObjects",
            value: function getFieldObjects() {
              return this._getFieldObjectsPromise || (this._getFieldObjectsPromise = this.messageHandler.sendWithPromise("GetFieldObjects", null));
            }
          }, {
            key: "hasJSActions",
            value: function hasJSActions() {
              return this._hasJSActionsPromise || (this._hasJSActionsPromise = this.messageHandler.sendWithPromise("HasJSActions", null));
            }
          }, {
            key: "getCalculationOrderIds",
            value: function getCalculationOrderIds() {
              return this.messageHandler.sendWithPromise("GetCalculationOrderIds", null);
            }
          }, {
            key: "getDestinations",
            value: function getDestinations() {
              return this.messageHandler.sendWithPromise("GetDestinations", null);
            }
          }, {
            key: "getDestination",
            value: function getDestination(id) {
              if (typeof id !== "string") {
                return Promise.reject(new Error("Invalid destination request."));
              }

              return this.messageHandler.sendWithPromise("GetDestination", {
                id: id
              });
            }
          }, {
            key: "getPageLabels",
            value: function getPageLabels() {
              return this.messageHandler.sendWithPromise("GetPageLabels", null);
            }
          }, {
            key: "getPageLayout",
            value: function getPageLayout() {
              return this.messageHandler.sendWithPromise("GetPageLayout", null);
            }
          }, {
            key: "getPageMode",
            value: function getPageMode() {
              return this.messageHandler.sendWithPromise("GetPageMode", null);
            }
          }, {
            key: "getViewerPreferences",
            value: function getViewerPreferences() {
              return this.messageHandler.sendWithPromise("GetViewerPreferences", null);
            }
          }, {
            key: "getOpenAction",
            value: function getOpenAction() {
              return this.messageHandler.sendWithPromise("GetOpenAction", null);
            }
          }, {
            key: "getAttachments",
            value: function getAttachments() {
              return this.messageHandler.sendWithPromise("GetAttachments", null);
            }
          }, {
            key: "getJavaScript",
            value: function getJavaScript() {
              return this.messageHandler.sendWithPromise("GetJavaScript", null);
            }
          }, {
            key: "getDocJSActions",
            value: function getDocJSActions() {
              return this.messageHandler.sendWithPromise("GetDocJSActions", null);
            }
          }, {
            key: "getPageJSActions",
            value: function getPageJSActions(pageIndex) {
              return this.messageHandler.sendWithPromise("GetPageJSActions", {
                pageIndex: pageIndex
              });
            }
          }, {
            key: "getStructTree",
            value: function getStructTree(pageIndex) {
              return this.messageHandler.sendWithPromise("GetStructTree", {
                pageIndex: pageIndex
              });
            }
          }, {
            key: "getOutline",
            value: function getOutline() {
              return this.messageHandler.sendWithPromise("GetOutline", null);
            }
          }, {
            key: "getOptionalContentConfig",
            value: function getOptionalContentConfig() {
              return this.messageHandler.sendWithPromise("GetOptionalContentConfig", null).then(function (results) {
                return new _optional_content_config.OptionalContentConfig(results);
              });
            }
          }, {
            key: "getPermissions",
            value: function getPermissions() {
              return this.messageHandler.sendWithPromise("GetPermissions", null);
            }
          }, {
            key: "getMetadata",
            value: function getMetadata() {
              var _this15 = this;

              return this.messageHandler.sendWithPromise("GetMetadata", null).then(function (results) {
                var _this15$_fullReader$f, _this15$_fullReader, _this15$_fullReader$c, _this15$_fullReader2;

                return {
                  info: results[0],
                  metadata: results[1] ? new _metadata.Metadata(results[1]) : null,
                  contentDispositionFilename: (_this15$_fullReader$f = (_this15$_fullReader = _this15._fullReader) === null || _this15$_fullReader === void 0 ? void 0 : _this15$_fullReader.filename) !== null && _this15$_fullReader$f !== void 0 ? _this15$_fullReader$f : null,
                  contentLength: (_this15$_fullReader$c = (_this15$_fullReader2 = _this15._fullReader) === null || _this15$_fullReader2 === void 0 ? void 0 : _this15$_fullReader2.contentLength) !== null && _this15$_fullReader$c !== void 0 ? _this15$_fullReader$c : null
                };
              });
            }
          }, {
            key: "getMarkInfo",
            value: function getMarkInfo() {
              return this.messageHandler.sendWithPromise("GetMarkInfo", null);
            }
          }, {
            key: "getStats",
            value: function getStats() {
              return this.messageHandler.sendWithPromise("GetStats", null);
            }
          }, {
            key: "startCleanup",
            value: function () {
              var _startCleanup = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
                var keepLoadedFonts,
                    i,
                    ii,
                    page,
                    cleanupSuccessful,
                    _args4 = arguments;
                return _regenerator["default"].wrap(function _callee4$(_context4) {
                  while (1) {
                    switch (_context4.prev = _context4.next) {
                      case 0:
                        keepLoadedFonts = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : false;
                        _context4.next = 3;
                        return this.messageHandler.sendWithPromise("Cleanup", null);

                      case 3:
                        if (!this.destroyed) {
                          _context4.next = 5;
                          break;
                        }

                        return _context4.abrupt("return");

                      case 5:
                        i = 0, ii = this.pageCache.length;

                      case 6:
                        if (!(i < ii)) {
                          _context4.next = 16;
                          break;
                        }

                        page = this.pageCache[i];

                        if (page) {
                          _context4.next = 10;
                          break;
                        }

                        return _context4.abrupt("continue", 13);

                      case 10:
                        cleanupSuccessful = page.cleanup();

                        if (cleanupSuccessful) {
                          _context4.next = 13;
                          break;
                        }

                        throw new Error("startCleanup: Page ".concat(i + 1, " is currently rendering."));

                      case 13:
                        i++;
                        _context4.next = 6;
                        break;

                      case 16:
                        this.commonObjs.clear();

                        if (!keepLoadedFonts) {
                          this.fontLoader.clear();
                        }

                        this._getFieldObjectsPromise = null;
                        this._hasJSActionsPromise = null;

                      case 20:
                      case "end":
                        return _context4.stop();
                    }
                  }
                }, _callee4, this);
              }));

              function startCleanup() {
                return _startCleanup.apply(this, arguments);
              }

              return startCleanup;
            }()
          }, {
            key: "loadingParams",
            get: function get() {
              var params = this._params;
              return (0, _util.shadow)(this, "loadingParams", {
                disableAutoFetch: params.disableAutoFetch,
                enableXfa: params.enableXfa
              });
            }
          }]);

          return WorkerTransport;
        }();

        var PDFObjects = /*#__PURE__*/function () {
          function PDFObjects() {
            _classCallCheck(this, PDFObjects);

            this._objs = Object.create(null);
          }

          _createClass(PDFObjects, [{
            key: "_ensureObj",
            value: function _ensureObj(objId) {
              if (this._objs[objId]) {
                return this._objs[objId];
              }

              return this._objs[objId] = {
                capability: (0, _util.createPromiseCapability)(),
                data: null,
                resolved: false
              };
            }
          }, {
            key: "get",
            value: function get(objId) {
              var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

              if (callback) {
                this._ensureObj(objId).capability.promise.then(callback);

                return null;
              }

              var obj = this._objs[objId];

              if (!obj || !obj.resolved) {
                throw new Error("Requesting object that isn't resolved yet ".concat(objId, "."));
              }

              return obj.data;
            }
          }, {
            key: "has",
            value: function has(objId) {
              var obj = this._objs[objId];
              return (obj === null || obj === void 0 ? void 0 : obj.resolved) || false;
            }
          }, {
            key: "resolve",
            value: function resolve(objId, data) {
              var obj = this._ensureObj(objId);

              obj.resolved = true;
              obj.data = data;
              obj.capability.resolve(data);
            }
          }, {
            key: "clear",
            value: function clear() {
              this._objs = Object.create(null);
            }
          }]);

          return PDFObjects;
        }();

        var RenderTask = /*#__PURE__*/function () {
          function RenderTask(internalRenderTask) {
            _classCallCheck(this, RenderTask);

            this._internalRenderTask = internalRenderTask;
            this.onContinue = null;
          }

          _createClass(RenderTask, [{
            key: "promise",
            get: function get() {
              return this._internalRenderTask.capability.promise;
            }
          }, {
            key: "cancel",
            value: function cancel() {
              this._internalRenderTask.cancel();
            }
          }]);

          return RenderTask;
        }();

        exports.RenderTask = RenderTask;

        var InternalRenderTask = /*#__PURE__*/function () {
          function InternalRenderTask(_ref20) {
            var callback = _ref20.callback,
                params = _ref20.params,
                objs = _ref20.objs,
                commonObjs = _ref20.commonObjs,
                operatorList = _ref20.operatorList,
                pageIndex = _ref20.pageIndex,
                canvasFactory = _ref20.canvasFactory,
                _ref20$useRequestAnim = _ref20.useRequestAnimationFrame,
                useRequestAnimationFrame = _ref20$useRequestAnim === void 0 ? false : _ref20$useRequestAnim,
                _ref20$pdfBug = _ref20.pdfBug,
                pdfBug = _ref20$pdfBug === void 0 ? false : _ref20$pdfBug;

            _classCallCheck(this, InternalRenderTask);

            this.callback = callback;
            this.params = params;
            this.objs = objs;
            this.commonObjs = commonObjs;
            this.operatorListIdx = null;
            this.operatorList = operatorList;
            this._pageIndex = pageIndex;
            this.canvasFactory = canvasFactory;
            this._pdfBug = pdfBug;
            this.running = false;
            this.graphicsReadyCallback = null;
            this.graphicsReady = false;
            this._useRequestAnimationFrame = useRequestAnimationFrame === true && typeof window !== "undefined";
            this.cancelled = false;
            this.capability = (0, _util.createPromiseCapability)();
            this.task = new RenderTask(this);
            this._cancelBound = this.cancel.bind(this);
            this._continueBound = this._continue.bind(this);
            this._scheduleNextBound = this._scheduleNext.bind(this);
            this._nextBound = this._next.bind(this);
            this._canvas = params.canvasContext.canvas;
          }

          _createClass(InternalRenderTask, [{
            key: "completed",
            get: function get() {
              return this.capability.promise["catch"](function () {});
            }
          }, {
            key: "initializeGraphics",
            value: function initializeGraphics(_ref21) {
              var _globalThis$StepperMa;

              var _ref21$transparency = _ref21.transparency,
                  transparency = _ref21$transparency === void 0 ? false : _ref21$transparency,
                  optionalContentConfig = _ref21.optionalContentConfig;

              if (this.cancelled) {
                return;
              }

              if (this._canvas) {
                if (InternalRenderTask.canvasInUse.has(this._canvas)) {
                  throw new Error("Cannot use the same canvas during multiple render() operations. " + "Use different canvas or ensure previous operations were " + "cancelled or completed.");
                }

                InternalRenderTask.canvasInUse.add(this._canvas);
              }

              if (this._pdfBug && (_globalThis$StepperMa = globalThis.StepperManager) !== null && _globalThis$StepperMa !== void 0 && _globalThis$StepperMa.enabled) {
                this.stepper = globalThis.StepperManager.create(this._pageIndex);
                this.stepper.init(this.operatorList);
                this.stepper.nextBreakPoint = this.stepper.getNextBreakPoint();
              }

              var _this$params = this.params,
                  canvasContext = _this$params.canvasContext,
                  viewport = _this$params.viewport,
                  transform = _this$params.transform,
                  imageLayer = _this$params.imageLayer,
                  background = _this$params.background;
              this.gfx = new _canvas.CanvasGraphics(canvasContext, this.commonObjs, this.objs, this.canvasFactory, imageLayer, optionalContentConfig);
              this.gfx.beginDrawing({
                transform: transform,
                viewport: viewport,
                transparency: transparency,
                background: background
              });
              this.operatorListIdx = 0;
              this.graphicsReady = true;

              if (this.graphicsReadyCallback) {
                this.graphicsReadyCallback();
              }
            }
          }, {
            key: "cancel",
            value: function cancel() {
              var error = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
              this.running = false;
              this.cancelled = true;

              if (this.gfx) {
                this.gfx.endDrawing();
              }

              if (this._canvas) {
                InternalRenderTask.canvasInUse["delete"](this._canvas);
              }

              this.callback(error || new _display_utils.RenderingCancelledException("Rendering cancelled, page ".concat(this._pageIndex + 1), "canvas"));
            }
          }, {
            key: "operatorListChanged",
            value: function operatorListChanged() {
              if (!this.graphicsReady) {
                if (!this.graphicsReadyCallback) {
                  this.graphicsReadyCallback = this._continueBound;
                }

                return;
              }

              if (this.stepper) {
                this.stepper.updateOperatorList(this.operatorList);
              }

              if (this.running) {
                return;
              }

              this._continue();
            }
          }, {
            key: "_continue",
            value: function _continue() {
              this.running = true;

              if (this.cancelled) {
                return;
              }

              if (this.task.onContinue) {
                this.task.onContinue(this._scheduleNextBound);
              } else {
                this._scheduleNext();
              }
            }
          }, {
            key: "_scheduleNext",
            value: function _scheduleNext() {
              var _this16 = this;

              if (this._useRequestAnimationFrame) {
                window.requestAnimationFrame(function () {
                  _this16._nextBound()["catch"](_this16._cancelBound);
                });
              } else {
                Promise.resolve().then(this._nextBound)["catch"](this._cancelBound);
              }
            }
          }, {
            key: "_next",
            value: function () {
              var _next2 = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {
                return _regenerator["default"].wrap(function _callee5$(_context5) {
                  while (1) {
                    switch (_context5.prev = _context5.next) {
                      case 0:
                        if (!this.cancelled) {
                          _context5.next = 2;
                          break;
                        }

                        return _context5.abrupt("return");

                      case 2:
                        this.operatorListIdx = this.gfx.executeOperatorList(this.operatorList, this.operatorListIdx, this._continueBound, this.stepper);

                        if (this.operatorListIdx === this.operatorList.argsArray.length) {
                          this.running = false;

                          if (this.operatorList.lastChunk) {
                            this.gfx.endDrawing();

                            if (this._canvas) {
                              InternalRenderTask.canvasInUse["delete"](this._canvas);
                            }

                            this.callback();
                          }
                        }

                      case 4:
                      case "end":
                        return _context5.stop();
                    }
                  }
                }, _callee5, this);
              }));

              function _next() {
                return _next2.apply(this, arguments);
              }

              return _next;
            }()
          }], [{
            key: "canvasInUse",
            get: function get() {
              return (0, _util.shadow)(this, "canvasInUse", new WeakSet());
            }
          }]);

          return InternalRenderTask;
        }();

        var version = '2.11.338';
        exports.version = version;
        var build = 'dedff3c98';
        exports.build = build;
        /***/
      },
      /* 120 */

      /***/
      function (__unused_webpack_module, exports, __w_pdfjs_require__) {
        "use strict";

        function _typeof(obj) {
          "@babel/helpers - typeof";

          if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
            _typeof = function _typeof(obj) {
              return typeof obj;
            };
          } else {
            _typeof = function _typeof(obj) {
              return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
            };
          }

          return _typeof(obj);
        }

        Object.defineProperty(exports, "__esModule", {
          value: true
        });
        exports.FontLoader = exports.FontFaceObject = void 0;

        var _regenerator = _interopRequireDefault(__w_pdfjs_require__(2));

        var _util = __w_pdfjs_require__(4);

        function _interopRequireDefault(obj) {
          return obj && obj.__esModule ? obj : {
            "default": obj
          };
        }

        function _inherits(subClass, superClass) {
          if (typeof superClass !== "function" && superClass !== null) {
            throw new TypeError("Super expression must either be null or a function");
          }

          subClass.prototype = Object.create(superClass && superClass.prototype, {
            constructor: {
              value: subClass,
              writable: true,
              configurable: true
            }
          });
          if (superClass) _setPrototypeOf(subClass, superClass);
        }

        function _setPrototypeOf(o, p) {
          _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
            o.__proto__ = p;
            return o;
          };

          return _setPrototypeOf(o, p);
        }

        function _createSuper(Derived) {
          var hasNativeReflectConstruct = _isNativeReflectConstruct();

          return function _createSuperInternal() {
            var Super = _getPrototypeOf(Derived),
                result;

            if (hasNativeReflectConstruct) {
              var NewTarget = _getPrototypeOf(this).constructor;

              result = Reflect.construct(Super, arguments, NewTarget);
            } else {
              result = Super.apply(this, arguments);
            }

            return _possibleConstructorReturn(this, result);
          };
        }

        function _possibleConstructorReturn(self, call) {
          if (call && (_typeof(call) === "object" || typeof call === "function")) {
            return call;
          } else if (call !== void 0) {
            throw new TypeError("Derived constructors may only return object or undefined");
          }

          return _assertThisInitialized(self);
        }

        function _assertThisInitialized(self) {
          if (self === void 0) {
            throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
          }

          return self;
        }

        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 (e) {
            return false;
          }
        }

        function _getPrototypeOf(o) {
          _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
            return o.__proto__ || Object.getPrototypeOf(o);
          };
          return _getPrototypeOf(o);
        }

        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 self = this,
                args = arguments;
            return new Promise(function (resolve, reject) {
              var gen = fn.apply(self, args);

              function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
              }

              function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
              }

              _next(undefined);
            });
          };
        }

        function _createForOfIteratorHelper(o, allowArrayLike) {
          var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];

          if (!it) {
            if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
              if (it) o = it;
              var i = 0;

              var F = function F() {};

              return {
                s: F,
                n: function n() {
                  if (i >= o.length) return {
                    done: true
                  };
                  return {
                    done: false,
                    value: o[i++]
                  };
                },
                e: function e(_e) {
                  throw _e;
                },
                f: F
              };
            }

            throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
          }

          var normalCompletion = true,
              didErr = false,
              err;
          return {
            s: function s() {
              it = it.call(o);
            },
            n: function n() {
              var step = it.next();
              normalCompletion = step.done;
              return step;
            },
            e: function e(_e2) {
              didErr = true;
              err = _e2;
            },
            f: function f() {
              try {
                if (!normalCompletion && it["return"] != null) it["return"]();
              } finally {
                if (didErr) throw err;
              }
            }
          };
        }

        function _unsupportedIterableToArray(o, minLen) {
          if (!o) return;
          if (typeof o === "string") return _arrayLikeToArray(o, minLen);
          var n = Object.prototype.toString.call(o).slice(8, -1);
          if (n === "Object" && o.constructor) n = o.constructor.name;
          if (n === "Map" || n === "Set") return Array.from(o);
          if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
        }

        function _arrayLikeToArray(arr, len) {
          if (len == null || len > arr.length) len = arr.length;

          for (var i = 0, arr2 = new Array(len); i < len; i++) {
            arr2[i] = arr[i];
          }

          return arr2;
        }

        function _classCallCheck(instance, Constructor) {
          if (!(instance instanceof Constructor)) {
            throw new TypeError("Cannot call a class as a function");
          }
        }

        function _defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];
            descriptor.enumerable = descriptor.enumerable || false;
            descriptor.configurable = true;
            if ("value" in descriptor) descriptor.writable = true;
            Object.defineProperty(target, descriptor.key, descriptor);
          }
        }

        function _createClass(Constructor, protoProps, staticProps) {
          if (protoProps) _defineProperties(Constructor.prototype, protoProps);
          if (staticProps) _defineProperties(Constructor, staticProps);
          return Constructor;
        }

        var BaseFontLoader = /*#__PURE__*/function () {
          function BaseFontLoader(_ref) {
            var docId = _ref.docId,
                onUnsupportedFeature = _ref.onUnsupportedFeature,
                _ref$ownerDocument = _ref.ownerDocument,
                ownerDocument = _ref$ownerDocument === void 0 ? globalThis.document : _ref$ownerDocument,
                _ref$styleElement = _ref.styleElement,
                styleElement = _ref$styleElement === void 0 ? null : _ref$styleElement;

            _classCallCheck(this, BaseFontLoader);

            if (this.constructor === BaseFontLoader) {
              (0, _util.unreachable)("Cannot initialize BaseFontLoader.");
            }

            this.docId = docId;
            this._onUnsupportedFeature = onUnsupportedFeature;
            this._document = ownerDocument;
            this.nativeFontFaces = [];
            this.styleElement = null;
          }

          _createClass(BaseFontLoader, [{
            key: "addNativeFontFace",
            value: function addNativeFontFace(nativeFontFace) {
              this.nativeFontFaces.push(nativeFontFace);

              this._document.fonts.add(nativeFontFace);
            }
          }, {
            key: "insertRule",
            value: function insertRule(rule) {
              var styleElement = this.styleElement;

              if (!styleElement) {
                styleElement = this.styleElement = this._document.createElement("style");
                styleElement.id = "PDFJS_FONT_STYLE_TAG_".concat(this.docId);

                this._document.documentElement.getElementsByTagName("head")[0].appendChild(styleElement);
              }

              var styleSheet = styleElement.sheet;
              styleSheet.insertRule(rule, styleSheet.cssRules.length);
            }
          }, {
            key: "clear",
            value: function clear() {
              var _iterator = _createForOfIteratorHelper(this.nativeFontFaces),
                  _step;

              try {
                for (_iterator.s(); !(_step = _iterator.n()).done;) {
                  var nativeFontFace = _step.value;

                  this._document.fonts["delete"](nativeFontFace);
                }
              } catch (err) {
                _iterator.e(err);
              } finally {
                _iterator.f();
              }

              this.nativeFontFaces.length = 0;

              if (this.styleElement) {
                this.styleElement.remove();
                this.styleElement = null;
              }
            }
          }, {
            key: "bind",
            value: function () {
              var _bind = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee(font) {
                var _this = this;

                var nativeFontFace, rule;
                return _regenerator["default"].wrap(function _callee$(_context) {
                  while (1) {
                    switch (_context.prev = _context.next) {
                      case 0:
                        if (!(font.attached || font.missingFile)) {
                          _context.next = 2;
                          break;
                        }

                        return _context.abrupt("return");

                      case 2:
                        font.attached = true;

                        if (!this.isFontLoadingAPISupported) {
                          _context.next = 19;
                          break;
                        }

                        nativeFontFace = font.createNativeFontFace();

                        if (!nativeFontFace) {
                          _context.next = 18;
                          break;
                        }

                        this.addNativeFontFace(nativeFontFace);
                        _context.prev = 7;
                        _context.next = 10;
                        return nativeFontFace.loaded;

                      case 10:
                        _context.next = 18;
                        break;

                      case 12:
                        _context.prev = 12;
                        _context.t0 = _context["catch"](7);

                        this._onUnsupportedFeature({
                          featureId: _util.UNSUPPORTED_FEATURES.errorFontLoadNative
                        });

                        (0, _util.warn)("Failed to load font '".concat(nativeFontFace.family, "': '").concat(_context.t0, "'."));
                        font.disableFontFace = true;
                        throw _context.t0;

                      case 18:
                        return _context.abrupt("return");

                      case 19:
                        rule = font.createFontFaceRule();

                        if (!rule) {
                          _context.next = 26;
                          break;
                        }

                        this.insertRule(rule);

                        if (!this.isSyncFontLoadingSupported) {
                          _context.next = 24;
                          break;
                        }

                        return _context.abrupt("return");

                      case 24:
                        _context.next = 26;
                        return new Promise(function (resolve) {
                          var request = _this._queueLoadingCallback(resolve);

                          _this._prepareFontLoadEvent([rule], [font], request);
                        });

                      case 26:
                      case "end":
                        return _context.stop();
                    }
                  }
                }, _callee, this, [[7, 12]]);
              }));

              function bind(_x) {
                return _bind.apply(this, arguments);
              }

              return bind;
            }()
          }, {
            key: "_queueLoadingCallback",
            value: function _queueLoadingCallback(callback) {
              (0, _util.unreachable)("Abstract method `_queueLoadingCallback`.");
            }
          }, {
            key: "isFontLoadingAPISupported",
            get: function get() {
              var _this$_document;

              var hasFonts = !!((_this$_document = this._document) !== null && _this$_document !== void 0 && _this$_document.fonts);
              return (0, _util.shadow)(this, "isFontLoadingAPISupported", hasFonts);
            }
          }, {
            key: "isSyncFontLoadingSupported",
            get: function get() {
              (0, _util.unreachable)("Abstract method `isSyncFontLoadingSupported`.");
            }
          }, {
            key: "_loadTestFont",
            get: function get() {
              (0, _util.unreachable)("Abstract method `_loadTestFont`.");
            }
          }, {
            key: "_prepareFontLoadEvent",
            value: function _prepareFontLoadEvent(rules, fontsToLoad, request) {
              (0, _util.unreachable)("Abstract method `_prepareFontLoadEvent`.");
            }
          }]);

          return BaseFontLoader;
        }();

        var FontLoader;
        exports.FontLoader = FontLoader;
        {
          exports.FontLoader = FontLoader = /*#__PURE__*/function (_BaseFontLoader) {
            _inherits(GenericFontLoader, _BaseFontLoader);

            var _super = _createSuper(GenericFontLoader);

            function GenericFontLoader(params) {
              var _this2;

              _classCallCheck(this, GenericFontLoader);

              _this2 = _super.call(this, params);
              _this2.loadingContext = {
                requests: [],
                nextRequestId: 0
              };
              _this2.loadTestFontId = 0;
              return _this2;
            }

            _createClass(GenericFontLoader, [{
              key: "isSyncFontLoadingSupported",
              get: function get() {
                var supported = false;

                if (typeof navigator === "undefined") {
                  supported = true;
                } else {
                  var m = /Mozilla\/5.0.*?rv:(\d+).*? Gecko/.exec(navigator.userAgent);

                  if ((m === null || m === void 0 ? void 0 : m[1]) >= 14) {
                    supported = true;
                  }
                }

                return (0, _util.shadow)(this, "isSyncFontLoadingSupported", supported);
              }
            }, {
              key: "_queueLoadingCallback",
              value: function _queueLoadingCallback(callback) {
                function completeRequest() {
                  (0, _util.assert)(!request.done, "completeRequest() cannot be called twice.");
                  request.done = true;

                  while (context.requests.length > 0 && context.requests[0].done) {
                    var otherRequest = context.requests.shift();
                    setTimeout(otherRequest.callback, 0);
                  }
                }

                var context = this.loadingContext;
                var request = {
                  id: "pdfjs-font-loading-".concat(context.nextRequestId++),
                  done: false,
                  complete: completeRequest,
                  callback: callback
                };
                context.requests.push(request);
                return request;
              }
            }, {
              key: "_loadTestFont",
              get: function get() {
                var getLoadTestFont = function getLoadTestFont() {
                  return atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQA" + "FQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAA" + "ALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgA" + "AAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1" + "AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD" + "6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACM" + "AooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4D" + "IP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAA" + "AAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUA" + "AQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgAB" + "AAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABY" + "AAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAA" + "AC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "AAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAA" + "AAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQAC" + "AQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3" + "Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTj" + "FQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");
                };

                return (0, _util.shadow)(this, "_loadTestFont", getLoadTestFont());
              }
            }, {
              key: "_prepareFontLoadEvent",
              value: function _prepareFontLoadEvent(rules, fonts, request) {
                var _this3 = this;

                function int32(data, offset) {
                  return data.charCodeAt(offset) << 24 | data.charCodeAt(offset + 1) << 16 | data.charCodeAt(offset + 2) << 8 | data.charCodeAt(offset + 3) & 0xff;
                }

                function spliceString(s, offset, remove, insert) {
                  var chunk1 = s.substring(0, offset);
                  var chunk2 = s.substring(offset + remove);
                  return chunk1 + insert + chunk2;
                }

                var i, ii;

                var canvas = this._document.createElement("canvas");

                canvas.width = 1;
                canvas.height = 1;
                var ctx = canvas.getContext("2d");
                var called = 0;

                function isFontReady(name, callback) {
                  called++;

                  if (called > 30) {
                    (0, _util.warn)("Load test font never loaded.");
                    callback();
                    return;
                  }

                  ctx.font = "30px " + name;
                  ctx.fillText(".", 0, 20);
                  var imageData = ctx.getImageData(0, 0, 1, 1);

                  if (imageData.data[3] > 0) {
                    callback();
                    return;
                  }

                  setTimeout(isFontReady.bind(null, name, callback));
                }

                var loadTestFontId = "lt".concat(Date.now()).concat(this.loadTestFontId++);
                var data = this._loadTestFont;
                var COMMENT_OFFSET = 976;
                data = spliceString(data, COMMENT_OFFSET, loadTestFontId.length, loadTestFontId);
                var CFF_CHECKSUM_OFFSET = 16;
                var XXXX_VALUE = 0x58585858;
                var checksum = int32(data, CFF_CHECKSUM_OFFSET);

                for (i = 0, ii = loadTestFontId.length - 3; i < ii; i += 4) {
                  checksum = checksum - XXXX_VALUE + int32(loadTestFontId, i) | 0;
                }

                if (i < loadTestFontId.length) {
                  checksum = checksum - XXXX_VALUE + int32(loadTestFontId + "XXX", i) | 0;
                }

                data = spliceString(data, CFF_CHECKSUM_OFFSET, 4, (0, _util.string32)(checksum));
                var url = "url(data:font/opentype;base64,".concat(btoa(data), ");");
                var rule = "@font-face {font-family:\"".concat(loadTestFontId, "\";src:").concat(url, "}");
                this.insertRule(rule);
                var names = [];

                var _iterator2 = _createForOfIteratorHelper(fonts),
                    _step2;

                try {
                  for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
                    var font = _step2.value;
                    names.push(font.loadedName);
                  }
                } catch (err) {
                  _iterator2.e(err);
                } finally {
                  _iterator2.f();
                }

                names.push(loadTestFontId);

                var div = this._document.createElement("div");

                div.style.visibility = "hidden";
                div.style.width = div.style.height = "10px";
                div.style.position = "absolute";
                div.style.top = div.style.left = "0px";

                for (var _i = 0, _names = names; _i < _names.length; _i++) {
                  var name = _names[_i];

                  var span = this._document.createElement("span");

                  span.textContent = "Hi";
                  span.style.fontFamily = name;
                  div.appendChild(span);
                }

                this._document.body.appendChild(div);

                isFontReady(loadTestFontId, function () {
                  _this3._document.body.removeChild(div);

                  request.complete();
                });
              }
            }]);

            return GenericFontLoader;
          }(BaseFontLoader);
        }

        var FontFaceObject = /*#__PURE__*/function () {
          function FontFaceObject(translatedData, _ref2) {
            var _ref2$isEvalSupported = _ref2.isEvalSupported,
                isEvalSupported = _ref2$isEvalSupported === void 0 ? true : _ref2$isEvalSupported,
                _ref2$disableFontFace = _ref2.disableFontFace,
                disableFontFace = _ref2$disableFontFace === void 0 ? false : _ref2$disableFontFace,
                _ref2$ignoreErrors = _ref2.ignoreErrors,
                ignoreErrors = _ref2$ignoreErrors === void 0 ? false : _ref2$ignoreErrors,
                onUnsupportedFeature = _ref2.onUnsupportedFeature,
                _ref2$fontRegistry = _ref2.fontRegistry,
                fontRegistry = _ref2$fontRegistry === void 0 ? null : _ref2$fontRegistry;

            _classCallCheck(this, FontFaceObject);

            this.compiledGlyphs = Object.create(null);

            for (var i in translatedData) {
              this[i] = translatedData[i];
            }

            this.isEvalSupported = isEvalSupported !== false;
            this.disableFontFace = disableFontFace === true;
            this.ignoreErrors = ignoreErrors === true;
            this._onUnsupportedFeature = onUnsupportedFeature;
            this.fontRegistry = fontRegistry;
          }

          _createClass(FontFaceObject, [{
            key: "createNativeFontFace",
            value: function createNativeFontFace() {
              if (!this.data || this.disableFontFace) {
                return null;
              }

              var nativeFontFace;

              if (!this.cssFontInfo) {
                nativeFontFace = new FontFace(this.loadedName, this.data, {});
              } else {
                var css = {
                  weight: this.cssFontInfo.fontWeight
                };

                if (this.cssFontInfo.italicAngle) {
                  css.style = "oblique ".concat(this.cssFontInfo.italicAngle, "deg");
                }

                nativeFontFace = new FontFace(this.cssFontInfo.fontFamily, this.data, css);
              }

              if (this.fontRegistry) {
                this.fontRegistry.registerFont(this);
              }

              return nativeFontFace;
            }
          }, {
            key: "createFontFaceRule",
            value: function createFontFaceRule() {
              if (!this.data || this.disableFontFace) {
                return null;
              }

              var data = (0, _util.bytesToString)(this.data);
              var url = "url(data:".concat(this.mimetype, ";base64,").concat(btoa(data), ");");
              var rule;

              if (!this.cssFontInfo) {
                rule = "@font-face {font-family:\"".concat(this.loadedName, "\";src:").concat(url, "}");
              } else {
                var css = "font-weight: ".concat(this.cssFontInfo.fontWeight, ";");

                if (this.cssFontInfo.italicAngle) {
                  css += "font-style: oblique ".concat(this.cssFontInfo.italicAngle, "deg;");
                }

                rule = "@font-face {font-family:\"".concat(this.cssFontInfo.fontFamily, "\";").concat(css, "src:").concat(url, "}");
              }

              if (this.fontRegistry) {
                this.fontRegistry.registerFont(this, url);
              }

              return rule;
            }
          }, {
            key: "getPathGenerator",
            value: function getPathGenerator(objs, character) {
              if (this.compiledGlyphs[character] !== undefined) {
                return this.compiledGlyphs[character];
              }

              var cmds;

              try {
                cmds = objs.get(this.loadedName + "_path_" + character);
              } catch (ex) {
                if (!this.ignoreErrors) {
                  throw ex;
                }

                this._onUnsupportedFeature({
                  featureId: _util.UNSUPPORTED_FEATURES.errorFontGetPath
                });

                (0, _util.warn)("getPathGenerator - ignoring character: \"".concat(ex, "\"."));
                return this.compiledGlyphs[character] = function (c, size) {};
              }

              if (this.isEvalSupported && _util.IsEvalSupportedCached.value) {
                var jsBuf = [];

                var _iterator3 = _createForOfIteratorHelper(cmds),
                    _step3;

                try {
                  for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
                    var current = _step3.value;
                    var args = current.args !== undefined ? current.args.join(",") : "";
                    jsBuf.push("c.", current.cmd, "(", args, ");\n");
                  }
                } catch (err) {
                  _iterator3.e(err);
                } finally {
                  _iterator3.f();
                }

                return this.compiledGlyphs[character] = new Function("c", "size", jsBuf.join(""));
              }

              return this.compiledGlyphs[character] = function (c, size) {
                var _iterator4 = _createForOfIteratorHelper(cmds),
                    _step4;

                try {
                  for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
                    var _current = _step4.value;

                    if (_current.cmd === "scale") {
                      _current.args = [size, -size];
                    }

                    c[_current.cmd].apply(c, _current.args);
                  }
                } catch (err) {
                  _iterator4.e(err);
                } finally {
                  _iterator4.f();
                }
              };
            }
          }]);

          return FontFaceObject;
        }();

        exports.FontFaceObject = FontFaceObject;
        /***/
      },
      /* 121 */

      /***/
      function (__unused_webpack_module, exports, __w_pdfjs_require__) {
        "use strict";

        function _typeof(obj) {
          "@babel/helpers - typeof";

          if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
            _typeof = function _typeof(obj) {
              return typeof obj;
            };
          } else {
            _typeof = function _typeof(obj) {
              return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
            };
          }

          return _typeof(obj);
        }

        Object.defineProperty(exports, "__esModule", {
          value: true
        });
        exports.NodeStandardFontDataFactory = exports.NodeCMapReaderFactory = exports.NodeCanvasFactory = void 0;

        var _base_factory = __w_pdfjs_require__(118);

        var _is_node = __w_pdfjs_require__(6);

        var _util = __w_pdfjs_require__(4);

        function _defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];
            descriptor.enumerable = descriptor.enumerable || false;
            descriptor.configurable = true;
            if ("value" in descriptor) descriptor.writable = true;
            Object.defineProperty(target, descriptor.key, descriptor);
          }
        }

        function _createClass(Constructor, protoProps, staticProps) {
          if (protoProps) _defineProperties(Constructor.prototype, protoProps);
          if (staticProps) _defineProperties(Constructor, staticProps);
          return Constructor;
        }

        function _inherits(subClass, superClass) {
          if (typeof superClass !== "function" && superClass !== null) {
            throw new TypeError("Super expression must either be null or a function");
          }

          subClass.prototype = Object.create(superClass && superClass.prototype, {
            constructor: {
              value: subClass,
              writable: true,
              configurable: true
            }
          });
          if (superClass) _setPrototypeOf(subClass, superClass);
        }

        function _setPrototypeOf(o, p) {
          _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
            o.__proto__ = p;
            return o;
          };

          return _setPrototypeOf(o, p);
        }

        function _createSuper(Derived) {
          var hasNativeReflectConstruct = _isNativeReflectConstruct();

          return function _createSuperInternal() {
            var Super = _getPrototypeOf(Derived),
                result;

            if (hasNativeReflectConstruct) {
              var NewTarget = _getPrototypeOf(this).constructor;

              result = Reflect.construct(Super, arguments, NewTarget);
            } else {
              result = Super.apply(this, arguments);
            }

            return _possibleConstructorReturn(this, result);
          };
        }

        function _possibleConstructorReturn(self, call) {
          if (call && (_typeof(call) === "object" || typeof call === "function")) {
            return call;
          } else if (call !== void 0) {
            throw new TypeError("Derived constructors may only return object or undefined");
          }

          return _assertThisInitialized(self);
        }

        function _assertThisInitialized(self) {
          if (self === void 0) {
            throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
          }

          return self;
        }

        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 (e) {
            return false;
          }
        }

        function _getPrototypeOf(o) {
          _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
            return o.__proto__ || Object.getPrototypeOf(o);
          };
          return _getPrototypeOf(o);
        }

        function _classCallCheck(instance, Constructor) {
          if (!(instance instanceof Constructor)) {
            throw new TypeError("Cannot call a class as a function");
          }
        }

        var NodeCanvasFactory = function NodeCanvasFactory() {
          _classCallCheck(this, NodeCanvasFactory);

          (0, _util.unreachable)("Not implemented: NodeCanvasFactory");
        };

        exports.NodeCanvasFactory = NodeCanvasFactory;

        var NodeCMapReaderFactory = function NodeCMapReaderFactory() {
          _classCallCheck(this, NodeCMapReaderFactory);

          (0, _util.unreachable)("Not implemented: NodeCMapReaderFactory");
        };

        exports.NodeCMapReaderFactory = NodeCMapReaderFactory;

        var NodeStandardFontDataFactory = function NodeStandardFontDataFactory() {
          _classCallCheck(this, NodeStandardFontDataFactory);

          (0, _util.unreachable)("Not implemented: NodeStandardFontDataFactory");
        };

        exports.NodeStandardFontDataFactory = NodeStandardFontDataFactory;

        if (_is_node.isNodeJS) {
          var fetchData = function fetchData(url) {
            return new Promise(function (resolve, reject) {
              var fs = __webpack_require__(767);

              fs.readFile(url, function (error, data) {
                if (error || !data) {
                  reject(new Error(error));
                  return;
                }

                resolve(new Uint8Array(data));
              });
            });
          };

          exports.NodeCanvasFactory = NodeCanvasFactory = /*#__PURE__*/function (_BaseCanvasFactory) {
            _inherits(NodeCanvasFactory, _BaseCanvasFactory);

            var _super = _createSuper(NodeCanvasFactory);

            function NodeCanvasFactory() {
              _classCallCheck(this, NodeCanvasFactory);

              return _super.apply(this, arguments);
            }

            _createClass(NodeCanvasFactory, [{
              key: "_createCanvas",
              value: function _createCanvas(width, height) {
                var Canvas = __webpack_require__(601);

                return Canvas.createCanvas(width, height);
              }
            }]);

            return NodeCanvasFactory;
          }(_base_factory.BaseCanvasFactory);

          exports.NodeCMapReaderFactory = NodeCMapReaderFactory = /*#__PURE__*/function (_BaseCMapReaderFactor) {
            _inherits(NodeCMapReaderFactory, _BaseCMapReaderFactor);

            var _super2 = _createSuper(NodeCMapReaderFactory);

            function NodeCMapReaderFactory() {
              _classCallCheck(this, NodeCMapReaderFactory);

              return _super2.apply(this, arguments);
            }

            _createClass(NodeCMapReaderFactory, [{
              key: "_fetchData",
              value: function _fetchData(url, compressionType) {
                return fetchData(url).then(function (data) {
                  return {
                    cMapData: data,
                    compressionType: compressionType
                  };
                });
              }
            }]);

            return NodeCMapReaderFactory;
          }(_base_factory.BaseCMapReaderFactory);

          exports.NodeStandardFontDataFactory = NodeStandardFontDataFactory = /*#__PURE__*/function (_BaseStandardFontData) {
            _inherits(NodeStandardFontDataFactory, _BaseStandardFontData);

            var _super3 = _createSuper(NodeStandardFontDataFactory);

            function NodeStandardFontDataFactory() {
              _classCallCheck(this, NodeStandardFontDataFactory);

              return _super3.apply(this, arguments);
            }

            _createClass(NodeStandardFontDataFactory, [{
              key: "_fetchData",
              value: function _fetchData(url) {
                return fetchData(url);
              }
            }]);

            return NodeStandardFontDataFactory;
          }(_base_factory.BaseStandardFontDataFactory);
        }
        /***/

      },
      /* 122 */

      /***/
      function (__unused_webpack_module, exports, __w_pdfjs_require__) {
        "use strict";

        Object.defineProperty(exports, "__esModule", {
          value: true
        });
        exports.AnnotationStorage = void 0;

        var _util = __w_pdfjs_require__(4);

        function _slicedToArray(arr, i) {
          return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
        }

        function _nonIterableRest() {
          throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
        }

        function _unsupportedIterableToArray(o, minLen) {
          if (!o) return;
          if (typeof o === "string") return _arrayLikeToArray(o, minLen);
          var n = Object.prototype.toString.call(o).slice(8, -1);
          if (n === "Object" && o.constructor) n = o.constructor.name;
          if (n === "Map" || n === "Set") return Array.from(o);
          if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
        }

        function _arrayLikeToArray(arr, len) {
          if (len == null || len > arr.length) len = arr.length;

          for (var i = 0, arr2 = new Array(len); i < len; i++) {
            arr2[i] = arr[i];
          }

          return arr2;
        }

        function _iterableToArrayLimit(arr, i) {
          var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];

          if (_i == null) return;
          var _arr = [];
          var _n = true;
          var _d = false;

          var _s, _e;

          try {
            for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
              _arr.push(_s.value);

              if (i && _arr.length === i) break;
            }
          } catch (err) {
            _d = true;
            _e = err;
          } finally {
            try {
              if (!_n && _i["return"] != null) _i["return"]();
            } finally {
              if (_d) throw _e;
            }
          }

          return _arr;
        }

        function _arrayWithHoles(arr) {
          if (Array.isArray(arr)) return arr;
        }

        function _classCallCheck(instance, Constructor) {
          if (!(instance instanceof Constructor)) {
            throw new TypeError("Cannot call a class as a function");
          }
        }

        function _defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];
            descriptor.enumerable = descriptor.enumerable || false;
            descriptor.configurable = true;
            if ("value" in descriptor) descriptor.writable = true;
            Object.defineProperty(target, descriptor.key, descriptor);
          }
        }

        function _createClass(Constructor, protoProps, staticProps) {
          if (protoProps) _defineProperties(Constructor.prototype, protoProps);
          if (staticProps) _defineProperties(Constructor, staticProps);
          return Constructor;
        }

        var AnnotationStorage = /*#__PURE__*/function () {
          function AnnotationStorage() {
            _classCallCheck(this, AnnotationStorage);

            this._storage = new Map();
            this._timeStamp = Date.now();
            this._modified = false;
            this.onSetModified = null;
            this.onResetModified = null;
          }

          _createClass(AnnotationStorage, [{
            key: "getValue",
            value: function getValue(key, defaultValue) {
              var value = this._storage.get(key);

              if (value === undefined) {
                return defaultValue;
              }

              return Object.assign(defaultValue, value);
            }
          }, {
            key: "setValue",
            value: function setValue(key, value) {
              var obj = this._storage.get(key);

              var modified = false;

              if (obj !== undefined) {
                for (var _i = 0, _Object$entries = Object.entries(value); _i < _Object$entries.length; _i++) {
                  var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
                      entry = _Object$entries$_i[0],
                      val = _Object$entries$_i[1];

                  if (obj[entry] !== val) {
                    modified = true;
                    obj[entry] = val;
                  }
                }
              } else {
                modified = true;

                this._storage.set(key, value);
              }

              if (modified) {
                this._timeStamp = Date.now();

                this._setModified();
              }
            }
          }, {
            key: "getAll",
            value: function getAll() {
              return this._storage.size > 0 ? (0, _util.objectFromMap)(this._storage) : null;
            }
          }, {
            key: "size",
            get: function get() {
              return this._storage.size;
            }
          }, {
            key: "_setModified",
            value: function _setModified() {
              if (!this._modified) {
                this._modified = true;

                if (typeof this.onSetModified === "function") {
                  this.onSetModified();
                }
              }
            }
          }, {
            key: "resetModified",
            value: function resetModified() {
              if (this._modified) {
                this._modified = false;

                if (typeof this.onResetModified === "function") {
                  this.onResetModified();
                }
              }
            }
          }, {
            key: "serializable",
            get: function get() {
              return this._storage.size > 0 ? this._storage : null;
            }
          }, {
            key: "lastModified",
            get: function get() {
              return this._timeStamp.toString();
            }
          }]);

          return AnnotationStorage;
        }();

        exports.AnnotationStorage = AnnotationStorage;
        /***/
      },
      /* 123 */

      /***/
      function (__unused_webpack_module, exports, __w_pdfjs_require__) {
        "use strict";

        Object.defineProperty(exports, "__esModule", {
          value: true
        });
        exports.CanvasGraphics = void 0;

        var _util = __w_pdfjs_require__(4);

        var _pattern_helper = __w_pdfjs_require__(124);

        var _display_utils = __w_pdfjs_require__(1);

        function _typeof(obj) {
          "@babel/helpers - typeof";

          if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
            _typeof = function _typeof(obj) {
              return typeof obj;
            };
          } else {
            _typeof = function _typeof(obj) {
              return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
            };
          }

          return _typeof(obj);
        }

        function _createForOfIteratorHelper(o, allowArrayLike) {
          var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];

          if (!it) {
            if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
              if (it) o = it;
              var i = 0;

              var F = function F() {};

              return {
                s: F,
                n: function n() {
                  if (i >= o.length) return {
                    done: true
                  };
                  return {
                    done: false,
                    value: o[i++]
                  };
                },
                e: function e(_e2) {
                  throw _e2;
                },
                f: F
              };
            }

            throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
          }

          var normalCompletion = true,
              didErr = false,
              err;
          return {
            s: function s() {
              it = it.call(o);
            },
            n: function n() {
              var step = it.next();
              normalCompletion = step.done;
              return step;
            },
            e: function e(_e3) {
              didErr = true;
              err = _e3;
            },
            f: function f() {
              try {
                if (!normalCompletion && it["return"] != null) it["return"]();
              } finally {
                if (didErr) throw err;
              }
            }
          };
        }

        function _classCallCheck(instance, Constructor) {
          if (!(instance instanceof Constructor)) {
            throw new TypeError("Cannot call a class as a function");
          }
        }

        function _defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];
            descriptor.enumerable = descriptor.enumerable || false;
            descriptor.configurable = true;
            if ("value" in descriptor) descriptor.writable = true;
            Object.defineProperty(target, descriptor.key, descriptor);
          }
        }

        function _createClass(Constructor, protoProps, staticProps) {
          if (protoProps) _defineProperties(Constructor.prototype, protoProps);
          if (staticProps) _defineProperties(Constructor, staticProps);
          return Constructor;
        }

        function _slicedToArray(arr, i) {
          return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
        }

        function _nonIterableRest() {
          throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
        }

        function _unsupportedIterableToArray(o, minLen) {
          if (!o) return;
          if (typeof o === "string") return _arrayLikeToArray(o, minLen);
          var n = Object.prototype.toString.call(o).slice(8, -1);
          if (n === "Object" && o.constructor) n = o.constructor.name;
          if (n === "Map" || n === "Set") return Array.from(o);
          if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
        }

        function _arrayLikeToArray(arr, len) {
          if (len == null || len > arr.length) len = arr.length;

          for (var i = 0, arr2 = new Array(len); i < len; i++) {
            arr2[i] = arr[i];
          }

          return arr2;
        }

        function _iterableToArrayLimit(arr, i) {
          var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];

          if (_i == null) return;
          var _arr = [];
          var _n = true;
          var _d = false;

          var _s, _e;

          try {
            for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
              _arr.push(_s.value);

              if (i && _arr.length === i) break;
            }
          } catch (err) {
            _d = true;
            _e = err;
          } finally {
            try {
              if (!_n && _i["return"] != null) _i["return"]();
            } finally {
              if (_d) throw _e;
            }
          }

          return _arr;
        }

        function _arrayWithHoles(arr) {
          if (Array.isArray(arr)) return arr;
        }

        var MIN_FONT_SIZE = 16;
        var MAX_FONT_SIZE = 100;
        var MAX_GROUP_SIZE = 4096;
        var MAX_CACHED_CANVAS_PATTERNS = 2;
        var EXECUTION_TIME = 15;
        var EXECUTION_STEPS = 10;
        var COMPILE_TYPE3_GLYPHS = true;
        var MAX_SIZE_TO_COMPILE = 1000;
        var FULL_CHUNK_HEIGHT = 16;
        var LINEWIDTH_SCALE_FACTOR = 1.000001;

        function addContextCurrentTransform(ctx) {
          if (ctx.mozCurrentTransform) {
            return;
          }

          ctx._originalSave = ctx.save;
          ctx._originalRestore = ctx.restore;
          ctx._originalRotate = ctx.rotate;
          ctx._originalScale = ctx.scale;
          ctx._originalTranslate = ctx.translate;
          ctx._originalTransform = ctx.transform;
          ctx._originalSetTransform = ctx.setTransform;
          ctx._originalResetTransform = ctx.resetTransform;
          ctx._transformMatrix = ctx._transformMatrix || [1, 0, 0, 1, 0, 0];
          ctx._transformStack = [];

          try {
            var desc = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(ctx), "lineWidth");
            ctx._setLineWidth = desc.set;
            ctx._getLineWidth = desc.get;
            Object.defineProperty(ctx, "lineWidth", {
              set: function setLineWidth(width) {
                this._setLineWidth(width * LINEWIDTH_SCALE_FACTOR);
              },
              get: function getLineWidth() {
                return this._getLineWidth();
              }
            });
          } catch (_) {}

          Object.defineProperty(ctx, "mozCurrentTransform", {
            get: function getCurrentTransform() {
              return this._transformMatrix;
            }
          });
          Object.defineProperty(ctx, "mozCurrentTransformInverse", {
            get: function getCurrentTransformInverse() {
              var _this$_transformMatri = _slicedToArray(this._transformMatrix, 6),
                  a = _this$_transformMatri[0],
                  b = _this$_transformMatri[1],
                  c = _this$_transformMatri[2],
                  d = _this$_transformMatri[3],
                  e = _this$_transformMatri[4],
                  f = _this$_transformMatri[5];

              var ad_bc = a * d - b * c;
              var bc_ad = b * c - a * d;
              return [d / ad_bc, b / bc_ad, c / bc_ad, a / ad_bc, (d * e - c * f) / bc_ad, (b * e - a * f) / ad_bc];
            }
          });

          ctx.save = function ctxSave() {
            var old = this._transformMatrix;

            this._transformStack.push(old);

            this._transformMatrix = old.slice(0, 6);

            this._originalSave();
          };

          ctx.restore = function ctxRestore() {
            var prev = this._transformStack.pop();

            if (prev) {
              this._transformMatrix = prev;

              this._originalRestore();
            }
          };

          ctx.translate = function ctxTranslate(x, y) {
            var m = this._transformMatrix;
            m[4] = m[0] * x + m[2] * y + m[4];
            m[5] = m[1] * x + m[3] * y + m[5];

            this._originalTranslate(x, y);
          };

          ctx.scale = function ctxScale(x, y) {
            var m = this._transformMatrix;
            m[0] *= x;
            m[1] *= x;
            m[2] *= y;
            m[3] *= y;

            this._originalScale(x, y);
          };

          ctx.transform = function ctxTransform(a, b, c, d, e, f) {
            var m = this._transformMatrix;
            this._transformMatrix = [m[0] * a + m[2] * b, m[1] * a + m[3] * b, m[0] * c + m[2] * d, m[1] * c + m[3] * d, m[0] * e + m[2] * f + m[4], m[1] * e + m[3] * f + m[5]];

            ctx._originalTransform(a, b, c, d, e, f);
          };

          ctx.setTransform = function ctxSetTransform(a, b, c, d, e, f) {
            this._transformMatrix = [a, b, c, d, e, f];

            ctx._originalSetTransform(a, b, c, d, e, f);
          };

          ctx.resetTransform = function ctxResetTransform() {
            this._transformMatrix = [1, 0, 0, 1, 0, 0];

            ctx._originalResetTransform();
          };

          ctx.rotate = function ctxRotate(angle) {
            var cosValue = Math.cos(angle);
            var sinValue = Math.sin(angle);
            var m = this._transformMatrix;
            this._transformMatrix = [m[0] * cosValue + m[2] * sinValue, m[1] * cosValue + m[3] * sinValue, m[0] * -sinValue + m[2] * cosValue, m[1] * -sinValue + m[3] * cosValue, m[4], m[5]];

            this._originalRotate(angle);
          };
        }

        var CachedCanvases = /*#__PURE__*/function () {
          function CachedCanvases(canvasFactory) {
            _classCallCheck(this, CachedCanvases);

            this.canvasFactory = canvasFactory;
            this.cache = Object.create(null);
          }

          _createClass(CachedCanvases, [{
            key: "getCanvas",
            value: function getCanvas(id, width, height, trackTransform) {
              var canvasEntry;

              if (this.cache[id] !== undefined) {
                canvasEntry = this.cache[id];
                this.canvasFactory.reset(canvasEntry, width, height);
                canvasEntry.context.setTransform(1, 0, 0, 1, 0, 0);
              } else {
                canvasEntry = this.canvasFactory.create(width, height);
                this.cache[id] = canvasEntry;
              }

              if (trackTransform) {
                addContextCurrentTransform(canvasEntry.context);
              }

              return canvasEntry;
            }
          }, {
            key: "clear",
            value: function clear() {
              for (var id in this.cache) {
                var canvasEntry = this.cache[id];
                this.canvasFactory.destroy(canvasEntry);
                delete this.cache[id];
              }
            }
          }]);

          return CachedCanvases;
        }();

        var LRUCache = /*#__PURE__*/function () {
          function LRUCache() {
            var maxSize = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;

            _classCallCheck(this, LRUCache);

            this._cache = new Map();
            this._maxSize = maxSize;
          }

          _createClass(LRUCache, [{
            key: "has",
            value: function has(key) {
              return this._cache.has(key);
            }
          }, {
            key: "get",
            value: function get(key) {
              if (this._cache.has(key)) {
                var value = this._cache.get(key);

                this._cache["delete"](key);

                this._cache.set(key, value);
              }

              return this._cache.get(key);
            }
          }, {
            key: "set",
            value: function set(key, value) {
              if (this._maxSize <= 0) {
                return;
              }

              if (this._cache.size + 1 > this._maxSize) {
                this._cache["delete"](this._cache.keys().next().value);
              }

              this._cache.set(key, value);
            }
          }, {
            key: "clear",
            value: function clear() {
              this._cache.clear();
            }
          }]);

          return LRUCache;
        }();

        function compileType3Glyph(imgData) {
          var POINT_TO_PROCESS_LIMIT = 1000;
          var POINT_TYPES = new Uint8Array([0, 2, 4, 0, 1, 0, 5, 4, 8, 10, 0, 8, 0, 2, 1, 0]);
          var width = imgData.width,
              height = imgData.height,
              width1 = width + 1;
          var i, ii, j, j0;
          var points = new Uint8Array(width1 * (height + 1));
          var lineSize = width + 7 & ~7,
              data0 = imgData.data;
          var data = new Uint8Array(lineSize * height);
          var pos = 0;

          for (i = 0, ii = data0.length; i < ii; i++) {
            var elem = data0[i];
            var mask = 128;

            while (mask > 0) {
              data[pos++] = elem & mask ? 0 : 255;
              mask >>= 1;
            }
          }

          var count = 0;
          pos = 0;

          if (data[pos] !== 0) {
            points[0] = 1;
            ++count;
          }

          for (j = 1; j < width; j++) {
            if (data[pos] !== data[pos + 1]) {
              points[j] = data[pos] ? 2 : 1;
              ++count;
            }

            pos++;
          }

          if (data[pos] !== 0) {
            points[j] = 2;
            ++count;
          }

          for (i = 1; i < height; i++) {
            pos = i * lineSize;
            j0 = i * width1;

            if (data[pos - lineSize] !== data[pos]) {
              points[j0] = data[pos] ? 1 : 8;
              ++count;
            }

            var sum = (data[pos] ? 4 : 0) + (data[pos - lineSize] ? 8 : 0);

            for (j = 1; j < width; j++) {
              sum = (sum >> 2) + (data[pos + 1] ? 4 : 0) + (data[pos - lineSize + 1] ? 8 : 0);

              if (POINT_TYPES[sum]) {
                points[j0 + j] = POINT_TYPES[sum];
                ++count;
              }

              pos++;
            }

            if (data[pos - lineSize] !== data[pos]) {
              points[j0 + j] = data[pos] ? 2 : 4;
              ++count;
            }

            if (count > POINT_TO_PROCESS_LIMIT) {
              return null;
            }
          }

          pos = lineSize * (height - 1);
          j0 = i * width1;

          if (data[pos] !== 0) {
            points[j0] = 8;
            ++count;
          }

          for (j = 1; j < width; j++) {
            if (data[pos] !== data[pos + 1]) {
              points[j0 + j] = data[pos] ? 4 : 8;
              ++count;
            }

            pos++;
          }

          if (data[pos] !== 0) {
            points[j0 + j] = 4;
            ++count;
          }

          if (count > POINT_TO_PROCESS_LIMIT) {
            return null;
          }

          var steps = new Int32Array([0, width1, -1, 0, -width1, 0, 0, 0, 1]);
          var outlines = [];

          for (i = 0; count && i <= height; i++) {
            var p = i * width1;
            var end = p + width;

            while (p < end && !points[p]) {
              p++;
            }

            if (p === end) {
              continue;
            }

            var coords = [p % width1, i];
            var p0 = p;
            var type = points[p];

            do {
              var step = steps[type];

              do {
                p += step;
              } while (!points[p]);

              var pp = points[p];

              if (pp !== 5 && pp !== 10) {
                type = pp;
                points[p] = 0;
              } else {
                type = pp & 0x33 * type >> 4;
                points[p] &= type >> 2 | type << 2;
              }

              coords.push(p % width1, p / width1 | 0);

              if (!points[p]) {
                --count;
              }
            } while (p0 !== p);

            outlines.push(coords);
            --i;
          }

          var drawOutline = function drawOutline(c) {
            c.save();
            c.scale(1 / width, -1 / height);
            c.translate(0, -height);
            c.beginPath();

            for (var k = 0, kk = outlines.length; k < kk; k++) {
              var o = outlines[k];
              c.moveTo(o[0], o[1]);

              for (var l = 2, ll = o.length; l < ll; l += 2) {
                c.lineTo(o[l], o[l + 1]);
              }
            }

            c.fill();
            c.beginPath();
            c.restore();
          };

          return drawOutline;
        }

        var CanvasExtraState = /*#__PURE__*/function () {
          function CanvasExtraState() {
            _classCallCheck(this, CanvasExtraState);

            this.alphaIsShape = false;
            this.fontSize = 0;
            this.fontSizeScale = 1;
            this.textMatrix = _util.IDENTITY_MATRIX;
            this.textMatrixScale = 1;
            this.fontMatrix = _util.FONT_IDENTITY_MATRIX;
            this.leading = 0;
            this.x = 0;
            this.y = 0;
            this.lineX = 0;
            this.lineY = 0;
            this.charSpacing = 0;
            this.wordSpacing = 0;
            this.textHScale = 1;
            this.textRenderingMode = _util.TextRenderingMode.FILL;
            this.textRise = 0;
            this.fillColor = "#000000";
            this.strokeColor = "#000000";
            this.patternFill = false;
            this.fillAlpha = 1;
            this.strokeAlpha = 1;
            this.lineWidth = 1;
            this.activeSMask = null;
            this.resumeSMaskCtx = null;
            this.transferMaps = null;
          }

          _createClass(CanvasExtraState, [{
            key: "clone",
            value: function clone() {
              return Object.create(this);
            }
          }, {
            key: "setCurrentPoint",
            value: function setCurrentPoint(x, y) {
              this.x = x;
              this.y = y;
            }
          }]);

          return CanvasExtraState;
        }();

        function putBinaryImageData(ctx, imgData) {
          var transferMaps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;

          if (typeof ImageData !== "undefined" && imgData instanceof ImageData) {
            ctx.putImageData(imgData, 0, 0);
            return;
          }

          var height = imgData.height,
              width = imgData.width;
          var partialChunkHeight = height % FULL_CHUNK_HEIGHT;
          var fullChunks = (height - partialChunkHeight) / FULL_CHUNK_HEIGHT;
          var totalChunks = partialChunkHeight === 0 ? fullChunks : fullChunks + 1;
          var chunkImgData = ctx.createImageData(width, FULL_CHUNK_HEIGHT);
          var srcPos = 0,
              destPos;
          var src = imgData.data;
          var dest = chunkImgData.data;
          var i, j, thisChunkHeight, elemsInThisChunk;
          var transferMapRed, transferMapGreen, transferMapBlue, transferMapGray;

          if (transferMaps) {
            switch (transferMaps.length) {
              case 1:
                transferMapRed = transferMaps[0];
                transferMapGreen = transferMaps[0];
                transferMapBlue = transferMaps[0];
                transferMapGray = transferMaps[0];
                break;

              case 4:
                transferMapRed = transferMaps[0];
                transferMapGreen = transferMaps[1];
                transferMapBlue = transferMaps[2];
                transferMapGray = transferMaps[3];
                break;
            }
          }

          if (imgData.kind === _util.ImageKind.GRAYSCALE_1BPP) {
            var srcLength = src.byteLength;
            var dest32 = new Uint32Array(dest.buffer, 0, dest.byteLength >> 2);
            var dest32DataLength = dest32.length;
            var fullSrcDiff = width + 7 >> 3;
            var white = 0xffffffff;
            var black = _util.IsLittleEndianCached.value ? 0xff000000 : 0x000000ff;

            if (transferMapGray) {
              if (transferMapGray[0] === 0xff && transferMapGray[0xff] === 0) {
                var _ref = [black, white];
                white = _ref[0];
                black = _ref[1];
              }
            }

            for (i = 0; i < totalChunks; i++) {
              thisChunkHeight = i < fullChunks ? FULL_CHUNK_HEIGHT : partialChunkHeight;
              destPos = 0;

              for (j = 0; j < thisChunkHeight; j++) {
                var srcDiff = srcLength - srcPos;
                var k = 0;
                var kEnd = srcDiff > fullSrcDiff ? width : srcDiff * 8 - 7;
                var kEndUnrolled = kEnd & ~7;
                var mask = 0;
                var srcByte = 0;

                for (; k < kEndUnrolled; k += 8) {
                  srcByte = src[srcPos++];
                  dest32[destPos++] = srcByte & 128 ? white : black;
                  dest32[destPos++] = srcByte & 64 ? white : black;
                  dest32[destPos++] = srcByte & 32 ? white : black;
                  dest32[destPos++] = srcByte & 16 ? white : black;
                  dest32[destPos++] = srcByte & 8 ? white : black;
                  dest32[destPos++] = srcByte & 4 ? white : black;
                  dest32[destPos++] = srcByte & 2 ? white : black;
                  dest32[destPos++] = srcByte & 1 ? white : black;
                }

                for (; k < kEnd; k++) {
                  if (mask === 0) {
                    srcByte = src[srcPos++];
                    mask = 128;
                  }

                  dest32[destPos++] = srcByte & mask ? white : black;
                  mask >>= 1;
                }
              }

              while (destPos < dest32DataLength) {
                dest32[destPos++] = 0;
              }

              ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT);
            }
          } else if (imgData.kind === _util.ImageKind.RGBA_32BPP) {
            var hasTransferMaps = !!(transferMapRed || transferMapGreen || transferMapBlue);
            j = 0;
            elemsInThisChunk = width * FULL_CHUNK_HEIGHT * 4;

            for (i = 0; i < fullChunks; i++) {
              dest.set(src.subarray(srcPos, srcPos + elemsInThisChunk));
              srcPos += elemsInThisChunk;

              if (hasTransferMaps) {
                for (var _k = 0; _k < elemsInThisChunk; _k += 4) {
                  if (transferMapRed) {
                    dest[_k + 0] = transferMapRed[dest[_k + 0]];
                  }

                  if (transferMapGreen) {
                    dest[_k + 1] = transferMapGreen[dest[_k + 1]];
                  }

                  if (transferMapBlue) {
                    dest[_k + 2] = transferMapBlue[dest[_k + 2]];
                  }
                }
              }

              ctx.putImageData(chunkImgData, 0, j);
              j += FULL_CHUNK_HEIGHT;
            }

            if (i < totalChunks) {
              elemsInThisChunk = width * partialChunkHeight * 4;
              dest.set(src.subarray(srcPos, srcPos + elemsInThisChunk));

              if (hasTransferMaps) {
                for (var _k2 = 0; _k2 < elemsInThisChunk; _k2 += 4) {
                  if (transferMapRed) {
                    dest[_k2 + 0] = transferMapRed[dest[_k2 + 0]];
                  }

                  if (transferMapGreen) {
                    dest[_k2 + 1] = transferMapGreen[dest[_k2 + 1]];
                  }

                  if (transferMapBlue) {
                    dest[_k2 + 2] = transferMapBlue[dest[_k2 + 2]];
                  }
                }
              }

              ctx.putImageData(chunkImgData, 0, j);
            }
          } else if (imgData.kind === _util.ImageKind.RGB_24BPP) {
            var _hasTransferMaps = !!(transferMapRed || transferMapGreen || transferMapBlue);

            thisChunkHeight = FULL_CHUNK_HEIGHT;
            elemsInThisChunk = width * thisChunkHeight;

            for (i = 0; i < totalChunks; i++) {
              if (i >= fullChunks) {
                thisChunkHeight = partialChunkHeight;
                elemsInThisChunk = width * thisChunkHeight;
              }

              destPos = 0;

              for (j = elemsInThisChunk; j--;) {
                dest[destPos++] = src[srcPos++];
                dest[destPos++] = src[srcPos++];
                dest[destPos++] = src[srcPos++];
                dest[destPos++] = 255;
              }

              if (_hasTransferMaps) {
                for (var _k3 = 0; _k3 < destPos; _k3 += 4) {
                  if (transferMapRed) {
                    dest[_k3 + 0] = transferMapRed[dest[_k3 + 0]];
                  }

                  if (transferMapGreen) {
                    dest[_k3 + 1] = transferMapGreen[dest[_k3 + 1]];
                  }

                  if (transferMapBlue) {
                    dest[_k3 + 2] = transferMapBlue[dest[_k3 + 2]];
                  }
                }
              }

              ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT);
            }
          } else {
            throw new Error("bad image kind: ".concat(imgData.kind));
          }
        }

        function putBinaryImageMask(ctx, imgData) {
          var height = imgData.height,
              width = imgData.width;
          var partialChunkHeight = height % FULL_CHUNK_HEIGHT;
          var fullChunks = (height - partialChunkHeight) / FULL_CHUNK_HEIGHT;
          var totalChunks = partialChunkHeight === 0 ? fullChunks : fullChunks + 1;
          var chunkImgData = ctx.createImageData(width, FULL_CHUNK_HEIGHT);
          var srcPos = 0;
          var src = imgData.data;
          var dest = chunkImgData.data;

          for (var i = 0; i < totalChunks; i++) {
            var thisChunkHeight = i < fullChunks ? FULL_CHUNK_HEIGHT : partialChunkHeight;
            var destPos = 3;

            for (var j = 0; j < thisChunkHeight; j++) {
              var elem = void 0,
                  mask = 0;

              for (var k = 0; k < width; k++) {
                if (!mask) {
                  elem = src[srcPos++];
                  mask = 128;
                }

                dest[destPos] = elem & mask ? 0 : 255;
                destPos += 4;
                mask >>= 1;
              }
            }

            ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT);
          }
        }

        function copyCtxState(sourceCtx, destCtx) {
          var properties = ["strokeStyle", "fillStyle", "fillRule", "globalAlpha", "lineWidth", "lineCap", "lineJoin", "miterLimit", "globalCompositeOperation", "font"];

          for (var i = 0, ii = properties.length; i < ii; i++) {
            var property = properties[i];

            if (sourceCtx[property] !== undefined) {
              destCtx[property] = sourceCtx[property];
            }
          }

          if (sourceCtx.setLineDash !== undefined) {
            destCtx.setLineDash(sourceCtx.getLineDash());
            destCtx.lineDashOffset = sourceCtx.lineDashOffset;
          }
        }

        function resetCtxToDefault(ctx) {
          ctx.strokeStyle = "#000000";
          ctx.fillStyle = "#000000";
          ctx.fillRule = "nonzero";
          ctx.globalAlpha = 1;
          ctx.lineWidth = 1;
          ctx.lineCap = "butt";
          ctx.lineJoin = "miter";
          ctx.miterLimit = 10;
          ctx.globalCompositeOperation = "source-over";
          ctx.font = "10px sans-serif";

          if (ctx.setLineDash !== undefined) {
            ctx.setLineDash([]);
            ctx.lineDashOffset = 0;
          }
        }

        function composeSMaskBackdrop(bytes, r0, g0, b0) {
          var length = bytes.length;

          for (var i = 3; i < length; i += 4) {
            var alpha = bytes[i];

            if (alpha === 0) {
              bytes[i - 3] = r0;
              bytes[i - 2] = g0;
              bytes[i - 1] = b0;
            } else if (alpha < 255) {
              var alpha_ = 255 - alpha;
              bytes[i - 3] = bytes[i - 3] * alpha + r0 * alpha_ >> 8;
              bytes[i - 2] = bytes[i - 2] * alpha + g0 * alpha_ >> 8;
              bytes[i - 1] = bytes[i - 1] * alpha + b0 * alpha_ >> 8;
            }
          }
        }

        function composeSMaskAlpha(maskData, layerData, transferMap) {
          var length = maskData.length;
          var scale = 1 / 255;

          for (var i = 3; i < length; i += 4) {
            var alpha = transferMap ? transferMap[maskData[i]] : maskData[i];
            layerData[i] = layerData[i] * alpha * scale | 0;
          }
        }

        function composeSMaskLuminosity(maskData, layerData, transferMap) {
          var length = maskData.length;

          for (var i = 3; i < length; i += 4) {
            var y = maskData[i - 3] * 77 + maskData[i - 2] * 152 + maskData[i - 1] * 28;
            layerData[i] = transferMap ? layerData[i] * transferMap[y >> 8] >> 8 : layerData[i] * y >> 16;
          }
        }

        function genericComposeSMask(maskCtx, layerCtx, width, height, subtype, backdrop, transferMap) {
          var hasBackdrop = !!backdrop;
          var r0 = hasBackdrop ? backdrop[0] : 0;
          var g0 = hasBackdrop ? backdrop[1] : 0;
          var b0 = hasBackdrop ? backdrop[2] : 0;
          var composeFn;

          if (subtype === "Luminosity") {
            composeFn = composeSMaskLuminosity;
          } else {
            composeFn = composeSMaskAlpha;
          }

          var PIXELS_TO_PROCESS = 1048576;
          var chunkSize = Math.min(height, Math.ceil(PIXELS_TO_PROCESS / width));

          for (var row = 0; row < height; row += chunkSize) {
            var chunkHeight = Math.min(chunkSize, height - row);
            var maskData = maskCtx.getImageData(0, row, width, chunkHeight);
            var layerData = layerCtx.getImageData(0, row, width, chunkHeight);

            if (hasBackdrop) {
              composeSMaskBackdrop(maskData.data, r0, g0, b0);
            }

            composeFn(maskData.data, layerData.data, transferMap);
            maskCtx.putImageData(layerData, 0, row);
          }
        }

        function composeSMask(ctx, smask, layerCtx) {
          var mask = smask.canvas;
          var maskCtx = smask.context;
          ctx.setTransform(smask.scaleX, 0, 0, smask.scaleY, smask.offsetX, smask.offsetY);
          genericComposeSMask(maskCtx, layerCtx, mask.width, mask.height, smask.subtype, smask.backdrop, smask.transferMap);
          ctx.drawImage(mask, 0, 0);
        }

        function getImageSmoothingEnabled(transform, interpolate) {
          var scale = _util.Util.singularValueDecompose2dScale(transform);

          scale[0] = Math.fround(scale[0]);
          scale[1] = Math.fround(scale[1]);
          var actualScale = Math.fround((globalThis.devicePixelRatio || 1) * _display_utils.PixelsPerInch.PDF_TO_CSS_UNITS);

          if (interpolate !== undefined) {
            return interpolate;
          } else if (scale[0] <= actualScale || scale[1] <= actualScale) {
            return true;
          }

          return false;
        }

        var LINE_CAP_STYLES = ["butt", "round", "square"];
        var LINE_JOIN_STYLES = ["miter", "round", "bevel"];
        var NORMAL_CLIP = {};
        var EO_CLIP = {};

        var CanvasGraphics = /*#__PURE__*/function () {
          function CanvasGraphics(canvasCtx, commonObjs, objs, canvasFactory, imageLayer, optionalContentConfig) {
            _classCallCheck(this, CanvasGraphics);

            this.ctx = canvasCtx;
            this.current = new CanvasExtraState();
            this.stateStack = [];
            this.pendingClip = null;
            this.pendingEOFill = false;
            this.res = null;
            this.xobjs = null;
            this.commonObjs = commonObjs;
            this.objs = objs;
            this.canvasFactory = canvasFactory;
            this.imageLayer = imageLayer;
            this.groupStack = [];
            this.processingType3 = null;
            this.baseTransform = null;
            this.baseTransformStack = [];
            this.groupLevel = 0;
            this.smaskStack = [];
            this.smaskCounter = 0;
            this.tempSMask = null;
            this.contentVisible = true;
            this.markedContentStack = [];
            this.optionalContentConfig = optionalContentConfig;
            this.cachedCanvases = new CachedCanvases(this.canvasFactory);
            this.cachedCanvasPatterns = new LRUCache(MAX_CACHED_CANVAS_PATTERNS);
            this.cachedPatterns = new Map();

            if (canvasCtx) {
              addContextCurrentTransform(canvasCtx);
            }

            this._cachedGetSinglePixelWidth = null;
          }

          _createClass(CanvasGraphics, [{
            key: "beginDrawing",
            value: function beginDrawing(_ref2) {
              var transform = _ref2.transform,
                  viewport = _ref2.viewport,
                  _ref2$transparency = _ref2.transparency,
                  transparency = _ref2$transparency === void 0 ? false : _ref2$transparency,
                  _ref2$background = _ref2.background,
                  background = _ref2$background === void 0 ? null : _ref2$background;
              var width = this.ctx.canvas.width;
              var height = this.ctx.canvas.height;
              this.ctx.save();
              this.ctx.fillStyle = background || "rgb(255, 255, 255)";
              this.ctx.fillRect(0, 0, width, height);
              this.ctx.restore();

              if (transparency) {
                var transparentCanvas = this.cachedCanvases.getCanvas("transparent", width, height, true);
                this.compositeCtx = this.ctx;
                this.transparentCanvas = transparentCanvas.canvas;
                this.ctx = transparentCanvas.context;
                this.ctx.save();
                this.ctx.transform.apply(this.ctx, this.compositeCtx.mozCurrentTransform);
              }

              this.ctx.save();
              resetCtxToDefault(this.ctx);

              if (transform) {
                this.ctx.transform.apply(this.ctx, transform);
              }

              this.ctx.transform.apply(this.ctx, viewport.transform);
              this.baseTransform = this.ctx.mozCurrentTransform.slice();
              this._combinedScaleFactor = Math.hypot(this.baseTransform[0], this.baseTransform[2]);

              if (this.imageLayer) {
                this.imageLayer.beginLayout();
              }
            }
          }, {
            key: "executeOperatorList",
            value: function executeOperatorList(operatorList, executionStartIdx, continueCallback, stepper) {
              var argsArray = operatorList.argsArray;
              var fnArray = operatorList.fnArray;
              var i = executionStartIdx || 0;
              var argsArrayLen = argsArray.length;

              if (argsArrayLen === i) {
                return i;
              }

              var chunkOperations = argsArrayLen - i > EXECUTION_STEPS && typeof continueCallback === "function";
              var endTime = chunkOperations ? Date.now() + EXECUTION_TIME : 0;
              var steps = 0;
              var commonObjs = this.commonObjs;
              var objs = this.objs;
              var fnId;

              while (true) {
                if (stepper !== undefined && i === stepper.nextBreakPoint) {
                  stepper.breakIt(i, continueCallback);
                  return i;
                }

                fnId = fnArray[i];

                if (fnId !== _util.OPS.dependency) {
                  this[fnId].apply(this, argsArray[i]);
                } else {
                  var _iterator = _createForOfIteratorHelper(argsArray[i]),
                      _step;

                  try {
                    for (_iterator.s(); !(_step = _iterator.n()).done;) {
                      var depObjId = _step.value;
                      var objsPool = depObjId.startsWith("g_") ? commonObjs : objs;

                      if (!objsPool.has(depObjId)) {
                        objsPool.get(depObjId, continueCallback);
                        return i;
                      }
                    }
                  } catch (err) {
                    _iterator.e(err);
                  } finally {
                    _iterator.f();
                  }
                }

                i++;

                if (i === argsArrayLen) {
                  return i;
                }

                if (chunkOperations && ++steps > EXECUTION_STEPS) {
                  if (Date.now() > endTime) {
                    continueCallback();
                    return i;
                  }

                  steps = 0;
                }
              }
            }
          }, {
            key: "endDrawing",
            value: function endDrawing() {
              while (this.stateStack.length || this.current.activeSMask !== null) {
                this.restore();
              }

              this.ctx.restore();

              if (this.transparentCanvas) {
                this.ctx = this.compositeCtx;
                this.ctx.save();
                this.ctx.setTransform(1, 0, 0, 1, 0, 0);
                this.ctx.drawImage(this.transparentCanvas, 0, 0);
                this.ctx.restore();
                this.transparentCanvas = null;
              }

              this.cachedCanvases.clear();
              this.cachedCanvasPatterns.clear();
              this.cachedPatterns.clear();

              if (this.imageLayer) {
                this.imageLayer.endLayout();
              }
            }
          }, {
            key: "_scaleImage",
            value: function _scaleImage(img, inverseTransform) {
              var width = img.width;
              var height = img.height;
              var widthScale = Math.max(Math.hypot(inverseTransform[0], inverseTransform[1]), 1);
              var heightScale = Math.max(Math.hypot(inverseTransform[2], inverseTransform[3]), 1);
              var paintWidth = width,
                  paintHeight = height;
              var tmpCanvasId = "prescale1";
              var tmpCanvas, tmpCtx;

              while (widthScale > 2 && paintWidth > 1 || heightScale > 2 && paintHeight > 1) {
                var newWidth = paintWidth,
                    newHeight = paintHeight;

                if (widthScale > 2 && paintWidth > 1) {
                  newWidth = Math.ceil(paintWidth / 2);
                  widthScale /= paintWidth / newWidth;
                }

                if (heightScale > 2 && paintHeight > 1) {
                  newHeight = Math.ceil(paintHeight / 2);
                  heightScale /= paintHeight / newHeight;
                }

                tmpCanvas = this.cachedCanvases.getCanvas(tmpCanvasId, newWidth, newHeight);
                tmpCtx = tmpCanvas.context;
                tmpCtx.clearRect(0, 0, newWidth, newHeight);
                tmpCtx.drawImage(img, 0, 0, paintWidth, paintHeight, 0, 0, newWidth, newHeight);
                img = tmpCanvas.canvas;
                paintWidth = newWidth;
                paintHeight = newHeight;
                tmpCanvasId = tmpCanvasId === "prescale1" ? "prescale2" : "prescale1";
              }

              return {
                img: img,
                paintWidth: paintWidth,
                paintHeight: paintHeight
              };
            }
          }, {
            key: "_createMaskCanvas",
            value: function _createMaskCanvas(img) {
              var ctx = this.ctx;
              var width = img.width,
                  height = img.height;
              var fillColor = this.current.fillColor;
              var isPatternFill = this.current.patternFill;
              var maskCanvas = this.cachedCanvases.getCanvas("maskCanvas", width, height);
              var maskCtx = maskCanvas.context;
              putBinaryImageMask(maskCtx, img);
              var objToCanvas = ctx.mozCurrentTransform;

              var maskToCanvas = _util.Util.transform(objToCanvas, [1 / width, 0, 0, -1 / height, 0, 0]);

              maskToCanvas = _util.Util.transform(maskToCanvas, [1, 0, 0, 1, 0, -height]);

              var cord1 = _util.Util.applyTransform([0, 0], maskToCanvas);

              var cord2 = _util.Util.applyTransform([width, height], maskToCanvas);

              var rect = _util.Util.normalizeRect([cord1[0], cord1[1], cord2[0], cord2[1]]);

              var drawnWidth = Math.ceil(rect[2] - rect[0]);
              var drawnHeight = Math.ceil(rect[3] - rect[1]);
              var fillCanvas = this.cachedCanvases.getCanvas("fillCanvas", drawnWidth, drawnHeight, true);
              var fillCtx = fillCanvas.context;
              var offsetX = Math.min(cord1[0], cord2[0]);
              var offsetY = Math.min(cord1[1], cord2[1]);
              fillCtx.translate(-offsetX, -offsetY);
              fillCtx.transform.apply(fillCtx, maskToCanvas);

              var scaled = this._scaleImage(maskCanvas.canvas, fillCtx.mozCurrentTransformInverse);

              fillCtx.imageSmoothingEnabled = getImageSmoothingEnabled(fillCtx.mozCurrentTransform, img.interpolate);
              fillCtx.drawImage(scaled.img, 0, 0, scaled.img.width, scaled.img.height, 0, 0, width, height);
              fillCtx.globalCompositeOperation = "source-in";

              var inverse = _util.Util.transform(fillCtx.mozCurrentTransformInverse, [1, 0, 0, 1, -offsetX, -offsetY]);

              fillCtx.fillStyle = isPatternFill ? fillColor.getPattern(ctx, this, inverse, false) : fillColor;
              fillCtx.fillRect(0, 0, width, height);
              return {
                canvas: fillCanvas.canvas,
                offsetX: Math.round(offsetX),
                offsetY: Math.round(offsetY)
              };
            }
          }, {
            key: "setLineWidth",
            value: function setLineWidth(width) {
              this.current.lineWidth = width;
              this.ctx.lineWidth = width;
            }
          }, {
            key: "setLineCap",
            value: function setLineCap(style) {
              this.ctx.lineCap = LINE_CAP_STYLES[style];
            }
          }, {
            key: "setLineJoin",
            value: function setLineJoin(style) {
              this.ctx.lineJoin = LINE_JOIN_STYLES[style];
            }
          }, {
            key: "setMiterLimit",
            value: function setMiterLimit(limit) {
              this.ctx.miterLimit = limit;
            }
          }, {
            key: "setDash",
            value: function setDash(dashArray, dashPhase) {
              var ctx = this.ctx;

              if (ctx.setLineDash !== undefined) {
                ctx.setLineDash(dashArray);
                ctx.lineDashOffset = dashPhase;
              }
            }
          }, {
            key: "setRenderingIntent",
            value: function setRenderingIntent(intent) {}
          }, {
            key: "setFlatness",
            value: function setFlatness(flatness) {}
          }, {
            key: "setGState",
            value: function setGState(states) {
              for (var i = 0, ii = states.length; i < ii; i++) {
                var state = states[i];
                var key = state[0];
                var value = state[1];

                switch (key) {
                  case "LW":
                    this.setLineWidth(value);
                    break;

                  case "LC":
                    this.setLineCap(value);
                    break;

                  case "LJ":
                    this.setLineJoin(value);
                    break;

                  case "ML":
                    this.setMiterLimit(value);
                    break;

                  case "D":
                    this.setDash(value[0], value[1]);
                    break;

                  case "RI":
                    this.setRenderingIntent(value);
                    break;

                  case "FL":
                    this.setFlatness(value);
                    break;

                  case "Font":
                    this.setFont(value[0], value[1]);
                    break;

                  case "CA":
                    this.current.strokeAlpha = state[1];
                    break;

                  case "ca":
                    this.current.fillAlpha = state[1];
                    this.ctx.globalAlpha = state[1];
                    break;

                  case "BM":
                    this.ctx.globalCompositeOperation = value;
                    break;

                  case "SMask":
                    if (this.current.activeSMask) {
                      if (this.stateStack.length > 0 && this.stateStack[this.stateStack.length - 1].activeSMask === this.current.activeSMask) {
                        this.suspendSMaskGroup();
                      } else {
                        this.endSMaskGroup();
                      }
                    }

                    this.current.activeSMask = value ? this.tempSMask : null;

                    if (this.current.activeSMask) {
                      this.beginSMaskGroup();
                    }

                    this.tempSMask = null;
                    break;

                  case "TR":
                    this.current.transferMaps = value;
                }
              }
            }
          }, {
            key: "beginSMaskGroup",
            value: function beginSMaskGroup() {
              var activeSMask = this.current.activeSMask;
              var drawnWidth = activeSMask.canvas.width;
              var drawnHeight = activeSMask.canvas.height;
              var cacheId = "smaskGroupAt" + this.groupLevel;
              var scratchCanvas = this.cachedCanvases.getCanvas(cacheId, drawnWidth, drawnHeight, true);
              var currentCtx = this.ctx;
              var currentTransform = currentCtx.mozCurrentTransform;
              this.ctx.save();
              var groupCtx = scratchCanvas.context;
              groupCtx.scale(1 / activeSMask.scaleX, 1 / activeSMask.scaleY);
              groupCtx.translate(-activeSMask.offsetX, -activeSMask.offsetY);
              groupCtx.transform.apply(groupCtx, currentTransform);
              activeSMask.startTransformInverse = groupCtx.mozCurrentTransformInverse;
              copyCtxState(currentCtx, groupCtx);
              this.ctx = groupCtx;
              this.setGState([["BM", "source-over"], ["ca", 1], ["CA", 1]]);
              this.groupStack.push(currentCtx);
              this.groupLevel++;
            }
          }, {
            key: "suspendSMaskGroup",
            value: function suspendSMaskGroup() {
              var groupCtx = this.ctx;
              this.groupLevel--;
              this.ctx = this.groupStack.pop();
              composeSMask(this.ctx, this.current.activeSMask, groupCtx);
              this.ctx.restore();
              this.ctx.save();
              copyCtxState(groupCtx, this.ctx);
              this.current.resumeSMaskCtx = groupCtx;

              var deltaTransform = _util.Util.transform(this.current.activeSMask.startTransformInverse, groupCtx.mozCurrentTransform);

              this.ctx.transform.apply(this.ctx, deltaTransform);
              groupCtx.save();
              groupCtx.setTransform(1, 0, 0, 1, 0, 0);
              groupCtx.clearRect(0, 0, groupCtx.canvas.width, groupCtx.canvas.height);
              groupCtx.restore();
            }
          }, {
            key: "resumeSMaskGroup",
            value: function resumeSMaskGroup() {
              var groupCtx = this.current.resumeSMaskCtx;
              var currentCtx = this.ctx;
              this.ctx = groupCtx;
              this.groupStack.push(currentCtx);
              this.groupLevel++;
            }
          }, {
            key: "endSMaskGroup",
            value: function endSMaskGroup() {
              var groupCtx = this.ctx;
              this.groupLevel--;
              this.ctx = this.groupStack.pop();
              composeSMask(this.ctx, this.current.activeSMask, groupCtx);
              this.ctx.restore();
              copyCtxState(groupCtx, this.ctx);

              var deltaTransform = _util.Util.transform(this.current.activeSMask.startTransformInverse, groupCtx.mozCurrentTransform);

              this.ctx.transform.apply(this.ctx, deltaTransform);
            }
          }, {
            key: "save",
            value: function save() {
              this.ctx.save();
              var old = this.current;
              this.stateStack.push(old);
              this.current = old.clone();
              this.current.resumeSMaskCtx = null;
            }
          }, {
            key: "restore",
            value: function restore() {
              if (this.current.resumeSMaskCtx) {
                this.resumeSMaskGroup();
              }

              if (this.current.activeSMask !== null && (this.stateStack.length === 0 || this.stateStack[this.stateStack.length - 1].activeSMask !== this.current.activeSMask)) {
                this.endSMaskGroup();
              }

              if (this.stateStack.length !== 0) {
                this.current = this.stateStack.pop();
                this.ctx.restore();
                this.pendingClip = null;
                this._cachedGetSinglePixelWidth = null;
              } else {
                this.current.activeSMask = null;
              }
            }
          }, {
            key: "transform",
            value: function transform(a, b, c, d, e, f) {
              this.ctx.transform(a, b, c, d, e, f);
              this._cachedGetSinglePixelWidth = null;
            }
          }, {
            key: "constructPath",
            value: function constructPath(ops, args) {
              var ctx = this.ctx;
              var current = this.current;
              var x = current.x,
                  y = current.y;

              for (var i = 0, j = 0, ii = ops.length; i < ii; i++) {
                switch (ops[i] | 0) {
                  case _util.OPS.rectangle:
                    x = args[j++];
                    y = args[j++];
                    var width = args[j++];
                    var height = args[j++];
                    var xw = x + width;
                    var yh = y + height;
                    ctx.moveTo(x, y);

                    if (width === 0 || height === 0) {
                      ctx.lineTo(xw, yh);
                    } else {
                      ctx.lineTo(xw, y);
                      ctx.lineTo(xw, yh);
                      ctx.lineTo(x, yh);
                    }

                    ctx.closePath();
                    break;

                  case _util.OPS.moveTo:
                    x = args[j++];
                    y = args[j++];
                    ctx.moveTo(x, y);
                    break;

                  case _util.OPS.lineTo:
                    x = args[j++];
                    y = args[j++];
                    ctx.lineTo(x, y);
                    break;

                  case _util.OPS.curveTo:
                    x = args[j + 4];
                    y = args[j + 5];
                    ctx.bezierCurveTo(args[j], args[j + 1], args[j + 2], args[j + 3], x, y);
                    j += 6;
                    break;

                  case _util.OPS.curveTo2:
                    ctx.bezierCurveTo(x, y, args[j], args[j + 1], args[j + 2], args[j + 3]);
                    x = args[j + 2];
                    y = args[j + 3];
                    j += 4;
                    break;

                  case _util.OPS.curveTo3:
                    x = args[j + 2];
                    y = args[j + 3];
                    ctx.bezierCurveTo(args[j], args[j + 1], x, y, x, y);
                    j += 4;
                    break;

                  case _util.OPS.closePath:
                    ctx.closePath();
                    break;
                }
              }

              current.setCurrentPoint(x, y);
            }
          }, {
            key: "closePath",
            value: function closePath() {
              this.ctx.closePath();
            }
          }, {
            key: "stroke",
            value: function stroke(consumePath) {
              consumePath = typeof consumePath !== "undefined" ? consumePath : true;
              var ctx = this.ctx;
              var strokeColor = this.current.strokeColor;
              ctx.globalAlpha = this.current.strokeAlpha;

              if (this.contentVisible) {
                if (_typeof(strokeColor) === "object" && strokeColor !== null && strokeColor !== void 0 && strokeColor.getPattern) {
                  var lineWidth = this.getSinglePixelWidth();
                  ctx.save();
                  ctx.strokeStyle = strokeColor.getPattern(ctx, this, ctx.mozCurrentTransformInverse);
                  ctx.lineWidth = Math.max(lineWidth, this.current.lineWidth);
                  ctx.stroke();
                  ctx.restore();
                } else {
                  var _lineWidth = this.getSinglePixelWidth();

                  if (_lineWidth < 0 && -_lineWidth >= this.current.lineWidth) {
                    ctx.save();
                    ctx.resetTransform();
                    ctx.lineWidth = Math.round(this._combinedScaleFactor);
                    ctx.stroke();
                    ctx.restore();
                  } else {
                    ctx.lineWidth = Math.max(_lineWidth, this.current.lineWidth);
                    ctx.stroke();
                  }
                }
              }

              if (consumePath) {
                this.consumePath();
              }

              ctx.globalAlpha = this.current.fillAlpha;
            }
          }, {
            key: "closeStroke",
            value: function closeStroke() {
              this.closePath();
              this.stroke();
            }
          }, {
            key: "fill",
            value: function fill(consumePath) {
              consumePath = typeof consumePath !== "undefined" ? consumePath : true;
              var ctx = this.ctx;
              var fillColor = this.current.fillColor;
              var isPatternFill = this.current.patternFill;
              var needRestore = false;

              if (isPatternFill) {
                ctx.save();
                ctx.fillStyle = fillColor.getPattern(ctx, this, ctx.mozCurrentTransformInverse);
                needRestore = true;
              }

              if (this.contentVisible) {
                if (this.pendingEOFill) {
                  ctx.fill("evenodd");
                  this.pendingEOFill = false;
                } else {
                  ctx.fill();
                }
              }

              if (needRestore) {
                ctx.restore();
              }

              if (consumePath) {
                this.consumePath();
              }
            }
          }, {
            key: "eoFill",
            value: function eoFill() {
              this.pendingEOFill = true;
              this.fill();
            }
          }, {
            key: "fillStroke",
            value: function fillStroke() {
              this.fill(false);
              this.stroke(false);
              this.consumePath();
            }
          }, {
            key: "eoFillStroke",
            value: function eoFillStroke() {
              this.pendingEOFill = true;
              this.fillStroke();
            }
          }, {
            key: "closeFillStroke",
            value: function closeFillStroke() {
              this.closePath();
              this.fillStroke();
            }
          }, {
            key: "closeEOFillStroke",
            value: function closeEOFillStroke() {
              this.pendingEOFill = true;
              this.closePath();
              this.fillStroke();
            }
          }, {
            key: "endPath",
            value: function endPath() {
              this.consumePath();
            }
          }, {
            key: "clip",
            value: function clip() {
              this.pendingClip = NORMAL_CLIP;
            }
          }, {
            key: "eoClip",
            value: function eoClip() {
              this.pendingClip = EO_CLIP;
            }
          }, {
            key: "beginText",
            value: function beginText() {
              this.current.textMatrix = _util.IDENTITY_MATRIX;
              this.current.textMatrixScale = 1;
              this.current.x = this.current.lineX = 0;
              this.current.y = this.current.lineY = 0;
            }
          }, {
            key: "endText",
            value: function endText() {
              var paths = this.pendingTextPaths;
              var ctx = this.ctx;

              if (paths === undefined) {
                ctx.beginPath();
                return;
              }

              ctx.save();
              ctx.beginPath();

              for (var i = 0; i < paths.length; i++) {
                var path = paths[i];
                ctx.setTransform.apply(ctx, path.transform);
                ctx.translate(path.x, path.y);
                path.addToPath(ctx, path.fontSize);
              }

              ctx.restore();
              ctx.clip();
              ctx.beginPath();
              delete this.pendingTextPaths;
            }
          }, {
            key: "setCharSpacing",
            value: function setCharSpacing(spacing) {
              this.current.charSpacing = spacing;
            }
          }, {
            key: "setWordSpacing",
            value: function setWordSpacing(spacing) {
              this.current.wordSpacing = spacing;
            }
          }, {
            key: "setHScale",
            value: function setHScale(scale) {
              this.current.textHScale = scale / 100;
            }
          }, {
            key: "setLeading",
            value: function setLeading(leading) {
              this.current.leading = -leading;
            }
          }, {
            key: "setFont",
            value: function setFont(fontRefName, size) {
              var fontObj = this.commonObjs.get(fontRefName);
              var current = this.current;

              if (!fontObj) {
                throw new Error("Can't find font for ".concat(fontRefName));
              }

              current.fontMatrix = fontObj.fontMatrix || _util.FONT_IDENTITY_MATRIX;

              if (current.fontMatrix[0] === 0 || current.fontMatrix[3] === 0) {
                (0, _util.warn)("Invalid font matrix for font " + fontRefName);
              }

              if (size < 0) {
                size = -size;
                current.fontDirection = -1;
              } else {
                current.fontDirection = 1;
              }

              this.current.font = fontObj;
              this.current.fontSize = size;

              if (fontObj.isType3Font) {
                return;
              }

              var name = fontObj.loadedName || "sans-serif";
              var bold = "normal";

              if (fontObj.black) {
                bold = "900";
              } else if (fontObj.bold) {
                bold = "bold";
              }

              var italic = fontObj.italic ? "italic" : "normal";
              var typeface = "\"".concat(name, "\", ").concat(fontObj.fallbackName);
              var browserFontSize = size;

              if (size < MIN_FONT_SIZE) {
                browserFontSize = MIN_FONT_SIZE;
              } else if (size > MAX_FONT_SIZE) {
                browserFontSize = MAX_FONT_SIZE;
              }

              this.current.fontSizeScale = size / browserFontSize;
              this.ctx.font = "".concat(italic, " ").concat(bold, " ").concat(browserFontSize, "px ").concat(typeface);
            }
          }, {
            key: "setTextRenderingMode",
            value: function setTextRenderingMode(mode) {
              this.current.textRenderingMode = mode;
            }
          }, {
            key: "setTextRise",
            value: function setTextRise(rise) {
              this.current.textRise = rise;
            }
          }, {
            key: "moveText",
            value: function moveText(x, y) {
              this.current.x = this.current.lineX += x;
              this.current.y = this.current.lineY += y;
            }
          }, {
            key: "setLeadingMoveText",
            value: function setLeadingMoveText(x, y) {
              this.setLeading(-y);
              this.moveText(x, y);
            }
          }, {
            key: "setTextMatrix",
            value: function setTextMatrix(a, b, c, d, e, f) {
              this.current.textMatrix = [a, b, c, d, e, f];
              this.current.textMatrixScale = Math.hypot(a, b);
              this.current.x = this.current.lineX = 0;
              this.current.y = this.current.lineY = 0;
            }
          }, {
            key: "nextLine",
            value: function nextLine() {
              this.moveText(0, this.current.leading);
            }
          }, {
            key: "paintChar",
            value: function paintChar(character, x, y, patternTransform, resetLineWidthToOne) {
              var ctx = this.ctx;
              var current = this.current;
              var font = current.font;
              var textRenderingMode = current.textRenderingMode;
              var fontSize = current.fontSize / current.fontSizeScale;
              var fillStrokeMode = textRenderingMode & _util.TextRenderingMode.FILL_STROKE_MASK;
              var isAddToPathSet = !!(textRenderingMode & _util.TextRenderingMode.ADD_TO_PATH_FLAG);
              var patternFill = current.patternFill && !font.missingFile;
              var addToPath;

              if (font.disableFontFace || isAddToPathSet || patternFill) {
                addToPath = font.getPathGenerator(this.commonObjs, character);
              }

              if (font.disableFontFace || patternFill) {
                ctx.save();
                ctx.translate(x, y);
                ctx.beginPath();
                addToPath(ctx, fontSize);

                if (patternTransform) {
                  ctx.setTransform.apply(ctx, patternTransform);
                }

                if (fillStrokeMode === _util.TextRenderingMode.FILL || fillStrokeMode === _util.TextRenderingMode.FILL_STROKE) {
                  ctx.fill();
                }

                if (fillStrokeMode === _util.TextRenderingMode.STROKE || fillStrokeMode === _util.TextRenderingMode.FILL_STROKE) {
                  if (resetLineWidthToOne) {
                    ctx.resetTransform();
                    ctx.lineWidth = Math.round(this._combinedScaleFactor);
                  }

                  ctx.stroke();
                }

                ctx.restore();
              } else {
                if (fillStrokeMode === _util.TextRenderingMode.FILL || fillStrokeMode === _util.TextRenderingMode.FILL_STROKE) {
                  ctx.fillText(character, x, y);
                }

                if (fillStrokeMode === _util.TextRenderingMode.STROKE || fillStrokeMode === _util.TextRenderingMode.FILL_STROKE) {
                  if (resetLineWidthToOne) {
                    ctx.save();
                    ctx.moveTo(x, y);
                    ctx.resetTransform();
                    ctx.lineWidth = Math.round(this._combinedScaleFactor);
                    ctx.strokeText(character, 0, 0);
                    ctx.restore();
                  } else {
                    ctx.strokeText(character, x, y);
                  }
                }
              }

              if (isAddToPathSet) {
                var paths = this.pendingTextPaths || (this.pendingTextPaths = []);
                paths.push({
                  transform: ctx.mozCurrentTransform,
                  x: x,
                  y: y,
                  fontSize: fontSize,
                  addToPath: addToPath
                });
              }
            }
          }, {
            key: "isFontSubpixelAAEnabled",
            get: function get() {
              var _this$cachedCanvases$ = this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled", 10, 10),
                  ctx = _this$cachedCanvases$.context;

              ctx.scale(1.5, 1);
              ctx.fillText("I", 0, 10);
              var data = ctx.getImageData(0, 0, 10, 10).data;
              var enabled = false;

              for (var i = 3; i < data.length; i += 4) {
                if (data[i] > 0 && data[i] < 255) {
                  enabled = true;
                  break;
                }
              }

              return (0, _util.shadow)(this, "isFontSubpixelAAEnabled", enabled);
            }
          }, {
            key: "showText",
            value: function showText(glyphs) {
              var current = this.current;
              var font = current.font;

              if (font.isType3Font) {
                return this.showType3Text(glyphs);
              }

              var fontSize = current.fontSize;

              if (fontSize === 0) {
                return undefined;
              }

              var ctx = this.ctx;
              var fontSizeScale = current.fontSizeScale;
              var charSpacing = current.charSpacing;
              var wordSpacing = current.wordSpacing;
              var fontDirection = current.fontDirection;
              var textHScale = current.textHScale * fontDirection;
              var glyphsLength = glyphs.length;
              var vertical = font.vertical;
              var spacingDir = vertical ? 1 : -1;
              var defaultVMetrics = font.defaultVMetrics;
              var widthAdvanceScale = fontSize * current.fontMatrix[0];
              var simpleFillText = current.textRenderingMode === _util.TextRenderingMode.FILL && !font.disableFontFace && !current.patternFill;
              ctx.save();
              var patternTransform;

              if (current.patternFill) {
                ctx.save();
                var pattern = current.fillColor.getPattern(ctx, this, ctx.mozCurrentTransformInverse);
                patternTransform = ctx.mozCurrentTransform;
                ctx.restore();
                ctx.fillStyle = pattern;
              }

              ctx.transform.apply(ctx, current.textMatrix);
              ctx.translate(current.x, current.y + current.textRise);

              if (fontDirection > 0) {
                ctx.scale(textHScale, -1);
              } else {
                ctx.scale(textHScale, 1);
              }

              var lineWidth = current.lineWidth;
              var resetLineWidthToOne = false;
              var scale = current.textMatrixScale;

              if (scale === 0 || lineWidth === 0) {
                var fillStrokeMode = current.textRenderingMode & _util.TextRenderingMode.FILL_STROKE_MASK;

                if (fillStrokeMode === _util.TextRenderingMode.STROKE || fillStrokeMode === _util.TextRenderingMode.FILL_STROKE) {
                  this._cachedGetSinglePixelWidth = null;
                  lineWidth = this.getSinglePixelWidth();
                  resetLineWidthToOne = lineWidth < 0;
                }
              } else {
                lineWidth /= scale;
              }

              if (fontSizeScale !== 1.0) {
                ctx.scale(fontSizeScale, fontSizeScale);
                lineWidth /= fontSizeScale;
              }

              ctx.lineWidth = lineWidth;
              var x = 0,
                  i;

              for (i = 0; i < glyphsLength; ++i) {
                var glyph = glyphs[i];

                if ((0, _util.isNum)(glyph)) {
                  x += spacingDir * glyph * fontSize / 1000;
                  continue;
                }

                var restoreNeeded = false;
                var spacing = (glyph.isSpace ? wordSpacing : 0) + charSpacing;
                var character = glyph.fontChar;
                var accent = glyph.accent;
                var scaledX = void 0,
                    scaledY = void 0;
                var width = glyph.width;

                if (vertical) {
                  var vmetric = glyph.vmetric || defaultVMetrics;
                  var vx = -(glyph.vmetric ? vmetric[1] : width * 0.5) * widthAdvanceScale;
                  var vy = vmetric[2] * widthAdvanceScale;
                  width = vmetric ? -vmetric[0] : width;
                  scaledX = vx / fontSizeScale;
                  scaledY = (x + vy) / fontSizeScale;
                } else {
                  scaledX = x / fontSizeScale;
                  scaledY = 0;
                }

                if (font.remeasure && width > 0) {
                  var measuredWidth = ctx.measureText(character).width * 1000 / fontSize * fontSizeScale;

                  if (width < measuredWidth && this.isFontSubpixelAAEnabled) {
                    var characterScaleX = width / measuredWidth;
                    restoreNeeded = true;
                    ctx.save();
                    ctx.scale(characterScaleX, 1);
                    scaledX /= characterScaleX;
                  } else if (width !== measuredWidth) {
                    scaledX += (width - measuredWidth) / 2000 * fontSize / fontSizeScale;
                  }
                }

                if (this.contentVisible && (glyph.isInFont || font.missingFile)) {
                  if (simpleFillText && !accent) {
                    ctx.fillText(character, scaledX, scaledY);
                  } else {
                    this.paintChar(character, scaledX, scaledY, patternTransform, resetLineWidthToOne);

                    if (accent) {
                      var scaledAccentX = scaledX + fontSize * accent.offset.x / fontSizeScale;
                      var scaledAccentY = scaledY - fontSize * accent.offset.y / fontSizeScale;
                      this.paintChar(accent.fontChar, scaledAccentX, scaledAccentY, patternTransform, resetLineWidthToOne);
                    }
                  }
                }

                var charWidth = void 0;

                if (vertical) {
                  charWidth = width * widthAdvanceScale - spacing * fontDirection;
                } else {
                  charWidth = width * widthAdvanceScale + spacing * fontDirection;
                }

                x += charWidth;

                if (restoreNeeded) {
                  ctx.restore();
                }
              }

              if (vertical) {
                current.y -= x;
              } else {
                current.x += x * textHScale;
              }

              ctx.restore();
              return undefined;
            }
          }, {
            key: "showType3Text",
            value: function showType3Text(glyphs) {
              var ctx = this.ctx;
              var current = this.current;
              var font = current.font;
              var fontSize = current.fontSize;
              var fontDirection = current.fontDirection;
              var spacingDir = font.vertical ? 1 : -1;
              var charSpacing = current.charSpacing;
              var wordSpacing = current.wordSpacing;
              var textHScale = current.textHScale * fontDirection;
              var fontMatrix = current.fontMatrix || _util.FONT_IDENTITY_MATRIX;
              var glyphsLength = glyphs.length;
              var isTextInvisible = current.textRenderingMode === _util.TextRenderingMode.INVISIBLE;
              var i, glyph, width, spacingLength;

              if (isTextInvisible || fontSize === 0) {
                return;
              }

              this._cachedGetSinglePixelWidth = null;
              ctx.save();
              ctx.transform.apply(ctx, current.textMatrix);
              ctx.translate(current.x, current.y);
              ctx.scale(textHScale, fontDirection);

              for (i = 0; i < glyphsLength; ++i) {
                glyph = glyphs[i];

                if ((0, _util.isNum)(glyph)) {
                  spacingLength = spacingDir * glyph * fontSize / 1000;
                  this.ctx.translate(spacingLength, 0);
                  current.x += spacingLength * textHScale;
                  continue;
                }

                var spacing = (glyph.isSpace ? wordSpacing : 0) + charSpacing;
                var operatorList = font.charProcOperatorList[glyph.operatorListId];

                if (!operatorList) {
                  (0, _util.warn)("Type3 character \"".concat(glyph.operatorListId, "\" is not available."));
                  continue;
                }

                if (this.contentVisible) {
                  this.processingType3 = glyph;
                  this.save();
                  ctx.scale(fontSize, fontSize);
                  ctx.transform.apply(ctx, fontMatrix);
                  this.executeOperatorList(operatorList);
                  this.restore();
                }

                var transformed = _util.Util.applyTransform([glyph.width, 0], fontMatrix);

                width = transformed[0] * fontSize + spacing;
                ctx.translate(width, 0);
                current.x += width * textHScale;
              }

              ctx.restore();
              this.processingType3 = null;
            }
          }, {
            key: "setCharWidth",
            value: function setCharWidth(xWidth, yWidth) {}
          }, {
            key: "setCharWidthAndBounds",
            value: function setCharWidthAndBounds(xWidth, yWidth, llx, lly, urx, ury) {
              this.ctx.rect(llx, lly, urx - llx, ury - lly);
              this.clip();
              this.endPath();
            }
          }, {
            key: "getColorN_Pattern",
            value: function getColorN_Pattern(IR) {
              var _this = this;

              var pattern;

              if (IR[0] === "TilingPattern") {
                var color = IR[1];
                var baseTransform = this.baseTransform || this.ctx.mozCurrentTransform.slice();
                var canvasGraphicsFactory = {
                  createCanvasGraphics: function createCanvasGraphics(ctx) {
                    return new CanvasGraphics(ctx, _this.commonObjs, _this.objs, _this.canvasFactory);
                  }
                };
                pattern = new _pattern_helper.TilingPattern(IR, color, this.ctx, canvasGraphicsFactory, baseTransform);
              } else {
                pattern = this._getPattern(IR[1], IR[2]);
              }

              return pattern;
            }
          }, {
            key: "setStrokeColorN",
            value: function setStrokeColorN() {
              this.current.strokeColor = this.getColorN_Pattern(arguments);
            }
          }, {
            key: "setFillColorN",
            value: function setFillColorN() {
              this.current.fillColor = this.getColorN_Pattern(arguments);
              this.current.patternFill = true;
            }
          }, {
            key: "setStrokeRGBColor",
            value: function setStrokeRGBColor(r, g, b) {
              var color = _util.Util.makeHexColor(r, g, b);

              this.ctx.strokeStyle = color;
              this.current.strokeColor = color;
            }
          }, {
            key: "setFillRGBColor",
            value: function setFillRGBColor(r, g, b) {
              var color = _util.Util.makeHexColor(r, g, b);

              this.ctx.fillStyle = color;
              this.current.fillColor = color;
              this.current.patternFill = false;
            }
          }, {
            key: "_getPattern",
            value: function _getPattern(objId) {
              var matrix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
              var pattern;

              if (this.cachedPatterns.has(objId)) {
                pattern = this.cachedPatterns.get(objId);
              } else {
                pattern = (0, _pattern_helper.getShadingPattern)(this.objs.get(objId), this.cachedCanvasPatterns);
                this.cachedPatterns.set(objId, pattern);
              }

              if (matrix) {
                pattern.matrix = matrix;
              }

              return pattern;
            }
          }, {
            key: "shadingFill",
            value: function shadingFill(objId) {
              if (!this.contentVisible) {
                return;
              }

              var ctx = this.ctx;
              this.save();

              var pattern = this._getPattern(objId);

              ctx.fillStyle = pattern.getPattern(ctx, this, ctx.mozCurrentTransformInverse, true);
              var inv = ctx.mozCurrentTransformInverse;

              if (inv) {
                var canvas = ctx.canvas;
                var width = canvas.width;
                var height = canvas.height;

                var bl = _util.Util.applyTransform([0, 0], inv);

                var br = _util.Util.applyTransform([0, height], inv);

                var ul = _util.Util.applyTransform([width, 0], inv);

                var ur = _util.Util.applyTransform([width, height], inv);

                var x0 = Math.min(bl[0], br[0], ul[0], ur[0]);
                var y0 = Math.min(bl[1], br[1], ul[1], ur[1]);
                var x1 = Math.max(bl[0], br[0], ul[0], ur[0]);
                var y1 = Math.max(bl[1], br[1], ul[1], ur[1]);
                this.ctx.fillRect(x0, y0, x1 - x0, y1 - y0);
              } else {
                this.ctx.fillRect(-1e10, -1e10, 2e10, 2e10);
              }

              this.restore();
            }
          }, {
            key: "beginInlineImage",
            value: function beginInlineImage() {
              (0, _util.unreachable)("Should not call beginInlineImage");
            }
          }, {
            key: "beginImageData",
            value: function beginImageData() {
              (0, _util.unreachable)("Should not call beginImageData");
            }
          }, {
            key: "paintFormXObjectBegin",
            value: function paintFormXObjectBegin(matrix, bbox) {
              if (!this.contentVisible) {
                return;
              }

              this.save();
              this.baseTransformStack.push(this.baseTransform);

              if (Array.isArray(matrix) && matrix.length === 6) {
                this.transform.apply(this, matrix);
              }

              this.baseTransform = this.ctx.mozCurrentTransform;

              if (bbox) {
                var width = bbox[2] - bbox[0];
                var height = bbox[3] - bbox[1];
                this.ctx.rect(bbox[0], bbox[1], width, height);
                this.clip();
                this.endPath();
              }
            }
          }, {
            key: "paintFormXObjectEnd",
            value: function paintFormXObjectEnd() {
              if (!this.contentVisible) {
                return;
              }

              this.restore();
              this.baseTransform = this.baseTransformStack.pop();
            }
          }, {
            key: "beginGroup",
            value: function beginGroup(group) {
              if (!this.contentVisible) {
                return;
              }

              this.save();
              var currentCtx = this.ctx;

              if (!group.isolated) {
                (0, _util.info)("TODO: Support non-isolated groups.");
              }

              if (group.knockout) {
                (0, _util.warn)("Knockout groups not supported.");
              }

              var currentTransform = currentCtx.mozCurrentTransform;

              if (group.matrix) {
                currentCtx.transform.apply(currentCtx, group.matrix);
              }

              if (!group.bbox) {
                throw new Error("Bounding box is required.");
              }

              var bounds = _util.Util.getAxialAlignedBoundingBox(group.bbox, currentCtx.mozCurrentTransform);

              var canvasBounds = [0, 0, currentCtx.canvas.width, currentCtx.canvas.height];
              bounds = _util.Util.intersect(bounds, canvasBounds) || [0, 0, 0, 0];
              var offsetX = Math.floor(bounds[0]);
              var offsetY = Math.floor(bounds[1]);
              var drawnWidth = Math.max(Math.ceil(bounds[2]) - offsetX, 1);
              var drawnHeight = Math.max(Math.ceil(bounds[3]) - offsetY, 1);
              var scaleX = 1,
                  scaleY = 1;

              if (drawnWidth > MAX_GROUP_SIZE) {
                scaleX = drawnWidth / MAX_GROUP_SIZE;
                drawnWidth = MAX_GROUP_SIZE;
              }

              if (drawnHeight > MAX_GROUP_SIZE) {
                scaleY = drawnHeight / MAX_GROUP_SIZE;
                drawnHeight = MAX_GROUP_SIZE;
              }

              var cacheId = "groupAt" + this.groupLevel;

              if (group.smask) {
                cacheId += "_smask_" + this.smaskCounter++ % 2;
              }

              var scratchCanvas = this.cachedCanvases.getCanvas(cacheId, drawnWidth, drawnHeight, true);
              var groupCtx = scratchCanvas.context;
              groupCtx.scale(1 / scaleX, 1 / scaleY);
              groupCtx.translate(-offsetX, -offsetY);
              groupCtx.transform.apply(groupCtx, currentTransform);

              if (group.smask) {
                this.smaskStack.push({
                  canvas: scratchCanvas.canvas,
                  context: groupCtx,
                  offsetX: offsetX,
                  offsetY: offsetY,
                  scaleX: scaleX,
                  scaleY: scaleY,
                  subtype: group.smask.subtype,
                  backdrop: group.smask.backdrop,
                  transferMap: group.smask.transferMap || null,
                  startTransformInverse: null
                });
              } else {
                currentCtx.setTransform(1, 0, 0, 1, 0, 0);
                currentCtx.translate(offsetX, offsetY);
                currentCtx.scale(scaleX, scaleY);
              }

              copyCtxState(currentCtx, groupCtx);
              this.ctx = groupCtx;
              this.setGState([["BM", "source-over"], ["ca", 1], ["CA", 1]]);
              this.groupStack.push(currentCtx);
              this.groupLevel++;
              this.current.activeSMask = null;
            }
          }, {
            key: "endGroup",
            value: function endGroup(group) {
              if (!this.contentVisible) {
                return;
              }

              this.groupLevel--;
              var groupCtx = this.ctx;
              this.ctx = this.groupStack.pop();
              this.ctx.imageSmoothingEnabled = false;

              if (group.smask) {
                this.tempSMask = this.smaskStack.pop();
              } else {
                this.ctx.drawImage(groupCtx.canvas, 0, 0);
              }

              this.restore();
            }
          }, {
            key: "beginAnnotations",
            value: function beginAnnotations() {
              this.save();

              if (this.baseTransform) {
                this.ctx.setTransform.apply(this.ctx, this.baseTransform);
              }
            }
          }, {
            key: "endAnnotations",
            value: function endAnnotations() {
              this.restore();
            }
          }, {
            key: "beginAnnotation",
            value: function beginAnnotation(id, rect, transform, matrix) {
              this.save();
              resetCtxToDefault(this.ctx);
              this.current = new CanvasExtraState();

              if (Array.isArray(rect) && rect.length === 4) {
                var width = rect[2] - rect[0];
                var height = rect[3] - rect[1];
                this.ctx.rect(rect[0], rect[1], width, height);
                this.clip();
                this.endPath();
              }

              this.transform.apply(this, transform);
              this.transform.apply(this, matrix);
            }
          }, {
            key: "endAnnotation",
            value: function endAnnotation() {
              this.restore();
            }
          }, {
            key: "paintImageMaskXObject",
            value: function paintImageMaskXObject(img) {
              if (!this.contentVisible) {
                return;
              }

              var ctx = this.ctx;
              var width = img.width,
                  height = img.height;
              var glyph = this.processingType3;

              if (COMPILE_TYPE3_GLYPHS && glyph && glyph.compiled === undefined) {
                if (width <= MAX_SIZE_TO_COMPILE && height <= MAX_SIZE_TO_COMPILE) {
                  glyph.compiled = compileType3Glyph({
                    data: img.data,
                    width: width,
                    height: height
                  });
                } else {
                  glyph.compiled = null;
                }
              }

              if (glyph !== null && glyph !== void 0 && glyph.compiled) {
                glyph.compiled(ctx);
                return;
              }

              var mask = this._createMaskCanvas(img);

              var maskCanvas = mask.canvas;
              ctx.save();
              ctx.setTransform(1, 0, 0, 1, 0, 0);
              ctx.drawImage(maskCanvas, mask.offsetX, mask.offsetY);
              ctx.restore();
            }
          }, {
            key: "paintImageMaskXObjectRepeat",
            value: function paintImageMaskXObjectRepeat(imgData, scaleX) {
              var skewX = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
              var skewY = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
              var scaleY = arguments.length > 4 ? arguments[4] : undefined;
              var positions = arguments.length > 5 ? arguments[5] : undefined;

              if (!this.contentVisible) {
                return;
              }

              var ctx = this.ctx;
              ctx.save();
              var currentTransform = ctx.mozCurrentTransform;
              ctx.transform(scaleX, skewX, skewY, scaleY, 0, 0);

              var mask = this._createMaskCanvas(imgData);

              ctx.setTransform(1, 0, 0, 1, 0, 0);

              for (var i = 0, ii = positions.length; i < ii; i += 2) {
                var trans = _util.Util.transform(currentTransform, [scaleX, skewX, skewY, scaleY, positions[i], positions[i + 1]]);

                var _Util$applyTransform = _util.Util.applyTransform([0, 0], trans),
                    _Util$applyTransform2 = _slicedToArray(_Util$applyTransform, 2),
                    x = _Util$applyTransform2[0],
                    y = _Util$applyTransform2[1];

                ctx.drawImage(mask.canvas, x, y);
              }

              ctx.restore();
            }
          }, {
            key: "paintImageMaskXObjectGroup",
            value: function paintImageMaskXObjectGroup(images) {
              if (!this.contentVisible) {
                return;
              }

              var ctx = this.ctx;
              var fillColor = this.current.fillColor;
              var isPatternFill = this.current.patternFill;

              for (var i = 0, ii = images.length; i < ii; i++) {
                var image = images[i];
                var width = image.width,
                    height = image.height;
                var maskCanvas = this.cachedCanvases.getCanvas("maskCanvas", width, height);
                var maskCtx = maskCanvas.context;
                maskCtx.save();
                putBinaryImageMask(maskCtx, image);
                maskCtx.globalCompositeOperation = "source-in";
                maskCtx.fillStyle = isPatternFill ? fillColor.getPattern(maskCtx, this, ctx.mozCurrentTransformInverse, false) : fillColor;
                maskCtx.fillRect(0, 0, width, height);
                maskCtx.restore();
                ctx.save();
                ctx.transform.apply(ctx, image.transform);
                ctx.scale(1, -1);
                ctx.drawImage(maskCanvas.canvas, 0, 0, width, height, 0, -1, 1, 1);
                ctx.restore();
              }
            }
          }, {
            key: "paintImageXObject",
            value: function paintImageXObject(objId) {
              if (!this.contentVisible) {
                return;
              }

              var imgData = objId.startsWith("g_") ? this.commonObjs.get(objId) : this.objs.get(objId);

              if (!imgData) {
                (0, _util.warn)("Dependent image isn't ready yet");
                return;
              }

              this.paintInlineImageXObject(imgData);
            }
          }, {
            key: "paintImageXObjectRepeat",
            value: function paintImageXObjectRepeat(objId, scaleX, scaleY, positions) {
              if (!this.contentVisible) {
                return;
              }

              var imgData = objId.startsWith("g_") ? this.commonObjs.get(objId) : this.objs.get(objId);

              if (!imgData) {
                (0, _util.warn)("Dependent image isn't ready yet");
                return;
              }

              var width = imgData.width;
              var height = imgData.height;
              var map = [];

              for (var i = 0, ii = positions.length; i < ii; i += 2) {
                map.push({
                  transform: [scaleX, 0, 0, scaleY, positions[i], positions[i + 1]],
                  x: 0,
                  y: 0,
                  w: width,
                  h: height
                });
              }

              this.paintInlineImageXObjectGroup(imgData, map);
            }
          }, {
            key: "paintInlineImageXObject",
            value: function paintInlineImageXObject(imgData) {
              if (!this.contentVisible) {
                return;
              }

              var width = imgData.width;
              var height = imgData.height;
              var ctx = this.ctx;
              this.save();
              ctx.scale(1 / width, -1 / height);
              var imgToPaint;

              if (typeof HTMLElement === "function" && imgData instanceof HTMLElement || !imgData.data) {
                imgToPaint = imgData;
              } else {
                var tmpCanvas = this.cachedCanvases.getCanvas("inlineImage", width, height);
                var tmpCtx = tmpCanvas.context;
                putBinaryImageData(tmpCtx, imgData, this.current.transferMaps);
                imgToPaint = tmpCanvas.canvas;
              }

              var scaled = this._scaleImage(imgToPaint, ctx.mozCurrentTransformInverse);

              ctx.imageSmoothingEnabled = getImageSmoothingEnabled(ctx.mozCurrentTransform, imgData.interpolate);
              ctx.drawImage(scaled.img, 0, 0, scaled.paintWidth, scaled.paintHeight, 0, -height, width, height);

              if (this.imageLayer) {
                var position = this.getCanvasPosition(0, -height);
                this.imageLayer.appendImage({
                  imgData: imgData,
                  left: position[0],
                  top: position[1],
                  width: width / ctx.mozCurrentTransformInverse[0],
                  height: height / ctx.mozCurrentTransformInverse[3]
                });
              }

              this.restore();
            }
          }, {
            key: "paintInlineImageXObjectGroup",
            value: function paintInlineImageXObjectGroup(imgData, map) {
              if (!this.contentVisible) {
                return;
              }

              var ctx = this.ctx;
              var w = imgData.width;
              var h = imgData.height;
              var tmpCanvas = this.cachedCanvases.getCanvas("inlineImage", w, h);
              var tmpCtx = tmpCanvas.context;
              putBinaryImageData(tmpCtx, imgData, this.current.transferMaps);

              for (var i = 0, ii = map.length; i < ii; i++) {
                var entry = map[i];
                ctx.save();
                ctx.transform.apply(ctx, entry.transform);
                ctx.scale(1, -1);
                ctx.drawImage(tmpCanvas.canvas, entry.x, entry.y, entry.w, entry.h, 0, -1, 1, 1);

                if (this.imageLayer) {
                  var position = this.getCanvasPosition(entry.x, entry.y);
                  this.imageLayer.appendImage({
                    imgData: imgData,
                    left: position[0],
                    top: position[1],
                    width: w,
                    height: h
                  });
                }

                ctx.restore();
              }
            }
          }, {
            key: "paintSolidColorImageMask",
            value: function paintSolidColorImageMask() {
              if (!this.contentVisible) {
                return;
              }

              this.ctx.fillRect(0, 0, 1, 1);
            }
          }, {
            key: "markPoint",
            value: function markPoint(tag) {}
          }, {
            key: "markPointProps",
            value: function markPointProps(tag, properties) {}
          }, {
            key: "beginMarkedContent",
            value: function beginMarkedContent(tag) {
              this.markedContentStack.push({
                visible: true
              });
            }
          }, {
            key: "beginMarkedContentProps",
            value: function beginMarkedContentProps(tag, properties) {
              if (tag === "OC") {
                this.markedContentStack.push({
                  visible: this.optionalContentConfig.isVisible(properties)
                });
              } else {
                this.markedContentStack.push({
                  visible: true
                });
              }

              this.contentVisible = this.isContentVisible();
            }
          }, {
            key: "endMarkedContent",
            value: function endMarkedContent() {
              this.markedContentStack.pop();
              this.contentVisible = this.isContentVisible();
            }
          }, {
            key: "beginCompat",
            value: function beginCompat() {}
          }, {
            key: "endCompat",
            value: function endCompat() {}
          }, {
            key: "consumePath",
            value: function consumePath() {
              var ctx = this.ctx;

              if (this.pendingClip) {
                if (this.pendingClip === EO_CLIP) {
                  ctx.clip("evenodd");
                } else {
                  ctx.clip();
                }

                this.pendingClip = null;
              }

              ctx.beginPath();
            }
          }, {
            key: "getSinglePixelWidth",
            value: function getSinglePixelWidth() {
              if (this._cachedGetSinglePixelWidth === null) {
                var m = this.ctx.mozCurrentTransform;
                var absDet = Math.abs(m[0] * m[3] - m[2] * m[1]);
                var sqNorm1 = Math.pow(m[0], 2) + Math.pow(m[2], 2);
                var sqNorm2 = Math.pow(m[1], 2) + Math.pow(m[3], 2);
                var pixelHeight = Math.sqrt(Math.max(sqNorm1, sqNorm2)) / absDet;

                if (sqNorm1 !== sqNorm2 && this._combinedScaleFactor * pixelHeight > 1) {
                  this._cachedGetSinglePixelWidth = -(this._combinedScaleFactor * pixelHeight);
                } else if (absDet > Number.EPSILON) {
                  this._cachedGetSinglePixelWidth = pixelHeight;
                } else {
                  this._cachedGetSinglePixelWidth = 1;
                }
              }

              return this._cachedGetSinglePixelWidth;
            }
          }, {
            key: "getCanvasPosition",
            value: function getCanvasPosition(x, y) {
              var transform = this.ctx.mozCurrentTransform;
              return [transform[0] * x + transform[2] * y + transform[4], transform[1] * x + transform[3] * y + transform[5]];
            }
          }, {
            key: "isContentVisible",
            value: function isContentVisible() {
              for (var i = this.markedContentStack.length - 1; i >= 0; i--) {
                if (!this.markedContentStack[i].visible) {
                  return false;
                }
              }

              return true;
            }
          }]);

          return CanvasGraphics;
        }();

        exports.CanvasGraphics = CanvasGraphics;

        for (var op in _util.OPS) {
          if (CanvasGraphics.prototype[op] !== undefined) {
            CanvasGraphics.prototype[_util.OPS[op]] = CanvasGraphics.prototype[op];
          }
        }
        /***/

      },
      /* 124 */

      /***/
      function (__unused_webpack_module, exports, __w_pdfjs_require__) {
        "use strict";

        function _typeof(obj) {
          "@babel/helpers - typeof";

          if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
            _typeof = function _typeof(obj) {
              return typeof obj;
            };
          } else {
            _typeof = function _typeof(obj) {
              return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
            };
          }

          return _typeof(obj);
        }

        Object.defineProperty(exports, "__esModule", {
          value: true
        });
        exports.getShadingPattern = getShadingPattern;
        exports.TilingPattern = void 0;

        var _util = __w_pdfjs_require__(4);

        function _createForOfIteratorHelper(o, allowArrayLike) {
          var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];

          if (!it) {
            if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
              if (it) o = it;
              var i = 0;

              var F = function F() {};

              return {
                s: F,
                n: function n() {
                  if (i >= o.length) return {
                    done: true
                  };
                  return {
                    done: false,
                    value: o[i++]
                  };
                },
                e: function e(_e) {
                  throw _e;
                },
                f: F
              };
            }

            throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
          }

          var normalCompletion = true,
              didErr = false,
              err;
          return {
            s: function s() {
              it = it.call(o);
            },
            n: function n() {
              var step = it.next();
              normalCompletion = step.done;
              return step;
            },
            e: function e(_e2) {
              didErr = true;
              err = _e2;
            },
            f: function f() {
              try {
                if (!normalCompletion && it["return"] != null) it["return"]();
              } finally {
                if (didErr) throw err;
              }
            }
          };
        }

        function _unsupportedIterableToArray(o, minLen) {
          if (!o) return;
          if (typeof o === "string") return _arrayLikeToArray(o, minLen);
          var n = Object.prototype.toString.call(o).slice(8, -1);
          if (n === "Object" && o.constructor) n = o.constructor.name;
          if (n === "Map" || n === "Set") return Array.from(o);
          if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
        }

        function _arrayLikeToArray(arr, len) {
          if (len == null || len > arr.length) len = arr.length;

          for (var i = 0, arr2 = new Array(len); i < len; i++) {
            arr2[i] = arr[i];
          }

          return arr2;
        }

        function _inherits(subClass, superClass) {
          if (typeof superClass !== "function" && superClass !== null) {
            throw new TypeError("Super expression must either be null or a function");
          }

          subClass.prototype = Object.create(superClass && superClass.prototype, {
            constructor: {
              value: subClass,
              writable: true,
              configurable: true
            }
          });
          if (superClass) _setPrototypeOf(subClass, superClass);
        }

        function _setPrototypeOf(o, p) {
          _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
            o.__proto__ = p;
            return o;
          };

          return _setPrototypeOf(o, p);
        }

        function _createSuper(Derived) {
          var hasNativeReflectConstruct = _isNativeReflectConstruct();

          return function _createSuperInternal() {
            var Super = _getPrototypeOf(Derived),
                result;

            if (hasNativeReflectConstruct) {
              var NewTarget = _getPrototypeOf(this).constructor;

              result = Reflect.construct(Super, arguments, NewTarget);
            } else {
              result = Super.apply(this, arguments);
            }

            return _possibleConstructorReturn(this, result);
          };
        }

        function _possibleConstructorReturn(self, call) {
          if (call && (_typeof(call) === "object" || typeof call === "function")) {
            return call;
          } else if (call !== void 0) {
            throw new TypeError("Derived constructors may only return object or undefined");
          }

          return _assertThisInitialized(self);
        }

        function _assertThisInitialized(self) {
          if (self === void 0) {
            throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
          }

          return self;
        }

        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 (e) {
            return false;
          }
        }

        function _getPrototypeOf(o) {
          _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
            return o.__proto__ || Object.getPrototypeOf(o);
          };
          return _getPrototypeOf(o);
        }

        function _classCallCheck(instance, Constructor) {
          if (!(instance instanceof Constructor)) {
            throw new TypeError("Cannot call a class as a function");
          }
        }

        function _defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];
            descriptor.enumerable = descriptor.enumerable || false;
            descriptor.configurable = true;
            if ("value" in descriptor) descriptor.writable = true;
            Object.defineProperty(target, descriptor.key, descriptor);
          }
        }

        function _createClass(Constructor, protoProps, staticProps) {
          if (protoProps) _defineProperties(Constructor.prototype, protoProps);
          if (staticProps) _defineProperties(Constructor, staticProps);
          return Constructor;
        }

        function applyBoundingBox(ctx, bbox) {
          if (!bbox || typeof Path2D === "undefined") {
            return;
          }

          var width = bbox[2] - bbox[0];
          var height = bbox[3] - bbox[1];
          var region = new Path2D();
          region.rect(bbox[0], bbox[1], width, height);
          ctx.clip(region);
        }

        var BaseShadingPattern = /*#__PURE__*/function () {
          function BaseShadingPattern() {
            _classCallCheck(this, BaseShadingPattern);

            if (this.constructor === BaseShadingPattern) {
              (0, _util.unreachable)("Cannot initialize BaseShadingPattern.");
            }
          }

          _createClass(BaseShadingPattern, [{
            key: "getPattern",
            value: function getPattern() {
              (0, _util.unreachable)("Abstract method `getPattern` called.");
            }
          }]);

          return BaseShadingPattern;
        }();

        var RadialAxialShadingPattern = /*#__PURE__*/function (_BaseShadingPattern) {
          _inherits(RadialAxialShadingPattern, _BaseShadingPattern);

          var _super = _createSuper(RadialAxialShadingPattern);

          function RadialAxialShadingPattern(IR, cachedCanvasPatterns) {
            var _this;

            _classCallCheck(this, RadialAxialShadingPattern);

            _this = _super.call(this);
            _this._type = IR[1];
            _this._bbox = IR[2];
            _this._colorStops = IR[3];
            _this._p0 = IR[4];
            _this._p1 = IR[5];
            _this._r0 = IR[6];
            _this._r1 = IR[7];
            _this.matrix = null;
            _this.cachedCanvasPatterns = cachedCanvasPatterns;
            return _this;
          }

          _createClass(RadialAxialShadingPattern, [{
            key: "_createGradient",
            value: function _createGradient(ctx) {
              var grad;

              if (this._type === "axial") {
                grad = ctx.createLinearGradient(this._p0[0], this._p0[1], this._p1[0], this._p1[1]);
              } else if (this._type === "radial") {
                grad = ctx.createRadialGradient(this._p0[0], this._p0[1], this._r0, this._p1[0], this._p1[1], this._r1);
              }

              var _iterator = _createForOfIteratorHelper(this._colorStops),
                  _step;

              try {
                for (_iterator.s(); !(_step = _iterator.n()).done;) {
                  var colorStop = _step.value;
                  grad.addColorStop(colorStop[0], colorStop[1]);
                }
              } catch (err) {
                _iterator.e(err);
              } finally {
                _iterator.f();
              }

              return grad;
            }
          }, {
            key: "getPattern",
            value: function getPattern(ctx, owner, inverse) {
              var shadingFill = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
              var pattern;

              if (!shadingFill) {
                if (this.cachedCanvasPatterns.has(this)) {
                  pattern = this.cachedCanvasPatterns.get(this);
                } else {
                  var tmpCanvas = owner.cachedCanvases.getCanvas("pattern", owner.ctx.canvas.width, owner.ctx.canvas.height, true);
                  var tmpCtx = tmpCanvas.context;
                  tmpCtx.clearRect(0, 0, tmpCtx.canvas.width, tmpCtx.canvas.height);
                  tmpCtx.beginPath();
                  tmpCtx.rect(0, 0, tmpCtx.canvas.width, tmpCtx.canvas.height);
                  tmpCtx.setTransform.apply(tmpCtx, owner.baseTransform);

                  if (this.matrix) {
                    tmpCtx.transform.apply(tmpCtx, this.matrix);
                  }

                  applyBoundingBox(tmpCtx, this._bbox);
                  tmpCtx.fillStyle = this._createGradient(tmpCtx);
                  tmpCtx.fill();
                  pattern = ctx.createPattern(tmpCanvas.canvas, "repeat");
                  this.cachedCanvasPatterns.set(this, pattern);
                }
              } else {
                applyBoundingBox(ctx, this._bbox);
                pattern = this._createGradient(ctx);
              }

              if (!shadingFill) {
                var domMatrix = new DOMMatrix(inverse);

                try {
                  pattern.setTransform(domMatrix);
                } catch (ex) {
                  (0, _util.warn)("RadialAxialShadingPattern.getPattern: \"".concat(ex === null || ex === void 0 ? void 0 : ex.message, "\"."));
                }
              }

              return pattern;
            }
          }]);

          return RadialAxialShadingPattern;
        }(BaseShadingPattern);

        function drawTriangle(data, context, p1, p2, p3, c1, c2, c3) {
          var coords = context.coords,
              colors = context.colors;
          var bytes = data.data,
              rowSize = data.width * 4;
          var tmp;

          if (coords[p1 + 1] > coords[p2 + 1]) {
            tmp = p1;
            p1 = p2;
            p2 = tmp;
            tmp = c1;
            c1 = c2;
            c2 = tmp;
          }

          if (coords[p2 + 1] > coords[p3 + 1]) {
            tmp = p2;
            p2 = p3;
            p3 = tmp;
            tmp = c2;
            c2 = c3;
            c3 = tmp;
          }

          if (coords[p1 + 1] > coords[p2 + 1]) {
            tmp = p1;
            p1 = p2;
            p2 = tmp;
            tmp = c1;
            c1 = c2;
            c2 = tmp;
          }

          var x1 = (coords[p1] + context.offsetX) * context.scaleX;
          var y1 = (coords[p1 + 1] + context.offsetY) * context.scaleY;
          var x2 = (coords[p2] + context.offsetX) * context.scaleX;
          var y2 = (coords[p2 + 1] + context.offsetY) * context.scaleY;
          var x3 = (coords[p3] + context.offsetX) * context.scaleX;
          var y3 = (coords[p3 + 1] + context.offsetY) * context.scaleY;

          if (y1 >= y3) {
            return;
          }

          var c1r = colors[c1],
              c1g = colors[c1 + 1],
              c1b = colors[c1 + 2];
          var c2r = colors[c2],
              c2g = colors[c2 + 1],
              c2b = colors[c2 + 2];
          var c3r = colors[c3],
              c3g = colors[c3 + 1],
              c3b = colors[c3 + 2];
          var minY = Math.round(y1),
              maxY = Math.round(y3);
          var xa, car, cag, cab;
          var xb, cbr, cbg, cbb;

          for (var y = minY; y <= maxY; y++) {
            if (y < y2) {
              var _k = void 0;

              if (y < y1) {
                _k = 0;
              } else {
                _k = (y1 - y) / (y1 - y2);
              }

              xa = x1 - (x1 - x2) * _k;
              car = c1r - (c1r - c2r) * _k;
              cag = c1g - (c1g - c2g) * _k;
              cab = c1b - (c1b - c2b) * _k;
            } else {
              var _k2 = void 0;

              if (y > y3) {
                _k2 = 1;
              } else if (y2 === y3) {
                _k2 = 0;
              } else {
                _k2 = (y2 - y) / (y2 - y3);
              }

              xa = x2 - (x2 - x3) * _k2;
              car = c2r - (c2r - c3r) * _k2;
              cag = c2g - (c2g - c3g) * _k2;
              cab = c2b - (c2b - c3b) * _k2;
            }

            var k = void 0;

            if (y < y1) {
              k = 0;
            } else if (y > y3) {
              k = 1;
            } else {
              k = (y1 - y) / (y1 - y3);
            }

            xb = x1 - (x1 - x3) * k;
            cbr = c1r - (c1r - c3r) * k;
            cbg = c1g - (c1g - c3g) * k;
            cbb = c1b - (c1b - c3b) * k;
            var x1_ = Math.round(Math.min(xa, xb));
            var x2_ = Math.round(Math.max(xa, xb));
            var j = rowSize * y + x1_ * 4;

            for (var x = x1_; x <= x2_; x++) {
              k = (xa - x) / (xa - xb);

              if (k < 0) {
                k = 0;
              } else if (k > 1) {
                k = 1;
              }

              bytes[j++] = car - (car - cbr) * k | 0;
              bytes[j++] = cag - (cag - cbg) * k | 0;
              bytes[j++] = cab - (cab - cbb) * k | 0;
              bytes[j++] = 255;
            }
          }
        }

        function drawFigure(data, figure, context) {
          var ps = figure.coords;
          var cs = figure.colors;
          var i, ii;

          switch (figure.type) {
            case "lattice":
              var verticesPerRow = figure.verticesPerRow;
              var rows = Math.floor(ps.length / verticesPerRow) - 1;
              var cols = verticesPerRow - 1;

              for (i = 0; i < rows; i++) {
                var q = i * verticesPerRow;

                for (var j = 0; j < cols; j++, q++) {
                  drawTriangle(data, context, ps[q], ps[q + 1], ps[q + verticesPerRow], cs[q], cs[q + 1], cs[q + verticesPerRow]);
                  drawTriangle(data, context, ps[q + verticesPerRow + 1], ps[q + 1], ps[q + verticesPerRow], cs[q + verticesPerRow + 1], cs[q + 1], cs[q + verticesPerRow]);
                }
              }

              break;

            case "triangles":
              for (i = 0, ii = ps.length; i < ii; i += 3) {
                drawTriangle(data, context, ps[i], ps[i + 1], ps[i + 2], cs[i], cs[i + 1], cs[i + 2]);
              }

              break;

            default:
              throw new Error("illegal figure");
          }
        }

        var MeshShadingPattern = /*#__PURE__*/function (_BaseShadingPattern2) {
          _inherits(MeshShadingPattern, _BaseShadingPattern2);

          var _super2 = _createSuper(MeshShadingPattern);

          function MeshShadingPattern(IR) {
            var _this2;

            _classCallCheck(this, MeshShadingPattern);

            _this2 = _super2.call(this);
            _this2._coords = IR[2];
            _this2._colors = IR[3];
            _this2._figures = IR[4];
            _this2._bounds = IR[5];
            _this2._bbox = IR[7];
            _this2._background = IR[8];
            _this2.matrix = null;
            return _this2;
          }

          _createClass(MeshShadingPattern, [{
            key: "_createMeshCanvas",
            value: function _createMeshCanvas(combinedScale, backgroundColor, cachedCanvases) {
              var EXPECTED_SCALE = 1.1;
              var MAX_PATTERN_SIZE = 3000;
              var BORDER_SIZE = 2;
              var offsetX = Math.floor(this._bounds[0]);
              var offsetY = Math.floor(this._bounds[1]);
              var boundsWidth = Math.ceil(this._bounds[2]) - offsetX;
              var boundsHeight = Math.ceil(this._bounds[3]) - offsetY;
              var width = Math.min(Math.ceil(Math.abs(boundsWidth * combinedScale[0] * EXPECTED_SCALE)), MAX_PATTERN_SIZE);
              var height = Math.min(Math.ceil(Math.abs(boundsHeight * combinedScale[1] * EXPECTED_SCALE)), MAX_PATTERN_SIZE);
              var scaleX = boundsWidth / width;
              var scaleY = boundsHeight / height;
              var context = {
                coords: this._coords,
                colors: this._colors,
                offsetX: -offsetX,
                offsetY: -offsetY,
                scaleX: 1 / scaleX,
                scaleY: 1 / scaleY
              };
              var paddedWidth = width + BORDER_SIZE * 2;
              var paddedHeight = height + BORDER_SIZE * 2;
              var tmpCanvas = cachedCanvases.getCanvas("mesh", paddedWidth, paddedHeight, false);
              var tmpCtx = tmpCanvas.context;
              var data = tmpCtx.createImageData(width, height);

              if (backgroundColor) {
                var bytes = data.data;

                for (var i = 0, ii = bytes.length; i < ii; i += 4) {
                  bytes[i] = backgroundColor[0];
                  bytes[i + 1] = backgroundColor[1];
                  bytes[i + 2] = backgroundColor[2];
                  bytes[i + 3] = 255;
                }
              }

              var _iterator2 = _createForOfIteratorHelper(this._figures),
                  _step2;

              try {
                for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
                  var figure = _step2.value;
                  drawFigure(data, figure, context);
                }
              } catch (err) {
                _iterator2.e(err);
              } finally {
                _iterator2.f();
              }

              tmpCtx.putImageData(data, BORDER_SIZE, BORDER_SIZE);
              var canvas = tmpCanvas.canvas;
              return {
                canvas: canvas,
                offsetX: offsetX - BORDER_SIZE * scaleX,
                offsetY: offsetY - BORDER_SIZE * scaleY,
                scaleX: scaleX,
                scaleY: scaleY
              };
            }
          }, {
            key: "getPattern",
            value: function getPattern(ctx, owner, inverse) {
              var shadingFill = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
              applyBoundingBox(ctx, this._bbox);
              var scale;

              if (shadingFill) {
                scale = _util.Util.singularValueDecompose2dScale(ctx.mozCurrentTransform);
              } else {
                scale = _util.Util.singularValueDecompose2dScale(owner.baseTransform);

                if (this.matrix) {
                  var matrixScale = _util.Util.singularValueDecompose2dScale(this.matrix);

                  scale = [scale[0] * matrixScale[0], scale[1] * matrixScale[1]];
                }
              }

              var temporaryPatternCanvas = this._createMeshCanvas(scale, shadingFill ? null : this._background, owner.cachedCanvases);

              if (!shadingFill) {
                ctx.setTransform.apply(ctx, owner.baseTransform);

                if (this.matrix) {
                  ctx.transform.apply(ctx, this.matrix);
                }
              }

              ctx.translate(temporaryPatternCanvas.offsetX, temporaryPatternCanvas.offsetY);
              ctx.scale(temporaryPatternCanvas.scaleX, temporaryPatternCanvas.scaleY);
              return ctx.createPattern(temporaryPatternCanvas.canvas, "no-repeat");
            }
          }]);

          return MeshShadingPattern;
        }(BaseShadingPattern);

        var DummyShadingPattern = /*#__PURE__*/function (_BaseShadingPattern3) {
          _inherits(DummyShadingPattern, _BaseShadingPattern3);

          var _super3 = _createSuper(DummyShadingPattern);

          function DummyShadingPattern() {
            _classCallCheck(this, DummyShadingPattern);

            return _super3.apply(this, arguments);
          }

          _createClass(DummyShadingPattern, [{
            key: "getPattern",
            value: function getPattern() {
              return "hotpink";
            }
          }]);

          return DummyShadingPattern;
        }(BaseShadingPattern);

        function getShadingPattern(IR, cachedCanvasPatterns) {
          switch (IR[0]) {
            case "RadialAxial":
              return new RadialAxialShadingPattern(IR, cachedCanvasPatterns);

            case "Mesh":
              return new MeshShadingPattern(IR);

            case "Dummy":
              return new DummyShadingPattern();
          }

          throw new Error("Unknown IR type: ".concat(IR[0]));
        }

        var PaintType = {
          COLORED: 1,
          UNCOLORED: 2
        };

        var TilingPattern = /*#__PURE__*/function () {
          function TilingPattern(IR, color, ctx, canvasGraphicsFactory, baseTransform) {
            _classCallCheck(this, TilingPattern);

            this.operatorList = IR[2];
            this.matrix = IR[3] || [1, 0, 0, 1, 0, 0];
            this.bbox = IR[4];
            this.xstep = IR[5];
            this.ystep = IR[6];
            this.paintType = IR[7];
            this.tilingType = IR[8];
            this.color = color;
            this.ctx = ctx;
            this.canvasGraphicsFactory = canvasGraphicsFactory;
            this.baseTransform = baseTransform;
          }

          _createClass(TilingPattern, [{
            key: "createPatternCanvas",
            value: function createPatternCanvas(owner) {
              var operatorList = this.operatorList;
              var bbox = this.bbox;
              var xstep = this.xstep;
              var ystep = this.ystep;
              var paintType = this.paintType;
              var tilingType = this.tilingType;
              var color = this.color;
              var canvasGraphicsFactory = this.canvasGraphicsFactory;
              (0, _util.info)("TilingType: " + tilingType);
              var x0 = bbox[0],
                  y0 = bbox[1],
                  x1 = bbox[2],
                  y1 = bbox[3];

              var matrixScale = _util.Util.singularValueDecompose2dScale(this.matrix);

              var curMatrixScale = _util.Util.singularValueDecompose2dScale(this.baseTransform);

              var combinedScale = [matrixScale[0] * curMatrixScale[0], matrixScale[1] * curMatrixScale[1]];
              var dimx = this.getSizeAndScale(xstep, this.ctx.canvas.width, combinedScale[0]);
              var dimy = this.getSizeAndScale(ystep, this.ctx.canvas.height, combinedScale[1]);
              var tmpCanvas = owner.cachedCanvases.getCanvas("pattern", dimx.size, dimy.size, true);
              var tmpCtx = tmpCanvas.context;
              var graphics = canvasGraphicsFactory.createCanvasGraphics(tmpCtx);
              graphics.groupLevel = owner.groupLevel;
              this.setFillAndStrokeStyleToContext(graphics, paintType, color);
              var adjustedX0 = x0;
              var adjustedY0 = y0;
              var adjustedX1 = x1;
              var adjustedY1 = y1;

              if (x0 < 0) {
                adjustedX0 = 0;
                adjustedX1 += Math.abs(x0);
              }

              if (y0 < 0) {
                adjustedY0 = 0;
                adjustedY1 += Math.abs(y0);
              }

              tmpCtx.translate(-(dimx.scale * adjustedX0), -(dimy.scale * adjustedY0));
              graphics.transform(dimx.scale, 0, 0, dimy.scale, 0, 0);
              this.clipBbox(graphics, adjustedX0, adjustedY0, adjustedX1, adjustedY1);
              graphics.baseTransform = graphics.ctx.mozCurrentTransform.slice();
              graphics.executeOperatorList(operatorList);
              graphics.endDrawing();
              return {
                canvas: tmpCanvas.canvas,
                scaleX: dimx.scale,
                scaleY: dimy.scale,
                offsetX: adjustedX0,
                offsetY: adjustedY0
              };
            }
          }, {
            key: "getSizeAndScale",
            value: function getSizeAndScale(step, realOutputSize, scale) {
              step = Math.abs(step);
              var maxSize = Math.max(TilingPattern.MAX_PATTERN_SIZE, realOutputSize);
              var size = Math.ceil(step * scale);

              if (size >= maxSize) {
                size = maxSize;
              } else {
                scale = size / step;
              }

              return {
                scale: scale,
                size: size
              };
            }
          }, {
            key: "clipBbox",
            value: function clipBbox(graphics, x0, y0, x1, y1) {
              var bboxWidth = x1 - x0;
              var bboxHeight = y1 - y0;
              graphics.ctx.rect(x0, y0, bboxWidth, bboxHeight);
              graphics.clip();
              graphics.endPath();
            }
          }, {
            key: "setFillAndStrokeStyleToContext",
            value: function setFillAndStrokeStyleToContext(graphics, paintType, color) {
              var context = graphics.ctx,
                  current = graphics.current;

              switch (paintType) {
                case PaintType.COLORED:
                  var ctx = this.ctx;
                  context.fillStyle = ctx.fillStyle;
                  context.strokeStyle = ctx.strokeStyle;
                  current.fillColor = ctx.fillStyle;
                  current.strokeColor = ctx.strokeStyle;
                  break;

                case PaintType.UNCOLORED:
                  var cssColor = _util.Util.makeHexColor(color[0], color[1], color[2]);

                  context.fillStyle = cssColor;
                  context.strokeStyle = cssColor;
                  current.fillColor = cssColor;
                  current.strokeColor = cssColor;
                  break;

                default:
                  throw new _util.FormatError("Unsupported paint type: ".concat(paintType));
              }
            }
          }, {
            key: "getPattern",
            value: function getPattern(ctx, owner, inverse) {
              var shadingFill = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
              var matrix = inverse;

              if (!shadingFill) {
                matrix = _util.Util.transform(matrix, owner.baseTransform);

                if (this.matrix) {
                  matrix = _util.Util.transform(matrix, this.matrix);
                }
              }

              var temporaryPatternCanvas = this.createPatternCanvas(owner);
              var domMatrix = new DOMMatrix(matrix);
              domMatrix = domMatrix.translate(temporaryPatternCanvas.offsetX, temporaryPatternCanvas.offsetY);
              domMatrix = domMatrix.scale(1 / temporaryPatternCanvas.scaleX, 1 / temporaryPatternCanvas.scaleY);
              var pattern = ctx.createPattern(temporaryPatternCanvas.canvas, "repeat");

              try {
                pattern.setTransform(domMatrix);
              } catch (ex) {
                (0, _util.warn)("TilingPattern.getPattern: \"".concat(ex === null || ex === void 0 ? void 0 : ex.message, "\"."));
              }

              return pattern;
            }
          }], [{
            key: "MAX_PATTERN_SIZE",
            get: function get() {
              return (0, _util.shadow)(this, "MAX_PATTERN_SIZE", 3000);
            }
          }]);

          return TilingPattern;
        }();

        exports.TilingPattern = TilingPattern;
        /***/
      },
      /* 125 */

      /***/
      function (__unused_webpack_module, exports) {
        "use strict";

        Object.defineProperty(exports, "__esModule", {
          value: true
        });
        exports.GlobalWorkerOptions = void 0;
        var GlobalWorkerOptions = Object.create(null);
        exports.GlobalWorkerOptions = GlobalWorkerOptions;
        GlobalWorkerOptions.workerPort = GlobalWorkerOptions.workerPort === undefined ? null : GlobalWorkerOptions.workerPort;
        GlobalWorkerOptions.workerSrc = GlobalWorkerOptions.workerSrc === undefined ? "" : GlobalWorkerOptions.workerSrc;
        /***/
      },
      /* 126 */

      /***/
      function (__unused_webpack_module, exports, __w_pdfjs_require__) {
        "use strict";

        Object.defineProperty(exports, "__esModule", {
          value: true
        });
        exports.MessageHandler = void 0;

        var _regenerator = _interopRequireDefault(__w_pdfjs_require__(2));

        var _util = __w_pdfjs_require__(4);

        function _interopRequireDefault(obj) {
          return obj && obj.__esModule ? obj : {
            "default": obj
          };
        }

        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 self = this,
                args = arguments;
            return new Promise(function (resolve, reject) {
              var gen = fn.apply(self, args);

              function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
              }

              function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
              }

              _next(undefined);
            });
          };
        }

        function _classCallCheck(instance, Constructor) {
          if (!(instance instanceof Constructor)) {
            throw new TypeError("Cannot call a class as a function");
          }
        }

        function _defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];
            descriptor.enumerable = descriptor.enumerable || false;
            descriptor.configurable = true;
            if ("value" in descriptor) descriptor.writable = true;
            Object.defineProperty(target, descriptor.key, descriptor);
          }
        }

        function _createClass(Constructor, protoProps, staticProps) {
          if (protoProps) _defineProperties(Constructor.prototype, protoProps);
          if (staticProps) _defineProperties(Constructor, staticProps);
          return Constructor;
        }

        function _typeof(obj) {
          "@babel/helpers - typeof";

          if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
            _typeof = function _typeof(obj) {
              return typeof obj;
            };
          } else {
            _typeof = function _typeof(obj) {
              return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
            };
          }

          return _typeof(obj);
        }

        var CallbackKind = {
          UNKNOWN: 0,
          DATA: 1,
          ERROR: 2
        };
        var StreamKind = {
          UNKNOWN: 0,
          CANCEL: 1,
          CANCEL_COMPLETE: 2,
          CLOSE: 3,
          ENQUEUE: 4,
          ERROR: 5,
          PULL: 6,
          PULL_COMPLETE: 7,
          START_COMPLETE: 8
        };

        function wrapReason(reason) {
          if (!(reason instanceof Error || _typeof(reason) === "object" && reason !== null)) {
            (0, _util.warn)('wrapReason: Expected "reason" to be a (possibly cloned) Error.');
            return reason;
          }

          switch (reason.name) {
            case "AbortException":
              return new _util.AbortException(reason.message);

            case "MissingPDFException":
              return new _util.MissingPDFException(reason.message);

            case "PasswordException":
              return new _util.PasswordException(reason.message, reason.code);

            case "UnexpectedResponseException":
              return new _util.UnexpectedResponseException(reason.message, reason.status);

            case "UnknownErrorException":
              return new _util.UnknownErrorException(reason.message, reason.details);

            default:
              return new _util.UnknownErrorException(reason.message, reason.toString());
          }
        }

        var MessageHandler = /*#__PURE__*/function () {
          function MessageHandler(sourceName, targetName, comObj) {
            var _this = this;

            _classCallCheck(this, MessageHandler);

            this.sourceName = sourceName;
            this.targetName = targetName;
            this.comObj = comObj;
            this.callbackId = 1;
            this.streamId = 1;
            this.postMessageTransfers = true;
            this.streamSinks = Object.create(null);
            this.streamControllers = Object.create(null);
            this.callbackCapabilities = Object.create(null);
            this.actionHandler = Object.create(null);

            this._onComObjOnMessage = function (event) {
              var data = event.data;

              if (data.targetName !== _this.sourceName) {
                return;
              }

              if (data.stream) {
                _this._processStreamMessage(data);

                return;
              }

              if (data.callback) {
                var callbackId = data.callbackId;
                var capability = _this.callbackCapabilities[callbackId];

                if (!capability) {
                  throw new Error("Cannot resolve callback ".concat(callbackId));
                }

                delete _this.callbackCapabilities[callbackId];

                if (data.callback === CallbackKind.DATA) {
                  capability.resolve(data.data);
                } else if (data.callback === CallbackKind.ERROR) {
                  capability.reject(wrapReason(data.reason));
                } else {
                  throw new Error("Unexpected callback case");
                }

                return;
              }

              var action = _this.actionHandler[data.action];

              if (!action) {
                throw new Error("Unknown action from worker: ".concat(data.action));
              }

              if (data.callbackId) {
                var cbSourceName = _this.sourceName;
                var cbTargetName = data.sourceName;
                new Promise(function (resolve) {
                  resolve(action(data.data));
                }).then(function (result) {
                  comObj.postMessage({
                    sourceName: cbSourceName,
                    targetName: cbTargetName,
                    callback: CallbackKind.DATA,
                    callbackId: data.callbackId,
                    data: result
                  });
                }, function (reason) {
                  comObj.postMessage({
                    sourceName: cbSourceName,
                    targetName: cbTargetName,
                    callback: CallbackKind.ERROR,
                    callbackId: data.callbackId,
                    reason: wrapReason(reason)
                  });
                });
                return;
              }

              if (data.streamId) {
                _this._createStreamSink(data);

                return;
              }

              action(data.data);
            };

            comObj.addEventListener("message", this._onComObjOnMessage);
          }

          _createClass(MessageHandler, [{
            key: "on",
            value: function on(actionName, handler) {
              var ah = this.actionHandler;

              if (ah[actionName]) {
                throw new Error("There is already an actionName called \"".concat(actionName, "\""));
              }

              ah[actionName] = handler;
            }
          }, {
            key: "send",
            value: function send(actionName, data, transfers) {
              this._postMessage({
                sourceName: this.sourceName,
                targetName: this.targetName,
                action: actionName,
                data: data
              }, transfers);
            }
          }, {
            key: "sendWithPromise",
            value: function sendWithPromise(actionName, data, transfers) {
              var callbackId = this.callbackId++;
              var capability = (0, _util.createPromiseCapability)();
              this.callbackCapabilities[callbackId] = capability;

              try {
                this._postMessage({
                  sourceName: this.sourceName,
                  targetName: this.targetName,
                  action: actionName,
                  callbackId: callbackId,
                  data: data
                }, transfers);
              } catch (ex) {
                capability.reject(ex);
              }

              return capability.promise;
            }
          }, {
            key: "sendWithStream",
            value: function sendWithStream(actionName, data, queueingStrategy, transfers) {
              var _this2 = this;

              var streamId = this.streamId++,
                  sourceName = this.sourceName,
                  targetName = this.targetName,
                  comObj = this.comObj;
              return new ReadableStream({
                start: function start(controller) {
                  var startCapability = (0, _util.createPromiseCapability)();
                  _this2.streamControllers[streamId] = {
                    controller: controller,
                    startCall: startCapability,
                    pullCall: null,
                    cancelCall: null,
                    isClosed: false
                  };

                  _this2._postMessage({
                    sourceName: sourceName,
                    targetName: targetName,
                    action: actionName,
                    streamId: streamId,
                    data: data,
                    desiredSize: controller.desiredSize
                  }, transfers);

                  return startCapability.promise;
                },
                pull: function pull(controller) {
                  var pullCapability = (0, _util.createPromiseCapability)();
                  _this2.streamControllers[streamId].pullCall = pullCapability;
                  comObj.postMessage({
                    sourceName: sourceName,
                    targetName: targetName,
                    stream: StreamKind.PULL,
                    streamId: streamId,
                    desiredSize: controller.desiredSize
                  });
                  return pullCapability.promise;
                },
                cancel: function cancel(reason) {
                  (0, _util.assert)(reason instanceof Error, "cancel must have a valid reason");
                  var cancelCapability = (0, _util.createPromiseCapability)();
                  _this2.streamControllers[streamId].cancelCall = cancelCapability;
                  _this2.streamControllers[streamId].isClosed = true;
                  comObj.postMessage({
                    sourceName: sourceName,
                    targetName: targetName,
                    stream: StreamKind.CANCEL,
                    streamId: streamId,
                    reason: wrapReason(reason)
                  });
                  return cancelCapability.promise;
                }
              }, queueingStrategy);
            }
          }, {
            key: "_createStreamSink",
            value: function _createStreamSink(data) {
              var streamId = data.streamId,
                  sourceName = this.sourceName,
                  targetName = data.sourceName,
                  comObj = this.comObj;
              var self = this,
                  action = this.actionHandler[data.action];
              var streamSink = {
                enqueue: function enqueue(chunk) {
                  var size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
                  var transfers = arguments.length > 2 ? arguments[2] : undefined;

                  if (this.isCancelled) {
                    return;
                  }

                  var lastDesiredSize = this.desiredSize;
                  this.desiredSize -= size;

                  if (lastDesiredSize > 0 && this.desiredSize <= 0) {
                    this.sinkCapability = (0, _util.createPromiseCapability)();
                    this.ready = this.sinkCapability.promise;
                  }

                  self._postMessage({
                    sourceName: sourceName,
                    targetName: targetName,
                    stream: StreamKind.ENQUEUE,
                    streamId: streamId,
                    chunk: chunk
                  }, transfers);
                },
                close: function close() {
                  if (this.isCancelled) {
                    return;
                  }

                  this.isCancelled = true;
                  comObj.postMessage({
                    sourceName: sourceName,
                    targetName: targetName,
                    stream: StreamKind.CLOSE,
                    streamId: streamId
                  });
                  delete self.streamSinks[streamId];
                },
                error: function error(reason) {
                  (0, _util.assert)(reason instanceof Error, "error must have a valid reason");

                  if (this.isCancelled) {
                    return;
                  }

                  this.isCancelled = true;
                  comObj.postMessage({
                    sourceName: sourceName,
                    targetName: targetName,
                    stream: StreamKind.ERROR,
                    streamId: streamId,
                    reason: wrapReason(reason)
                  });
                },
                sinkCapability: (0, _util.createPromiseCapability)(),
                onPull: null,
                onCancel: null,
                isCancelled: false,
                desiredSize: data.desiredSize,
                ready: null
              };
              streamSink.sinkCapability.resolve();
              streamSink.ready = streamSink.sinkCapability.promise;
              this.streamSinks[streamId] = streamSink;
              new Promise(function (resolve) {
                resolve(action(data.data, streamSink));
              }).then(function () {
                comObj.postMessage({
                  sourceName: sourceName,
                  targetName: targetName,
                  stream: StreamKind.START_COMPLETE,
                  streamId: streamId,
                  success: true
                });
              }, function (reason) {
                comObj.postMessage({
                  sourceName: sourceName,
                  targetName: targetName,
                  stream: StreamKind.START_COMPLETE,
                  streamId: streamId,
                  reason: wrapReason(reason)
                });
              });
            }
          }, {
            key: "_processStreamMessage",
            value: function _processStreamMessage(data) {
              var streamId = data.streamId,
                  sourceName = this.sourceName,
                  targetName = data.sourceName,
                  comObj = this.comObj;
              var streamController = this.streamControllers[streamId],
                  streamSink = this.streamSinks[streamId];

              switch (data.stream) {
                case StreamKind.START_COMPLETE:
                  if (data.success) {
                    streamController.startCall.resolve();
                  } else {
                    streamController.startCall.reject(wrapReason(data.reason));
                  }

                  break;

                case StreamKind.PULL_COMPLETE:
                  if (data.success) {
                    streamController.pullCall.resolve();
                  } else {
                    streamController.pullCall.reject(wrapReason(data.reason));
                  }

                  break;

                case StreamKind.PULL:
                  if (!streamSink) {
                    comObj.postMessage({
                      sourceName: sourceName,
                      targetName: targetName,
                      stream: StreamKind.PULL_COMPLETE,
                      streamId: streamId,
                      success: true
                    });
                    break;
                  }

                  if (streamSink.desiredSize <= 0 && data.desiredSize > 0) {
                    streamSink.sinkCapability.resolve();
                  }

                  streamSink.desiredSize = data.desiredSize;
                  new Promise(function (resolve) {
                    resolve(streamSink.onPull && streamSink.onPull());
                  }).then(function () {
                    comObj.postMessage({
                      sourceName: sourceName,
                      targetName: targetName,
                      stream: StreamKind.PULL_COMPLETE,
                      streamId: streamId,
                      success: true
                    });
                  }, function (reason) {
                    comObj.postMessage({
                      sourceName: sourceName,
                      targetName: targetName,
                      stream: StreamKind.PULL_COMPLETE,
                      streamId: streamId,
                      reason: wrapReason(reason)
                    });
                  });
                  break;

                case StreamKind.ENQUEUE:
                  (0, _util.assert)(streamController, "enqueue should have stream controller");

                  if (streamController.isClosed) {
                    break;
                  }

                  streamController.controller.enqueue(data.chunk);
                  break;

                case StreamKind.CLOSE:
                  (0, _util.assert)(streamController, "close should have stream controller");

                  if (streamController.isClosed) {
                    break;
                  }

                  streamController.isClosed = true;
                  streamController.controller.close();

                  this._deleteStreamController(streamController, streamId);

                  break;

                case StreamKind.ERROR:
                  (0, _util.assert)(streamController, "error should have stream controller");
                  streamController.controller.error(wrapReason(data.reason));

                  this._deleteStreamController(streamController, streamId);

                  break;

                case StreamKind.CANCEL_COMPLETE:
                  if (data.success) {
                    streamController.cancelCall.resolve();
                  } else {
                    streamController.cancelCall.reject(wrapReason(data.reason));
                  }

                  this._deleteStreamController(streamController, streamId);

                  break;

                case StreamKind.CANCEL:
                  if (!streamSink) {
                    break;
                  }

                  new Promise(function (resolve) {
                    resolve(streamSink.onCancel && streamSink.onCancel(wrapReason(data.reason)));
                  }).then(function () {
                    comObj.postMessage({
                      sourceName: sourceName,
                      targetName: targetName,
                      stream: StreamKind.CANCEL_COMPLETE,
                      streamId: streamId,
                      success: true
                    });
                  }, function (reason) {
                    comObj.postMessage({
                      sourceName: sourceName,
                      targetName: targetName,
                      stream: StreamKind.CANCEL_COMPLETE,
                      streamId: streamId,
                      reason: wrapReason(reason)
                    });
                  });
                  streamSink.sinkCapability.reject(wrapReason(data.reason));
                  streamSink.isCancelled = true;
                  delete this.streamSinks[streamId];
                  break;

                default:
                  throw new Error("Unexpected stream case");
              }
            }
          }, {
            key: "_deleteStreamController",
            value: function () {
              var _deleteStreamController2 = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee(streamController, streamId) {
                return _regenerator["default"].wrap(function _callee$(_context) {
                  while (1) {
                    switch (_context.prev = _context.next) {
                      case 0:
                        _context.next = 2;
                        return Promise.allSettled([streamController.startCall && streamController.startCall.promise, streamController.pullCall && streamController.pullCall.promise, streamController.cancelCall && streamController.cancelCall.promise]);

                      case 2:
                        delete this.streamControllers[streamId];

                      case 3:
                      case "end":
                        return _context.stop();
                    }
                  }
                }, _callee, this);
              }));

              function _deleteStreamController(_x, _x2) {
                return _deleteStreamController2.apply(this, arguments);
              }

              return _deleteStreamController;
            }()
          }, {
            key: "_postMessage",
            value: function _postMessage(message, transfers) {
              if (transfers && this.postMessageTransfers) {
                this.comObj.postMessage(message, transfers);
              } else {
                this.comObj.postMessage(message);
              }
            }
          }, {
            key: "destroy",
            value: function destroy() {
              this.comObj.removeEventListener("message", this._onComObjOnMessage);
            }
          }]);

          return MessageHandler;
        }();

        exports.MessageHandler = MessageHandler;
        /***/
      },
      /* 127 */

      /***/
      function (__unused_webpack_module, exports, __w_pdfjs_require__) {
        "use strict";

        Object.defineProperty(exports, "__esModule", {
          value: true
        });
        exports.Metadata = void 0;

        var _util = __w_pdfjs_require__(4);

        function _classCallCheck(instance, Constructor) {
          if (!(instance instanceof Constructor)) {
            throw new TypeError("Cannot call a class as a function");
          }
        }

        function _defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];
            descriptor.enumerable = descriptor.enumerable || false;
            descriptor.configurable = true;
            if ("value" in descriptor) descriptor.writable = true;
            Object.defineProperty(target, descriptor.key, descriptor);
          }
        }

        function _createClass(Constructor, protoProps, staticProps) {
          if (protoProps) _defineProperties(Constructor.prototype, protoProps);
          if (staticProps) _defineProperties(Constructor, staticProps);
          return Constructor;
        }

        var Metadata = /*#__PURE__*/function () {
          function Metadata(_ref) {
            var parsedData = _ref.parsedData,
                rawData = _ref.rawData;

            _classCallCheck(this, Metadata);

            this._metadataMap = parsedData;
            this._data = rawData;
          }

          _createClass(Metadata, [{
            key: "getRaw",
            value: function getRaw() {
              return this._data;
            }
          }, {
            key: "get",
            value: function get(name) {
              var _this$_metadataMap$ge;

              return (_this$_metadataMap$ge = this._metadataMap.get(name)) !== null && _this$_metadataMap$ge !== void 0 ? _this$_metadataMap$ge : null;
            }
          }, {
            key: "getAll",
            value: function getAll() {
              return (0, _util.objectFromMap)(this._metadataMap);
            }
          }, {
            key: "has",
            value: function has(name) {
              return this._metadataMap.has(name);
            }
          }]);

          return Metadata;
        }();

        exports.Metadata = Metadata;
        /***/
      },
      /* 128 */

      /***/
      function (__unused_webpack_module, exports, __w_pdfjs_require__) {
        "use strict";

        Object.defineProperty(exports, "__esModule", {
          value: true
        });
        exports.OptionalContentConfig = void 0;

        var _util = __w_pdfjs_require__(4);

        function _createForOfIteratorHelper(o, allowArrayLike) {
          var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];

          if (!it) {
            if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
              if (it) o = it;
              var i = 0;

              var F = function F() {};

              return {
                s: F,
                n: function n() {
                  if (i >= o.length) return {
                    done: true
                  };
                  return {
                    done: false,
                    value: o[i++]
                  };
                },
                e: function e(_e) {
                  throw _e;
                },
                f: F
              };
            }

            throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
          }

          var normalCompletion = true,
              didErr = false,
              err;
          return {
            s: function s() {
              it = it.call(o);
            },
            n: function n() {
              var step = it.next();
              normalCompletion = step.done;
              return step;
            },
            e: function e(_e2) {
              didErr = true;
              err = _e2;
            },
            f: function f() {
              try {
                if (!normalCompletion && it["return"] != null) it["return"]();
              } finally {
                if (didErr) throw err;
              }
            }
          };
        }

        function _unsupportedIterableToArray(o, minLen) {
          if (!o) return;
          if (typeof o === "string") return _arrayLikeToArray(o, minLen);
          var n = Object.prototype.toString.call(o).slice(8, -1);
          if (n === "Object" && o.constructor) n = o.constructor.name;
          if (n === "Map" || n === "Set") return Array.from(o);
          if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
        }

        function _arrayLikeToArray(arr, len) {
          if (len == null || len > arr.length) len = arr.length;

          for (var i = 0, arr2 = new Array(len); i < len; i++) {
            arr2[i] = arr[i];
          }

          return arr2;
        }

        function _defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];
            descriptor.enumerable = descriptor.enumerable || false;
            descriptor.configurable = true;
            if ("value" in descriptor) descriptor.writable = true;
            Object.defineProperty(target, descriptor.key, descriptor);
          }
        }

        function _createClass(Constructor, protoProps, staticProps) {
          if (protoProps) _defineProperties(Constructor.prototype, protoProps);
          if (staticProps) _defineProperties(Constructor, staticProps);
          return Constructor;
        }

        function _classCallCheck(instance, Constructor) {
          if (!(instance instanceof Constructor)) {
            throw new TypeError("Cannot call a class as a function");
          }
        }

        var OptionalContentGroup = function OptionalContentGroup(name, intent) {
          _classCallCheck(this, OptionalContentGroup);

          this.visible = true;
          this.name = name;
          this.intent = intent;
        };

        var OptionalContentConfig = /*#__PURE__*/function () {
          function OptionalContentConfig(data) {
            _classCallCheck(this, OptionalContentConfig);

            this.name = null;
            this.creator = null;
            this._order = null;
            this._groups = new Map();

            if (data === null) {
              return;
            }

            this.name = data.name;
            this.creator = data.creator;
            this._order = data.order;

            var _iterator = _createForOfIteratorHelper(data.groups),
                _step;

            try {
              for (_iterator.s(); !(_step = _iterator.n()).done;) {
                var _group = _step.value;

                this._groups.set(_group.id, new OptionalContentGroup(_group.name, _group.intent));
              }
            } catch (err) {
              _iterator.e(err);
            } finally {
              _iterator.f();
            }

            if (data.baseState === "OFF") {
              var _iterator2 = _createForOfIteratorHelper(this._groups),
                  _step2;

              try {
                for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
                  var group = _step2.value;
                  group.visible = false;
                }
              } catch (err) {
                _iterator2.e(err);
              } finally {
                _iterator2.f();
              }
            }

            var _iterator3 = _createForOfIteratorHelper(data.on),
                _step3;

            try {
              for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
                var on = _step3.value;
                this._groups.get(on).visible = true;
              }
            } catch (err) {
              _iterator3.e(err);
            } finally {
              _iterator3.f();
            }

            var _iterator4 = _createForOfIteratorHelper(data.off),
                _step4;

            try {
              for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
                var off = _step4.value;
                this._groups.get(off).visible = false;
              }
            } catch (err) {
              _iterator4.e(err);
            } finally {
              _iterator4.f();
            }
          }

          _createClass(OptionalContentConfig, [{
            key: "_evaluateVisibilityExpression",
            value: function _evaluateVisibilityExpression(array) {
              var length = array.length;

              if (length < 2) {
                return true;
              }

              var operator = array[0];

              for (var i = 1; i < length; i++) {
                var element = array[i];
                var state = void 0;

                if (Array.isArray(element)) {
                  state = this._evaluateVisibilityExpression(element);
                } else if (this._groups.has(element)) {
                  state = this._groups.get(element).visible;
                } else {
                  (0, _util.warn)("Optional content group not found: ".concat(element));
                  return true;
                }

                switch (operator) {
                  case "And":
                    if (!state) {
                      return false;
                    }

                    break;

                  case "Or":
                    if (state) {
                      return true;
                    }

                    break;

                  case "Not":
                    return !state;

                  default:
                    return true;
                }
              }

              return operator === "And";
            }
          }, {
            key: "isVisible",
            value: function isVisible(group) {
              if (this._groups.size === 0) {
                return true;
              }

              if (!group) {
                (0, _util.warn)("Optional content group not defined.");
                return true;
              }

              if (group.type === "OCG") {
                if (!this._groups.has(group.id)) {
                  (0, _util.warn)("Optional content group not found: ".concat(group.id));
                  return true;
                }

                return this._groups.get(group.id).visible;
              } else if (group.type === "OCMD") {
                if (group.expression) {
                  return this._evaluateVisibilityExpression(group.expression);
                }

                if (!group.policy || group.policy === "AnyOn") {
                  var _iterator5 = _createForOfIteratorHelper(group.ids),
                      _step5;

                  try {
                    for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
                      var id = _step5.value;

                      if (!this._groups.has(id)) {
                        (0, _util.warn)("Optional content group not found: ".concat(id));
                        return true;
                      }

                      if (this._groups.get(id).visible) {
                        return true;
                      }
                    }
                  } catch (err) {
                    _iterator5.e(err);
                  } finally {
                    _iterator5.f();
                  }

                  return false;
                } else if (group.policy === "AllOn") {
                  var _iterator6 = _createForOfIteratorHelper(group.ids),
                      _step6;

                  try {
                    for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
                      var _id = _step6.value;

                      if (!this._groups.has(_id)) {
                        (0, _util.warn)("Optional content group not found: ".concat(_id));
                        return true;
                      }

                      if (!this._groups.get(_id).visible) {
                        return false;
                      }
                    }
                  } catch (err) {
                    _iterator6.e(err);
                  } finally {
                    _iterator6.f();
                  }

                  return true;
                } else if (group.policy === "AnyOff") {
                  var _iterator7 = _createForOfIteratorHelper(group.ids),
                      _step7;

                  try {
                    for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
                      var _id2 = _step7.value;

                      if (!this._groups.has(_id2)) {
                        (0, _util.warn)("Optional content group not found: ".concat(_id2));
                        return true;
                      }

                      if (!this._groups.get(_id2).visible) {
                        return true;
                      }
                    }
                  } catch (err) {
                    _iterator7.e(err);
                  } finally {
                    _iterator7.f();
                  }

                  return false;
                } else if (group.policy === "AllOff") {
                  var _iterator8 = _createForOfIteratorHelper(group.ids),
                      _step8;

                  try {
                    for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
                      var _id3 = _step8.value;

                      if (!this._groups.has(_id3)) {
                        (0, _util.warn)("Optional content group not found: ".concat(_id3));
                        return true;
                      }

                      if (this._groups.get(_id3).visible) {
                        return false;
                      }
                    }
                  } catch (err) {
                    _iterator8.e(err);
                  } finally {
                    _iterator8.f();
                  }

                  return true;
                }

                (0, _util.warn)("Unknown optional content policy ".concat(group.policy, "."));
                return true;
              }

              (0, _util.warn)("Unknown group type ".concat(group.type, "."));
              return true;
            }
          }, {
            key: "setVisibility",
            value: function setVisibility(id) {
              var visible = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;

              if (!this._groups.has(id)) {
                (0, _util.warn)("Optional content group not found: ".concat(id));
                return;
              }

              this._groups.get(id).visible = !!visible;
            }
          }, {
            key: "getOrder",
            value: function getOrder() {
              if (!this._groups.size) {
                return null;
              }

              if (this._order) {
                return this._order.slice();
              }

              return Array.from(this._groups.keys());
            }
          }, {
            key: "getGroups",
            value: function getGroups() {
              return this._groups.size > 0 ? (0, _util.objectFromMap)(this._groups) : null;
            }
          }, {
            key: "getGroup",
            value: function getGroup(id) {
              return this._groups.get(id) || null;
            }
          }]);

          return OptionalContentConfig;
        }();

        exports.OptionalContentConfig = OptionalContentConfig;
        /***/
      },
      /* 129 */

      /***/
      function (__unused_webpack_module, exports, __w_pdfjs_require__) {
        "use strict";

        Object.defineProperty(exports, "__esModule", {
          value: true
        });
        exports.PDFDataTransportStream = void 0;

        var _regenerator = _interopRequireDefault(__w_pdfjs_require__(2));

        var _util = __w_pdfjs_require__(4);

        var _display_utils = __w_pdfjs_require__(1);

        function _interopRequireDefault(obj) {
          return obj && obj.__esModule ? obj : {
            "default": obj
          };
        }

        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 self = this,
                args = arguments;
            return new Promise(function (resolve, reject) {
              var gen = fn.apply(self, args);

              function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
              }

              function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
              }

              _next(undefined);
            });
          };
        }

        function _createForOfIteratorHelper(o, allowArrayLike) {
          var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];

          if (!it) {
            if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
              if (it) o = it;
              var i = 0;

              var F = function F() {};

              return {
                s: F,
                n: function n() {
                  if (i >= o.length) return {
                    done: true
                  };
                  return {
                    done: false,
                    value: o[i++]
                  };
                },
                e: function e(_e) {
                  throw _e;
                },
                f: F
              };
            }

            throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
          }

          var normalCompletion = true,
              didErr = false,
              err;
          return {
            s: function s() {
              it = it.call(o);
            },
            n: function n() {
              var step = it.next();
              normalCompletion = step.done;
              return step;
            },
            e: function e(_e2) {
              didErr = true;
              err = _e2;
            },
            f: function f() {
              try {
                if (!normalCompletion && it["return"] != null) it["return"]();
              } finally {
                if (didErr) throw err;
              }
            }
          };
        }

        function _unsupportedIterableToArray(o, minLen) {
          if (!o) return;
          if (typeof o === "string") return _arrayLikeToArray(o, minLen);
          var n = Object.prototype.toString.call(o).slice(8, -1);
          if (n === "Object" && o.constructor) n = o.constructor.name;
          if (n === "Map" || n === "Set") return Array.from(o);
          if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
        }

        function _arrayLikeToArray(arr, len) {
          if (len == null || len > arr.length) len = arr.length;

          for (var i = 0, arr2 = new Array(len); i < len; i++) {
            arr2[i] = arr[i];
          }

          return arr2;
        }

        function _classCallCheck(instance, Constructor) {
          if (!(instance instanceof Constructor)) {
            throw new TypeError("Cannot call a class as a function");
          }
        }

        function _defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];
            descriptor.enumerable = descriptor.enumerable || false;
            descriptor.configurable = true;
            if ("value" in descriptor) descriptor.writable = true;
            Object.defineProperty(target, descriptor.key, descriptor);
          }
        }

        function _createClass(Constructor, protoProps, staticProps) {
          if (protoProps) _defineProperties(Constructor.prototype, protoProps);
          if (staticProps) _defineProperties(Constructor, staticProps);
          return Constructor;
        }

        var PDFDataTransportStream = /*#__PURE__*/function () {
          function PDFDataTransportStream(params, pdfDataRangeTransport) {
            var _this = this;

            _classCallCheck(this, PDFDataTransportStream);

            (0, _util.assert)(pdfDataRangeTransport, 'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');
            this._queuedChunks = [];
            this._progressiveDone = params.progressiveDone || false;
            this._contentDispositionFilename = params.contentDispositionFilename || null;
            var initialData = params.initialData;

            if ((initialData === null || initialData === void 0 ? void 0 : initialData.length) > 0) {
              var buffer = new Uint8Array(initialData).buffer;

              this._queuedChunks.push(buffer);
            }

            this._pdfDataRangeTransport = pdfDataRangeTransport;
            this._isStreamingSupported = !params.disableStream;
            this._isRangeSupported = !params.disableRange;
            this._contentLength = params.length;
            this._fullRequestReader = null;
            this._rangeReaders = [];

            this._pdfDataRangeTransport.addRangeListener(function (begin, chunk) {
              _this._onReceiveData({
                begin: begin,
                chunk: chunk
              });
            });

            this._pdfDataRangeTransport.addProgressListener(function (loaded, total) {
              _this._onProgress({
                loaded: loaded,
                total: total
              });
            });

            this._pdfDataRangeTransport.addProgressiveReadListener(function (chunk) {
              _this._onReceiveData({
                chunk: chunk
              });
            });

            this._pdfDataRangeTransport.addProgressiveDoneListener(function () {
              _this._onProgressiveDone();
            });

            this._pdfDataRangeTransport.transportReady();
          }

          _createClass(PDFDataTransportStream, [{
            key: "_onReceiveData",
            value: function _onReceiveData(args) {
              var buffer = new Uint8Array(args.chunk).buffer;

              if (args.begin === undefined) {
                if (this._fullRequestReader) {
                  this._fullRequestReader._enqueue(buffer);
                } else {
                  this._queuedChunks.push(buffer);
                }
              } else {
                var found = this._rangeReaders.some(function (rangeReader) {
                  if (rangeReader._begin !== args.begin) {
                    return false;
                  }

                  rangeReader._enqueue(buffer);

                  return true;
                });

                (0, _util.assert)(found, "_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.");
              }
            }
          }, {
            key: "_progressiveDataLength",
            get: function get() {
              var _this$_fullRequestRea, _this$_fullRequestRea2;

              return (_this$_fullRequestRea = (_this$_fullRequestRea2 = this._fullRequestReader) === null || _this$_fullRequestRea2 === void 0 ? void 0 : _this$_fullRequestRea2._loaded) !== null && _this$_fullRequestRea !== void 0 ? _this$_fullRequestRea : 0;
            }
          }, {
            key: "_onProgress",
            value: function _onProgress(evt) {
              if (evt.total === undefined) {
                var firstReader = this._rangeReaders[0];

                if (firstReader !== null && firstReader !== void 0 && firstReader.onProgress) {
                  firstReader.onProgress({
                    loaded: evt.loaded
                  });
                }
              } else {
                var fullReader = this._fullRequestReader;

                if (fullReader !== null && fullReader !== void 0 && fullReader.onProgress) {
                  fullReader.onProgress({
                    loaded: evt.loaded,
                    total: evt.total
                  });
                }
              }
            }
          }, {
            key: "_onProgressiveDone",
            value: function _onProgressiveDone() {
              if (this._fullRequestReader) {
                this._fullRequestReader.progressiveDone();
              }

              this._progressiveDone = true;
            }
          }, {
            key: "_removeRangeReader",
            value: function _removeRangeReader(reader) {
              var i = this._rangeReaders.indexOf(reader);

              if (i >= 0) {
                this._rangeReaders.splice(i, 1);
              }
            }
          }, {
            key: "getFullReader",
            value: function getFullReader() {
              (0, _util.assert)(!this._fullRequestReader, "PDFDataTransportStream.getFullReader can only be called once.");
              var queuedChunks = this._queuedChunks;
              this._queuedChunks = null;
              return new PDFDataTransportStreamReader(this, queuedChunks, this._progressiveDone, this._contentDispositionFilename);
            }
          }, {
            key: "getRangeReader",
            value: function getRangeReader(begin, end) {
              if (end <= this._progressiveDataLength) {
                return null;
              }

              var reader = new PDFDataTransportStreamRangeReader(this, begin, end);

              this._pdfDataRangeTransport.requestDataRange(begin, end);

              this._rangeReaders.push(reader);

              return reader;
            }
          }, {
            key: "cancelAllRequests",
            value: function cancelAllRequests(reason) {
              if (this._fullRequestReader) {
                this._fullRequestReader.cancel(reason);
              }

              var _iterator = _createForOfIteratorHelper(this._rangeReaders.slice(0)),
                  _step;

              try {
                for (_iterator.s(); !(_step = _iterator.n()).done;) {
                  var reader = _step.value;
                  reader.cancel(reason);
                }
              } catch (err) {
                _iterator.e(err);
              } finally {
                _iterator.f();
              }

              this._pdfDataRangeTransport.abort();
            }
          }]);

          return PDFDataTransportStream;
        }();

        exports.PDFDataTransportStream = PDFDataTransportStream;

        var PDFDataTransportStreamReader = /*#__PURE__*/function () {
          function PDFDataTransportStreamReader(stream, queuedChunks) {
            var progressiveDone = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
            var contentDispositionFilename = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;

            _classCallCheck(this, PDFDataTransportStreamReader);

            this._stream = stream;
            this._done = progressiveDone || false;
            this._filename = (0, _display_utils.isPdfFile)(contentDispositionFilename) ? contentDispositionFilename : null;
            this._queuedChunks = queuedChunks || [];
            this._loaded = 0;

            var _iterator2 = _createForOfIteratorHelper(this._queuedChunks),
                _step2;

            try {
              for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
                var chunk = _step2.value;
                this._loaded += chunk.byteLength;
              }
            } catch (err) {
              _iterator2.e(err);
            } finally {
              _iterator2.f();
            }

            this._requests = [];
            this._headersReady = Promise.resolve();
            stream._fullRequestReader = this;
            this.onProgress = null;
          }

          _createClass(PDFDataTransportStreamReader, [{
            key: "_enqueue",
            value: function _enqueue(chunk) {
              if (this._done) {
                return;
              }

              if (this._requests.length > 0) {
                var requestCapability = this._requests.shift();

                requestCapability.resolve({
                  value: chunk,
                  done: false
                });
              } else {
                this._queuedChunks.push(chunk);
              }

              this._loaded += chunk.byteLength;
            }
          }, {
            key: "headersReady",
            get: function get() {
              return this._headersReady;
            }
          }, {
            key: "filename",
            get: function get() {
              return this._filename;
            }
          }, {
            key: "isRangeSupported",
            get: function get() {
              return this._stream._isRangeSupported;
            }
          }, {
            key: "isStreamingSupported",
            get: function get() {
              return this._stream._isStreamingSupported;
            }
          }, {
            key: "contentLength",
            get: function get() {
              return this._stream._contentLength;
            }
          }, {
            key: "read",
            value: function () {
              var _read = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
                var chunk, requestCapability;
                return _regenerator["default"].wrap(function _callee$(_context) {
                  while (1) {
                    switch (_context.prev = _context.next) {
                      case 0:
                        if (!(this._queuedChunks.length > 0)) {
                          _context.next = 3;
                          break;
                        }

                        chunk = this._queuedChunks.shift();
                        return _context.abrupt("return", {
                          value: chunk,
                          done: false
                        });

                      case 3:
                        if (!this._done) {
                          _context.next = 5;
                          break;
                        }

                        return _context.abrupt("return", {
                          value: undefined,
                          done: true
                        });

                      case 5:
                        requestCapability = (0, _util.createPromiseCapability)();

                        this._requests.push(requestCapability);

                        return _context.abrupt("return", requestCapability.promise);

                      case 8:
                      case "end":
                        return _context.stop();
                    }
                  }
                }, _callee, this);
              }));

              function read() {
                return _read.apply(this, arguments);
              }

              return read;
            }()
          }, {
            key: "cancel",
            value: function cancel(reason) {
              this._done = true;

              var _iterator3 = _createForOfIteratorHelper(this._requests),
                  _step3;

              try {
                for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
                  var requestCapability = _step3.value;
                  requestCapability.resolve({
                    value: undefined,
                    done: true
                  });
                }
              } catch (err) {
                _iterator3.e(err);
              } finally {
                _iterator3.f();
              }

              this._requests.length = 0;
            }
          }, {
            key: "progressiveDone",
            value: function progressiveDone() {
              if (this._done) {
                return;
              }

              this._done = true;
            }
          }]);

          return PDFDataTransportStreamReader;
        }();

        var PDFDataTransportStreamRangeReader = /*#__PURE__*/function () {
          function PDFDataTransportStreamRangeReader(stream, begin, end) {
            _classCallCheck(this, PDFDataTransportStreamRangeReader);

            this._stream = stream;
            this._begin = begin;
            this._end = end;
            this._queuedChunk = null;
            this._requests = [];
            this._done = false;
            this.onProgress = null;
          }

          _createClass(PDFDataTransportStreamRangeReader, [{
            key: "_enqueue",
            value: function _enqueue(chunk) {
              if (this._done) {
                return;
              }

              if (this._requests.length === 0) {
                this._queuedChunk = chunk;
              } else {
                var requestsCapability = this._requests.shift();

                requestsCapability.resolve({
                  value: chunk,
                  done: false
                });

                var _iterator4 = _createForOfIteratorHelper(this._requests),
                    _step4;

                try {
                  for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
                    var requestCapability = _step4.value;
                    requestCapability.resolve({
                      value: undefined,
                      done: true
                    });
                  }
                } catch (err) {
                  _iterator4.e(err);
                } finally {
                  _iterator4.f();
                }

                this._requests.length = 0;
              }

              this._done = true;

              this._stream._removeRangeReader(this);
            }
          }, {
            key: "isStreamingSupported",
            get: function get() {
              return false;
            }
          }, {
            key: "read",
            value: function () {
              var _read2 = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
                var chunk, requestCapability;
                return _regenerator["default"].wrap(function _callee2$(_context2) {
                  while (1) {
                    switch (_context2.prev = _context2.next) {
                      case 0:
                        if (!this._queuedChunk) {
                          _context2.next = 4;
                          break;
                        }

                        chunk = this._queuedChunk;
                        this._queuedChunk = null;
                        return _context2.abrupt("return", {
                          value: chunk,
                          done: false
                        });

                      case 4:
                        if (!this._done) {
                          _context2.next = 6;
                          break;
                        }

                        return _context2.abrupt("return", {
                          value: undefined,
                          done: true
                        });

                      case 6:
                        requestCapability = (0, _util.createPromiseCapability)();

                        this._requests.push(requestCapability);

                        return _context2.abrupt("return", requestCapability.promise);

                      case 9:
                      case "end":
                        return _context2.stop();
                    }
                  }
                }, _callee2, this);
              }));

              function read() {
                return _read2.apply(this, arguments);
              }

              return read;
            }()
          }, {
            key: "cancel",
            value: function cancel(reason) {
              this._done = true;

              var _iterator5 = _createForOfIteratorHelper(this._requests),
                  _step5;

              try {
                for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
                  var requestCapability = _step5.value;
                  requestCapability.resolve({
                    value: undefined,
                    done: true
                  });
                }
              } catch (err) {
                _iterator5.e(err);
              } finally {
                _iterator5.f();
              }

              this._requests.length = 0;

              this._stream._removeRangeReader(this);
            }
          }]);

          return PDFDataTransportStreamRangeReader;
        }();
        /***/

      },
      /* 130 */

      /***/
      function (__unused_webpack_module, exports) {
        "use strict";

        Object.defineProperty(exports, "__esModule", {
          value: true
        });
        exports.XfaText = void 0;

        function _createForOfIteratorHelper(o, allowArrayLike) {
          var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];

          if (!it) {
            if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
              if (it) o = it;
              var i = 0;

              var F = function F() {};

              return {
                s: F,
                n: function n() {
                  if (i >= o.length) return {
                    done: true
                  };
                  return {
                    done: false,
                    value: o[i++]
                  };
                },
                e: function e(_e) {
                  throw _e;
                },
                f: F
              };
            }

            throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
          }

          var normalCompletion = true,
              didErr = false,
              err;
          return {
            s: function s() {
              it = it.call(o);
            },
            n: function n() {
              var step = it.next();
              normalCompletion = step.done;
              return step;
            },
            e: function e(_e2) {
              didErr = true;
              err = _e2;
            },
            f: function f() {
              try {
                if (!normalCompletion && it["return"] != null) it["return"]();
              } finally {
                if (didErr) throw err;
              }
            }
          };
        }

        function _unsupportedIterableToArray(o, minLen) {
          if (!o) return;
          if (typeof o === "string") return _arrayLikeToArray(o, minLen);
          var n = Object.prototype.toString.call(o).slice(8, -1);
          if (n === "Object" && o.constructor) n = o.constructor.name;
          if (n === "Map" || n === "Set") return Array.from(o);
          if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
        }

        function _arrayLikeToArray(arr, len) {
          if (len == null || len > arr.length) len = arr.length;

          for (var i = 0, arr2 = new Array(len); i < len; i++) {
            arr2[i] = arr[i];
          }

          return arr2;
        }

        function _classCallCheck(instance, Constructor) {
          if (!(instance instanceof Constructor)) {
            throw new TypeError("Cannot call a class as a function");
          }
        }

        function _defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];
            descriptor.enumerable = descriptor.enumerable || false;
            descriptor.configurable = true;
            if ("value" in descriptor) descriptor.writable = true;
            Object.defineProperty(target, descriptor.key, descriptor);
          }
        }

        function _createClass(Constructor, protoProps, staticProps) {
          if (protoProps) _defineProperties(Constructor.prototype, protoProps);
          if (staticProps) _defineProperties(Constructor, staticProps);
          return Constructor;
        }

        var XfaText = /*#__PURE__*/function () {
          function XfaText() {
            _classCallCheck(this, XfaText);
          }

          _createClass(XfaText, null, [{
            key: "textContent",
            value: function textContent(xfa) {
              var items = [];
              var output = {
                items: items,
                styles: Object.create(null)
              };

              function walk(node) {
                var _node$attributes;

                if (!node) {
                  return;
                }

                var str = null;
                var name = node.name;

                if (name === "#text") {
                  str = node.value;
                } else if (!XfaText.shouldBuildText(name)) {
                  return;
                } else if (node !== null && node !== void 0 && (_node$attributes = node.attributes) !== null && _node$attributes !== void 0 && _node$attributes.textContent) {
                  str = node.attributes.textContent;
                } else if (node.value) {
                  str = node.value;
                }

                if (str !== null) {
                  items.push({
                    str: str
                  });
                }

                if (!node.children) {
                  return;
                }

                var _iterator = _createForOfIteratorHelper(node.children),
                    _step;

                try {
                  for (_iterator.s(); !(_step = _iterator.n()).done;) {
                    var child = _step.value;
                    walk(child);
                  }
                } catch (err) {
                  _iterator.e(err);
                } finally {
                  _iterator.f();
                }
              }

              walk(xfa);
              return output;
            }
          }, {
            key: "shouldBuildText",
            value: function shouldBuildText(name) {
              return !(name === "textarea" || name === "input" || name === "option" || name === "select");
            }
          }]);

          return XfaText;
        }();

        exports.XfaText = XfaText;
        /***/
      },
      /* 131 */

      /***/
      function (__unused_webpack_module, exports, __w_pdfjs_require__) {
        "use strict";

        function _typeof(obj) {
          "@babel/helpers - typeof";

          if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
            _typeof = function _typeof(obj) {
              return typeof obj;
            };
          } else {
            _typeof = function _typeof(obj) {
              return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
            };
          }

          return _typeof(obj);
        }

        Object.defineProperty(exports, "__esModule", {
          value: true
        });
        exports.AnnotationLayer = void 0;

        var _util = __w_pdfjs_require__(4);

        var _display_utils = __w_pdfjs_require__(1);

        var _annotation_storage = __w_pdfjs_require__(122);

        var _scripting_utils = __w_pdfjs_require__(132);

        function _get(target, property, receiver) {
          if (typeof Reflect !== "undefined" && Reflect.get) {
            _get = Reflect.get;
          } else {
            _get = function _get(target, property, receiver) {
              var base = _superPropBase(target, property);

              if (!base) return;
              var desc = Object.getOwnPropertyDescriptor(base, property);

              if (desc.get) {
                return desc.get.call(receiver);
              }

              return desc.value;
            };
          }

          return _get(target, property, receiver || target);
        }

        function _superPropBase(object, property) {
          while (!Object.prototype.hasOwnProperty.call(object, property)) {
            object = _getPrototypeOf(object);
            if (object === null) break;
          }

          return object;
        }

        function _defineProperty(obj, key, value) {
          if (key in obj) {
            Object.defineProperty(obj, key, {
              value: value,
              enumerable: true,
              configurable: true,
              writable: true
            });
          } else {
            obj[key] = value;
          }

          return obj;
        }

        function _slicedToArray(arr, i) {
          return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
        }

        function _nonIterableRest() {
          throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
        }

        function _iterableToArrayLimit(arr, i) {
          var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];

          if (_i == null) return;
          var _arr = [];
          var _n = true;
          var _d = false;

          var _s, _e;

          try {
            for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
              _arr.push(_s.value);

              if (i && _arr.length === i) break;
            }
          } catch (err) {
            _d = true;
            _e = err;
          } finally {
            try {
              if (!_n && _i["return"] != null) _i["return"]();
            } finally {
              if (_d) throw _e;
            }
          }

          return _arr;
        }

        function _arrayWithHoles(arr) {
          if (Array.isArray(arr)) return arr;
        }

        function _toConsumableArray(arr) {
          return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
        }

        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.");
        }

        function _iterableToArray(iter) {
          if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
        }

        function _arrayWithoutHoles(arr) {
          if (Array.isArray(arr)) return _arrayLikeToArray(arr);
        }

        function _inherits(subClass, superClass) {
          if (typeof superClass !== "function" && superClass !== null) {
            throw new TypeError("Super expression must either be null or a function");
          }

          subClass.prototype = Object.create(superClass && superClass.prototype, {
            constructor: {
              value: subClass,
              writable: true,
              configurable: true
            }
          });
          if (superClass) _setPrototypeOf(subClass, superClass);
        }

        function _setPrototypeOf(o, p) {
          _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
            o.__proto__ = p;
            return o;
          };

          return _setPrototypeOf(o, p);
        }

        function _createSuper(Derived) {
          var hasNativeReflectConstruct = _isNativeReflectConstruct();

          return function _createSuperInternal() {
            var Super = _getPrototypeOf(Derived),
                result;

            if (hasNativeReflectConstruct) {
              var NewTarget = _getPrototypeOf(this).constructor;

              result = Reflect.construct(Super, arguments, NewTarget);
            } else {
              result = Super.apply(this, arguments);
            }

            return _possibleConstructorReturn(this, result);
          };
        }

        function _possibleConstructorReturn(self, call) {
          if (call && (_typeof(call) === "object" || typeof call === "function")) {
            return call;
          } else if (call !== void 0) {
            throw new TypeError("Derived constructors may only return object or undefined");
          }

          return _assertThisInitialized(self);
        }

        function _assertThisInitialized(self) {
          if (self === void 0) {
            throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
          }

          return self;
        }

        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 (e) {
            return false;
          }
        }

        function _getPrototypeOf(o) {
          _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
            return o.__proto__ || Object.getPrototypeOf(o);
          };
          return _getPrototypeOf(o);
        }

        function _createForOfIteratorHelper(o, allowArrayLike) {
          var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];

          if (!it) {
            if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
              if (it) o = it;
              var i = 0;

              var F = function F() {};

              return {
                s: F,
                n: function n() {
                  if (i >= o.length) return {
                    done: true
                  };
                  return {
                    done: false,
                    value: o[i++]
                  };
                },
                e: function e(_e2) {
                  throw _e2;
                },
                f: F
              };
            }

            throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
          }

          var normalCompletion = true,
              didErr = false,
              err;
          return {
            s: function s() {
              it = it.call(o);
            },
            n: function n() {
              var step = it.next();
              normalCompletion = step.done;
              return step;
            },
            e: function e(_e3) {
              didErr = true;
              err = _e3;
            },
            f: function f() {
              try {
                if (!normalCompletion && it["return"] != null) it["return"]();
              } finally {
                if (didErr) throw err;
              }
            }
          };
        }

        function _unsupportedIterableToArray(o, minLen) {
          if (!o) return;
          if (typeof o === "string") return _arrayLikeToArray(o, minLen);
          var n = Object.prototype.toString.call(o).slice(8, -1);
          if (n === "Object" && o.constructor) n = o.constructor.name;
          if (n === "Map" || n === "Set") return Array.from(o);
          if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
        }

        function _arrayLikeToArray(arr, len) {
          if (len == null || len > arr.length) len = arr.length;

          for (var i = 0, arr2 = new Array(len); i < len; i++) {
            arr2[i] = arr[i];
          }

          return arr2;
        }

        function _classCallCheck(instance, Constructor) {
          if (!(instance instanceof Constructor)) {
            throw new TypeError("Cannot call a class as a function");
          }
        }

        function _defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];
            descriptor.enumerable = descriptor.enumerable || false;
            descriptor.configurable = true;
            if ("value" in descriptor) descriptor.writable = true;
            Object.defineProperty(target, descriptor.key, descriptor);
          }
        }

        function _createClass(Constructor, protoProps, staticProps) {
          if (protoProps) _defineProperties(Constructor.prototype, protoProps);
          if (staticProps) _defineProperties(Constructor, staticProps);
          return Constructor;
        }

        var DEFAULT_TAB_INDEX = 1000;
        var GetElementsByNameSet = new WeakSet();

        var AnnotationElementFactory = /*#__PURE__*/function () {
          function AnnotationElementFactory() {
            _classCallCheck(this, AnnotationElementFactory);
          }

          _createClass(AnnotationElementFactory, null, [{
            key: "create",
            value: function create(parameters) {
              var subtype = parameters.data.annotationType;

              switch (subtype) {
                case _util.AnnotationType.LINK:
                  return new LinkAnnotationElement(parameters);

                case _util.AnnotationType.TEXT:
                  return new TextAnnotationElement(parameters);

                case _util.AnnotationType.WIDGET:
                  var fieldType = parameters.data.fieldType;

                  switch (fieldType) {
                    case "Tx":
                      return new TextWidgetAnnotationElement(parameters);

                    case "Btn":
                      if (parameters.data.radioButton) {
                        return new RadioButtonWidgetAnnotationElement(parameters);
                      } else if (parameters.data.checkBox) {
                        return new CheckboxWidgetAnnotationElement(parameters);
                      }

                      return new PushButtonWidgetAnnotationElement(parameters);

                    case "Ch":
                      return new ChoiceWidgetAnnotationElement(parameters);
                  }

                  return new WidgetAnnotationElement(parameters);

                case _util.AnnotationType.POPUP:
                  return new PopupAnnotationElement(parameters);

                case _util.AnnotationType.FREETEXT:
                  return new FreeTextAnnotationElement(parameters);

                case _util.AnnotationType.LINE:
                  return new LineAnnotationElement(parameters);

                case _util.AnnotationType.SQUARE:
                  return new SquareAnnotationElement(parameters);

                case _util.AnnotationType.CIRCLE:
                  return new CircleAnnotationElement(parameters);

                case _util.AnnotationType.POLYLINE:
                  return new PolylineAnnotationElement(parameters);

                case _util.AnnotationType.CARET:
                  return new CaretAnnotationElement(parameters);

                case _util.AnnotationType.INK:
                  return new InkAnnotationElement(parameters);

                case _util.AnnotationType.POLYGON:
                  return new PolygonAnnotationElement(parameters);

                case _util.AnnotationType.HIGHLIGHT:
                  return new HighlightAnnotationElement(parameters);

                case _util.AnnotationType.UNDERLINE:
                  return new UnderlineAnnotationElement(parameters);

                case _util.AnnotationType.SQUIGGLY:
                  return new SquigglyAnnotationElement(parameters);

                case _util.AnnotationType.STRIKEOUT:
                  return new StrikeOutAnnotationElement(parameters);

                case _util.AnnotationType.STAMP:
                  return new StampAnnotationElement(parameters);

                case _util.AnnotationType.FILEATTACHMENT:
                  return new FileAttachmentAnnotationElement(parameters);

                default:
                  return new AnnotationElement(parameters);
              }
            }
          }]);

          return AnnotationElementFactory;
        }();

        var AnnotationElement = /*#__PURE__*/function () {
          function AnnotationElement(parameters) {
            var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
                _ref$isRenderable = _ref.isRenderable,
                isRenderable = _ref$isRenderable === void 0 ? false : _ref$isRenderable,
                _ref$ignoreBorder = _ref.ignoreBorder,
                ignoreBorder = _ref$ignoreBorder === void 0 ? false : _ref$ignoreBorder,
                _ref$createQuadrilate = _ref.createQuadrilaterals,
                createQuadrilaterals = _ref$createQuadrilate === void 0 ? false : _ref$createQuadrilate;

            _classCallCheck(this, AnnotationElement);

            this.isRenderable = isRenderable;
            this.data = parameters.data;
            this.layer = parameters.layer;
            this.page = parameters.page;
            this.viewport = parameters.viewport;
            this.linkService = parameters.linkService;
            this.downloadManager = parameters.downloadManager;
            this.imageResourcesPath = parameters.imageResourcesPath;
            this.renderForms = parameters.renderForms;
            this.svgFactory = parameters.svgFactory;
            this.annotationStorage = parameters.annotationStorage;
            this.enableScripting = parameters.enableScripting;
            this.hasJSActions = parameters.hasJSActions;
            this._fieldObjects = parameters.fieldObjects;
            this._mouseState = parameters.mouseState;

            if (isRenderable) {
              this.container = this._createContainer(ignoreBorder);
            }

            if (createQuadrilaterals) {
              this.quadrilaterals = this._createQuadrilaterals(ignoreBorder);
            }
          }

          _createClass(AnnotationElement, [{
            key: "_createContainer",
            value: function _createContainer() {
              var ignoreBorder = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
              var data = this.data,
                  page = this.page,
                  viewport = this.viewport;
              var container = document.createElement("section");
              var width = data.rect[2] - data.rect[0];
              var height = data.rect[3] - data.rect[1];
              container.setAttribute("data-annotation-id", data.id);

              var rect = _util.Util.normalizeRect([data.rect[0], page.view[3] - data.rect[1] + page.view[1], data.rect[2], page.view[3] - data.rect[3] + page.view[1]]);

              container.style.transform = "matrix(".concat(viewport.transform.join(","), ")");
              container.style.transformOrigin = "".concat(-rect[0], "px ").concat(-rect[1], "px");

              if (!ignoreBorder && data.borderStyle.width > 0) {
                container.style.borderWidth = "".concat(data.borderStyle.width, "px");

                if (data.borderStyle.style !== _util.AnnotationBorderStyleType.UNDERLINE) {
                  width -= 2 * data.borderStyle.width;
                  height -= 2 * data.borderStyle.width;
                }

                var horizontalRadius = data.borderStyle.horizontalCornerRadius;
                var verticalRadius = data.borderStyle.verticalCornerRadius;

                if (horizontalRadius > 0 || verticalRadius > 0) {
                  var radius = "".concat(horizontalRadius, "px / ").concat(verticalRadius, "px");
                  container.style.borderRadius = radius;
                }

                switch (data.borderStyle.style) {
                  case _util.AnnotationBorderStyleType.SOLID:
                    container.style.borderStyle = "solid";
                    break;

                  case _util.AnnotationBorderStyleType.DASHED:
                    container.style.borderStyle = "dashed";
                    break;

                  case _util.AnnotationBorderStyleType.BEVELED:
                    (0, _util.warn)("Unimplemented border style: beveled");
                    break;

                  case _util.AnnotationBorderStyleType.INSET:
                    (0, _util.warn)("Unimplemented border style: inset");
                    break;

                  case _util.AnnotationBorderStyleType.UNDERLINE:
                    container.style.borderBottomStyle = "solid";
                    break;

                  default:
                    break;
                }

                var borderColor = data.borderColor || data.color || null;

                if (borderColor) {
                  container.style.borderColor = _util.Util.makeHexColor(data.color[0] | 0, data.color[1] | 0, data.color[2] | 0);
                } else {
                  container.style.borderWidth = 0;
                }
              }

              container.style.left = "".concat(rect[0], "px");
              container.style.top = "".concat(rect[1], "px");
              container.style.width = "".concat(width, "px");
              container.style.height = "".concat(height, "px");
              return container;
            }
          }, {
            key: "_createQuadrilaterals",
            value: function _createQuadrilaterals() {
              var ignoreBorder = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;

              if (!this.data.quadPoints) {
                return null;
              }

              var quadrilaterals = [];
              var savedRect = this.data.rect;

              var _iterator = _createForOfIteratorHelper(this.data.quadPoints),
                  _step;

              try {
                for (_iterator.s(); !(_step = _iterator.n()).done;) {
                  var quadPoint = _step.value;
                  this.data.rect = [quadPoint[2].x, quadPoint[2].y, quadPoint[1].x, quadPoint[1].y];
                  quadrilaterals.push(this._createContainer(ignoreBorder));
                }
              } catch (err) {
                _iterator.e(err);
              } finally {
                _iterator.f();
              }

              this.data.rect = savedRect;
              return quadrilaterals;
            }
          }, {
            key: "_createPopup",
            value: function _createPopup(trigger, data) {
              var container = this.container;

              if (this.quadrilaterals) {
                trigger = trigger || this.quadrilaterals;
                container = this.quadrilaterals[0];
              }

              if (!trigger) {
                trigger = document.createElement("div");
                trigger.style.height = container.style.height;
                trigger.style.width = container.style.width;
                container.appendChild(trigger);
              }

              var popupElement = new PopupElement({
                container: container,
                trigger: trigger,
                color: data.color,
                titleObj: data.titleObj,
                modificationDate: data.modificationDate,
                contentsObj: data.contentsObj,
                hideWrapper: true
              });
              var popup = popupElement.render();
              popup.style.left = container.style.width;
              container.appendChild(popup);
            }
          }, {
            key: "_renderQuadrilaterals",
            value: function _renderQuadrilaterals(className) {
              var _iterator2 = _createForOfIteratorHelper(this.quadrilaterals),
                  _step2;

              try {
                for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
                  var quadrilateral = _step2.value;
                  quadrilateral.className = className;
                }
              } catch (err) {
                _iterator2.e(err);
              } finally {
                _iterator2.f();
              }

              return this.quadrilaterals;
            }
          }, {
            key: "render",
            value: function render() {
              (0, _util.unreachable)("Abstract method `AnnotationElement.render` called");
            }
          }, {
            key: "_getElementsByName",
            value: function _getElementsByName(name) {
              var skipId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
              var fields = [];

              if (this._fieldObjects) {
                var fieldObj = this._fieldObjects[name];

                if (fieldObj) {
                  var _iterator3 = _createForOfIteratorHelper(fieldObj),
                      _step3;

                  try {
                    for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
                      var _step3$value = _step3.value,
                          page = _step3$value.page,
                          id = _step3$value.id,
                          exportValues = _step3$value.exportValues;

                      if (page === -1) {
                        continue;
                      }

                      if (id === skipId) {
                        continue;
                      }

                      var exportValue = typeof exportValues === "string" ? exportValues : null;
                      var domElement = document.getElementById(id);

                      if (domElement && !GetElementsByNameSet.has(domElement)) {
                        (0, _util.warn)("_getElementsByName - element not allowed: ".concat(id));
                        continue;
                      }

                      fields.push({
                        id: id,
                        exportValue: exportValue,
                        domElement: domElement
                      });
                    }
                  } catch (err) {
                    _iterator3.e(err);
                  } finally {
                    _iterator3.f();
                  }
                }

                return fields;
              }

              var _iterator4 = _createForOfIteratorHelper(document.getElementsByName(name)),
                  _step4;

              try {
                for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
                  var _domElement = _step4.value;
                  var _id = _domElement.id,
                      _exportValue = _domElement.exportValue;

                  if (_id === skipId) {
                    continue;
                  }

                  if (!GetElementsByNameSet.has(_domElement)) {
                    continue;
                  }

                  fields.push({
                    id: _id,
                    exportValue: _exportValue,
                    domElement: _domElement
                  });
                }
              } catch (err) {
                _iterator4.e(err);
              } finally {
                _iterator4.f();
              }

              return fields;
            }
          }], [{
            key: "platform",
            get: function get() {
              var platform = typeof navigator !== "undefined" ? navigator.platform : "";
              return (0, _util.shadow)(this, "platform", {
                isWin: platform.includes("Win"),
                isMac: platform.includes("Mac")
              });
            }
          }]);

          return AnnotationElement;
        }();

        var LinkAnnotationElement = /*#__PURE__*/function (_AnnotationElement) {
          _inherits(LinkAnnotationElement, _AnnotationElement);

          var _super = _createSuper(LinkAnnotationElement);

          function LinkAnnotationElement(parameters) {
            _classCallCheck(this, LinkAnnotationElement);

            var isRenderable = !!(parameters.data.url || parameters.data.dest || parameters.data.action || parameters.data.isTooltipOnly || parameters.data.resetForm || parameters.data.actions && (parameters.data.actions.Action || parameters.data.actions["Mouse Up"] || parameters.data.actions["Mouse Down"]));
            return _super.call(this, parameters, {
              isRenderable: isRenderable,
              createQuadrilaterals: true
            });
          }

          _createClass(LinkAnnotationElement, [{
            key: "render",
            value: function render() {
              var data = this.data,
                  linkService = this.linkService;
              var link = document.createElement("a");

              if (data.url) {
                var _linkService$addLinkA;

                if (!linkService.addLinkAttributes) {
                  (0, _util.warn)("LinkAnnotationElement.render - missing `addLinkAttributes`-method on the `linkService`-instance.");
                }

                (_linkService$addLinkA = linkService.addLinkAttributes) === null || _linkService$addLinkA === void 0 ? void 0 : _linkService$addLinkA.call(linkService, link, data.url, data.newWindow);
              } else if (data.action) {
                this._bindNamedAction(link, data.action);
              } else if (data.dest) {
                this._bindLink(link, data.dest);
              } else {
                var hasClickAction = false;

                if (data.actions && (data.actions.Action || data.actions["Mouse Up"] || data.actions["Mouse Down"]) && this.enableScripting && this.hasJSActions) {
                  hasClickAction = true;

                  this._bindJSAction(link, data);
                }

                if (data.resetForm) {
                  this._bindResetFormAction(link, data.resetForm);
                } else if (!hasClickAction) {
                  this._bindLink(link, "");
                }
              }

              if (this.quadrilaterals) {
                return this._renderQuadrilaterals("linkAnnotation").map(function (quadrilateral, index) {
                  var linkElement = index === 0 ? link : link.cloneNode();
                  quadrilateral.appendChild(linkElement);
                  return quadrilateral;
                });
              }

              this.container.className = "linkAnnotation";
              this.container.appendChild(link);
              return this.container;
            }
          }, {
            key: "_bindLink",
            value: function _bindLink(link, destination) {
              var _this = this;

              link.href = this.linkService.getDestinationHash(destination);

              link.onclick = function () {
                if (destination) {
                  _this.linkService.goToDestination(destination);
                }

                return false;
              };

              if (destination || destination === "") {
                link.className = "internalLink";
              }
            }
          }, {
            key: "_bindNamedAction",
            value: function _bindNamedAction(link, action) {
              var _this2 = this;

              link.href = this.linkService.getAnchorUrl("");

              link.onclick = function () {
                _this2.linkService.executeNamedAction(action);

                return false;
              };

              link.className = "internalLink";
            }
          }, {
            key: "_bindJSAction",
            value: function _bindJSAction(link, data) {
              var _this3 = this;

              link.href = this.linkService.getAnchorUrl("");
              var map = new Map([["Action", "onclick"], ["Mouse Up", "onmouseup"], ["Mouse Down", "onmousedown"]]);

              var _loop = function _loop() {
                var name = _Object$keys[_i];
                var jsName = map.get(name);

                if (!jsName) {
                  return "continue";
                }

                link[jsName] = function () {
                  var _this3$linkService$ev;

                  (_this3$linkService$ev = _this3.linkService.eventBus) === null || _this3$linkService$ev === void 0 ? void 0 : _this3$linkService$ev.dispatch("dispatcheventinsandbox", {
                    source: _this3,
                    detail: {
                      id: data.id,
                      name: name
                    }
                  });
                  return false;
                };
              };

              for (var _i = 0, _Object$keys = Object.keys(data.actions); _i < _Object$keys.length; _i++) {
                var _ret = _loop();

                if (_ret === "continue") continue;
              }

              if (!link.onclick) {
                link.onclick = function () {
                  return false;
                };
              }

              link.className = "internalLink";
            }
          }, {
            key: "_bindResetFormAction",
            value: function _bindResetFormAction(link, resetForm) {
              var _this4 = this;

              var otherClickAction = link.onclick;

              if (!otherClickAction) {
                link.href = this.linkService.getAnchorUrl("");
              }

              link.className = "internalLink";

              if (!this._fieldObjects) {
                (0, _util.warn)("_bindResetFormAction - \"resetForm\" action not supported, " + "ensure that the `fieldObjects` parameter is provided.");

                if (!otherClickAction) {
                  link.onclick = function () {
                    return false;
                  };
                }

                return;
              }

              link.onclick = function () {
                if (otherClickAction) {
                  otherClickAction();
                }

                var resetFormFields = resetForm.fields,
                    resetFormRefs = resetForm.refs,
                    include = resetForm.include;
                var allFields = [];

                if (resetFormFields.length !== 0 || resetFormRefs.length !== 0) {
                  var fieldIds = new Set(resetFormRefs);

                  var _iterator5 = _createForOfIteratorHelper(resetFormFields),
                      _step5;

                  try {
                    for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
                      var fieldName = _step5.value;

                      var _fields = _this4._fieldObjects[fieldName] || [];

                      var _iterator7 = _createForOfIteratorHelper(_fields),
                          _step7;

                      try {
                        for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
                          var id = _step7.value.id;
                          fieldIds.add(id);
                        }
                      } catch (err) {
                        _iterator7.e(err);
                      } finally {
                        _iterator7.f();
                      }
                    }
                  } catch (err) {
                    _iterator5.e(err);
                  } finally {
                    _iterator5.f();
                  }

                  for (var _i2 = 0, _Object$values = Object.values(_this4._fieldObjects); _i2 < _Object$values.length; _i2++) {
                    var fields = _Object$values[_i2];

                    var _iterator6 = _createForOfIteratorHelper(fields),
                        _step6;

                    try {
                      for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
                        var field = _step6.value;

                        if (fieldIds.has(field.id) === include) {
                          allFields.push(field);
                        }
                      }
                    } catch (err) {
                      _iterator6.e(err);
                    } finally {
                      _iterator6.f();
                    }
                  }
                } else {
                  for (var _i3 = 0, _Object$values2 = Object.values(_this4._fieldObjects); _i3 < _Object$values2.length; _i3++) {
                    var _fields2 = _Object$values2[_i3];
                    allFields.push.apply(allFields, _toConsumableArray(_fields2));
                  }
                }

                var storage = _this4.annotationStorage;
                var allIds = [];

                for (var _i4 = 0, _allFields = allFields; _i4 < _allFields.length; _i4++) {
                  var _field = _allFields[_i4];
                  var _id2 = _field.id;
                  allIds.push(_id2);

                  switch (_field.type) {
                    case "text":
                      {
                        var value = _field.defaultValue || "";
                        storage.setValue(_id2, {
                          value: value,
                          valueAsString: value
                        });
                        break;
                      }

                    case "checkbox":
                    case "radiobutton":
                      {
                        var _value = _field.defaultValue === _field.exportValues;

                        storage.setValue(_id2, {
                          value: _value
                        });
                        break;
                      }

                    case "combobox":
                    case "listbox":
                      {
                        var _value2 = _field.defaultValue || "";

                        storage.setValue(_id2, {
                          value: _value2
                        });
                        break;
                      }

                    default:
                      continue;
                  }

                  var domElement = document.getElementById(_id2);

                  if (!domElement || !GetElementsByNameSet.has(domElement)) {
                    continue;
                  }

                  domElement.dispatchEvent(new Event("resetform"));
                }

                if (_this4.enableScripting) {
                  var _this4$linkService$ev;

                  (_this4$linkService$ev = _this4.linkService.eventBus) === null || _this4$linkService$ev === void 0 ? void 0 : _this4$linkService$ev.dispatch("dispatcheventinsandbox", {
                    source: _this4,
                    detail: {
                      id: "app",
                      ids: allIds,
                      name: "ResetForm"
                    }
                  });
                }

                return false;
              };
            }
          }]);

          return LinkAnnotationElement;
        }(AnnotationElement);

        var TextAnnotationElement = /*#__PURE__*/function (_AnnotationElement2) {
          _inherits(TextAnnotationElement, _AnnotationElement2);

          var _super2 = _createSuper(TextAnnotationElement);

          function TextAnnotationElement(parameters) {
            var _parameters$data$titl, _parameters$data$cont;

            _classCallCheck(this, TextAnnotationElement);

            var isRenderable = !!(parameters.data.hasPopup || (_parameters$data$titl = parameters.data.titleObj) !== null && _parameters$data$titl !== void 0 && _parameters$data$titl.str || (_parameters$data$cont = parameters.data.contentsObj) !== null && _parameters$data$cont !== void 0 && _parameters$data$cont.str);
            return _super2.call(this, parameters, {
              isRenderable: isRenderable
            });
          }

          _createClass(TextAnnotationElement, [{
            key: "render",
            value: function render() {
              this.container.className = "textAnnotation";
              var image = document.createElement("img");
              image.style.height = this.container.style.height;
              image.style.width = this.container.style.width;
              image.src = this.imageResourcesPath + "annotation-" + this.data.name.toLowerCase() + ".svg";
              image.alt = "[{{type}} Annotation]";
              image.dataset.l10nId = "text_annotation_type";
              image.dataset.l10nArgs = JSON.stringify({
                type: this.data.name
              });

              if (!this.data.hasPopup) {
                this._createPopup(image, this.data);
              }

              this.container.appendChild(image);
              return this.container;
            }
          }]);

          return TextAnnotationElement;
        }(AnnotationElement);

        var WidgetAnnotationElement = /*#__PURE__*/function (_AnnotationElement3) {
          _inherits(WidgetAnnotationElement, _AnnotationElement3);

          var _super3 = _createSuper(WidgetAnnotationElement);

          function WidgetAnnotationElement() {
            _classCallCheck(this, WidgetAnnotationElement);

            return _super3.apply(this, arguments);
          }

          _createClass(WidgetAnnotationElement, [{
            key: "render",
            value: function render() {
              if (this.data.alternativeText) {
                this.container.title = this.data.alternativeText;
              }

              return this.container;
            }
          }, {
            key: "_getKeyModifier",
            value: function _getKeyModifier(event) {
              var _AnnotationElement$pl = AnnotationElement.platform,
                  isWin = _AnnotationElement$pl.isWin,
                  isMac = _AnnotationElement$pl.isMac;
              return isWin && event.ctrlKey || isMac && event.metaKey;
            }
          }, {
            key: "_setEventListener",
            value: function _setEventListener(element, baseName, eventName, valueGetter) {
              var _this5 = this;

              if (baseName.includes("mouse")) {
                element.addEventListener(baseName, function (event) {
                  var _this5$linkService$ev;

                  (_this5$linkService$ev = _this5.linkService.eventBus) === null || _this5$linkService$ev === void 0 ? void 0 : _this5$linkService$ev.dispatch("dispatcheventinsandbox", {
                    source: _this5,
                    detail: {
                      id: _this5.data.id,
                      name: eventName,
                      value: valueGetter(event),
                      shift: event.shiftKey,
                      modifier: _this5._getKeyModifier(event)
                    }
                  });
                });
              } else {
                element.addEventListener(baseName, function (event) {
                  var _this5$linkService$ev2;

                  (_this5$linkService$ev2 = _this5.linkService.eventBus) === null || _this5$linkService$ev2 === void 0 ? void 0 : _this5$linkService$ev2.dispatch("dispatcheventinsandbox", {
                    source: _this5,
                    detail: {
                      id: _this5.data.id,
                      name: eventName,
                      value: event.target.checked
                    }
                  });
                });
              }
            }
          }, {
            key: "_setEventListeners",
            value: function _setEventListeners(element, names, getter) {
              var _iterator8 = _createForOfIteratorHelper(names),
                  _step8;

              try {
                for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
                  var _this$data$actions;

                  var _step8$value = _slicedToArray(_step8.value, 2),
                      baseName = _step8$value[0],
                      eventName = _step8$value[1];

                  if (eventName === "Action" || (_this$data$actions = this.data.actions) !== null && _this$data$actions !== void 0 && _this$data$actions[eventName]) {
                    this._setEventListener(element, baseName, eventName, getter);
                  }
                }
              } catch (err) {
                _iterator8.e(err);
              } finally {
                _iterator8.f();
              }
            }
          }, {
            key: "_setBackgroundColor",
            value: function _setBackgroundColor(element) {
              var color = this.data.backgroundColor || null;
              element.style.backgroundColor = color === null ? "transparent" : _util.Util.makeHexColor(color[0], color[1], color[2]);
            }
          }, {
            key: "_dispatchEventFromSandbox",
            value: function _dispatchEventFromSandbox(actions, jsEvent) {
              var _this6 = this;

              var setColor = function setColor(jsName, styleName, event) {
                var color = event.detail[jsName];
                event.target.style[styleName] = _scripting_utils.ColorConverters["".concat(color[0], "_HTML")](color.slice(1));
              };

              var commonActions = {
                display: function display(event) {
                  var hidden = event.detail.display % 2 === 1;
                  event.target.style.visibility = hidden ? "hidden" : "visible";

                  _this6.annotationStorage.setValue(_this6.data.id, {
                    hidden: hidden,
                    print: event.detail.display === 0 || event.detail.display === 3
                  });
                },
                print: function print(event) {
                  _this6.annotationStorage.setValue(_this6.data.id, {
                    print: event.detail.print
                  });
                },
                hidden: function hidden(event) {
                  event.target.style.visibility = event.detail.hidden ? "hidden" : "visible";

                  _this6.annotationStorage.setValue(_this6.data.id, {
                    hidden: event.detail.hidden
                  });
                },
                focus: function focus(event) {
                  setTimeout(function () {
                    return event.target.focus({
                      preventScroll: false
                    });
                  }, 0);
                },
                userName: function userName(event) {
                  event.target.title = event.detail.userName;
                },
                readonly: function readonly(event) {
                  if (event.detail.readonly) {
                    event.target.setAttribute("readonly", "");
                  } else {
                    event.target.removeAttribute("readonly");
                  }
                },
                required: function required(event) {
                  if (event.detail.required) {
                    event.target.setAttribute("required", "");
                  } else {
                    event.target.removeAttribute("required");
                  }
                },
                bgColor: function bgColor(event) {
                  setColor("bgColor", "backgroundColor", event);
                },
                fillColor: function fillColor(event) {
                  setColor("fillColor", "backgroundColor", event);
                },
                fgColor: function fgColor(event) {
                  setColor("fgColor", "color", event);
                },
                textColor: function textColor(event) {
                  setColor("textColor", "color", event);
                },
                borderColor: function borderColor(event) {
                  setColor("borderColor", "borderColor", event);
                },
                strokeColor: function strokeColor(event) {
                  setColor("strokeColor", "borderColor", event);
                }
              };

              for (var _i5 = 0, _Object$keys2 = Object.keys(jsEvent.detail); _i5 < _Object$keys2.length; _i5++) {
                var name = _Object$keys2[_i5];
                var action = actions[name] || commonActions[name];

                if (action) {
                  action(jsEvent);
                }
              }
            }
          }]);

          return WidgetAnnotationElement;
        }(AnnotationElement);

        var TextWidgetAnnotationElement = /*#__PURE__*/function (_WidgetAnnotationElem) {
          _inherits(TextWidgetAnnotationElement, _WidgetAnnotationElem);

          var _super4 = _createSuper(TextWidgetAnnotationElement);

          function TextWidgetAnnotationElement(parameters) {
            _classCallCheck(this, TextWidgetAnnotationElement);

            var isRenderable = parameters.renderForms || !parameters.data.hasAppearance && !!parameters.data.fieldValue;
            return _super4.call(this, parameters, {
              isRenderable: isRenderable
            });
          }

          _createClass(TextWidgetAnnotationElement, [{
            key: "setPropertyOnSiblings",
            value: function setPropertyOnSiblings(base, key, value, keyInStorage) {
              var storage = this.annotationStorage;

              var _iterator9 = _createForOfIteratorHelper(this._getElementsByName(base.name, base.id)),
                  _step9;

              try {
                for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
                  var element = _step9.value;

                  if (element.domElement) {
                    element.domElement[key] = value;
                  }

                  storage.setValue(element.id, _defineProperty({}, keyInStorage, value));
                }
              } catch (err) {
                _iterator9.e(err);
              } finally {
                _iterator9.f();
              }
            }
          }, {
            key: "render",
            value: function render() {
              var _this7 = this;

              var storage = this.annotationStorage;
              var id = this.data.id;
              this.container.className = "textWidgetAnnotation";
              var element = null;

              if (this.renderForms) {
                var storedData = storage.getValue(id, {
                  value: this.data.fieldValue,
                  valueAsString: this.data.fieldValue
                });
                var textContent = storedData.valueAsString || storedData.value || "";
                var elementData = {
                  userValue: null,
                  formattedValue: null,
                  beforeInputSelectionRange: null,
                  beforeInputValue: null
                };

                if (this.data.multiLine) {
                  element = document.createElement("textarea");
                  element.textContent = textContent;
                } else {
                  element = document.createElement("input");
                  element.type = "text";
                  element.setAttribute("value", textContent);
                }

                GetElementsByNameSet.add(element);
                element.disabled = this.data.readOnly;
                element.name = this.data.fieldName;
                element.tabIndex = DEFAULT_TAB_INDEX;
                elementData.userValue = textContent;
                element.setAttribute("id", id);
                element.addEventListener("input", function (event) {
                  storage.setValue(id, {
                    value: event.target.value
                  });

                  _this7.setPropertyOnSiblings(element, "value", event.target.value, "value");
                });
                element.addEventListener("resetform", function (event) {
                  var defaultValue = _this7.data.defaultFieldValue || "";
                  element.value = elementData.userValue = defaultValue;
                  delete elementData.formattedValue;
                });

                var blurListener = function blurListener(event) {
                  if (elementData.formattedValue) {
                    event.target.value = elementData.formattedValue;
                  }

                  event.target.scrollLeft = 0;
                  elementData.beforeInputSelectionRange = null;
                };

                if (this.enableScripting && this.hasJSActions) {
                  var _this$data$actions2;

                  element.addEventListener("focus", function (event) {
                    if (elementData.userValue) {
                      event.target.value = elementData.userValue;
                    }
                  });
                  element.addEventListener("updatefromsandbox", function (jsEvent) {
                    var actions = {
                      value: function value(event) {
                        elementData.userValue = event.detail.value || "";
                        storage.setValue(id, {
                          value: elementData.userValue.toString()
                        });

                        if (!elementData.formattedValue) {
                          event.target.value = elementData.userValue;
                        }
                      },
                      valueAsString: function valueAsString(event) {
                        elementData.formattedValue = event.detail.valueAsString || "";

                        if (event.target !== document.activeElement) {
                          event.target.value = elementData.formattedValue;
                        }

                        storage.setValue(id, {
                          formattedValue: elementData.formattedValue
                        });
                      },
                      selRange: function selRange(event) {
                        var _event$detail$selRang = _slicedToArray(event.detail.selRange, 2),
                            selStart = _event$detail$selRang[0],
                            selEnd = _event$detail$selRang[1];

                        if (selStart >= 0 && selEnd < event.target.value.length) {
                          event.target.setSelectionRange(selStart, selEnd);
                        }
                      }
                    };

                    _this7._dispatchEventFromSandbox(actions, jsEvent);
                  });
                  element.addEventListener("keydown", function (event) {
                    var _this7$linkService$ev;

                    elementData.beforeInputValue = event.target.value;
                    var commitKey = -1;

                    if (event.key === "Escape") {
                      commitKey = 0;
                    } else if (event.key === "Enter") {
                      commitKey = 2;
                    } else if (event.key === "Tab") {
                      commitKey = 3;
                    }

                    if (commitKey === -1) {
                      return;
                    }

                    elementData.userValue = event.target.value;
                    (_this7$linkService$ev = _this7.linkService.eventBus) === null || _this7$linkService$ev === void 0 ? void 0 : _this7$linkService$ev.dispatch("dispatcheventinsandbox", {
                      source: _this7,
                      detail: {
                        id: id,
                        name: "Keystroke",
                        value: event.target.value,
                        willCommit: true,
                        commitKey: commitKey,
                        selStart: event.target.selectionStart,
                        selEnd: event.target.selectionEnd
                      }
                    });
                  });
                  var _blurListener = blurListener;
                  blurListener = null;
                  element.addEventListener("blur", function (event) {
                    if (_this7._mouseState.isDown) {
                      var _this7$linkService$ev2;

                      elementData.userValue = event.target.value;
                      (_this7$linkService$ev2 = _this7.linkService.eventBus) === null || _this7$linkService$ev2 === void 0 ? void 0 : _this7$linkService$ev2.dispatch("dispatcheventinsandbox", {
                        source: _this7,
                        detail: {
                          id: id,
                          name: "Keystroke",
                          value: event.target.value,
                          willCommit: true,
                          commitKey: 1,
                          selStart: event.target.selectionStart,
                          selEnd: event.target.selectionEnd
                        }
                      });
                    }

                    _blurListener(event);
                  });
                  element.addEventListener("mousedown", function (event) {
                    elementData.beforeInputValue = event.target.value;
                    elementData.beforeInputSelectionRange = null;
                  });
                  element.addEventListener("keyup", function (event) {
                    if (event.target.selectionStart === event.target.selectionEnd) {
                      elementData.beforeInputSelectionRange = null;
                    }
                  });
                  element.addEventListener("select", function (event) {
                    elementData.beforeInputSelectionRange = [event.target.selectionStart, event.target.selectionEnd];
                  });

                  if ((_this$data$actions2 = this.data.actions) !== null && _this$data$actions2 !== void 0 && _this$data$actions2.Keystroke) {
                    element.addEventListener("input", function (event) {
                      var _this7$linkService$ev3;

                      var selStart = -1;
                      var selEnd = -1;

                      if (elementData.beforeInputSelectionRange) {
                        var _elementData$beforeIn = _slicedToArray(elementData.beforeInputSelectionRange, 2);

                        selStart = _elementData$beforeIn[0];
                        selEnd = _elementData$beforeIn[1];
                      }

                      (_this7$linkService$ev3 = _this7.linkService.eventBus) === null || _this7$linkService$ev3 === void 0 ? void 0 : _this7$linkService$ev3.dispatch("dispatcheventinsandbox", {
                        source: _this7,
                        detail: {
                          id: id,
                          name: "Keystroke",
                          value: elementData.beforeInputValue,
                          change: event.data,
                          willCommit: false,
                          selStart: selStart,
                          selEnd: selEnd
                        }
                      });
                    });
                  }

                  this._setEventListeners(element, [["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"]], function (event) {
                    return event.target.value;
                  });
                }

                if (blurListener) {
                  element.addEventListener("blur", blurListener);
                }

                if (this.data.maxLen !== null) {
                  element.maxLength = this.data.maxLen;
                }

                if (this.data.comb) {
                  var fieldWidth = this.data.rect[2] - this.data.rect[0];
                  var combWidth = fieldWidth / this.data.maxLen;
                  element.classList.add("comb");
                  element.style.letterSpacing = "calc(".concat(combWidth, "px - 1ch)");
                }
              } else {
                element = document.createElement("div");
                element.textContent = this.data.fieldValue;
                element.style.verticalAlign = "middle";
                element.style.display = "table-cell";
              }

              this._setTextStyle(element);

              this._setBackgroundColor(element);

              this.container.appendChild(element);
              return this.container;
            }
          }, {
            key: "_setTextStyle",
            value: function _setTextStyle(element) {
              var TEXT_ALIGNMENT = ["left", "center", "right"];
              var _this$data$defaultApp = this.data.defaultAppearanceData,
                  fontSize = _this$data$defaultApp.fontSize,
                  fontColor = _this$data$defaultApp.fontColor;
              var style = element.style;

              if (fontSize) {
                style.fontSize = "".concat(fontSize, "px");
              }

              style.color = _util.Util.makeHexColor(fontColor[0], fontColor[1], fontColor[2]);

              if (this.data.textAlignment !== null) {
                style.textAlign = TEXT_ALIGNMENT[this.data.textAlignment];
              }
            }
          }]);

          return TextWidgetAnnotationElement;
        }(WidgetAnnotationElement);

        var CheckboxWidgetAnnotationElement = /*#__PURE__*/function (_WidgetAnnotationElem2) {
          _inherits(CheckboxWidgetAnnotationElement, _WidgetAnnotationElem2);

          var _super5 = _createSuper(CheckboxWidgetAnnotationElement);

          function CheckboxWidgetAnnotationElement(parameters) {
            _classCallCheck(this, CheckboxWidgetAnnotationElement);

            return _super5.call(this, parameters, {
              isRenderable: parameters.renderForms
            });
          }

          _createClass(CheckboxWidgetAnnotationElement, [{
            key: "render",
            value: function render() {
              var _this8 = this;

              var storage = this.annotationStorage;
              var data = this.data;
              var id = data.id;
              var value = storage.getValue(id, {
                value: data.exportValue === data.fieldValue
              }).value;

              if (typeof value === "string") {
                value = value !== "Off";
                storage.setValue(id, {
                  value: value
                });
              }

              this.container.className = "buttonWidgetAnnotation checkBox";
              var element = document.createElement("input");
              GetElementsByNameSet.add(element);
              element.disabled = data.readOnly;
              element.type = "checkbox";
              element.name = data.fieldName;

              if (value) {
                element.setAttribute("checked", true);
              }

              element.setAttribute("id", id);
              element.setAttribute("exportValue", data.exportValue);
              element.tabIndex = DEFAULT_TAB_INDEX;
              element.addEventListener("change", function (event) {
                var _event$target = event.target,
                    name = _event$target.name,
                    checked = _event$target.checked;

                var _iterator10 = _createForOfIteratorHelper(_this8._getElementsByName(name, id)),
                    _step10;

                try {
                  for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
                    var checkbox = _step10.value;
                    var curChecked = checked && checkbox.exportValue === data.exportValue;

                    if (checkbox.domElement) {
                      checkbox.domElement.checked = curChecked;
                    }

                    storage.setValue(checkbox.id, {
                      value: curChecked
                    });
                  }
                } catch (err) {
                  _iterator10.e(err);
                } finally {
                  _iterator10.f();
                }

                storage.setValue(id, {
                  value: checked
                });
              });
              element.addEventListener("resetform", function (event) {
                var defaultValue = data.defaultFieldValue || "Off";
                event.target.checked = defaultValue === data.exportValue;
              });

              if (this.enableScripting && this.hasJSActions) {
                element.addEventListener("updatefromsandbox", function (jsEvent) {
                  var actions = {
                    value: function value(event) {
                      event.target.checked = event.detail.value !== "Off";
                      storage.setValue(id, {
                        value: event.target.checked
                      });
                    }
                  };

                  _this8._dispatchEventFromSandbox(actions, jsEvent);
                });

                this._setEventListeners(element, [["change", "Validate"], ["change", "Action"], ["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"]], function (event) {
                  return event.target.checked;
                });
              }

              this._setBackgroundColor(element);

              this.container.appendChild(element);
              return this.container;
            }
          }]);

          return CheckboxWidgetAnnotationElement;
        }(WidgetAnnotationElement);

        var RadioButtonWidgetAnnotationElement = /*#__PURE__*/function (_WidgetAnnotationElem3) {
          _inherits(RadioButtonWidgetAnnotationElement, _WidgetAnnotationElem3);

          var _super6 = _createSuper(RadioButtonWidgetAnnotationElement);

          function RadioButtonWidgetAnnotationElement(parameters) {
            _classCallCheck(this, RadioButtonWidgetAnnotationElement);

            return _super6.call(this, parameters, {
              isRenderable: parameters.renderForms
            });
          }

          _createClass(RadioButtonWidgetAnnotationElement, [{
            key: "render",
            value: function render() {
              var _this9 = this;

              this.container.className = "buttonWidgetAnnotation radioButton";
              var storage = this.annotationStorage;
              var data = this.data;
              var id = data.id;
              var value = storage.getValue(id, {
                value: data.fieldValue === data.buttonValue
              }).value;

              if (typeof value === "string") {
                value = value !== data.buttonValue;
                storage.setValue(id, {
                  value: value
                });
              }

              var element = document.createElement("input");
              GetElementsByNameSet.add(element);
              element.disabled = data.readOnly;
              element.type = "radio";
              element.name = data.fieldName;

              if (value) {
                element.setAttribute("checked", true);
              }

              element.setAttribute("id", id);
              element.tabIndex = DEFAULT_TAB_INDEX;
              element.addEventListener("change", function (event) {
                var _event$target2 = event.target,
                    name = _event$target2.name,
                    checked = _event$target2.checked;

                var _iterator11 = _createForOfIteratorHelper(_this9._getElementsByName(name, id)),
                    _step11;

                try {
                  for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
                    var radio = _step11.value;
                    storage.setValue(radio.id, {
                      value: false
                    });
                  }
                } catch (err) {
                  _iterator11.e(err);
                } finally {
                  _iterator11.f();
                }

                storage.setValue(id, {
                  value: checked
                });
              });
              element.addEventListener("resetform", function (event) {
                var defaultValue = data.defaultFieldValue;
                event.target.checked = defaultValue !== null && defaultValue !== undefined && defaultValue === data.buttonValue;
              });

              if (this.enableScripting && this.hasJSActions) {
                var pdfButtonValue = data.buttonValue;
                element.addEventListener("updatefromsandbox", function (jsEvent) {
                  var actions = {
                    value: function value(event) {
                      var checked = pdfButtonValue === event.detail.value;

                      var _iterator12 = _createForOfIteratorHelper(_this9._getElementsByName(event.target.name)),
                          _step12;

                      try {
                        for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
                          var radio = _step12.value;
                          var curChecked = checked && radio.id === id;

                          if (radio.domElement) {
                            radio.domElement.checked = curChecked;
                          }

                          storage.setValue(radio.id, {
                            value: curChecked
                          });
                        }
                      } catch (err) {
                        _iterator12.e(err);
                      } finally {
                        _iterator12.f();
                      }
                    }
                  };

                  _this9._dispatchEventFromSandbox(actions, jsEvent);
                });

                this._setEventListeners(element, [["change", "Validate"], ["change", "Action"], ["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"]], function (event) {
                  return event.target.checked;
                });
              }

              this._setBackgroundColor(element);

              this.container.appendChild(element);
              return this.container;
            }
          }]);

          return RadioButtonWidgetAnnotationElement;
        }(WidgetAnnotationElement);

        var PushButtonWidgetAnnotationElement = /*#__PURE__*/function (_LinkAnnotationElemen) {
          _inherits(PushButtonWidgetAnnotationElement, _LinkAnnotationElemen);

          var _super7 = _createSuper(PushButtonWidgetAnnotationElement);

          function PushButtonWidgetAnnotationElement() {
            _classCallCheck(this, PushButtonWidgetAnnotationElement);

            return _super7.apply(this, arguments);
          }

          _createClass(PushButtonWidgetAnnotationElement, [{
            key: "render",
            value: function render() {
              var container = _get(_getPrototypeOf(PushButtonWidgetAnnotationElement.prototype), "render", this).call(this);

              container.className = "buttonWidgetAnnotation pushButton";

              if (this.data.alternativeText) {
                container.title = this.data.alternativeText;
              }

              return container;
            }
          }]);

          return PushButtonWidgetAnnotationElement;
        }(LinkAnnotationElement);

        var ChoiceWidgetAnnotationElement = /*#__PURE__*/function (_WidgetAnnotationElem4) {
          _inherits(ChoiceWidgetAnnotationElement, _WidgetAnnotationElem4);

          var _super8 = _createSuper(ChoiceWidgetAnnotationElement);

          function ChoiceWidgetAnnotationElement(parameters) {
            _classCallCheck(this, ChoiceWidgetAnnotationElement);

            return _super8.call(this, parameters, {
              isRenderable: parameters.renderForms
            });
          }

          _createClass(ChoiceWidgetAnnotationElement, [{
            key: "render",
            value: function render() {
              var _this10 = this;

              this.container.className = "choiceWidgetAnnotation";
              var storage = this.annotationStorage;
              var id = this.data.id;
              storage.getValue(id, {
                value: this.data.fieldValue.length > 0 ? this.data.fieldValue[0] : undefined
              });
              var fontSize = this.data.defaultAppearanceData.fontSize;

              if (!fontSize) {
                fontSize = 9;
              }

              var fontSizeStyle = "calc(".concat(fontSize, "px * var(--zoom-factor))");
              var selectElement = document.createElement("select");
              GetElementsByNameSet.add(selectElement);
              selectElement.disabled = this.data.readOnly;
              selectElement.name = this.data.fieldName;
              selectElement.setAttribute("id", id);
              selectElement.tabIndex = DEFAULT_TAB_INDEX;
              selectElement.style.fontSize = "".concat(fontSize, "px");

              if (!this.data.combo) {
                selectElement.size = this.data.options.length;

                if (this.data.multiSelect) {
                  selectElement.multiple = true;
                }
              }

              selectElement.addEventListener("resetform", function (event) {
                var defaultValue = _this10.data.defaultFieldValue;

                var _iterator13 = _createForOfIteratorHelper(selectElement.options),
                    _step13;

                try {
                  for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
                    var option = _step13.value;
                    option.selected = option.value === defaultValue;
                  }
                } catch (err) {
                  _iterator13.e(err);
                } finally {
                  _iterator13.f();
                }
              });

              var _iterator14 = _createForOfIteratorHelper(this.data.options),
                  _step14;

              try {
                for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) {
                  var option = _step14.value;
                  var optionElement = document.createElement("option");
                  optionElement.textContent = option.displayValue;
                  optionElement.value = option.exportValue;

                  if (this.data.combo) {
                    optionElement.style.fontSize = fontSizeStyle;
                  }

                  if (this.data.fieldValue.includes(option.exportValue)) {
                    optionElement.setAttribute("selected", true);
                  }

                  selectElement.appendChild(optionElement);
                }
              } catch (err) {
                _iterator14.e(err);
              } finally {
                _iterator14.f();
              }

              var getValue = function getValue(event, isExport) {
                var name = isExport ? "value" : "textContent";
                var options = event.target.options;

                if (!event.target.multiple) {
                  return options.selectedIndex === -1 ? null : options[options.selectedIndex][name];
                }

                return Array.prototype.filter.call(options, function (option) {
                  return option.selected;
                }).map(function (option) {
                  return option[name];
                });
              };

              var getItems = function getItems(event) {
                var options = event.target.options;
                return Array.prototype.map.call(options, function (option) {
                  return {
                    displayValue: option.textContent,
                    exportValue: option.value
                  };
                });
              };

              if (this.enableScripting && this.hasJSActions) {
                selectElement.addEventListener("updatefromsandbox", function (jsEvent) {
                  var actions = {
                    value: function value(event) {
                      var value = event.detail.value;
                      var values = new Set(Array.isArray(value) ? value : [value]);

                      var _iterator15 = _createForOfIteratorHelper(selectElement.options),
                          _step15;

                      try {
                        for (_iterator15.s(); !(_step15 = _iterator15.n()).done;) {
                          var option = _step15.value;
                          option.selected = values.has(option.value);
                        }
                      } catch (err) {
                        _iterator15.e(err);
                      } finally {
                        _iterator15.f();
                      }

                      storage.setValue(id, {
                        value: getValue(event, true)
                      });
                    },
                    multipleSelection: function multipleSelection(event) {
                      selectElement.multiple = true;
                    },
                    remove: function remove(event) {
                      var options = selectElement.options;
                      var index = event.detail.remove;
                      options[index].selected = false;
                      selectElement.remove(index);

                      if (options.length > 0) {
                        var i = Array.prototype.findIndex.call(options, function (option) {
                          return option.selected;
                        });

                        if (i === -1) {
                          options[0].selected = true;
                        }
                      }

                      storage.setValue(id, {
                        value: getValue(event, true),
                        items: getItems(event)
                      });
                    },
                    clear: function clear(event) {
                      while (selectElement.length !== 0) {
                        selectElement.remove(0);
                      }

                      storage.setValue(id, {
                        value: null,
                        items: []
                      });
                    },
                    insert: function insert(event) {
                      var _event$detail$insert = event.detail.insert,
                          index = _event$detail$insert.index,
                          displayValue = _event$detail$insert.displayValue,
                          exportValue = _event$detail$insert.exportValue;
                      var optionElement = document.createElement("option");
                      optionElement.textContent = displayValue;
                      optionElement.value = exportValue;
                      selectElement.insertBefore(optionElement, selectElement.children[index]);
                      storage.setValue(id, {
                        value: getValue(event, true),
                        items: getItems(event)
                      });
                    },
                    items: function items(event) {
                      var items = event.detail.items;

                      while (selectElement.length !== 0) {
                        selectElement.remove(0);
                      }

                      var _iterator16 = _createForOfIteratorHelper(items),
                          _step16;

                      try {
                        for (_iterator16.s(); !(_step16 = _iterator16.n()).done;) {
                          var item = _step16.value;
                          var displayValue = item.displayValue,
                              exportValue = item.exportValue;
                          var optionElement = document.createElement("option");
                          optionElement.textContent = displayValue;
                          optionElement.value = exportValue;
                          selectElement.appendChild(optionElement);
                        }
                      } catch (err) {
                        _iterator16.e(err);
                      } finally {
                        _iterator16.f();
                      }

                      if (selectElement.options.length > 0) {
                        selectElement.options[0].selected = true;
                      }

                      storage.setValue(id, {
                        value: getValue(event, true),
                        items: getItems(event)
                      });
                    },
                    indices: function indices(event) {
                      var indices = new Set(event.detail.indices);

                      var _iterator17 = _createForOfIteratorHelper(event.target.options),
                          _step17;

                      try {
                        for (_iterator17.s(); !(_step17 = _iterator17.n()).done;) {
                          var option = _step17.value;
                          option.selected = indices.has(option.index);
                        }
                      } catch (err) {
                        _iterator17.e(err);
                      } finally {
                        _iterator17.f();
                      }

                      storage.setValue(id, {
                        value: getValue(event, true)
                      });
                    },
                    editable: function editable(event) {
                      event.target.disabled = !event.detail.editable;
                    }
                  };

                  _this10._dispatchEventFromSandbox(actions, jsEvent);
                });
                selectElement.addEventListener("input", function (event) {
                  var _this10$linkService$e;

                  var exportValue = getValue(event, true);
                  var value = getValue(event, false);
                  storage.setValue(id, {
                    value: exportValue
                  });
                  (_this10$linkService$e = _this10.linkService.eventBus) === null || _this10$linkService$e === void 0 ? void 0 : _this10$linkService$e.dispatch("dispatcheventinsandbox", {
                    source: _this10,
                    detail: {
                      id: id,
                      name: "Keystroke",
                      value: value,
                      changeEx: exportValue,
                      willCommit: true,
                      commitKey: 1,
                      keyDown: false
                    }
                  });
                });

                this._setEventListeners(selectElement, [["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"], ["input", "Action"]], function (event) {
                  return event.target.checked;
                });
              } else {
                selectElement.addEventListener("input", function (event) {
                  storage.setValue(id, {
                    value: getValue(event)
                  });
                });
              }

              this._setBackgroundColor(selectElement);

              this.container.appendChild(selectElement);
              return this.container;
            }
          }]);

          return ChoiceWidgetAnnotationElement;
        }(WidgetAnnotationElement);

        var PopupAnnotationElement = /*#__PURE__*/function (_AnnotationElement4) {
          _inherits(PopupAnnotationElement, _AnnotationElement4);

          var _super9 = _createSuper(PopupAnnotationElement);

          function PopupAnnotationElement(parameters) {
            var _parameters$data$titl2, _parameters$data$cont2;

            _classCallCheck(this, PopupAnnotationElement);

            var isRenderable = !!((_parameters$data$titl2 = parameters.data.titleObj) !== null && _parameters$data$titl2 !== void 0 && _parameters$data$titl2.str || (_parameters$data$cont2 = parameters.data.contentsObj) !== null && _parameters$data$cont2 !== void 0 && _parameters$data$cont2.str);
            return _super9.call(this, parameters, {
              isRenderable: isRenderable
            });
          }

          _createClass(PopupAnnotationElement, [{
            key: "render",
            value: function render() {
              var IGNORE_TYPES = ["Line", "Square", "Circle", "PolyLine", "Polygon", "Ink"];
              this.container.className = "popupAnnotation";

              if (IGNORE_TYPES.includes(this.data.parentType)) {
                return this.container;
              }

              var selector = "[data-annotation-id=\"".concat(this.data.parentId, "\"]");
              var parentElements = this.layer.querySelectorAll(selector);

              if (parentElements.length === 0) {
                return this.container;
              }

              var popup = new PopupElement({
                container: this.container,
                trigger: Array.from(parentElements),
                color: this.data.color,
                titleObj: this.data.titleObj,
                modificationDate: this.data.modificationDate,
                contentsObj: this.data.contentsObj
              });
              var page = this.page;

              var rect = _util.Util.normalizeRect([this.data.parentRect[0], page.view[3] - this.data.parentRect[1] + page.view[1], this.data.parentRect[2], page.view[3] - this.data.parentRect[3] + page.view[1]]);

              var popupLeft = rect[0] + this.data.parentRect[2] - this.data.parentRect[0];
              var popupTop = rect[1];
              this.container.style.transformOrigin = "".concat(-popupLeft, "px ").concat(-popupTop, "px");
              this.container.style.left = "".concat(popupLeft, "px");
              this.container.style.top = "".concat(popupTop, "px");
              this.container.appendChild(popup.render());
              return this.container;
            }
          }]);

          return PopupAnnotationElement;
        }(AnnotationElement);

        var PopupElement = /*#__PURE__*/function () {
          function PopupElement(parameters) {
            _classCallCheck(this, PopupElement);

            this.container = parameters.container;
            this.trigger = parameters.trigger;
            this.color = parameters.color;
            this.titleObj = parameters.titleObj;
            this.modificationDate = parameters.modificationDate;
            this.contentsObj = parameters.contentsObj;
            this.hideWrapper = parameters.hideWrapper || false;
            this.pinned = false;
          }

          _createClass(PopupElement, [{
            key: "render",
            value: function render() {
              var BACKGROUND_ENLIGHT = 0.7;
              var wrapper = document.createElement("div");
              wrapper.className = "popupWrapper";
              this.hideElement = this.hideWrapper ? wrapper : this.container;
              this.hideElement.hidden = true;
              var popup = document.createElement("div");
              popup.className = "popup";
              var color = this.color;

              if (color) {
                var r = BACKGROUND_ENLIGHT * (255 - color[0]) + color[0];
                var g = BACKGROUND_ENLIGHT * (255 - color[1]) + color[1];
                var b = BACKGROUND_ENLIGHT * (255 - color[2]) + color[2];
                popup.style.backgroundColor = _util.Util.makeHexColor(r | 0, g | 0, b | 0);
              }

              var title = document.createElement("h1");
              title.dir = this.titleObj.dir;
              title.textContent = this.titleObj.str;
              popup.appendChild(title);

              var dateObject = _display_utils.PDFDateString.toDateObject(this.modificationDate);

              if (dateObject) {
                var modificationDate = document.createElement("span");
                modificationDate.textContent = "{{date}}, {{time}}";
                modificationDate.dataset.l10nId = "annotation_date_string";
                modificationDate.dataset.l10nArgs = JSON.stringify({
                  date: dateObject.toLocaleDateString(),
                  time: dateObject.toLocaleTimeString()
                });
                popup.appendChild(modificationDate);
              }

              var contents = this._formatContents(this.contentsObj);

              popup.appendChild(contents);

              if (!Array.isArray(this.trigger)) {
                this.trigger = [this.trigger];
              }

              var _iterator18 = _createForOfIteratorHelper(this.trigger),
                  _step18;

              try {
                for (_iterator18.s(); !(_step18 = _iterator18.n()).done;) {
                  var element = _step18.value;
                  element.addEventListener("click", this._toggle.bind(this));
                  element.addEventListener("mouseover", this._show.bind(this, false));
                  element.addEventListener("mouseout", this._hide.bind(this, false));
                }
              } catch (err) {
                _iterator18.e(err);
              } finally {
                _iterator18.f();
              }

              popup.addEventListener("click", this._hide.bind(this, true));
              wrapper.appendChild(popup);
              return wrapper;
            }
          }, {
            key: "_formatContents",
            value: function _formatContents(_ref2) {
              var str = _ref2.str,
                  dir = _ref2.dir;
              var p = document.createElement("p");
              p.dir = dir;
              var lines = str.split(/(?:\r\n?|\n)/);

              for (var i = 0, ii = lines.length; i < ii; ++i) {
                var line = lines[i];
                p.appendChild(document.createTextNode(line));

                if (i < ii - 1) {
                  p.appendChild(document.createElement("br"));
                }
              }

              return p;
            }
          }, {
            key: "_toggle",
            value: function _toggle() {
              if (this.pinned) {
                this._hide(true);
              } else {
                this._show(true);
              }
            }
          }, {
            key: "_show",
            value: function _show() {
              var pin = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;

              if (pin) {
                this.pinned = true;
              }

              if (this.hideElement.hidden) {
                this.hideElement.hidden = false;
                this.container.style.zIndex += 1;
              }
            }
          }, {
            key: "_hide",
            value: function _hide() {
              var unpin = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;

              if (unpin) {
                this.pinned = false;
              }

              if (!this.hideElement.hidden && !this.pinned) {
                this.hideElement.hidden = true;
                this.container.style.zIndex -= 1;
              }
            }
          }]);

          return PopupElement;
        }();

        var FreeTextAnnotationElement = /*#__PURE__*/function (_AnnotationElement5) {
          _inherits(FreeTextAnnotationElement, _AnnotationElement5);

          var _super10 = _createSuper(FreeTextAnnotationElement);

          function FreeTextAnnotationElement(parameters) {
            var _parameters$data$titl3, _parameters$data$cont3;

            _classCallCheck(this, FreeTextAnnotationElement);

            var isRenderable = !!(parameters.data.hasPopup || (_parameters$data$titl3 = parameters.data.titleObj) !== null && _parameters$data$titl3 !== void 0 && _parameters$data$titl3.str || (_parameters$data$cont3 = parameters.data.contentsObj) !== null && _parameters$data$cont3 !== void 0 && _parameters$data$cont3.str);
            return _super10.call(this, parameters, {
              isRenderable: isRenderable,
              ignoreBorder: true
            });
          }

          _createClass(FreeTextAnnotationElement, [{
            key: "render",
            value: function render() {
              this.container.className = "freeTextAnnotation";

              if (!this.data.hasPopup) {
                this._createPopup(null, this.data);
              }

              return this.container;
            }
          }]);

          return FreeTextAnnotationElement;
        }(AnnotationElement);

        var LineAnnotationElement = /*#__PURE__*/function (_AnnotationElement6) {
          _inherits(LineAnnotationElement, _AnnotationElement6);

          var _super11 = _createSuper(LineAnnotationElement);

          function LineAnnotationElement(parameters) {
            var _parameters$data$titl4, _parameters$data$cont4;

            _classCallCheck(this, LineAnnotationElement);

            var isRenderable = !!(parameters.data.hasPopup || (_parameters$data$titl4 = parameters.data.titleObj) !== null && _parameters$data$titl4 !== void 0 && _parameters$data$titl4.str || (_parameters$data$cont4 = parameters.data.contentsObj) !== null && _parameters$data$cont4 !== void 0 && _parameters$data$cont4.str);
            return _super11.call(this, parameters, {
              isRenderable: isRenderable,
              ignoreBorder: true
            });
          }

          _createClass(LineAnnotationElement, [{
            key: "render",
            value: function render() {
              this.container.className = "lineAnnotation";
              var data = this.data;
              var width = data.rect[2] - data.rect[0];
              var height = data.rect[3] - data.rect[1];
              var svg = this.svgFactory.create(width, height);
              var line = this.svgFactory.createElement("svg:line");
              line.setAttribute("x1", data.rect[2] - data.lineCoordinates[0]);
              line.setAttribute("y1", data.rect[3] - data.lineCoordinates[1]);
              line.setAttribute("x2", data.rect[2] - data.lineCoordinates[2]);
              line.setAttribute("y2", data.rect[3] - data.lineCoordinates[3]);
              line.setAttribute("stroke-width", data.borderStyle.width || 1);
              line.setAttribute("stroke", "transparent");
              svg.appendChild(line);
              this.container.append(svg);

              this._createPopup(line, data);

              return this.container;
            }
          }]);

          return LineAnnotationElement;
        }(AnnotationElement);

        var SquareAnnotationElement = /*#__PURE__*/function (_AnnotationElement7) {
          _inherits(SquareAnnotationElement, _AnnotationElement7);

          var _super12 = _createSuper(SquareAnnotationElement);

          function SquareAnnotationElement(parameters) {
            var _parameters$data$titl5, _parameters$data$cont5;

            _classCallCheck(this, SquareAnnotationElement);

            var isRenderable = !!(parameters.data.hasPopup || (_parameters$data$titl5 = parameters.data.titleObj) !== null && _parameters$data$titl5 !== void 0 && _parameters$data$titl5.str || (_parameters$data$cont5 = parameters.data.contentsObj) !== null && _parameters$data$cont5 !== void 0 && _parameters$data$cont5.str);
            return _super12.call(this, parameters, {
              isRenderable: isRenderable,
              ignoreBorder: true
            });
          }

          _createClass(SquareAnnotationElement, [{
            key: "render",
            value: function render() {
              this.container.className = "squareAnnotation";
              var data = this.data;
              var width = data.rect[2] - data.rect[0];
              var height = data.rect[3] - data.rect[1];
              var svg = this.svgFactory.create(width, height);
              var borderWidth = data.borderStyle.width;
              var square = this.svgFactory.createElement("svg:rect");
              square.setAttribute("x", borderWidth / 2);
              square.setAttribute("y", borderWidth / 2);
              square.setAttribute("width", width - borderWidth);
              square.setAttribute("height", height - borderWidth);
              square.setAttribute("stroke-width", borderWidth || 1);
              square.setAttribute("stroke", "transparent");
              square.setAttribute("fill", "none");
              svg.appendChild(square);
              this.container.append(svg);

              this._createPopup(square, data);

              return this.container;
            }
          }]);

          return SquareAnnotationElement;
        }(AnnotationElement);

        var CircleAnnotationElement = /*#__PURE__*/function (_AnnotationElement8) {
          _inherits(CircleAnnotationElement, _AnnotationElement8);

          var _super13 = _createSuper(CircleAnnotationElement);

          function CircleAnnotationElement(parameters) {
            var _parameters$data$titl6, _parameters$data$cont6;

            _classCallCheck(this, CircleAnnotationElement);

            var isRenderable = !!(parameters.data.hasPopup || (_parameters$data$titl6 = parameters.data.titleObj) !== null && _parameters$data$titl6 !== void 0 && _parameters$data$titl6.str || (_parameters$data$cont6 = parameters.data.contentsObj) !== null && _parameters$data$cont6 !== void 0 && _parameters$data$cont6.str);
            return _super13.call(this, parameters, {
              isRenderable: isRenderable,
              ignoreBorder: true
            });
          }

          _createClass(CircleAnnotationElement, [{
            key: "render",
            value: function render() {
              this.container.className = "circleAnnotation";
              var data = this.data;
              var width = data.rect[2] - data.rect[0];
              var height = data.rect[3] - data.rect[1];
              var svg = this.svgFactory.create(width, height);
              var borderWidth = data.borderStyle.width;
              var circle = this.svgFactory.createElement("svg:ellipse");
              circle.setAttribute("cx", width / 2);
              circle.setAttribute("cy", height / 2);
              circle.setAttribute("rx", width / 2 - borderWidth / 2);
              circle.setAttribute("ry", height / 2 - borderWidth / 2);
              circle.setAttribute("stroke-width", borderWidth || 1);
              circle.setAttribute("stroke", "transparent");
              circle.setAttribute("fill", "none");
              svg.appendChild(circle);
              this.container.append(svg);

              this._createPopup(circle, data);

              return this.container;
            }
          }]);

          return CircleAnnotationElement;
        }(AnnotationElement);

        var PolylineAnnotationElement = /*#__PURE__*/function (_AnnotationElement9) {
          _inherits(PolylineAnnotationElement, _AnnotationElement9);

          var _super14 = _createSuper(PolylineAnnotationElement);

          function PolylineAnnotationElement(parameters) {
            var _parameters$data$titl7, _parameters$data$cont7;

            var _this11;

            _classCallCheck(this, PolylineAnnotationElement);

            var isRenderable = !!(parameters.data.hasPopup || (_parameters$data$titl7 = parameters.data.titleObj) !== null && _parameters$data$titl7 !== void 0 && _parameters$data$titl7.str || (_parameters$data$cont7 = parameters.data.contentsObj) !== null && _parameters$data$cont7 !== void 0 && _parameters$data$cont7.str);
            _this11 = _super14.call(this, parameters, {
              isRenderable: isRenderable,
              ignoreBorder: true
            });
            _this11.containerClassName = "polylineAnnotation";
            _this11.svgElementName = "svg:polyline";
            return _this11;
          }

          _createClass(PolylineAnnotationElement, [{
            key: "render",
            value: function render() {
              this.container.className = this.containerClassName;
              var data = this.data;
              var width = data.rect[2] - data.rect[0];
              var height = data.rect[3] - data.rect[1];
              var svg = this.svgFactory.create(width, height);
              var points = [];

              var _iterator19 = _createForOfIteratorHelper(data.vertices),
                  _step19;

              try {
                for (_iterator19.s(); !(_step19 = _iterator19.n()).done;) {
                  var coordinate = _step19.value;
                  var x = coordinate.x - data.rect[0];
                  var y = data.rect[3] - coordinate.y;
                  points.push(x + "," + y);
                }
              } catch (err) {
                _iterator19.e(err);
              } finally {
                _iterator19.f();
              }

              points = points.join(" ");
              var polyline = this.svgFactory.createElement(this.svgElementName);
              polyline.setAttribute("points", points);
              polyline.setAttribute("stroke-width", data.borderStyle.width || 1);
              polyline.setAttribute("stroke", "transparent");
              polyline.setAttribute("fill", "none");
              svg.appendChild(polyline);
              this.container.append(svg);

              this._createPopup(polyline, data);

              return this.container;
            }
          }]);

          return PolylineAnnotationElement;
        }(AnnotationElement);

        var PolygonAnnotationElement = /*#__PURE__*/function (_PolylineAnnotationEl) {
          _inherits(PolygonAnnotationElement, _PolylineAnnotationEl);

          var _super15 = _createSuper(PolygonAnnotationElement);

          function PolygonAnnotationElement(parameters) {
            var _this12;

            _classCallCheck(this, PolygonAnnotationElement);

            _this12 = _super15.call(this, parameters);
            _this12.containerClassName = "polygonAnnotation";
            _this12.svgElementName = "svg:polygon";
            return _this12;
          }

          return PolygonAnnotationElement;
        }(PolylineAnnotationElement);

        var CaretAnnotationElement = /*#__PURE__*/function (_AnnotationElement10) {
          _inherits(CaretAnnotationElement, _AnnotationElement10);

          var _super16 = _createSuper(CaretAnnotationElement);

          function CaretAnnotationElement(parameters) {
            var _parameters$data$titl8, _parameters$data$cont8;

            _classCallCheck(this, CaretAnnotationElement);

            var isRenderable = !!(parameters.data.hasPopup || (_parameters$data$titl8 = parameters.data.titleObj) !== null && _parameters$data$titl8 !== void 0 && _parameters$data$titl8.str || (_parameters$data$cont8 = parameters.data.contentsObj) !== null && _parameters$data$cont8 !== void 0 && _parameters$data$cont8.str);
            return _super16.call(this, parameters, {
              isRenderable: isRenderable,
              ignoreBorder: true
            });
          }

          _createClass(CaretAnnotationElement, [{
            key: "render",
            value: function render() {
              this.container.className = "caretAnnotation";

              if (!this.data.hasPopup) {
                this._createPopup(null, this.data);
              }

              return this.container;
            }
          }]);

          return CaretAnnotationElement;
        }(AnnotationElement);

        var InkAnnotationElement = /*#__PURE__*/function (_AnnotationElement11) {
          _inherits(InkAnnotationElement, _AnnotationElement11);

          var _super17 = _createSuper(InkAnnotationElement);

          function InkAnnotationElement(parameters) {
            var _parameters$data$titl9, _parameters$data$cont9;

            var _this13;

            _classCallCheck(this, InkAnnotationElement);

            var isRenderable = !!(parameters.data.hasPopup || (_parameters$data$titl9 = parameters.data.titleObj) !== null && _parameters$data$titl9 !== void 0 && _parameters$data$titl9.str || (_parameters$data$cont9 = parameters.data.contentsObj) !== null && _parameters$data$cont9 !== void 0 && _parameters$data$cont9.str);
            _this13 = _super17.call(this, parameters, {
              isRenderable: isRenderable,
              ignoreBorder: true
            });
            _this13.containerClassName = "inkAnnotation";
            _this13.svgElementName = "svg:polyline";
            return _this13;
          }

          _createClass(InkAnnotationElement, [{
            key: "render",
            value: function render() {
              this.container.className = this.containerClassName;
              var data = this.data;
              var width = data.rect[2] - data.rect[0];
              var height = data.rect[3] - data.rect[1];
              var svg = this.svgFactory.create(width, height);

              var _iterator20 = _createForOfIteratorHelper(data.inkLists),
                  _step20;

              try {
                for (_iterator20.s(); !(_step20 = _iterator20.n()).done;) {
                  var inkList = _step20.value;
                  var points = [];

                  var _iterator21 = _createForOfIteratorHelper(inkList),
                      _step21;

                  try {
                    for (_iterator21.s(); !(_step21 = _iterator21.n()).done;) {
                      var coordinate = _step21.value;
                      var x = coordinate.x - data.rect[0];
                      var y = data.rect[3] - coordinate.y;
                      points.push("".concat(x, ",").concat(y));
                    }
                  } catch (err) {
                    _iterator21.e(err);
                  } finally {
                    _iterator21.f();
                  }

                  points = points.join(" ");
                  var polyline = this.svgFactory.createElement(this.svgElementName);
                  polyline.setAttribute("points", points);
                  polyline.setAttribute("stroke-width", data.borderStyle.width || 1);
                  polyline.setAttribute("stroke", "transparent");
                  polyline.setAttribute("fill", "none");

                  this._createPopup(polyline, data);

                  svg.appendChild(polyline);
                }
              } catch (err) {
                _iterator20.e(err);
              } finally {
                _iterator20.f();
              }

              this.container.append(svg);
              return this.container;
            }
          }]);

          return InkAnnotationElement;
        }(AnnotationElement);

        var HighlightAnnotationElement = /*#__PURE__*/function (_AnnotationElement12) {
          _inherits(HighlightAnnotationElement, _AnnotationElement12);

          var _super18 = _createSuper(HighlightAnnotationElement);

          function HighlightAnnotationElement(parameters) {
            var _parameters$data$titl10, _parameters$data$cont10;

            _classCallCheck(this, HighlightAnnotationElement);

            var isRenderable = !!(parameters.data.hasPopup || (_parameters$data$titl10 = parameters.data.titleObj) !== null && _parameters$data$titl10 !== void 0 && _parameters$data$titl10.str || (_parameters$data$cont10 = parameters.data.contentsObj) !== null && _parameters$data$cont10 !== void 0 && _parameters$data$cont10.str);
            return _super18.call(this, parameters, {
              isRenderable: isRenderable,
              ignoreBorder: true,
              createQuadrilaterals: true
            });
          }

          _createClass(HighlightAnnotationElement, [{
            key: "render",
            value: function render() {
              if (!this.data.hasPopup) {
                this._createPopup(null, this.data);
              }

              if (this.quadrilaterals) {
                return this._renderQuadrilaterals("highlightAnnotation");
              }

              this.container.className = "highlightAnnotation";
              return this.container;
            }
          }]);

          return HighlightAnnotationElement;
        }(AnnotationElement);

        var UnderlineAnnotationElement = /*#__PURE__*/function (_AnnotationElement13) {
          _inherits(UnderlineAnnotationElement, _AnnotationElement13);

          var _super19 = _createSuper(UnderlineAnnotationElement);

          function UnderlineAnnotationElement(parameters) {
            var _parameters$data$titl11, _parameters$data$cont11;

            _classCallCheck(this, UnderlineAnnotationElement);

            var isRenderable = !!(parameters.data.hasPopup || (_parameters$data$titl11 = parameters.data.titleObj) !== null && _parameters$data$titl11 !== void 0 && _parameters$data$titl11.str || (_parameters$data$cont11 = parameters.data.contentsObj) !== null && _parameters$data$cont11 !== void 0 && _parameters$data$cont11.str);
            return _super19.call(this, parameters, {
              isRenderable: isRenderable,
              ignoreBorder: true,
              createQuadrilaterals: true
            });
          }

          _createClass(UnderlineAnnotationElement, [{
            key: "render",
            value: function render() {
              if (!this.data.hasPopup) {
                this._createPopup(null, this.data);
              }

              if (this.quadrilaterals) {
                return this._renderQuadrilaterals("underlineAnnotation");
              }

              this.container.className = "underlineAnnotation";
              return this.container;
            }
          }]);

          return UnderlineAnnotationElement;
        }(AnnotationElement);

        var SquigglyAnnotationElement = /*#__PURE__*/function (_AnnotationElement14) {
          _inherits(SquigglyAnnotationElement, _AnnotationElement14);

          var _super20 = _createSuper(SquigglyAnnotationElement);

          function SquigglyAnnotationElement(parameters) {
            var _parameters$data$titl12, _parameters$data$cont12;

            _classCallCheck(this, SquigglyAnnotationElement);

            var isRenderable = !!(parameters.data.hasPopup || (_parameters$data$titl12 = parameters.data.titleObj) !== null && _parameters$data$titl12 !== void 0 && _parameters$data$titl12.str || (_parameters$data$cont12 = parameters.data.contentsObj) !== null && _parameters$data$cont12 !== void 0 && _parameters$data$cont12.str);
            return _super20.call(this, parameters, {
              isRenderable: isRenderable,
              ignoreBorder: true,
              createQuadrilaterals: true
            });
          }

          _createClass(SquigglyAnnotationElement, [{
            key: "render",
            value: function render() {
              if (!this.data.hasPopup) {
                this._createPopup(null, this.data);
              }

              if (this.quadrilaterals) {
                return this._renderQuadrilaterals("squigglyAnnotation");
              }

              this.container.className = "squigglyAnnotation";
              return this.container;
            }
          }]);

          return SquigglyAnnotationElement;
        }(AnnotationElement);

        var StrikeOutAnnotationElement = /*#__PURE__*/function (_AnnotationElement15) {
          _inherits(StrikeOutAnnotationElement, _AnnotationElement15);

          var _super21 = _createSuper(StrikeOutAnnotationElement);

          function StrikeOutAnnotationElement(parameters) {
            var _parameters$data$titl13, _parameters$data$cont13;

            _classCallCheck(this, StrikeOutAnnotationElement);

            var isRenderable = !!(parameters.data.hasPopup || (_parameters$data$titl13 = parameters.data.titleObj) !== null && _parameters$data$titl13 !== void 0 && _parameters$data$titl13.str || (_parameters$data$cont13 = parameters.data.contentsObj) !== null && _parameters$data$cont13 !== void 0 && _parameters$data$cont13.str);
            return _super21.call(this, parameters, {
              isRenderable: isRenderable,
              ignoreBorder: true,
              createQuadrilaterals: true
            });
          }

          _createClass(StrikeOutAnnotationElement, [{
            key: "render",
            value: function render() {
              if (!this.data.hasPopup) {
                this._createPopup(null, this.data);
              }

              if (this.quadrilaterals) {
                return this._renderQuadrilaterals("strikeoutAnnotation");
              }

              this.container.className = "strikeoutAnnotation";
              return this.container;
            }
          }]);

          return StrikeOutAnnotationElement;
        }(AnnotationElement);

        var StampAnnotationElement = /*#__PURE__*/function (_AnnotationElement16) {
          _inherits(StampAnnotationElement, _AnnotationElement16);

          var _super22 = _createSuper(StampAnnotationElement);

          function StampAnnotationElement(parameters) {
            var _parameters$data$titl14, _parameters$data$cont14;

            _classCallCheck(this, StampAnnotationElement);

            var isRenderable = !!(parameters.data.hasPopup || (_parameters$data$titl14 = parameters.data.titleObj) !== null && _parameters$data$titl14 !== void 0 && _parameters$data$titl14.str || (_parameters$data$cont14 = parameters.data.contentsObj) !== null && _parameters$data$cont14 !== void 0 && _parameters$data$cont14.str);
            return _super22.call(this, parameters, {
              isRenderable: isRenderable,
              ignoreBorder: true
            });
          }

          _createClass(StampAnnotationElement, [{
            key: "render",
            value: function render() {
              this.container.className = "stampAnnotation";

              if (!this.data.hasPopup) {
                this._createPopup(null, this.data);
              }

              return this.container;
            }
          }]);

          return StampAnnotationElement;
        }(AnnotationElement);

        var FileAttachmentAnnotationElement = /*#__PURE__*/function (_AnnotationElement17) {
          _inherits(FileAttachmentAnnotationElement, _AnnotationElement17);

          var _super23 = _createSuper(FileAttachmentAnnotationElement);

          function FileAttachmentAnnotationElement(parameters) {
            var _this14$linkService$e;

            var _this14;

            _classCallCheck(this, FileAttachmentAnnotationElement);

            _this14 = _super23.call(this, parameters, {
              isRenderable: true
            });
            var _this14$data$file = _this14.data.file,
                filename = _this14$data$file.filename,
                content = _this14$data$file.content;
            _this14.filename = (0, _display_utils.getFilenameFromUrl)(filename);
            _this14.content = content;
            (_this14$linkService$e = _this14.linkService.eventBus) === null || _this14$linkService$e === void 0 ? void 0 : _this14$linkService$e.dispatch("fileattachmentannotation", {
              source: _assertThisInitialized(_this14),
              id: (0, _util.stringToPDFString)(filename),
              filename: filename,
              content: content
            });
            return _this14;
          }

          _createClass(FileAttachmentAnnotationElement, [{
            key: "render",
            value: function render() {
              var _this$data$titleObj, _this$data$contentsOb;

              this.container.className = "fileAttachmentAnnotation";
              var trigger = document.createElement("div");
              trigger.style.height = this.container.style.height;
              trigger.style.width = this.container.style.width;
              trigger.addEventListener("dblclick", this._download.bind(this));

              if (!this.data.hasPopup && ((_this$data$titleObj = this.data.titleObj) !== null && _this$data$titleObj !== void 0 && _this$data$titleObj.str || (_this$data$contentsOb = this.data.contentsObj) !== null && _this$data$contentsOb !== void 0 && _this$data$contentsOb.str)) {
                this._createPopup(trigger, this.data);
              }

              this.container.appendChild(trigger);
              return this.container;
            }
          }, {
            key: "_download",
            value: function _download() {
              var _this$downloadManager;

              (_this$downloadManager = this.downloadManager) === null || _this$downloadManager === void 0 ? void 0 : _this$downloadManager.openOrDownloadData(this.container, this.content, this.filename);
            }
          }]);

          return FileAttachmentAnnotationElement;
        }(AnnotationElement);

        var AnnotationLayer = /*#__PURE__*/function () {
          function AnnotationLayer() {
            _classCallCheck(this, AnnotationLayer);
          }

          _createClass(AnnotationLayer, null, [{
            key: "render",
            value: function render(parameters) {
              var sortedAnnotations = [],
                  popupAnnotations = [];

              var _iterator22 = _createForOfIteratorHelper(parameters.annotations),
                  _step22;

              try {
                for (_iterator22.s(); !(_step22 = _iterator22.n()).done;) {
                  var _data = _step22.value;

                  if (!_data) {
                    continue;
                  }

                  if (_data.annotationType === _util.AnnotationType.POPUP) {
                    popupAnnotations.push(_data);
                    continue;
                  }

                  sortedAnnotations.push(_data);
                }
              } catch (err) {
                _iterator22.e(err);
              } finally {
                _iterator22.f();
              }

              if (popupAnnotations.length) {
                sortedAnnotations.push.apply(sortedAnnotations, popupAnnotations);
              }

              for (var _i6 = 0, _sortedAnnotations = sortedAnnotations; _i6 < _sortedAnnotations.length; _i6++) {
                var data = _sortedAnnotations[_i6];
                var element = AnnotationElementFactory.create({
                  data: data,
                  layer: parameters.div,
                  page: parameters.page,
                  viewport: parameters.viewport,
                  linkService: parameters.linkService,
                  downloadManager: parameters.downloadManager,
                  imageResourcesPath: parameters.imageResourcesPath || "",
                  renderForms: parameters.renderForms !== false,
                  svgFactory: new _display_utils.DOMSVGFactory(),
                  annotationStorage: parameters.annotationStorage || new _annotation_storage.AnnotationStorage(),
                  enableScripting: parameters.enableScripting,
                  hasJSActions: parameters.hasJSActions,
                  fieldObjects: parameters.fieldObjects,
                  mouseState: parameters.mouseState || {
                    isDown: false
                  }
                });

                if (element.isRenderable) {
                  var rendered = element.render();

                  if (data.hidden) {
                    rendered.style.visibility = "hidden";
                  }

                  if (Array.isArray(rendered)) {
                    var _iterator23 = _createForOfIteratorHelper(rendered),
                        _step23;

                    try {
                      for (_iterator23.s(); !(_step23 = _iterator23.n()).done;) {
                        var renderedElement = _step23.value;
                        parameters.div.appendChild(renderedElement);
                      }
                    } catch (err) {
                      _iterator23.e(err);
                    } finally {
                      _iterator23.f();
                    }
                  } else {
                    if (element instanceof PopupAnnotationElement) {
                      parameters.div.prepend(rendered);
                    } else {
                      parameters.div.appendChild(rendered);
                    }
                  }
                }
              }
            }
          }, {
            key: "update",
            value: function update(parameters) {
              var transform = "matrix(".concat(parameters.viewport.transform.join(","), ")");

              var _iterator24 = _createForOfIteratorHelper(parameters.annotations),
                  _step24;

              try {
                for (_iterator24.s(); !(_step24 = _iterator24.n()).done;) {
                  var data = _step24.value;
                  var elements = parameters.div.querySelectorAll("[data-annotation-id=\"".concat(data.id, "\"]"));

                  if (elements) {
                    var _iterator25 = _createForOfIteratorHelper(elements),
                        _step25;

                    try {
                      for (_iterator25.s(); !(_step25 = _iterator25.n()).done;) {
                        var element = _step25.value;
                        element.style.transform = transform;
                      }
                    } catch (err) {
                      _iterator25.e(err);
                    } finally {
                      _iterator25.f();
                    }
                  }
                }
              } catch (err) {
                _iterator24.e(err);
              } finally {
                _iterator24.f();
              }

              parameters.div.hidden = false;
            }
          }]);

          return AnnotationLayer;
        }();

        exports.AnnotationLayer = AnnotationLayer;
        /***/
      },
      /* 132 */

      /***/
      function (__unused_webpack_module, exports) {
        "use strict";

        Object.defineProperty(exports, "__esModule", {
          value: true
        });
        exports.ColorConverters = void 0;

        function _slicedToArray(arr, i) {
          return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
        }

        function _nonIterableRest() {
          throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
        }

        function _unsupportedIterableToArray(o, minLen) {
          if (!o) return;
          if (typeof o === "string") return _arrayLikeToArray(o, minLen);
          var n = Object.prototype.toString.call(o).slice(8, -1);
          if (n === "Object" && o.constructor) n = o.constructor.name;
          if (n === "Map" || n === "Set") return Array.from(o);
          if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
        }

        function _arrayLikeToArray(arr, len) {
          if (len == null || len > arr.length) len = arr.length;

          for (var i = 0, arr2 = new Array(len); i < len; i++) {
            arr2[i] = arr[i];
          }

          return arr2;
        }

        function _iterableToArrayLimit(arr, i) {
          var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];

          if (_i == null) return;
          var _arr = [];
          var _n = true;
          var _d = false;

          var _s, _e;

          try {
            for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
              _arr.push(_s.value);

              if (i && _arr.length === i) break;
            }
          } catch (err) {
            _d = true;
            _e = err;
          } finally {
            try {
              if (!_n && _i["return"] != null) _i["return"]();
            } finally {
              if (_d) throw _e;
            }
          }

          return _arr;
        }

        function _arrayWithHoles(arr) {
          if (Array.isArray(arr)) return arr;
        }

        function _classCallCheck(instance, Constructor) {
          if (!(instance instanceof Constructor)) {
            throw new TypeError("Cannot call a class as a function");
          }
        }

        function _defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];
            descriptor.enumerable = descriptor.enumerable || false;
            descriptor.configurable = true;
            if ("value" in descriptor) descriptor.writable = true;
            Object.defineProperty(target, descriptor.key, descriptor);
          }
        }

        function _createClass(Constructor, protoProps, staticProps) {
          if (protoProps) _defineProperties(Constructor.prototype, protoProps);
          if (staticProps) _defineProperties(Constructor, staticProps);
          return Constructor;
        }

        function makeColorComp(n) {
          return Math.floor(Math.max(0, Math.min(1, n)) * 255).toString(16).padStart(2, "0");
        }

        var ColorConverters = /*#__PURE__*/function () {
          function ColorConverters() {
            _classCallCheck(this, ColorConverters);
          }

          _createClass(ColorConverters, null, [{
            key: "CMYK_G",
            value: function CMYK_G(_ref) {
              var _ref2 = _slicedToArray(_ref, 4),
                  c = _ref2[0],
                  y = _ref2[1],
                  m = _ref2[2],
                  k = _ref2[3];

              return ["G", 1 - Math.min(1, 0.3 * c + 0.59 * m + 0.11 * y + k)];
            }
          }, {
            key: "G_CMYK",
            value: function G_CMYK(_ref3) {
              var _ref4 = _slicedToArray(_ref3, 1),
                  g = _ref4[0];

              return ["CMYK", 0, 0, 0, 1 - g];
            }
          }, {
            key: "G_RGB",
            value: function G_RGB(_ref5) {
              var _ref6 = _slicedToArray(_ref5, 1),
                  g = _ref6[0];

              return ["RGB", g, g, g];
            }
          }, {
            key: "G_HTML",
            value: function G_HTML(_ref7) {
              var _ref8 = _slicedToArray(_ref7, 1),
                  g = _ref8[0];

              var G = makeColorComp(g);
              return "#".concat(G).concat(G).concat(G);
            }
          }, {
            key: "RGB_G",
            value: function RGB_G(_ref9) {
              var _ref10 = _slicedToArray(_ref9, 3),
                  r = _ref10[0],
                  g = _ref10[1],
                  b = _ref10[2];

              return ["G", 0.3 * r + 0.59 * g + 0.11 * b];
            }
          }, {
            key: "RGB_HTML",
            value: function RGB_HTML(_ref11) {
              var _ref12 = _slicedToArray(_ref11, 3),
                  r = _ref12[0],
                  g = _ref12[1],
                  b = _ref12[2];

              var R = makeColorComp(r);
              var G = makeColorComp(g);
              var B = makeColorComp(b);
              return "#".concat(R).concat(G).concat(B);
            }
          }, {
            key: "T_HTML",
            value: function T_HTML() {
              return "#00000000";
            }
          }, {
            key: "CMYK_RGB",
            value: function CMYK_RGB(_ref13) {
              var _ref14 = _slicedToArray(_ref13, 4),
                  c = _ref14[0],
                  y = _ref14[1],
                  m = _ref14[2],
                  k = _ref14[3];

              return ["RGB", 1 - Math.min(1, c + k), 1 - Math.min(1, m + k), 1 - Math.min(1, y + k)];
            }
          }, {
            key: "CMYK_HTML",
            value: function CMYK_HTML(components) {
              return this.RGB_HTML(this.CMYK_RGB(components));
            }
          }, {
            key: "RGB_CMYK",
            value: function RGB_CMYK(_ref15) {
              var _ref16 = _slicedToArray(_ref15, 3),
                  r = _ref16[0],
                  g = _ref16[1],
                  b = _ref16[2];

              var c = 1 - r;
              var m = 1 - g;
              var y = 1 - b;
              var k = Math.min(c, m, y);
              return ["CMYK", c, m, y, k];
            }
          }]);

          return ColorConverters;
        }();

        exports.ColorConverters = ColorConverters;
        /***/
      },
      /* 133 */

      /***/
      function (__unused_webpack_module, exports, __w_pdfjs_require__) {
        "use strict";

        Object.defineProperty(exports, "__esModule", {
          value: true
        });
        exports.renderTextLayer = renderTextLayer;

        var _util = __w_pdfjs_require__(4);

        function _classCallCheck(instance, Constructor) {
          if (!(instance instanceof Constructor)) {
            throw new TypeError("Cannot call a class as a function");
          }
        }

        function _defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];
            descriptor.enumerable = descriptor.enumerable || false;
            descriptor.configurable = true;
            if ("value" in descriptor) descriptor.writable = true;
            Object.defineProperty(target, descriptor.key, descriptor);
          }
        }

        function _createClass(Constructor, protoProps, staticProps) {
          if (protoProps) _defineProperties(Constructor.prototype, protoProps);
          if (staticProps) _defineProperties(Constructor, staticProps);
          return Constructor;
        }

        function _createForOfIteratorHelper(o, allowArrayLike) {
          var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];

          if (!it) {
            if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
              if (it) o = it;
              var i = 0;

              var F = function F() {};

              return {
                s: F,
                n: function n() {
                  if (i >= o.length) return {
                    done: true
                  };
                  return {
                    done: false,
                    value: o[i++]
                  };
                },
                e: function e(_e) {
                  throw _e;
                },
                f: F
              };
            }

            throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
          }

          var normalCompletion = true,
              didErr = false,
              err;
          return {
            s: function s() {
              it = it.call(o);
            },
            n: function n() {
              var step = it.next();
              normalCompletion = step.done;
              return step;
            },
            e: function e(_e2) {
              didErr = true;
              err = _e2;
            },
            f: function f() {
              try {
                if (!normalCompletion && it["return"] != null) it["return"]();
              } finally {
                if (didErr) throw err;
              }
            }
          };
        }

        function _unsupportedIterableToArray(o, minLen) {
          if (!o) return;
          if (typeof o === "string") return _arrayLikeToArray(o, minLen);
          var n = Object.prototype.toString.call(o).slice(8, -1);
          if (n === "Object" && o.constructor) n = o.constructor.name;
          if (n === "Map" || n === "Set") return Array.from(o);
          if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
        }

        function _arrayLikeToArray(arr, len) {
          if (len == null || len > arr.length) len = arr.length;

          for (var i = 0, arr2 = new Array(len); i < len; i++) {
            arr2[i] = arr[i];
          }

          return arr2;
        }

        var MAX_TEXT_DIVS_TO_RENDER = 100000;
        var DEFAULT_FONT_SIZE = 30;
        var DEFAULT_FONT_ASCENT = 0.8;
        var ascentCache = new Map();
        var AllWhitespaceRegexp = /^\s+$/g;

        function getAscent(fontFamily, ctx) {
          var cachedAscent = ascentCache.get(fontFamily);

          if (cachedAscent) {
            return cachedAscent;
          }

          ctx.save();
          ctx.font = "".concat(DEFAULT_FONT_SIZE, "px ").concat(fontFamily);
          var metrics = ctx.measureText("");
          var ascent = metrics.fontBoundingBoxAscent;
          var descent = Math.abs(metrics.fontBoundingBoxDescent);

          if (ascent) {
            ctx.restore();
            var ratio = ascent / (ascent + descent);
            ascentCache.set(fontFamily, ratio);
            return ratio;
          }

          ctx.strokeStyle = "red";
          ctx.clearRect(0, 0, DEFAULT_FONT_SIZE, DEFAULT_FONT_SIZE);
          ctx.strokeText("g", 0, 0);
          var pixels = ctx.getImageData(0, 0, DEFAULT_FONT_SIZE, DEFAULT_FONT_SIZE).data;
          descent = 0;

          for (var i = pixels.length - 1 - 3; i >= 0; i -= 4) {
            if (pixels[i] > 0) {
              descent = Math.ceil(i / 4 / DEFAULT_FONT_SIZE);
              break;
            }
          }

          ctx.clearRect(0, 0, DEFAULT_FONT_SIZE, DEFAULT_FONT_SIZE);
          ctx.strokeText("A", 0, DEFAULT_FONT_SIZE);
          pixels = ctx.getImageData(0, 0, DEFAULT_FONT_SIZE, DEFAULT_FONT_SIZE).data;
          ascent = 0;

          for (var _i = 0, ii = pixels.length; _i < ii; _i += 4) {
            if (pixels[_i] > 0) {
              ascent = DEFAULT_FONT_SIZE - Math.floor(_i / 4 / DEFAULT_FONT_SIZE);
              break;
            }
          }

          ctx.restore();

          if (ascent) {
            var _ratio = ascent / (ascent + descent);

            ascentCache.set(fontFamily, _ratio);
            return _ratio;
          }

          ascentCache.set(fontFamily, DEFAULT_FONT_ASCENT);
          return DEFAULT_FONT_ASCENT;
        }

        function appendText(task, geom, styles, ctx) {
          var textDiv = document.createElement("span");
          var textDivProperties = task._enhanceTextSelection ? {
            angle: 0,
            canvasWidth: 0,
            hasText: geom.str !== "",
            hasEOL: geom.hasEOL,
            originalTransform: null,
            paddingBottom: 0,
            paddingLeft: 0,
            paddingRight: 0,
            paddingTop: 0,
            scale: 1
          } : {
            angle: 0,
            canvasWidth: 0,
            hasText: geom.str !== "",
            hasEOL: geom.hasEOL
          };

          task._textDivs.push(textDiv);

          var tx = _util.Util.transform(task._viewport.transform, geom.transform);

          var angle = Math.atan2(tx[1], tx[0]);
          var style = styles[geom.fontName];

          if (style.vertical) {
            angle += Math.PI / 2;
          }

          var fontHeight = Math.hypot(tx[2], tx[3]);
          var fontAscent = fontHeight * getAscent(style.fontFamily, ctx);
          var left, top;

          if (angle === 0) {
            left = tx[4];
            top = tx[5] - fontAscent;
          } else {
            left = tx[4] + fontAscent * Math.sin(angle);
            top = tx[5] - fontAscent * Math.cos(angle);
          }

          textDiv.style.left = "".concat(left, "px");
          textDiv.style.top = "".concat(top, "px");
          textDiv.style.fontSize = "".concat(fontHeight, "px");
          textDiv.style.fontFamily = style.fontFamily;
          textDiv.setAttribute("role", "presentation");
          textDiv.textContent = geom.str;
          textDiv.dir = geom.dir;

          if (task._fontInspectorEnabled) {
            textDiv.dataset.fontName = geom.fontName;
          }

          if (angle !== 0) {
            textDivProperties.angle = angle * (180 / Math.PI);
          }

          var shouldScaleText = false;

          if (geom.str.length > 1 || task._enhanceTextSelection && AllWhitespaceRegexp.test(geom.str)) {
            shouldScaleText = true;
          } else if (geom.transform[0] !== geom.transform[3]) {
            var absScaleX = Math.abs(geom.transform[0]),
                absScaleY = Math.abs(geom.transform[3]);

            if (absScaleX !== absScaleY && Math.max(absScaleX, absScaleY) / Math.min(absScaleX, absScaleY) > 1.5) {
              shouldScaleText = true;
            }
          }

          if (shouldScaleText) {
            if (style.vertical) {
              textDivProperties.canvasWidth = geom.height * task._viewport.scale;
            } else {
              textDivProperties.canvasWidth = geom.width * task._viewport.scale;
            }
          }

          task._textDivProperties.set(textDiv, textDivProperties);

          if (task._textContentStream) {
            task._layoutText(textDiv);
          }

          if (task._enhanceTextSelection && textDivProperties.hasText) {
            var angleCos = 1,
                angleSin = 0;

            if (angle !== 0) {
              angleCos = Math.cos(angle);
              angleSin = Math.sin(angle);
            }

            var divWidth = (style.vertical ? geom.height : geom.width) * task._viewport.scale;
            var divHeight = fontHeight;
            var m, b;

            if (angle !== 0) {
              m = [angleCos, angleSin, -angleSin, angleCos, left, top];
              b = _util.Util.getAxialAlignedBoundingBox([0, 0, divWidth, divHeight], m);
            } else {
              b = [left, top, left + divWidth, top + divHeight];
            }

            task._bounds.push({
              left: b[0],
              top: b[1],
              right: b[2],
              bottom: b[3],
              div: textDiv,
              size: [divWidth, divHeight],
              m: m
            });
          }
        }

        function render(task) {
          if (task._canceled) {
            return;
          }

          var textDivs = task._textDivs;
          var capability = task._capability;
          var textDivsLength = textDivs.length;

          if (textDivsLength > MAX_TEXT_DIVS_TO_RENDER) {
            task._renderingDone = true;
            capability.resolve();
            return;
          }

          if (!task._textContentStream) {
            for (var i = 0; i < textDivsLength; i++) {
              task._layoutText(textDivs[i]);
            }
          }

          task._renderingDone = true;
          capability.resolve();
        }

        function findPositiveMin(ts, offset, count) {
          var result = 0;

          for (var i = 0; i < count; i++) {
            var t = ts[offset++];

            if (t > 0) {
              result = result ? Math.min(t, result) : t;
            }
          }

          return result;
        }

        function expand(task) {
          var bounds = task._bounds;
          var viewport = task._viewport;
          var expanded = expandBounds(viewport.width, viewport.height, bounds);

          for (var i = 0; i < expanded.length; i++) {
            var div = bounds[i].div;

            var divProperties = task._textDivProperties.get(div);

            if (divProperties.angle === 0) {
              divProperties.paddingLeft = bounds[i].left - expanded[i].left;
              divProperties.paddingTop = bounds[i].top - expanded[i].top;
              divProperties.paddingRight = expanded[i].right - bounds[i].right;
              divProperties.paddingBottom = expanded[i].bottom - bounds[i].bottom;

              task._textDivProperties.set(div, divProperties);

              continue;
            }

            var e = expanded[i],
                b = bounds[i];
            var m = b.m,
                c = m[0],
                s = m[1];
            var points = [[0, 0], [0, b.size[1]], [b.size[0], 0], b.size];
            var ts = new Float64Array(64);

            for (var j = 0, jj = points.length; j < jj; j++) {
              var t = _util.Util.applyTransform(points[j], m);

              ts[j + 0] = c && (e.left - t[0]) / c;
              ts[j + 4] = s && (e.top - t[1]) / s;
              ts[j + 8] = c && (e.right - t[0]) / c;
              ts[j + 12] = s && (e.bottom - t[1]) / s;
              ts[j + 16] = s && (e.left - t[0]) / -s;
              ts[j + 20] = c && (e.top - t[1]) / c;
              ts[j + 24] = s && (e.right - t[0]) / -s;
              ts[j + 28] = c && (e.bottom - t[1]) / c;
              ts[j + 32] = c && (e.left - t[0]) / -c;
              ts[j + 36] = s && (e.top - t[1]) / -s;
              ts[j + 40] = c && (e.right - t[0]) / -c;
              ts[j + 44] = s && (e.bottom - t[1]) / -s;
              ts[j + 48] = s && (e.left - t[0]) / s;
              ts[j + 52] = c && (e.top - t[1]) / -c;
              ts[j + 56] = s && (e.right - t[0]) / s;
              ts[j + 60] = c && (e.bottom - t[1]) / -c;
            }

            var boxScale = 1 + Math.min(Math.abs(c), Math.abs(s));
            divProperties.paddingLeft = findPositiveMin(ts, 32, 16) / boxScale;
            divProperties.paddingTop = findPositiveMin(ts, 48, 16) / boxScale;
            divProperties.paddingRight = findPositiveMin(ts, 0, 16) / boxScale;
            divProperties.paddingBottom = findPositiveMin(ts, 16, 16) / boxScale;

            task._textDivProperties.set(div, divProperties);
          }
        }

        function expandBounds(width, height, boxes) {
          var bounds = boxes.map(function (box, i) {
            return {
              x1: box.left,
              y1: box.top,
              x2: box.right,
              y2: box.bottom,
              index: i,
              x1New: undefined,
              x2New: undefined
            };
          });
          expandBoundsLTR(width, bounds);
          var expanded = new Array(boxes.length);

          var _iterator = _createForOfIteratorHelper(bounds),
              _step;

          try {
            for (_iterator.s(); !(_step = _iterator.n()).done;) {
              var b = _step.value;
              var i = b.index;
              expanded[i] = {
                left: b.x1New,
                top: 0,
                right: b.x2New,
                bottom: 0
              };
            }
          } catch (err) {
            _iterator.e(err);
          } finally {
            _iterator.f();
          }

          boxes.map(function (box, i) {
            var e = expanded[i],
                b = bounds[i];
            b.x1 = box.top;
            b.y1 = width - e.right;
            b.x2 = box.bottom;
            b.y2 = width - e.left;
            b.index = i;
            b.x1New = undefined;
            b.x2New = undefined;
          });
          expandBoundsLTR(height, bounds);

          var _iterator2 = _createForOfIteratorHelper(bounds),
              _step2;

          try {
            for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
              var _b = _step2.value;
              var _i2 = _b.index;
              expanded[_i2].top = _b.x1New;
              expanded[_i2].bottom = _b.x2New;
            }
          } catch (err) {
            _iterator2.e(err);
          } finally {
            _iterator2.f();
          }

          return expanded;
        }

        function expandBoundsLTR(width, bounds) {
          bounds.sort(function (a, b) {
            return a.x1 - b.x1 || a.index - b.index;
          });
          var fakeBoundary = {
            x1: -Infinity,
            y1: -Infinity,
            x2: 0,
            y2: Infinity,
            index: -1,
            x1New: 0,
            x2New: 0
          };
          var horizon = [{
            start: -Infinity,
            end: Infinity,
            boundary: fakeBoundary
          }];

          var _iterator3 = _createForOfIteratorHelper(bounds),
              _step3;

          try {
            for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
              var boundary = _step3.value;
              var i = 0;

              while (i < horizon.length && horizon[i].end <= boundary.y1) {
                i++;
              }

              var j = horizon.length - 1;

              while (j >= 0 && horizon[j].start >= boundary.y2) {
                j--;
              }

              var _horizonPart = void 0,
                  _affectedBoundary = void 0;

              var q = void 0,
                  k = void 0,
                  maxXNew = -Infinity;

              for (q = i; q <= j; q++) {
                _horizonPart = horizon[q];
                _affectedBoundary = _horizonPart.boundary;
                var xNew = void 0;

                if (_affectedBoundary.x2 > boundary.x1) {
                  xNew = _affectedBoundary.index > boundary.index ? _affectedBoundary.x1New : boundary.x1;
                } else if (_affectedBoundary.x2New === undefined) {
                  xNew = (_affectedBoundary.x2 + boundary.x1) / 2;
                } else {
                  xNew = _affectedBoundary.x2New;
                }

                if (xNew > maxXNew) {
                  maxXNew = xNew;
                }
              }

              boundary.x1New = maxXNew;

              for (q = i; q <= j; q++) {
                _horizonPart = horizon[q];
                _affectedBoundary = _horizonPart.boundary;

                if (_affectedBoundary.x2New === undefined) {
                  if (_affectedBoundary.x2 > boundary.x1) {
                    if (_affectedBoundary.index > boundary.index) {
                      _affectedBoundary.x2New = _affectedBoundary.x2;
                    }
                  } else {
                    _affectedBoundary.x2New = maxXNew;
                  }
                } else if (_affectedBoundary.x2New > maxXNew) {
                  _affectedBoundary.x2New = Math.max(maxXNew, _affectedBoundary.x2);
                }
              }

              var changedHorizon = [];
              var lastBoundary = null;

              for (q = i; q <= j; q++) {
                _horizonPart = horizon[q];
                _affectedBoundary = _horizonPart.boundary;
                var useBoundary = _affectedBoundary.x2 > boundary.x2 ? _affectedBoundary : boundary;

                if (lastBoundary === useBoundary) {
                  changedHorizon[changedHorizon.length - 1].end = _horizonPart.end;
                } else {
                  changedHorizon.push({
                    start: _horizonPart.start,
                    end: _horizonPart.end,
                    boundary: useBoundary
                  });
                  lastBoundary = useBoundary;
                }
              }

              if (horizon[i].start < boundary.y1) {
                changedHorizon[0].start = boundary.y1;
                changedHorizon.unshift({
                  start: horizon[i].start,
                  end: boundary.y1,
                  boundary: horizon[i].boundary
                });
              }

              if (boundary.y2 < horizon[j].end) {
                changedHorizon[changedHorizon.length - 1].end = boundary.y2;
                changedHorizon.push({
                  start: boundary.y2,
                  end: horizon[j].end,
                  boundary: horizon[j].boundary
                });
              }

              for (q = i; q <= j; q++) {
                _horizonPart = horizon[q];
                _affectedBoundary = _horizonPart.boundary;

                if (_affectedBoundary.x2New !== undefined) {
                  continue;
                }

                var used = false;

                for (k = i - 1; !used && k >= 0 && horizon[k].start >= _affectedBoundary.y1; k--) {
                  used = horizon[k].boundary === _affectedBoundary;
                }

                for (k = j + 1; !used && k < horizon.length && horizon[k].end <= _affectedBoundary.y2; k++) {
                  used = horizon[k].boundary === _affectedBoundary;
                }

                for (k = 0; !used && k < changedHorizon.length; k++) {
                  used = changedHorizon[k].boundary === _affectedBoundary;
                }

                if (!used) {
                  _affectedBoundary.x2New = maxXNew;
                }
              }

              Array.prototype.splice.apply(horizon, [i, j - i + 1].concat(changedHorizon));
            }
          } catch (err) {
            _iterator3.e(err);
          } finally {
            _iterator3.f();
          }

          for (var _i3 = 0, _horizon = horizon; _i3 < _horizon.length; _i3++) {
            var horizonPart = _horizon[_i3];
            var affectedBoundary = horizonPart.boundary;

            if (affectedBoundary.x2New === undefined) {
              affectedBoundary.x2New = Math.max(width, affectedBoundary.x2);
            }
          }
        }

        var TextLayerRenderTask = /*#__PURE__*/function () {
          function TextLayerRenderTask(_ref) {
            var _globalThis$FontInspe,
                _this = this;

            var textContent = _ref.textContent,
                textContentStream = _ref.textContentStream,
                container = _ref.container,
                viewport = _ref.viewport,
                textDivs = _ref.textDivs,
                textContentItemsStr = _ref.textContentItemsStr,
                enhanceTextSelection = _ref.enhanceTextSelection;

            _classCallCheck(this, TextLayerRenderTask);

            this._textContent = textContent;
            this._textContentStream = textContentStream;
            this._container = container;
            this._document = container.ownerDocument;
            this._viewport = viewport;
            this._textDivs = textDivs || [];
            this._textContentItemsStr = textContentItemsStr || [];
            this._enhanceTextSelection = !!enhanceTextSelection;
            this._fontInspectorEnabled = !!((_globalThis$FontInspe = globalThis.FontInspector) !== null && _globalThis$FontInspe !== void 0 && _globalThis$FontInspe.enabled);
            this._reader = null;
            this._layoutTextLastFontSize = null;
            this._layoutTextLastFontFamily = null;
            this._layoutTextCtx = null;
            this._textDivProperties = new WeakMap();
            this._renderingDone = false;
            this._canceled = false;
            this._capability = (0, _util.createPromiseCapability)();
            this._renderTimer = null;
            this._bounds = [];

            this._capability.promise["finally"](function () {
              if (!_this._enhanceTextSelection) {
                _this._textDivProperties = null;
              }

              if (_this._layoutTextCtx) {
                _this._layoutTextCtx.canvas.width = 0;
                _this._layoutTextCtx.canvas.height = 0;
                _this._layoutTextCtx = null;
              }
            })["catch"](function () {});
          }

          _createClass(TextLayerRenderTask, [{
            key: "promise",
            get: function get() {
              return this._capability.promise;
            }
          }, {
            key: "cancel",
            value: function cancel() {
              this._canceled = true;

              if (this._reader) {
                this._reader.cancel(new _util.AbortException("TextLayer task cancelled."))["catch"](function () {});

                this._reader = null;
              }

              if (this._renderTimer !== null) {
                clearTimeout(this._renderTimer);
                this._renderTimer = null;
              }

              this._capability.reject(new Error("TextLayer task cancelled."));
            }
          }, {
            key: "_processItems",
            value: function _processItems(items, styleCache) {
              for (var i = 0, len = items.length; i < len; i++) {
                if (items[i].str === undefined) {
                  if (items[i].type === "beginMarkedContentProps" || items[i].type === "beginMarkedContent") {
                    var parent = this._container;
                    this._container = document.createElement("span");

                    this._container.classList.add("markedContent");

                    if (items[i].id !== null) {
                      this._container.setAttribute("id", "".concat(items[i].id));
                    }

                    parent.appendChild(this._container);
                  } else if (items[i].type === "endMarkedContent") {
                    this._container = this._container.parentNode;
                  }

                  continue;
                }

                this._textContentItemsStr.push(items[i].str);

                appendText(this, items[i], styleCache, this._layoutTextCtx);
              }
            }
          }, {
            key: "_layoutText",
            value: function _layoutText(textDiv) {
              var textDivProperties = this._textDivProperties.get(textDiv);

              var transform = "";

              if (textDivProperties.canvasWidth !== 0 && textDivProperties.hasText) {
                var _textDiv$style = textDiv.style,
                    fontSize = _textDiv$style.fontSize,
                    fontFamily = _textDiv$style.fontFamily;

                if (fontSize !== this._layoutTextLastFontSize || fontFamily !== this._layoutTextLastFontFamily) {
                  this._layoutTextCtx.font = "".concat(fontSize, " ").concat(fontFamily);
                  this._layoutTextLastFontSize = fontSize;
                  this._layoutTextLastFontFamily = fontFamily;
                }

                var _this$_layoutTextCtx$ = this._layoutTextCtx.measureText(textDiv.textContent),
                    width = _this$_layoutTextCtx$.width;

                if (width > 0) {
                  var scale = textDivProperties.canvasWidth / width;

                  if (this._enhanceTextSelection) {
                    textDivProperties.scale = scale;
                  }

                  transform = "scaleX(".concat(scale, ")");
                }
              }

              if (textDivProperties.angle !== 0) {
                transform = "rotate(".concat(textDivProperties.angle, "deg) ").concat(transform);
              }

              if (transform.length > 0) {
                if (this._enhanceTextSelection) {
                  textDivProperties.originalTransform = transform;
                }

                textDiv.style.transform = transform;
              }

              if (textDivProperties.hasText) {
                this._container.appendChild(textDiv);
              }

              if (textDivProperties.hasEOL) {
                var br = document.createElement("br");
                br.setAttribute("role", "presentation");

                this._container.appendChild(br);
              }
            }
          }, {
            key: "_render",
            value: function _render() {
              var _this2 = this;

              var timeout = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
              var capability = (0, _util.createPromiseCapability)();
              var styleCache = Object.create(null);

              var canvas = this._document.createElement("canvas");

              canvas.height = canvas.width = DEFAULT_FONT_SIZE;
              canvas.mozOpaque = true;
              this._layoutTextCtx = canvas.getContext("2d", {
                alpha: false
              });

              if (this._textContent) {
                var textItems = this._textContent.items;
                var textStyles = this._textContent.styles;

                this._processItems(textItems, textStyles);

                capability.resolve();
              } else if (this._textContentStream) {
                var pump = function pump() {
                  _this2._reader.read().then(function (_ref2) {
                    var value = _ref2.value,
                        done = _ref2.done;

                    if (done) {
                      capability.resolve();
                      return;
                    }

                    Object.assign(styleCache, value.styles);

                    _this2._processItems(value.items, styleCache);

                    pump();
                  }, capability.reject);
                };

                this._reader = this._textContentStream.getReader();
                pump();
              } else {
                throw new Error('Neither "textContent" nor "textContentStream" parameters specified.');
              }

              capability.promise.then(function () {
                styleCache = null;

                if (!timeout) {
                  render(_this2);
                } else {
                  _this2._renderTimer = setTimeout(function () {
                    render(_this2);
                    _this2._renderTimer = null;
                  }, timeout);
                }
              }, this._capability.reject);
            }
          }, {
            key: "expandTextDivs",
            value: function expandTextDivs() {
              var expandDivs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;

              if (!this._enhanceTextSelection || !this._renderingDone) {
                return;
              }

              if (this._bounds !== null) {
                expand(this);
                this._bounds = null;
              }

              var transformBuf = [],
                  paddingBuf = [];

              for (var i = 0, ii = this._textDivs.length; i < ii; i++) {
                var div = this._textDivs[i];

                var divProps = this._textDivProperties.get(div);

                if (!divProps.hasText) {
                  continue;
                }

                if (expandDivs) {
                  transformBuf.length = 0;
                  paddingBuf.length = 0;

                  if (divProps.originalTransform) {
                    transformBuf.push(divProps.originalTransform);
                  }

                  if (divProps.paddingTop > 0) {
                    paddingBuf.push("".concat(divProps.paddingTop, "px"));
                    transformBuf.push("translateY(".concat(-divProps.paddingTop, "px)"));
                  } else {
                    paddingBuf.push(0);
                  }

                  if (divProps.paddingRight > 0) {
                    paddingBuf.push("".concat(divProps.paddingRight / divProps.scale, "px"));
                  } else {
                    paddingBuf.push(0);
                  }

                  if (divProps.paddingBottom > 0) {
                    paddingBuf.push("".concat(divProps.paddingBottom, "px"));
                  } else {
                    paddingBuf.push(0);
                  }

                  if (divProps.paddingLeft > 0) {
                    paddingBuf.push("".concat(divProps.paddingLeft / divProps.scale, "px"));
                    transformBuf.push("translateX(".concat(-divProps.paddingLeft / divProps.scale, "px)"));
                  } else {
                    paddingBuf.push(0);
                  }

                  div.style.padding = paddingBuf.join(" ");

                  if (transformBuf.length) {
                    div.style.transform = transformBuf.join(" ");
                  }
                } else {
                  div.style.padding = null;
                  div.style.transform = divProps.originalTransform;
                }
              }
            }
          }]);

          return TextLayerRenderTask;
        }();

        function renderTextLayer(renderParameters) {
          var task = new TextLayerRenderTask({
            textContent: renderParameters.textContent,
            textContentStream: renderParameters.textContentStream,
            container: renderParameters.container,
            viewport: renderParameters.viewport,
            textDivs: renderParameters.textDivs,
            textContentItemsStr: renderParameters.textContentItemsStr,
            enhanceTextSelection: renderParameters.enhanceTextSelection
          });

          task._render(renderParameters.timeout);

          return task;
        }
        /***/

      },
      /* 134 */

      /***/
      function (__unused_webpack_module, exports, __w_pdfjs_require__) {
        "use strict";

        Object.defineProperty(exports, "__esModule", {
          value: true
        });
        exports.SVGGraphics = void 0;

        var _util = __w_pdfjs_require__(4);

        var _display_utils = __w_pdfjs_require__(1);

        var _is_node = __w_pdfjs_require__(6);

        function _toConsumableArray(arr) {
          return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
        }

        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.");
        }

        function _iterableToArray(iter) {
          if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
        }

        function _arrayWithoutHoles(arr) {
          if (Array.isArray(arr)) return _arrayLikeToArray(arr);
        }

        function _slicedToArray(arr, i) {
          return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
        }

        function _nonIterableRest() {
          throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
        }

        function _iterableToArrayLimit(arr, i) {
          var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];

          if (_i == null) return;
          var _arr = [];
          var _n = true;
          var _d = false;

          var _s, _e;

          try {
            for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
              _arr.push(_s.value);

              if (i && _arr.length === i) break;
            }
          } catch (err) {
            _d = true;
            _e = err;
          } finally {
            try {
              if (!_n && _i["return"] != null) _i["return"]();
            } finally {
              if (_d) throw _e;
            }
          }

          return _arr;
        }

        function _arrayWithHoles(arr) {
          if (Array.isArray(arr)) return arr;
        }

        function _createForOfIteratorHelper(o, allowArrayLike) {
          var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];

          if (!it) {
            if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
              if (it) o = it;
              var i = 0;

              var F = function F() {};

              return {
                s: F,
                n: function n() {
                  if (i >= o.length) return {
                    done: true
                  };
                  return {
                    done: false,
                    value: o[i++]
                  };
                },
                e: function e(_e2) {
                  throw _e2;
                },
                f: F
              };
            }

            throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
          }

          var normalCompletion = true,
              didErr = false,
              err;
          return {
            s: function s() {
              it = it.call(o);
            },
            n: function n() {
              var step = it.next();
              normalCompletion = step.done;
              return step;
            },
            e: function e(_e3) {
              didErr = true;
              err = _e3;
            },
            f: function f() {
              try {
                if (!normalCompletion && it["return"] != null) it["return"]();
              } finally {
                if (didErr) throw err;
              }
            }
          };
        }

        function _unsupportedIterableToArray(o, minLen) {
          if (!o) return;
          if (typeof o === "string") return _arrayLikeToArray(o, minLen);
          var n = Object.prototype.toString.call(o).slice(8, -1);
          if (n === "Object" && o.constructor) n = o.constructor.name;
          if (n === "Map" || n === "Set") return Array.from(o);
          if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
        }

        function _arrayLikeToArray(arr, len) {
          if (len == null || len > arr.length) len = arr.length;

          for (var i = 0, arr2 = new Array(len); i < len; i++) {
            arr2[i] = arr[i];
          }

          return arr2;
        }

        function _defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];
            descriptor.enumerable = descriptor.enumerable || false;
            descriptor.configurable = true;
            if ("value" in descriptor) descriptor.writable = true;
            Object.defineProperty(target, descriptor.key, descriptor);
          }
        }

        function _createClass(Constructor, protoProps, staticProps) {
          if (protoProps) _defineProperties(Constructor.prototype, protoProps);
          if (staticProps) _defineProperties(Constructor, staticProps);
          return Constructor;
        }

        function _classCallCheck(instance, Constructor) {
          if (!(instance instanceof Constructor)) {
            throw new TypeError("Cannot call a class as a function");
          }
        }

        var SVGGraphics = function SVGGraphics() {
          _classCallCheck(this, SVGGraphics);

          (0, _util.unreachable)("Not implemented: SVGGraphics");
        };

        exports.SVGGraphics = SVGGraphics;
        {
          var opListToTree = function opListToTree(opList) {
            var opTree = [];
            var tmp = [];

            var _iterator = _createForOfIteratorHelper(opList),
                _step;

            try {
              for (_iterator.s(); !(_step = _iterator.n()).done;) {
                var opListElement = _step.value;

                if (opListElement.fn === "save") {
                  opTree.push({
                    fnId: 92,
                    fn: "group",
                    items: []
                  });
                  tmp.push(opTree);
                  opTree = opTree[opTree.length - 1].items;
                  continue;
                }

                if (opListElement.fn === "restore") {
                  opTree = tmp.pop();
                } else {
                  opTree.push(opListElement);
                }
              }
            } catch (err) {
              _iterator.e(err);
            } finally {
              _iterator.f();
            }

            return opTree;
          };

          var pf = function pf(value) {
            if (Number.isInteger(value)) {
              return value.toString();
            }

            var s = value.toFixed(10);
            var i = s.length - 1;

            if (s[i] !== "0") {
              return s;
            }

            do {
              i--;
            } while (s[i] === "0");

            return s.substring(0, s[i] === "." ? i : i + 1);
          };

          var pm = function pm(m) {
            if (m[4] === 0 && m[5] === 0) {
              if (m[1] === 0 && m[2] === 0) {
                if (m[0] === 1 && m[3] === 1) {
                  return "";
                }

                return "scale(".concat(pf(m[0]), " ").concat(pf(m[3]), ")");
              }

              if (m[0] === m[3] && m[1] === -m[2]) {
                var a = Math.acos(m[0]) * 180 / Math.PI;
                return "rotate(".concat(pf(a), ")");
              }
            } else {
              if (m[0] === 1 && m[1] === 0 && m[2] === 0 && m[3] === 1) {
                return "translate(".concat(pf(m[4]), " ").concat(pf(m[5]), ")");
              }
            }

            return "matrix(".concat(pf(m[0]), " ").concat(pf(m[1]), " ").concat(pf(m[2]), " ").concat(pf(m[3]), " ").concat(pf(m[4]), " ") + "".concat(pf(m[5]), ")");
          };

          var SVG_DEFAULTS = {
            fontStyle: "normal",
            fontWeight: "normal",
            fillColor: "#000000"
          };
          var XML_NS = "http://www.w3.org/XML/1998/namespace";
          var XLINK_NS = "http://www.w3.org/1999/xlink";
          var LINE_CAP_STYLES = ["butt", "round", "square"];
          var LINE_JOIN_STYLES = ["miter", "round", "bevel"];

          var convertImgDataToPng = function () {
            var PNG_HEADER = new Uint8Array([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]);
            var CHUNK_WRAPPER_SIZE = 12;
            var crcTable = new Int32Array(256);

            for (var i = 0; i < 256; i++) {
              var c = i;

              for (var h = 0; h < 8; h++) {
                if (c & 1) {
                  c = 0xedb88320 ^ c >> 1 & 0x7fffffff;
                } else {
                  c = c >> 1 & 0x7fffffff;
                }
              }

              crcTable[i] = c;
            }

            function crc32(data, start, end) {
              var crc = -1;

              for (var _i = start; _i < end; _i++) {
                var a = (crc ^ data[_i]) & 0xff;
                var b = crcTable[a];
                crc = crc >>> 8 ^ b;
              }

              return crc ^ -1;
            }

            function writePngChunk(type, body, data, offset) {
              var p = offset;
              var len = body.length;
              data[p] = len >> 24 & 0xff;
              data[p + 1] = len >> 16 & 0xff;
              data[p + 2] = len >> 8 & 0xff;
              data[p + 3] = len & 0xff;
              p += 4;
              data[p] = type.charCodeAt(0) & 0xff;
              data[p + 1] = type.charCodeAt(1) & 0xff;
              data[p + 2] = type.charCodeAt(2) & 0xff;
              data[p + 3] = type.charCodeAt(3) & 0xff;
              p += 4;
              data.set(body, p);
              p += body.length;
              var crc = crc32(data, offset + 4, p);
              data[p] = crc >> 24 & 0xff;
              data[p + 1] = crc >> 16 & 0xff;
              data[p + 2] = crc >> 8 & 0xff;
              data[p + 3] = crc & 0xff;
            }

            function adler32(data, start, end) {
              var a = 1;
              var b = 0;

              for (var _i2 = start; _i2 < end; ++_i2) {
                a = (a + (data[_i2] & 0xff)) % 65521;
                b = (b + a) % 65521;
              }

              return b << 16 | a;
            }

            function deflateSync(literals) {
              if (!_is_node.isNodeJS) {
                return deflateSyncUncompressed(literals);
              }

              try {
                var input;

                if (parseInt(process.versions.node) >= 8) {
                  input = literals;
                } else {
                  input = Buffer.from(literals);
                }

                var output = (__webpack_require__(324).deflateSync)(input, {
                  level: 9
                });

                return output instanceof Uint8Array ? output : new Uint8Array(output);
              } catch (e) {
                (0, _util.warn)("Not compressing PNG because zlib.deflateSync is unavailable: " + e);
              }

              return deflateSyncUncompressed(literals);
            }

            function deflateSyncUncompressed(literals) {
              var len = literals.length;
              var maxBlockLength = 0xffff;
              var deflateBlocks = Math.ceil(len / maxBlockLength);
              var idat = new Uint8Array(2 + len + deflateBlocks * 5 + 4);
              var pi = 0;
              idat[pi++] = 0x78;
              idat[pi++] = 0x9c;
              var pos = 0;

              while (len > maxBlockLength) {
                idat[pi++] = 0x00;
                idat[pi++] = 0xff;
                idat[pi++] = 0xff;
                idat[pi++] = 0x00;
                idat[pi++] = 0x00;
                idat.set(literals.subarray(pos, pos + maxBlockLength), pi);
                pi += maxBlockLength;
                pos += maxBlockLength;
                len -= maxBlockLength;
              }

              idat[pi++] = 0x01;
              idat[pi++] = len & 0xff;
              idat[pi++] = len >> 8 & 0xff;
              idat[pi++] = ~len & 0xffff & 0xff;
              idat[pi++] = (~len & 0xffff) >> 8 & 0xff;
              idat.set(literals.subarray(pos), pi);
              pi += literals.length - pos;
              var adler = adler32(literals, 0, literals.length);
              idat[pi++] = adler >> 24 & 0xff;
              idat[pi++] = adler >> 16 & 0xff;
              idat[pi++] = adler >> 8 & 0xff;
              idat[pi++] = adler & 0xff;
              return idat;
            }

            function encode(imgData, kind, forceDataSchema, isMask) {
              var width = imgData.width;
              var height = imgData.height;
              var bitDepth, colorType, lineSize;
              var bytes = imgData.data;

              switch (kind) {
                case _util.ImageKind.GRAYSCALE_1BPP:
                  colorType = 0;
                  bitDepth = 1;
                  lineSize = width + 7 >> 3;
                  break;

                case _util.ImageKind.RGB_24BPP:
                  colorType = 2;
                  bitDepth = 8;
                  lineSize = width * 3;
                  break;

                case _util.ImageKind.RGBA_32BPP:
                  colorType = 6;
                  bitDepth = 8;
                  lineSize = width * 4;
                  break;

                default:
                  throw new Error("invalid format");
              }

              var literals = new Uint8Array((1 + lineSize) * height);
              var offsetLiterals = 0,
                  offsetBytes = 0;

              for (var y = 0; y < height; ++y) {
                literals[offsetLiterals++] = 0;
                literals.set(bytes.subarray(offsetBytes, offsetBytes + lineSize), offsetLiterals);
                offsetBytes += lineSize;
                offsetLiterals += lineSize;
              }

              if (kind === _util.ImageKind.GRAYSCALE_1BPP && isMask) {
                offsetLiterals = 0;

                for (var _y = 0; _y < height; _y++) {
                  offsetLiterals++;

                  for (var _i3 = 0; _i3 < lineSize; _i3++) {
                    literals[offsetLiterals++] ^= 0xff;
                  }
                }
              }

              var ihdr = new Uint8Array([width >> 24 & 0xff, width >> 16 & 0xff, width >> 8 & 0xff, width & 0xff, height >> 24 & 0xff, height >> 16 & 0xff, height >> 8 & 0xff, height & 0xff, bitDepth, colorType, 0x00, 0x00, 0x00]);
              var idat = deflateSync(literals);
              var pngLength = PNG_HEADER.length + CHUNK_WRAPPER_SIZE * 3 + ihdr.length + idat.length;
              var data = new Uint8Array(pngLength);
              var offset = 0;
              data.set(PNG_HEADER, offset);
              offset += PNG_HEADER.length;
              writePngChunk("IHDR", ihdr, data, offset);
              offset += CHUNK_WRAPPER_SIZE + ihdr.length;
              writePngChunk("IDATA", idat, data, offset);
              offset += CHUNK_WRAPPER_SIZE + idat.length;
              writePngChunk("IEND", new Uint8Array(0), data, offset);
              return (0, _util.createObjectURL)(data, "image/png", forceDataSchema);
            }

            return function convertImgDataToPng(imgData, forceDataSchema, isMask) {
              var kind = imgData.kind === undefined ? _util.ImageKind.GRAYSCALE_1BPP : imgData.kind;
              return encode(imgData, kind, forceDataSchema, isMask);
            };
          }();

          var SVGExtraState = /*#__PURE__*/function () {
            function SVGExtraState() {
              _classCallCheck(this, SVGExtraState);

              this.fontSizeScale = 1;
              this.fontWeight = SVG_DEFAULTS.fontWeight;
              this.fontSize = 0;
              this.textMatrix = _util.IDENTITY_MATRIX;
              this.fontMatrix = _util.FONT_IDENTITY_MATRIX;
              this.leading = 0;
              this.textRenderingMode = _util.TextRenderingMode.FILL;
              this.textMatrixScale = 1;
              this.x = 0;
              this.y = 0;
              this.lineX = 0;
              this.lineY = 0;
              this.charSpacing = 0;
              this.wordSpacing = 0;
              this.textHScale = 1;
              this.textRise = 0;
              this.fillColor = SVG_DEFAULTS.fillColor;
              this.strokeColor = "#000000";
              this.fillAlpha = 1;
              this.strokeAlpha = 1;
              this.lineWidth = 1;
              this.lineJoin = "";
              this.lineCap = "";
              this.miterLimit = 0;
              this.dashArray = [];
              this.dashPhase = 0;
              this.dependencies = [];
              this.activeClipUrl = null;
              this.clipGroup = null;
              this.maskId = "";
            }

            _createClass(SVGExtraState, [{
              key: "clone",
              value: function clone() {
                return Object.create(this);
              }
            }, {
              key: "setCurrentPoint",
              value: function setCurrentPoint(x, y) {
                this.x = x;
                this.y = y;
              }
            }]);

            return SVGExtraState;
          }();

          var clipCount = 0;
          var maskCount = 0;
          var shadingCount = 0;

          exports.SVGGraphics = SVGGraphics = /*#__PURE__*/function () {
            function SVGGraphics(commonObjs, objs) {
              var forceDataSchema = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;

              _classCallCheck(this, SVGGraphics);

              this.svgFactory = new _display_utils.DOMSVGFactory();
              this.current = new SVGExtraState();
              this.transformMatrix = _util.IDENTITY_MATRIX;
              this.transformStack = [];
              this.extraStack = [];
              this.commonObjs = commonObjs;
              this.objs = objs;
              this.pendingClip = null;
              this.pendingEOFill = false;
              this.embedFonts = false;
              this.embeddedFonts = Object.create(null);
              this.cssStyle = null;
              this.forceDataSchema = !!forceDataSchema;
              this._operatorIdMapping = [];

              for (var op in _util.OPS) {
                this._operatorIdMapping[_util.OPS[op]] = op;
              }
            }

            _createClass(SVGGraphics, [{
              key: "save",
              value: function save() {
                this.transformStack.push(this.transformMatrix);
                var old = this.current;
                this.extraStack.push(old);
                this.current = old.clone();
              }
            }, {
              key: "restore",
              value: function restore() {
                this.transformMatrix = this.transformStack.pop();
                this.current = this.extraStack.pop();
                this.pendingClip = null;
                this.tgrp = null;
              }
            }, {
              key: "group",
              value: function group(items) {
                this.save();
                this.executeOpTree(items);
                this.restore();
              }
            }, {
              key: "loadDependencies",
              value: function loadDependencies(operatorList) {
                var _this = this;

                var fnArray = operatorList.fnArray;
                var argsArray = operatorList.argsArray;

                for (var i = 0, ii = fnArray.length; i < ii; i++) {
                  if (fnArray[i] !== _util.OPS.dependency) {
                    continue;
                  }

                  var _iterator2 = _createForOfIteratorHelper(argsArray[i]),
                      _step2;

                  try {
                    var _loop = function _loop() {
                      var obj = _step2.value;
                      var objsPool = obj.startsWith("g_") ? _this.commonObjs : _this.objs;
                      var promise = new Promise(function (resolve) {
                        objsPool.get(obj, resolve);
                      });

                      _this.current.dependencies.push(promise);
                    };

                    for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
                      _loop();
                    }
                  } catch (err) {
                    _iterator2.e(err);
                  } finally {
                    _iterator2.f();
                  }
                }

                return Promise.all(this.current.dependencies);
              }
            }, {
              key: "transform",
              value: function transform(a, b, c, d, e, f) {
                var transformMatrix = [a, b, c, d, e, f];
                this.transformMatrix = _util.Util.transform(this.transformMatrix, transformMatrix);
                this.tgrp = null;
              }
            }, {
              key: "getSVG",
              value: function getSVG(operatorList, viewport) {
                var _this2 = this;

                this.viewport = viewport;

                var svgElement = this._initialize(viewport);

                return this.loadDependencies(operatorList).then(function () {
                  _this2.transformMatrix = _util.IDENTITY_MATRIX;

                  _this2.executeOpTree(_this2.convertOpList(operatorList));

                  return svgElement;
                });
              }
            }, {
              key: "convertOpList",
              value: function convertOpList(operatorList) {
                var operatorIdMapping = this._operatorIdMapping;
                var argsArray = operatorList.argsArray;
                var fnArray = operatorList.fnArray;
                var opList = [];

                for (var i = 0, ii = fnArray.length; i < ii; i++) {
                  var fnId = fnArray[i];
                  opList.push({
                    fnId: fnId,
                    fn: operatorIdMapping[fnId],
                    args: argsArray[i]
                  });
                }

                return opListToTree(opList);
              }
            }, {
              key: "executeOpTree",
              value: function executeOpTree(opTree) {
                var _iterator3 = _createForOfIteratorHelper(opTree),
                    _step3;

                try {
                  for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
                    var opTreeElement = _step3.value;
                    var fn = opTreeElement.fn;
                    var fnId = opTreeElement.fnId;
                    var args = opTreeElement.args;

                    switch (fnId | 0) {
                      case _util.OPS.beginText:
                        this.beginText();
                        break;

                      case _util.OPS.dependency:
                        break;

                      case _util.OPS.setLeading:
                        this.setLeading(args);
                        break;

                      case _util.OPS.setLeadingMoveText:
                        this.setLeadingMoveText(args[0], args[1]);
                        break;

                      case _util.OPS.setFont:
                        this.setFont(args);
                        break;

                      case _util.OPS.showText:
                        this.showText(args[0]);
                        break;

                      case _util.OPS.showSpacedText:
                        this.showText(args[0]);
                        break;

                      case _util.OPS.endText:
                        this.endText();
                        break;

                      case _util.OPS.moveText:
                        this.moveText(args[0], args[1]);
                        break;

                      case _util.OPS.setCharSpacing:
                        this.setCharSpacing(args[0]);
                        break;

                      case _util.OPS.setWordSpacing:
                        this.setWordSpacing(args[0]);
                        break;

                      case _util.OPS.setHScale:
                        this.setHScale(args[0]);
                        break;

                      case _util.OPS.setTextMatrix:
                        this.setTextMatrix(args[0], args[1], args[2], args[3], args[4], args[5]);
                        break;

                      case _util.OPS.setTextRise:
                        this.setTextRise(args[0]);
                        break;

                      case _util.OPS.setTextRenderingMode:
                        this.setTextRenderingMode(args[0]);
                        break;

                      case _util.OPS.setLineWidth:
                        this.setLineWidth(args[0]);
                        break;

                      case _util.OPS.setLineJoin:
                        this.setLineJoin(args[0]);
                        break;

                      case _util.OPS.setLineCap:
                        this.setLineCap(args[0]);
                        break;

                      case _util.OPS.setMiterLimit:
                        this.setMiterLimit(args[0]);
                        break;

                      case _util.OPS.setFillRGBColor:
                        this.setFillRGBColor(args[0], args[1], args[2]);
                        break;

                      case _util.OPS.setStrokeRGBColor:
                        this.setStrokeRGBColor(args[0], args[1], args[2]);
                        break;

                      case _util.OPS.setStrokeColorN:
                        this.setStrokeColorN(args);
                        break;

                      case _util.OPS.setFillColorN:
                        this.setFillColorN(args);
                        break;

                      case _util.OPS.shadingFill:
                        this.shadingFill(args[0]);
                        break;

                      case _util.OPS.setDash:
                        this.setDash(args[0], args[1]);
                        break;

                      case _util.OPS.setRenderingIntent:
                        this.setRenderingIntent(args[0]);
                        break;

                      case _util.OPS.setFlatness:
                        this.setFlatness(args[0]);
                        break;

                      case _util.OPS.setGState:
                        this.setGState(args[0]);
                        break;

                      case _util.OPS.fill:
                        this.fill();
                        break;

                      case _util.OPS.eoFill:
                        this.eoFill();
                        break;

                      case _util.OPS.stroke:
                        this.stroke();
                        break;

                      case _util.OPS.fillStroke:
                        this.fillStroke();
                        break;

                      case _util.OPS.eoFillStroke:
                        this.eoFillStroke();
                        break;

                      case _util.OPS.clip:
                        this.clip("nonzero");
                        break;

                      case _util.OPS.eoClip:
                        this.clip("evenodd");
                        break;

                      case _util.OPS.paintSolidColorImageMask:
                        this.paintSolidColorImageMask();
                        break;

                      case _util.OPS.paintImageXObject:
                        this.paintImageXObject(args[0]);
                        break;

                      case _util.OPS.paintInlineImageXObject:
                        this.paintInlineImageXObject(args[0]);
                        break;

                      case _util.OPS.paintImageMaskXObject:
                        this.paintImageMaskXObject(args[0]);
                        break;

                      case _util.OPS.paintFormXObjectBegin:
                        this.paintFormXObjectBegin(args[0], args[1]);
                        break;

                      case _util.OPS.paintFormXObjectEnd:
                        this.paintFormXObjectEnd();
                        break;

                      case _util.OPS.closePath:
                        this.closePath();
                        break;

                      case _util.OPS.closeStroke:
                        this.closeStroke();
                        break;

                      case _util.OPS.closeFillStroke:
                        this.closeFillStroke();
                        break;

                      case _util.OPS.closeEOFillStroke:
                        this.closeEOFillStroke();
                        break;

                      case _util.OPS.nextLine:
                        this.nextLine();
                        break;

                      case _util.OPS.transform:
                        this.transform(args[0], args[1], args[2], args[3], args[4], args[5]);
                        break;

                      case _util.OPS.constructPath:
                        this.constructPath(args[0], args[1]);
                        break;

                      case _util.OPS.endPath:
                        this.endPath();
                        break;

                      case 92:
                        this.group(opTreeElement.items);
                        break;

                      default:
                        (0, _util.warn)("Unimplemented operator ".concat(fn));
                        break;
                    }
                  }
                } catch (err) {
                  _iterator3.e(err);
                } finally {
                  _iterator3.f();
                }
              }
            }, {
              key: "setWordSpacing",
              value: function setWordSpacing(wordSpacing) {
                this.current.wordSpacing = wordSpacing;
              }
            }, {
              key: "setCharSpacing",
              value: function setCharSpacing(charSpacing) {
                this.current.charSpacing = charSpacing;
              }
            }, {
              key: "nextLine",
              value: function nextLine() {
                this.moveText(0, this.current.leading);
              }
            }, {
              key: "setTextMatrix",
              value: function setTextMatrix(a, b, c, d, e, f) {
                var current = this.current;
                current.textMatrix = current.lineMatrix = [a, b, c, d, e, f];
                current.textMatrixScale = Math.hypot(a, b);
                current.x = current.lineX = 0;
                current.y = current.lineY = 0;
                current.xcoords = [];
                current.ycoords = [];
                current.tspan = this.svgFactory.createElement("svg:tspan");
                current.tspan.setAttributeNS(null, "font-family", current.fontFamily);
                current.tspan.setAttributeNS(null, "font-size", "".concat(pf(current.fontSize), "px"));
                current.tspan.setAttributeNS(null, "y", pf(-current.y));
                current.txtElement = this.svgFactory.createElement("svg:text");
                current.txtElement.appendChild(current.tspan);
              }
            }, {
              key: "beginText",
              value: function beginText() {
                var current = this.current;
                current.x = current.lineX = 0;
                current.y = current.lineY = 0;
                current.textMatrix = _util.IDENTITY_MATRIX;
                current.lineMatrix = _util.IDENTITY_MATRIX;
                current.textMatrixScale = 1;
                current.tspan = this.svgFactory.createElement("svg:tspan");
                current.txtElement = this.svgFactory.createElement("svg:text");
                current.txtgrp = this.svgFactory.createElement("svg:g");
                current.xcoords = [];
                current.ycoords = [];
              }
            }, {
              key: "moveText",
              value: function moveText(x, y) {
                var current = this.current;
                current.x = current.lineX += x;
                current.y = current.lineY += y;
                current.xcoords = [];
                current.ycoords = [];
                current.tspan = this.svgFactory.createElement("svg:tspan");
                current.tspan.setAttributeNS(null, "font-family", current.fontFamily);
                current.tspan.setAttributeNS(null, "font-size", "".concat(pf(current.fontSize), "px"));
                current.tspan.setAttributeNS(null, "y", pf(-current.y));
              }
            }, {
              key: "showText",
              value: function showText(glyphs) {
                var current = this.current;
                var font = current.font;
                var fontSize = current.fontSize;

                if (fontSize === 0) {
                  return;
                }

                var fontSizeScale = current.fontSizeScale;
                var charSpacing = current.charSpacing;
                var wordSpacing = current.wordSpacing;
                var fontDirection = current.fontDirection;
                var textHScale = current.textHScale * fontDirection;
                var vertical = font.vertical;
                var spacingDir = vertical ? 1 : -1;
                var defaultVMetrics = font.defaultVMetrics;
                var widthAdvanceScale = fontSize * current.fontMatrix[0];
                var x = 0;

                var _iterator4 = _createForOfIteratorHelper(glyphs),
                    _step4;

                try {
                  for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
                    var glyph = _step4.value;

                    if (glyph === null) {
                      x += fontDirection * wordSpacing;
                      continue;
                    } else if ((0, _util.isNum)(glyph)) {
                      x += spacingDir * glyph * fontSize / 1000;
                      continue;
                    }

                    var spacing = (glyph.isSpace ? wordSpacing : 0) + charSpacing;
                    var character = glyph.fontChar;
                    var scaledX = void 0,
                        scaledY = void 0;
                    var width = glyph.width;

                    if (vertical) {
                      var vx = void 0;
                      var vmetric = glyph.vmetric || defaultVMetrics;
                      vx = glyph.vmetric ? vmetric[1] : width * 0.5;
                      vx = -vx * widthAdvanceScale;
                      var vy = vmetric[2] * widthAdvanceScale;
                      width = vmetric ? -vmetric[0] : width;
                      scaledX = vx / fontSizeScale;
                      scaledY = (x + vy) / fontSizeScale;
                    } else {
                      scaledX = x / fontSizeScale;
                      scaledY = 0;
                    }

                    if (glyph.isInFont || font.missingFile) {
                      current.xcoords.push(current.x + scaledX);

                      if (vertical) {
                        current.ycoords.push(-current.y + scaledY);
                      }

                      current.tspan.textContent += character;
                    } else {}

                    var charWidth = void 0;

                    if (vertical) {
                      charWidth = width * widthAdvanceScale - spacing * fontDirection;
                    } else {
                      charWidth = width * widthAdvanceScale + spacing * fontDirection;
                    }

                    x += charWidth;
                  }
                } catch (err) {
                  _iterator4.e(err);
                } finally {
                  _iterator4.f();
                }

                current.tspan.setAttributeNS(null, "x", current.xcoords.map(pf).join(" "));

                if (vertical) {
                  current.tspan.setAttributeNS(null, "y", current.ycoords.map(pf).join(" "));
                } else {
                  current.tspan.setAttributeNS(null, "y", pf(-current.y));
                }

                if (vertical) {
                  current.y -= x;
                } else {
                  current.x += x * textHScale;
                }

                current.tspan.setAttributeNS(null, "font-family", current.fontFamily);
                current.tspan.setAttributeNS(null, "font-size", "".concat(pf(current.fontSize), "px"));

                if (current.fontStyle !== SVG_DEFAULTS.fontStyle) {
                  current.tspan.setAttributeNS(null, "font-style", current.fontStyle);
                }

                if (current.fontWeight !== SVG_DEFAULTS.fontWeight) {
                  current.tspan.setAttributeNS(null, "font-weight", current.fontWeight);
                }

                var fillStrokeMode = current.textRenderingMode & _util.TextRenderingMode.FILL_STROKE_MASK;

                if (fillStrokeMode === _util.TextRenderingMode.FILL || fillStrokeMode === _util.TextRenderingMode.FILL_STROKE) {
                  if (current.fillColor !== SVG_DEFAULTS.fillColor) {
                    current.tspan.setAttributeNS(null, "fill", current.fillColor);
                  }

                  if (current.fillAlpha < 1) {
                    current.tspan.setAttributeNS(null, "fill-opacity", current.fillAlpha);
                  }
                } else if (current.textRenderingMode === _util.TextRenderingMode.ADD_TO_PATH) {
                  current.tspan.setAttributeNS(null, "fill", "transparent");
                } else {
                  current.tspan.setAttributeNS(null, "fill", "none");
                }

                if (fillStrokeMode === _util.TextRenderingMode.STROKE || fillStrokeMode === _util.TextRenderingMode.FILL_STROKE) {
                  var lineWidthScale = 1 / (current.textMatrixScale || 1);

                  this._setStrokeAttributes(current.tspan, lineWidthScale);
                }

                var textMatrix = current.textMatrix;

                if (current.textRise !== 0) {
                  textMatrix = textMatrix.slice();
                  textMatrix[5] += current.textRise;
                }

                current.txtElement.setAttributeNS(null, "transform", "".concat(pm(textMatrix), " scale(").concat(pf(textHScale), ", -1)"));
                current.txtElement.setAttributeNS(XML_NS, "xml:space", "preserve");
                current.txtElement.appendChild(current.tspan);
                current.txtgrp.appendChild(current.txtElement);

                this._ensureTransformGroup().appendChild(current.txtElement);
              }
            }, {
              key: "setLeadingMoveText",
              value: function setLeadingMoveText(x, y) {
                this.setLeading(-y);
                this.moveText(x, y);
              }
            }, {
              key: "addFontStyle",
              value: function addFontStyle(fontObj) {
                if (!fontObj.data) {
                  throw new Error("addFontStyle: No font data available, " + 'ensure that the "fontExtraProperties" API parameter is set.');
                }

                if (!this.cssStyle) {
                  this.cssStyle = this.svgFactory.createElement("svg:style");
                  this.cssStyle.setAttributeNS(null, "type", "text/css");
                  this.defs.appendChild(this.cssStyle);
                }

                var url = (0, _util.createObjectURL)(fontObj.data, fontObj.mimetype, this.forceDataSchema);
                this.cssStyle.textContent += "@font-face { font-family: \"".concat(fontObj.loadedName, "\";") + " src: url(".concat(url, "); }\n");
              }
            }, {
              key: "setFont",
              value: function setFont(details) {
                var current = this.current;
                var fontObj = this.commonObjs.get(details[0]);
                var size = details[1];
                current.font = fontObj;

                if (this.embedFonts && !fontObj.missingFile && !this.embeddedFonts[fontObj.loadedName]) {
                  this.addFontStyle(fontObj);
                  this.embeddedFonts[fontObj.loadedName] = fontObj;
                }

                current.fontMatrix = fontObj.fontMatrix || _util.FONT_IDENTITY_MATRIX;
                var bold = "normal";

                if (fontObj.black) {
                  bold = "900";
                } else if (fontObj.bold) {
                  bold = "bold";
                }

                var italic = fontObj.italic ? "italic" : "normal";

                if (size < 0) {
                  size = -size;
                  current.fontDirection = -1;
                } else {
                  current.fontDirection = 1;
                }

                current.fontSize = size;
                current.fontFamily = fontObj.loadedName;
                current.fontWeight = bold;
                current.fontStyle = italic;
                current.tspan = this.svgFactory.createElement("svg:tspan");
                current.tspan.setAttributeNS(null, "y", pf(-current.y));
                current.xcoords = [];
                current.ycoords = [];
              }
            }, {
              key: "endText",
              value: function endText() {
                var _current$txtElement;

                var current = this.current;

                if (current.textRenderingMode & _util.TextRenderingMode.ADD_TO_PATH_FLAG && (_current$txtElement = current.txtElement) !== null && _current$txtElement !== void 0 && _current$txtElement.hasChildNodes()) {
                  current.element = current.txtElement;
                  this.clip("nonzero");
                  this.endPath();
                }
              }
            }, {
              key: "setLineWidth",
              value: function setLineWidth(width) {
                if (width > 0) {
                  this.current.lineWidth = width;
                }
              }
            }, {
              key: "setLineCap",
              value: function setLineCap(style) {
                this.current.lineCap = LINE_CAP_STYLES[style];
              }
            }, {
              key: "setLineJoin",
              value: function setLineJoin(style) {
                this.current.lineJoin = LINE_JOIN_STYLES[style];
              }
            }, {
              key: "setMiterLimit",
              value: function setMiterLimit(limit) {
                this.current.miterLimit = limit;
              }
            }, {
              key: "setStrokeAlpha",
              value: function setStrokeAlpha(strokeAlpha) {
                this.current.strokeAlpha = strokeAlpha;
              }
            }, {
              key: "setStrokeRGBColor",
              value: function setStrokeRGBColor(r, g, b) {
                this.current.strokeColor = _util.Util.makeHexColor(r, g, b);
              }
            }, {
              key: "setFillAlpha",
              value: function setFillAlpha(fillAlpha) {
                this.current.fillAlpha = fillAlpha;
              }
            }, {
              key: "setFillRGBColor",
              value: function setFillRGBColor(r, g, b) {
                this.current.fillColor = _util.Util.makeHexColor(r, g, b);
                this.current.tspan = this.svgFactory.createElement("svg:tspan");
                this.current.xcoords = [];
                this.current.ycoords = [];
              }
            }, {
              key: "setStrokeColorN",
              value: function setStrokeColorN(args) {
                this.current.strokeColor = this._makeColorN_Pattern(args);
              }
            }, {
              key: "setFillColorN",
              value: function setFillColorN(args) {
                this.current.fillColor = this._makeColorN_Pattern(args);
              }
            }, {
              key: "shadingFill",
              value: function shadingFill(args) {
                var width = this.viewport.width;
                var height = this.viewport.height;

                var inv = _util.Util.inverseTransform(this.transformMatrix);

                var bl = _util.Util.applyTransform([0, 0], inv);

                var br = _util.Util.applyTransform([0, height], inv);

                var ul = _util.Util.applyTransform([width, 0], inv);

                var ur = _util.Util.applyTransform([width, height], inv);

                var x0 = Math.min(bl[0], br[0], ul[0], ur[0]);
                var y0 = Math.min(bl[1], br[1], ul[1], ur[1]);
                var x1 = Math.max(bl[0], br[0], ul[0], ur[0]);
                var y1 = Math.max(bl[1], br[1], ul[1], ur[1]);
                var rect = this.svgFactory.createElement("svg:rect");
                rect.setAttributeNS(null, "x", x0);
                rect.setAttributeNS(null, "y", y0);
                rect.setAttributeNS(null, "width", x1 - x0);
                rect.setAttributeNS(null, "height", y1 - y0);
                rect.setAttributeNS(null, "fill", this._makeShadingPattern(args));

                if (this.current.fillAlpha < 1) {
                  rect.setAttributeNS(null, "fill-opacity", this.current.fillAlpha);
                }

                this._ensureTransformGroup().appendChild(rect);
              }
            }, {
              key: "_makeColorN_Pattern",
              value: function _makeColorN_Pattern(args) {
                if (args[0] === "TilingPattern") {
                  return this._makeTilingPattern(args);
                }

                return this._makeShadingPattern(args);
              }
            }, {
              key: "_makeTilingPattern",
              value: function _makeTilingPattern(args) {
                var color = args[1];
                var operatorList = args[2];
                var matrix = args[3] || _util.IDENTITY_MATRIX;

                var _args$ = _slicedToArray(args[4], 4),
                    x0 = _args$[0],
                    y0 = _args$[1],
                    x1 = _args$[2],
                    y1 = _args$[3];

                var xstep = args[5];
                var ystep = args[6];
                var paintType = args[7];
                var tilingId = "shading".concat(shadingCount++);

                var _Util$normalizeRect = _util.Util.normalizeRect([].concat(_toConsumableArray(_util.Util.applyTransform([x0, y0], matrix)), _toConsumableArray(_util.Util.applyTransform([x1, y1], matrix)))),
                    _Util$normalizeRect2 = _slicedToArray(_Util$normalizeRect, 4),
                    tx0 = _Util$normalizeRect2[0],
                    ty0 = _Util$normalizeRect2[1],
                    tx1 = _Util$normalizeRect2[2],
                    ty1 = _Util$normalizeRect2[3];

                var _Util$singularValueDe = _util.Util.singularValueDecompose2dScale(matrix),
                    _Util$singularValueDe2 = _slicedToArray(_Util$singularValueDe, 2),
                    xscale = _Util$singularValueDe2[0],
                    yscale = _Util$singularValueDe2[1];

                var txstep = xstep * xscale;
                var tystep = ystep * yscale;
                var tiling = this.svgFactory.createElement("svg:pattern");
                tiling.setAttributeNS(null, "id", tilingId);
                tiling.setAttributeNS(null, "patternUnits", "userSpaceOnUse");
                tiling.setAttributeNS(null, "width", txstep);
                tiling.setAttributeNS(null, "height", tystep);
                tiling.setAttributeNS(null, "x", "".concat(tx0));
                tiling.setAttributeNS(null, "y", "".concat(ty0));
                var svg = this.svg;
                var transformMatrix = this.transformMatrix;
                var fillColor = this.current.fillColor;
                var strokeColor = this.current.strokeColor;
                var bbox = this.svgFactory.create(tx1 - tx0, ty1 - ty0);
                this.svg = bbox;
                this.transformMatrix = matrix;

                if (paintType === 2) {
                  var cssColor = _util.Util.makeHexColor.apply(_util.Util, _toConsumableArray(color));

                  this.current.fillColor = cssColor;
                  this.current.strokeColor = cssColor;
                }

                this.executeOpTree(this.convertOpList(operatorList));
                this.svg = svg;
                this.transformMatrix = transformMatrix;
                this.current.fillColor = fillColor;
                this.current.strokeColor = strokeColor;
                tiling.appendChild(bbox.childNodes[0]);
                this.defs.appendChild(tiling);
                return "url(#".concat(tilingId, ")");
              }
            }, {
              key: "_makeShadingPattern",
              value: function _makeShadingPattern(args) {
                switch (args[0]) {
                  case "RadialAxial":
                    var shadingId = "shading".concat(shadingCount++);
                    var colorStops = args[3];
                    var gradient;

                    switch (args[1]) {
                      case "axial":
                        var point0 = args[4];
                        var point1 = args[5];
                        gradient = this.svgFactory.createElement("svg:linearGradient");
                        gradient.setAttributeNS(null, "id", shadingId);
                        gradient.setAttributeNS(null, "gradientUnits", "userSpaceOnUse");
                        gradient.setAttributeNS(null, "x1", point0[0]);
                        gradient.setAttributeNS(null, "y1", point0[1]);
                        gradient.setAttributeNS(null, "x2", point1[0]);
                        gradient.setAttributeNS(null, "y2", point1[1]);
                        break;

                      case "radial":
                        var focalPoint = args[4];
                        var circlePoint = args[5];
                        var focalRadius = args[6];
                        var circleRadius = args[7];
                        gradient = this.svgFactory.createElement("svg:radialGradient");
                        gradient.setAttributeNS(null, "id", shadingId);
                        gradient.setAttributeNS(null, "gradientUnits", "userSpaceOnUse");
                        gradient.setAttributeNS(null, "cx", circlePoint[0]);
                        gradient.setAttributeNS(null, "cy", circlePoint[1]);
                        gradient.setAttributeNS(null, "r", circleRadius);
                        gradient.setAttributeNS(null, "fx", focalPoint[0]);
                        gradient.setAttributeNS(null, "fy", focalPoint[1]);
                        gradient.setAttributeNS(null, "fr", focalRadius);
                        break;

                      default:
                        throw new Error("Unknown RadialAxial type: ".concat(args[1]));
                    }

                    var _iterator5 = _createForOfIteratorHelper(colorStops),
                        _step5;

                    try {
                      for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
                        var colorStop = _step5.value;
                        var stop = this.svgFactory.createElement("svg:stop");
                        stop.setAttributeNS(null, "offset", colorStop[0]);
                        stop.setAttributeNS(null, "stop-color", colorStop[1]);
                        gradient.appendChild(stop);
                      }
                    } catch (err) {
                      _iterator5.e(err);
                    } finally {
                      _iterator5.f();
                    }

                    this.defs.appendChild(gradient);
                    return "url(#".concat(shadingId, ")");

                  case "Mesh":
                    (0, _util.warn)("Unimplemented pattern Mesh");
                    return null;

                  case "Dummy":
                    return "hotpink";

                  default:
                    throw new Error("Unknown IR type: ".concat(args[0]));
                }
              }
            }, {
              key: "setDash",
              value: function setDash(dashArray, dashPhase) {
                this.current.dashArray = dashArray;
                this.current.dashPhase = dashPhase;
              }
            }, {
              key: "constructPath",
              value: function constructPath(ops, args) {
                var current = this.current;
                var x = current.x,
                    y = current.y;
                var d = [];
                var j = 0;

                var _iterator6 = _createForOfIteratorHelper(ops),
                    _step6;

                try {
                  for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
                    var op = _step6.value;

                    switch (op | 0) {
                      case _util.OPS.rectangle:
                        x = args[j++];
                        y = args[j++];
                        var width = args[j++];
                        var height = args[j++];
                        var xw = x + width;
                        var yh = y + height;
                        d.push("M", pf(x), pf(y), "L", pf(xw), pf(y), "L", pf(xw), pf(yh), "L", pf(x), pf(yh), "Z");
                        break;

                      case _util.OPS.moveTo:
                        x = args[j++];
                        y = args[j++];
                        d.push("M", pf(x), pf(y));
                        break;

                      case _util.OPS.lineTo:
                        x = args[j++];
                        y = args[j++];
                        d.push("L", pf(x), pf(y));
                        break;

                      case _util.OPS.curveTo:
                        x = args[j + 4];
                        y = args[j + 5];
                        d.push("C", pf(args[j]), pf(args[j + 1]), pf(args[j + 2]), pf(args[j + 3]), pf(x), pf(y));
                        j += 6;
                        break;

                      case _util.OPS.curveTo2:
                        d.push("C", pf(x), pf(y), pf(args[j]), pf(args[j + 1]), pf(args[j + 2]), pf(args[j + 3]));
                        x = args[j + 2];
                        y = args[j + 3];
                        j += 4;
                        break;

                      case _util.OPS.curveTo3:
                        x = args[j + 2];
                        y = args[j + 3];
                        d.push("C", pf(args[j]), pf(args[j + 1]), pf(x), pf(y), pf(x), pf(y));
                        j += 4;
                        break;

                      case _util.OPS.closePath:
                        d.push("Z");
                        break;
                    }
                  }
                } catch (err) {
                  _iterator6.e(err);
                } finally {
                  _iterator6.f();
                }

                d = d.join(" ");

                if (current.path && ops.length > 0 && ops[0] !== _util.OPS.rectangle && ops[0] !== _util.OPS.moveTo) {
                  d = current.path.getAttributeNS(null, "d") + d;
                } else {
                  current.path = this.svgFactory.createElement("svg:path");

                  this._ensureTransformGroup().appendChild(current.path);
                }

                current.path.setAttributeNS(null, "d", d);
                current.path.setAttributeNS(null, "fill", "none");
                current.element = current.path;
                current.setCurrentPoint(x, y);
              }
            }, {
              key: "endPath",
              value: function endPath() {
                var current = this.current;
                current.path = null;

                if (!this.pendingClip) {
                  return;
                }

                if (!current.element) {
                  this.pendingClip = null;
                  return;
                }

                var clipId = "clippath".concat(clipCount++);
                var clipPath = this.svgFactory.createElement("svg:clipPath");
                clipPath.setAttributeNS(null, "id", clipId);
                clipPath.setAttributeNS(null, "transform", pm(this.transformMatrix));
                var clipElement = current.element.cloneNode(true);

                if (this.pendingClip === "evenodd") {
                  clipElement.setAttributeNS(null, "clip-rule", "evenodd");
                } else {
                  clipElement.setAttributeNS(null, "clip-rule", "nonzero");
                }

                this.pendingClip = null;
                clipPath.appendChild(clipElement);
                this.defs.appendChild(clipPath);

                if (current.activeClipUrl) {
                  current.clipGroup = null;

                  var _iterator7 = _createForOfIteratorHelper(this.extraStack),
                      _step7;

                  try {
                    for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
                      var prev = _step7.value;
                      prev.clipGroup = null;
                    }
                  } catch (err) {
                    _iterator7.e(err);
                  } finally {
                    _iterator7.f();
                  }

                  clipPath.setAttributeNS(null, "clip-path", current.activeClipUrl);
                }

                current.activeClipUrl = "url(#".concat(clipId, ")");
                this.tgrp = null;
              }
            }, {
              key: "clip",
              value: function clip(type) {
                this.pendingClip = type;
              }
            }, {
              key: "closePath",
              value: function closePath() {
                var current = this.current;

                if (current.path) {
                  var d = "".concat(current.path.getAttributeNS(null, "d"), "Z");
                  current.path.setAttributeNS(null, "d", d);
                }
              }
            }, {
              key: "setLeading",
              value: function setLeading(leading) {
                this.current.leading = -leading;
              }
            }, {
              key: "setTextRise",
              value: function setTextRise(textRise) {
                this.current.textRise = textRise;
              }
            }, {
              key: "setTextRenderingMode",
              value: function setTextRenderingMode(textRenderingMode) {
                this.current.textRenderingMode = textRenderingMode;
              }
            }, {
              key: "setHScale",
              value: function setHScale(scale) {
                this.current.textHScale = scale / 100;
              }
            }, {
              key: "setRenderingIntent",
              value: function setRenderingIntent(intent) {}
            }, {
              key: "setFlatness",
              value: function setFlatness(flatness) {}
            }, {
              key: "setGState",
              value: function setGState(states) {
                var _iterator8 = _createForOfIteratorHelper(states),
                    _step8;

                try {
                  for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
                    var _step8$value = _slicedToArray(_step8.value, 2),
                        key = _step8$value[0],
                        value = _step8$value[1];

                    switch (key) {
                      case "LW":
                        this.setLineWidth(value);
                        break;

                      case "LC":
                        this.setLineCap(value);
                        break;

                      case "LJ":
                        this.setLineJoin(value);
                        break;

                      case "ML":
                        this.setMiterLimit(value);
                        break;

                      case "D":
                        this.setDash(value[0], value[1]);
                        break;

                      case "RI":
                        this.setRenderingIntent(value);
                        break;

                      case "FL":
                        this.setFlatness(value);
                        break;

                      case "Font":
                        this.setFont(value);
                        break;

                      case "CA":
                        this.setStrokeAlpha(value);
                        break;

                      case "ca":
                        this.setFillAlpha(value);
                        break;

                      default:
                        (0, _util.warn)("Unimplemented graphic state operator ".concat(key));
                        break;
                    }
                  }
                } catch (err) {
                  _iterator8.e(err);
                } finally {
                  _iterator8.f();
                }
              }
            }, {
              key: "fill",
              value: function fill() {
                var current = this.current;

                if (current.element) {
                  current.element.setAttributeNS(null, "fill", current.fillColor);
                  current.element.setAttributeNS(null, "fill-opacity", current.fillAlpha);
                  this.endPath();
                }
              }
            }, {
              key: "stroke",
              value: function stroke() {
                var current = this.current;

                if (current.element) {
                  this._setStrokeAttributes(current.element);

                  current.element.setAttributeNS(null, "fill", "none");
                  this.endPath();
                }
              }
            }, {
              key: "_setStrokeAttributes",
              value: function _setStrokeAttributes(element) {
                var lineWidthScale = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
                var current = this.current;
                var dashArray = current.dashArray;

                if (lineWidthScale !== 1 && dashArray.length > 0) {
                  dashArray = dashArray.map(function (value) {
                    return lineWidthScale * value;
                  });
                }

                element.setAttributeNS(null, "stroke", current.strokeColor);
                element.setAttributeNS(null, "stroke-opacity", current.strokeAlpha);
                element.setAttributeNS(null, "stroke-miterlimit", pf(current.miterLimit));
                element.setAttributeNS(null, "stroke-linecap", current.lineCap);
                element.setAttributeNS(null, "stroke-linejoin", current.lineJoin);
                element.setAttributeNS(null, "stroke-width", pf(lineWidthScale * current.lineWidth) + "px");
                element.setAttributeNS(null, "stroke-dasharray", dashArray.map(pf).join(" "));
                element.setAttributeNS(null, "stroke-dashoffset", pf(lineWidthScale * current.dashPhase) + "px");
              }
            }, {
              key: "eoFill",
              value: function eoFill() {
                if (this.current.element) {
                  this.current.element.setAttributeNS(null, "fill-rule", "evenodd");
                }

                this.fill();
              }
            }, {
              key: "fillStroke",
              value: function fillStroke() {
                this.stroke();
                this.fill();
              }
            }, {
              key: "eoFillStroke",
              value: function eoFillStroke() {
                if (this.current.element) {
                  this.current.element.setAttributeNS(null, "fill-rule", "evenodd");
                }

                this.fillStroke();
              }
            }, {
              key: "closeStroke",
              value: function closeStroke() {
                this.closePath();
                this.stroke();
              }
            }, {
              key: "closeFillStroke",
              value: function closeFillStroke() {
                this.closePath();
                this.fillStroke();
              }
            }, {
              key: "closeEOFillStroke",
              value: function closeEOFillStroke() {
                this.closePath();
                this.eoFillStroke();
              }
            }, {
              key: "paintSolidColorImageMask",
              value: function paintSolidColorImageMask() {
                var rect = this.svgFactory.createElement("svg:rect");
                rect.setAttributeNS(null, "x", "0");
                rect.setAttributeNS(null, "y", "0");
                rect.setAttributeNS(null, "width", "1px");
                rect.setAttributeNS(null, "height", "1px");
                rect.setAttributeNS(null, "fill", this.current.fillColor);

                this._ensureTransformGroup().appendChild(rect);
              }
            }, {
              key: "paintImageXObject",
              value: function paintImageXObject(objId) {
                var imgData = objId.startsWith("g_") ? this.commonObjs.get(objId) : this.objs.get(objId);

                if (!imgData) {
                  (0, _util.warn)("Dependent image with object ID ".concat(objId, " is not ready yet"));
                  return;
                }

                this.paintInlineImageXObject(imgData);
              }
            }, {
              key: "paintInlineImageXObject",
              value: function paintInlineImageXObject(imgData, mask) {
                var width = imgData.width;
                var height = imgData.height;
                var imgSrc = convertImgDataToPng(imgData, this.forceDataSchema, !!mask);
                var cliprect = this.svgFactory.createElement("svg:rect");
                cliprect.setAttributeNS(null, "x", "0");
                cliprect.setAttributeNS(null, "y", "0");
                cliprect.setAttributeNS(null, "width", pf(width));
                cliprect.setAttributeNS(null, "height", pf(height));
                this.current.element = cliprect;
                this.clip("nonzero");
                var imgEl = this.svgFactory.createElement("svg:image");
                imgEl.setAttributeNS(XLINK_NS, "xlink:href", imgSrc);
                imgEl.setAttributeNS(null, "x", "0");
                imgEl.setAttributeNS(null, "y", pf(-height));
                imgEl.setAttributeNS(null, "width", pf(width) + "px");
                imgEl.setAttributeNS(null, "height", pf(height) + "px");
                imgEl.setAttributeNS(null, "transform", "scale(".concat(pf(1 / width), " ").concat(pf(-1 / height), ")"));

                if (mask) {
                  mask.appendChild(imgEl);
                } else {
                  this._ensureTransformGroup().appendChild(imgEl);
                }
              }
            }, {
              key: "paintImageMaskXObject",
              value: function paintImageMaskXObject(imgData) {
                var current = this.current;
                var width = imgData.width;
                var height = imgData.height;
                var fillColor = current.fillColor;
                current.maskId = "mask".concat(maskCount++);
                var mask = this.svgFactory.createElement("svg:mask");
                mask.setAttributeNS(null, "id", current.maskId);
                var rect = this.svgFactory.createElement("svg:rect");
                rect.setAttributeNS(null, "x", "0");
                rect.setAttributeNS(null, "y", "0");
                rect.setAttributeNS(null, "width", pf(width));
                rect.setAttributeNS(null, "height", pf(height));
                rect.setAttributeNS(null, "fill", fillColor);
                rect.setAttributeNS(null, "mask", "url(#".concat(current.maskId, ")"));
                this.defs.appendChild(mask);

                this._ensureTransformGroup().appendChild(rect);

                this.paintInlineImageXObject(imgData, mask);
              }
            }, {
              key: "paintFormXObjectBegin",
              value: function paintFormXObjectBegin(matrix, bbox) {
                if (Array.isArray(matrix) && matrix.length === 6) {
                  this.transform(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]);
                }

                if (bbox) {
                  var width = bbox[2] - bbox[0];
                  var height = bbox[3] - bbox[1];
                  var cliprect = this.svgFactory.createElement("svg:rect");
                  cliprect.setAttributeNS(null, "x", bbox[0]);
                  cliprect.setAttributeNS(null, "y", bbox[1]);
                  cliprect.setAttributeNS(null, "width", pf(width));
                  cliprect.setAttributeNS(null, "height", pf(height));
                  this.current.element = cliprect;
                  this.clip("nonzero");
                  this.endPath();
                }
              }
            }, {
              key: "paintFormXObjectEnd",
              value: function paintFormXObjectEnd() {}
            }, {
              key: "_initialize",
              value: function _initialize(viewport) {
                var svg = this.svgFactory.create(viewport.width, viewport.height);
                var definitions = this.svgFactory.createElement("svg:defs");
                svg.appendChild(definitions);
                this.defs = definitions;
                var rootGroup = this.svgFactory.createElement("svg:g");
                rootGroup.setAttributeNS(null, "transform", pm(viewport.transform));
                svg.appendChild(rootGroup);
                this.svg = rootGroup;
                return svg;
              }
            }, {
              key: "_ensureClipGroup",
              value: function _ensureClipGroup() {
                if (!this.current.clipGroup) {
                  var clipGroup = this.svgFactory.createElement("svg:g");
                  clipGroup.setAttributeNS(null, "clip-path", this.current.activeClipUrl);
                  this.svg.appendChild(clipGroup);
                  this.current.clipGroup = clipGroup;
                }

                return this.current.clipGroup;
              }
            }, {
              key: "_ensureTransformGroup",
              value: function _ensureTransformGroup() {
                if (!this.tgrp) {
                  this.tgrp = this.svgFactory.createElement("svg:g");
                  this.tgrp.setAttributeNS(null, "transform", pm(this.transformMatrix));

                  if (this.current.activeClipUrl) {
                    this._ensureClipGroup().appendChild(this.tgrp);
                  } else {
                    this.svg.appendChild(this.tgrp);
                  }
                }

                return this.tgrp;
              }
            }]);

            return SVGGraphics;
          }();
        }
        /***/
      },
      /* 135 */

      /***/
      function (__unused_webpack_module, exports, __w_pdfjs_require__) {
        "use strict";

        Object.defineProperty(exports, "__esModule", {
          value: true
        });
        exports.XfaLayer = void 0;

        var _util = __w_pdfjs_require__(4);

        var _xfa_text = __w_pdfjs_require__(130);

        function _slicedToArray(arr, i) {
          return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
        }

        function _nonIterableRest() {
          throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
        }

        function _iterableToArrayLimit(arr, i) {
          var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];

          if (_i == null) return;
          var _arr = [];
          var _n = true;
          var _d = false;

          var _s, _e;

          try {
            for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
              _arr.push(_s.value);

              if (i && _arr.length === i) break;
            }
          } catch (err) {
            _d = true;
            _e = err;
          } finally {
            try {
              if (!_n && _i["return"] != null) _i["return"]();
            } finally {
              if (_d) throw _e;
            }
          }

          return _arr;
        }

        function _arrayWithHoles(arr) {
          if (Array.isArray(arr)) return arr;
        }

        function _createForOfIteratorHelper(o, allowArrayLike) {
          var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];

          if (!it) {
            if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
              if (it) o = it;
              var i = 0;

              var F = function F() {};

              return {
                s: F,
                n: function n() {
                  if (i >= o.length) return {
                    done: true
                  };
                  return {
                    done: false,
                    value: o[i++]
                  };
                },
                e: function e(_e2) {
                  throw _e2;
                },
                f: F
              };
            }

            throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
          }

          var normalCompletion = true,
              didErr = false,
              err;
          return {
            s: function s() {
              it = it.call(o);
            },
            n: function n() {
              var step = it.next();
              normalCompletion = step.done;
              return step;
            },
            e: function e(_e3) {
              didErr = true;
              err = _e3;
            },
            f: function f() {
              try {
                if (!normalCompletion && it["return"] != null) it["return"]();
              } finally {
                if (didErr) throw err;
              }
            }
          };
        }

        function _unsupportedIterableToArray(o, minLen) {
          if (!o) return;
          if (typeof o === "string") return _arrayLikeToArray(o, minLen);
          var n = Object.prototype.toString.call(o).slice(8, -1);
          if (n === "Object" && o.constructor) n = o.constructor.name;
          if (n === "Map" || n === "Set") return Array.from(o);
          if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
        }

        function _arrayLikeToArray(arr, len) {
          if (len == null || len > arr.length) len = arr.length;

          for (var i = 0, arr2 = new Array(len); i < len; i++) {
            arr2[i] = arr[i];
          }

          return arr2;
        }

        function _classCallCheck(instance, Constructor) {
          if (!(instance instanceof Constructor)) {
            throw new TypeError("Cannot call a class as a function");
          }
        }

        function _defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];
            descriptor.enumerable = descriptor.enumerable || false;
            descriptor.configurable = true;
            if ("value" in descriptor) descriptor.writable = true;
            Object.defineProperty(target, descriptor.key, descriptor);
          }
        }

        function _createClass(Constructor, protoProps, staticProps) {
          if (protoProps) _defineProperties(Constructor.prototype, protoProps);
          if (staticProps) _defineProperties(Constructor, staticProps);
          return Constructor;
        }

        var XfaLayer = /*#__PURE__*/function () {
          function XfaLayer() {
            _classCallCheck(this, XfaLayer);
          }

          _createClass(XfaLayer, null, [{
            key: "setupStorage",
            value: function setupStorage(html, id, element, storage, intent) {
              var storedData = storage.getValue(id, {
                value: null
              });

              switch (element.name) {
                case "textarea":
                  if (storedData.value !== null) {
                    html.textContent = storedData.value;
                  }

                  if (intent === "print") {
                    break;
                  }

                  html.addEventListener("input", function (event) {
                    storage.setValue(id, {
                      value: event.target.value
                    });
                  });
                  break;

                case "input":
                  if (element.attributes.type === "radio" || element.attributes.type === "checkbox") {
                    if (storedData.value === element.attributes.xfaOn) {
                      html.setAttribute("checked", true);
                    } else if (storedData.value === element.attributes.xfaOff) {
                      html.removeAttribute("checked");
                    }

                    if (intent === "print") {
                      break;
                    }

                    html.addEventListener("change", function (event) {
                      storage.setValue(id, {
                        value: event.target.checked ? event.target.getAttribute("xfaOn") : event.target.getAttribute("xfaOff")
                      });
                    });
                  } else {
                    if (storedData.value !== null) {
                      html.setAttribute("value", storedData.value);
                    }

                    if (intent === "print") {
                      break;
                    }

                    html.addEventListener("input", function (event) {
                      storage.setValue(id, {
                        value: event.target.value
                      });
                    });
                  }

                  break;

                case "select":
                  if (storedData.value !== null) {
                    var _iterator = _createForOfIteratorHelper(element.children),
                        _step;

                    try {
                      for (_iterator.s(); !(_step = _iterator.n()).done;) {
                        var option = _step.value;

                        if (option.attributes.value === storedData.value) {
                          option.attributes.selected = true;
                        }
                      }
                    } catch (err) {
                      _iterator.e(err);
                    } finally {
                      _iterator.f();
                    }
                  }

                  html.addEventListener("input", function (event) {
                    var options = event.target.options;
                    var value = options.selectedIndex === -1 ? "" : options[options.selectedIndex].value;
                    storage.setValue(id, {
                      value: value
                    });
                  });
                  break;
              }
            }
          }, {
            key: "setAttributes",
            value: function setAttributes(_ref) {
              var html = _ref.html,
                  element = _ref.element,
                  _ref$storage = _ref.storage,
                  storage = _ref$storage === void 0 ? null : _ref$storage,
                  intent = _ref.intent,
                  linkService = _ref.linkService;
              var attributes = element.attributes;
              var isHTMLAnchorElement = html instanceof HTMLAnchorElement;

              if (attributes.type === "radio") {
                attributes.name = "".concat(attributes.name, "-").concat(intent);
              }

              for (var _i = 0, _Object$entries = Object.entries(attributes); _i < _Object$entries.length; _i++) {
                var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
                    key = _Object$entries$_i[0],
                    value = _Object$entries$_i[1];

                if (value === null || value === undefined || key === "dataId") {
                  continue;
                }

                if (key !== "style") {
                  if (key === "textContent") {
                    html.textContent = value;
                  } else if (key === "class") {
                    html.setAttribute(key, value.join(" "));
                  } else {
                    if (isHTMLAnchorElement && (key === "href" || key === "newWindow")) {
                      continue;
                    }

                    html.setAttribute(key, value);
                  }
                } else {
                  Object.assign(html.style, value);
                }
              }

              if (isHTMLAnchorElement) {
                var _linkService$addLinkA;

                if (!linkService.addLinkAttributes) {
                  (0, _util.warn)("XfaLayer.setAttribute - missing `addLinkAttributes`-method on the `linkService`-instance.");
                }

                (_linkService$addLinkA = linkService.addLinkAttributes) === null || _linkService$addLinkA === void 0 ? void 0 : _linkService$addLinkA.call(linkService, html, attributes.href, attributes.newWindow);
              }

              if (storage && attributes.dataId) {
                this.setupStorage(html, attributes.dataId, element, storage);
              }
            }
          }, {
            key: "render",
            value: function render(parameters) {
              var storage = parameters.annotationStorage;
              var linkService = parameters.linkService;
              var root = parameters.xfa;
              var intent = parameters.intent || "display";
              var rootHtml = document.createElement(root.name);

              if (root.attributes) {
                this.setAttributes({
                  html: rootHtml,
                  element: root,
                  intent: intent,
                  linkService: linkService
                });
              }

              var stack = [[root, -1, rootHtml]];
              var rootDiv = parameters.div;
              rootDiv.appendChild(rootHtml);
              var transform = "matrix(".concat(parameters.viewport.transform.join(","), ")");
              rootDiv.style.transform = transform;
              rootDiv.setAttribute("class", "xfaLayer xfaFont");
              var textDivs = [];

              while (stack.length > 0) {
                var _child$attributes;

                var _stack = _slicedToArray(stack[stack.length - 1], 3),
                    parent = _stack[0],
                    i = _stack[1],
                    html = _stack[2];

                if (i + 1 === parent.children.length) {
                  stack.pop();
                  continue;
                }

                var child = parent.children[++stack[stack.length - 1][1]];

                if (child === null) {
                  continue;
                }

                var name = child.name;

                if (name === "#text") {
                  var node = document.createTextNode(child.value);
                  textDivs.push(node);
                  html.appendChild(node);
                  continue;
                }

                var childHtml = void 0;

                if (child !== null && child !== void 0 && (_child$attributes = child.attributes) !== null && _child$attributes !== void 0 && _child$attributes.xmlns) {
                  childHtml = document.createElementNS(child.attributes.xmlns, name);
                } else {
                  childHtml = document.createElement(name);
                }

                html.appendChild(childHtml);

                if (child.attributes) {
                  this.setAttributes({
                    html: childHtml,
                    element: child,
                    storage: storage,
                    intent: intent,
                    linkService: linkService
                  });
                }

                if (child.children && child.children.length > 0) {
                  stack.push([child, -1, childHtml]);
                } else if (child.value) {
                  var _node = document.createTextNode(child.value);

                  if (_xfa_text.XfaText.shouldBuildText(name)) {
                    textDivs.push(_node);
                  }

                  childHtml.appendChild(_node);
                }
              }

              var _iterator2 = _createForOfIteratorHelper(rootDiv.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea")),
                  _step2;

              try {
                for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
                  var el = _step2.value;
                  el.setAttribute("readOnly", true);
                }
              } catch (err) {
                _iterator2.e(err);
              } finally {
                _iterator2.f();
              }

              return {
                textDivs: textDivs
              };
            }
          }, {
            key: "update",
            value: function update(parameters) {
              var transform = "matrix(".concat(parameters.viewport.transform.join(","), ")");
              parameters.div.style.transform = transform;
              parameters.div.hidden = false;
            }
          }]);

          return XfaLayer;
        }();

        exports.XfaLayer = XfaLayer;
        /***/
      },
      /* 136 */

      /***/
      function (__unused_webpack_module, exports, __w_pdfjs_require__) {
        "use strict";

        function _typeof(obj) {
          "@babel/helpers - typeof";

          if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
            _typeof = function _typeof(obj) {
              return typeof obj;
            };
          } else {
            _typeof = function _typeof(obj) {
              return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
            };
          }

          return _typeof(obj);
        }

        Object.defineProperty(exports, "__esModule", {
          value: true
        });
        exports.PDFNodeStream = void 0;

        var _regenerator = _interopRequireDefault(__w_pdfjs_require__(2));

        var _util = __w_pdfjs_require__(4);

        var _network_utils = __w_pdfjs_require__(137);

        function _interopRequireDefault(obj) {
          return obj && obj.__esModule ? obj : {
            "default": obj
          };
        }

        function _inherits(subClass, superClass) {
          if (typeof superClass !== "function" && superClass !== null) {
            throw new TypeError("Super expression must either be null or a function");
          }

          subClass.prototype = Object.create(superClass && superClass.prototype, {
            constructor: {
              value: subClass,
              writable: true,
              configurable: true
            }
          });
          if (superClass) _setPrototypeOf(subClass, superClass);
        }

        function _setPrototypeOf(o, p) {
          _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
            o.__proto__ = p;
            return o;
          };

          return _setPrototypeOf(o, p);
        }

        function _createSuper(Derived) {
          var hasNativeReflectConstruct = _isNativeReflectConstruct();

          return function _createSuperInternal() {
            var Super = _getPrototypeOf(Derived),
                result;

            if (hasNativeReflectConstruct) {
              var NewTarget = _getPrototypeOf(this).constructor;

              result = Reflect.construct(Super, arguments, NewTarget);
            } else {
              result = Super.apply(this, arguments);
            }

            return _possibleConstructorReturn(this, result);
          };
        }

        function _possibleConstructorReturn(self, call) {
          if (call && (_typeof(call) === "object" || typeof call === "function")) {
            return call;
          } else if (call !== void 0) {
            throw new TypeError("Derived constructors may only return object or undefined");
          }

          return _assertThisInitialized(self);
        }

        function _assertThisInitialized(self) {
          if (self === void 0) {
            throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
          }

          return self;
        }

        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 (e) {
            return false;
          }
        }

        function _getPrototypeOf(o) {
          _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
            return o.__proto__ || Object.getPrototypeOf(o);
          };
          return _getPrototypeOf(o);
        }

        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 self = this,
                args = arguments;
            return new Promise(function (resolve, reject) {
              var gen = fn.apply(self, args);

              function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
              }

              function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
              }

              _next(undefined);
            });
          };
        }

        function _createForOfIteratorHelper(o, allowArrayLike) {
          var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];

          if (!it) {
            if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
              if (it) o = it;
              var i = 0;

              var F = function F() {};

              return {
                s: F,
                n: function n() {
                  if (i >= o.length) return {
                    done: true
                  };
                  return {
                    done: false,
                    value: o[i++]
                  };
                },
                e: function e(_e) {
                  throw _e;
                },
                f: F
              };
            }

            throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
          }

          var normalCompletion = true,
              didErr = false,
              err;
          return {
            s: function s() {
              it = it.call(o);
            },
            n: function n() {
              var step = it.next();
              normalCompletion = step.done;
              return step;
            },
            e: function e(_e2) {
              didErr = true;
              err = _e2;
            },
            f: function f() {
              try {
                if (!normalCompletion && it["return"] != null) it["return"]();
              } finally {
                if (didErr) throw err;
              }
            }
          };
        }

        function _unsupportedIterableToArray(o, minLen) {
          if (!o) return;
          if (typeof o === "string") return _arrayLikeToArray(o, minLen);
          var n = Object.prototype.toString.call(o).slice(8, -1);
          if (n === "Object" && o.constructor) n = o.constructor.name;
          if (n === "Map" || n === "Set") return Array.from(o);
          if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
        }

        function _arrayLikeToArray(arr, len) {
          if (len == null || len > arr.length) len = arr.length;

          for (var i = 0, arr2 = new Array(len); i < len; i++) {
            arr2[i] = arr[i];
          }

          return arr2;
        }

        function _classCallCheck(instance, Constructor) {
          if (!(instance instanceof Constructor)) {
            throw new TypeError("Cannot call a class as a function");
          }
        }

        function _defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];
            descriptor.enumerable = descriptor.enumerable || false;
            descriptor.configurable = true;
            if ("value" in descriptor) descriptor.writable = true;
            Object.defineProperty(target, descriptor.key, descriptor);
          }
        }

        function _createClass(Constructor, protoProps, staticProps) {
          if (protoProps) _defineProperties(Constructor.prototype, protoProps);
          if (staticProps) _defineProperties(Constructor, staticProps);
          return Constructor;
        }

        ;

        var fs = __webpack_require__(767);

        var http = __webpack_require__(251);

        var https = __webpack_require__(677);

        var url = __webpack_require__(543);

        var fileUriRegex = /^file:\/\/\/[a-zA-Z]:\//;

        function parseUrl(sourceUrl) {
          var parsedUrl = url.parse(sourceUrl);

          if (parsedUrl.protocol === "file:" || parsedUrl.host) {
            return parsedUrl;
          }

          if (/^[a-z]:[/\\]/i.test(sourceUrl)) {
            return url.parse("file:///".concat(sourceUrl));
          }

          if (!parsedUrl.host) {
            parsedUrl.protocol = "file:";
          }

          return parsedUrl;
        }

        var PDFNodeStream = /*#__PURE__*/function () {
          function PDFNodeStream(source) {
            _classCallCheck(this, PDFNodeStream);

            this.source = source;
            this.url = parseUrl(source.url);
            this.isHttp = this.url.protocol === "http:" || this.url.protocol === "https:";
            this.isFsUrl = this.url.protocol === "file:";
            this.httpHeaders = this.isHttp && source.httpHeaders || {};
            this._fullRequestReader = null;
            this._rangeRequestReaders = [];
          }

          _createClass(PDFNodeStream, [{
            key: "_progressiveDataLength",
            get: function get() {
              var _this$_fullRequestRea, _this$_fullRequestRea2;

              return (_this$_fullRequestRea = (_this$_fullRequestRea2 = this._fullRequestReader) === null || _this$_fullRequestRea2 === void 0 ? void 0 : _this$_fullRequestRea2._loaded) !== null && _this$_fullRequestRea !== void 0 ? _this$_fullRequestRea : 0;
            }
          }, {
            key: "getFullReader",
            value: function getFullReader() {
              (0, _util.assert)(!this._fullRequestReader, "PDFNodeStream.getFullReader can only be called once.");
              this._fullRequestReader = this.isFsUrl ? new PDFNodeStreamFsFullReader(this) : new PDFNodeStreamFullReader(this);
              return this._fullRequestReader;
            }
          }, {
            key: "getRangeReader",
            value: function getRangeReader(start, end) {
              if (end <= this._progressiveDataLength) {
                return null;
              }

              var rangeReader = this.isFsUrl ? new PDFNodeStreamFsRangeReader(this, start, end) : new PDFNodeStreamRangeReader(this, start, end);

              this._rangeRequestReaders.push(rangeReader);

              return rangeReader;
            }
          }, {
            key: "cancelAllRequests",
            value: function cancelAllRequests(reason) {
              if (this._fullRequestReader) {
                this._fullRequestReader.cancel(reason);
              }

              var _iterator = _createForOfIteratorHelper(this._rangeRequestReaders.slice(0)),
                  _step;

              try {
                for (_iterator.s(); !(_step = _iterator.n()).done;) {
                  var reader = _step.value;
                  reader.cancel(reason);
                }
              } catch (err) {
                _iterator.e(err);
              } finally {
                _iterator.f();
              }
            }
          }]);

          return PDFNodeStream;
        }();

        exports.PDFNodeStream = PDFNodeStream;

        var BaseFullReader = /*#__PURE__*/function () {
          function BaseFullReader(stream) {
            _classCallCheck(this, BaseFullReader);

            this._url = stream.url;
            this._done = false;
            this._storedError = null;
            this.onProgress = null;
            var source = stream.source;
            this._contentLength = source.length;
            this._loaded = 0;
            this._filename = null;
            this._disableRange = source.disableRange || false;
            this._rangeChunkSize = source.rangeChunkSize;

            if (!this._rangeChunkSize && !this._disableRange) {
              this._disableRange = true;
            }

            this._isStreamingSupported = !source.disableStream;
            this._isRangeSupported = !source.disableRange;
            this._readableStream = null;
            this._readCapability = (0, _util.createPromiseCapability)();
            this._headersCapability = (0, _util.createPromiseCapability)();
          }

          _createClass(BaseFullReader, [{
            key: "headersReady",
            get: function get() {
              return this._headersCapability.promise;
            }
          }, {
            key: "filename",
            get: function get() {
              return this._filename;
            }
          }, {
            key: "contentLength",
            get: function get() {
              return this._contentLength;
            }
          }, {
            key: "isRangeSupported",
            get: function get() {
              return this._isRangeSupported;
            }
          }, {
            key: "isStreamingSupported",
            get: function get() {
              return this._isStreamingSupported;
            }
          }, {
            key: "read",
            value: function () {
              var _read = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
                var chunk, buffer;
                return _regenerator["default"].wrap(function _callee$(_context) {
                  while (1) {
                    switch (_context.prev = _context.next) {
                      case 0:
                        _context.next = 2;
                        return this._readCapability.promise;

                      case 2:
                        if (!this._done) {
                          _context.next = 4;
                          break;
                        }

                        return _context.abrupt("return", {
                          value: undefined,
                          done: true
                        });

                      case 4:
                        if (!this._storedError) {
                          _context.next = 6;
                          break;
                        }

                        throw this._storedError;

                      case 6:
                        chunk = this._readableStream.read();

                        if (!(chunk === null)) {
                          _context.next = 10;
                          break;
                        }

                        this._readCapability = (0, _util.createPromiseCapability)();
                        return _context.abrupt("return", this.read());

                      case 10:
                        this._loaded += chunk.length;

                        if (this.onProgress) {
                          this.onProgress({
                            loaded: this._loaded,
                            total: this._contentLength
                          });
                        }

                        buffer = new Uint8Array(chunk).buffer;
                        return _context.abrupt("return", {
                          value: buffer,
                          done: false
                        });

                      case 14:
                      case "end":
                        return _context.stop();
                    }
                  }
                }, _callee, this);
              }));

              function read() {
                return _read.apply(this, arguments);
              }

              return read;
            }()
          }, {
            key: "cancel",
            value: function cancel(reason) {
              if (!this._readableStream) {
                this._error(reason);

                return;
              }

              this._readableStream.destroy(reason);
            }
          }, {
            key: "_error",
            value: function _error(reason) {
              this._storedError = reason;

              this._readCapability.resolve();
            }
          }, {
            key: "_setReadableStream",
            value: function _setReadableStream(readableStream) {
              var _this = this;

              this._readableStream = readableStream;
              readableStream.on("readable", function () {
                _this._readCapability.resolve();
              });
              readableStream.on("end", function () {
                readableStream.destroy();
                _this._done = true;

                _this._readCapability.resolve();
              });
              readableStream.on("error", function (reason) {
                _this._error(reason);
              });

              if (!this._isStreamingSupported && this._isRangeSupported) {
                this._error(new _util.AbortException("streaming is disabled"));
              }

              if (this._storedError) {
                this._readableStream.destroy(this._storedError);
              }
            }
          }]);

          return BaseFullReader;
        }();

        var BaseRangeReader = /*#__PURE__*/function () {
          function BaseRangeReader(stream) {
            _classCallCheck(this, BaseRangeReader);

            this._url = stream.url;
            this._done = false;
            this._storedError = null;
            this.onProgress = null;
            this._loaded = 0;
            this._readableStream = null;
            this._readCapability = (0, _util.createPromiseCapability)();
            var source = stream.source;
            this._isStreamingSupported = !source.disableStream;
          }

          _createClass(BaseRangeReader, [{
            key: "isStreamingSupported",
            get: function get() {
              return this._isStreamingSupported;
            }
          }, {
            key: "read",
            value: function () {
              var _read2 = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
                var chunk, buffer;
                return _regenerator["default"].wrap(function _callee2$(_context2) {
                  while (1) {
                    switch (_context2.prev = _context2.next) {
                      case 0:
                        _context2.next = 2;
                        return this._readCapability.promise;

                      case 2:
                        if (!this._done) {
                          _context2.next = 4;
                          break;
                        }

                        return _context2.abrupt("return", {
                          value: undefined,
                          done: true
                        });

                      case 4:
                        if (!this._storedError) {
                          _context2.next = 6;
                          break;
                        }

                        throw this._storedError;

                      case 6:
                        chunk = this._readableStream.read();

                        if (!(chunk === null)) {
                          _context2.next = 10;
                          break;
                        }

                        this._readCapability = (0, _util.createPromiseCapability)();
                        return _context2.abrupt("return", this.read());

                      case 10:
                        this._loaded += chunk.length;

                        if (this.onProgress) {
                          this.onProgress({
                            loaded: this._loaded
                          });
                        }

                        buffer = new Uint8Array(chunk).buffer;
                        return _context2.abrupt("return", {
                          value: buffer,
                          done: false
                        });

                      case 14:
                      case "end":
                        return _context2.stop();
                    }
                  }
                }, _callee2, this);
              }));

              function read() {
                return _read2.apply(this, arguments);
              }

              return read;
            }()
          }, {
            key: "cancel",
            value: function cancel(reason) {
              if (!this._readableStream) {
                this._error(reason);

                return;
              }

              this._readableStream.destroy(reason);
            }
          }, {
            key: "_error",
            value: function _error(reason) {
              this._storedError = reason;

              this._readCapability.resolve();
            }
          }, {
            key: "_setReadableStream",
            value: function _setReadableStream(readableStream) {
              var _this2 = this;

              this._readableStream = readableStream;
              readableStream.on("readable", function () {
                _this2._readCapability.resolve();
              });
              readableStream.on("end", function () {
                readableStream.destroy();
                _this2._done = true;

                _this2._readCapability.resolve();
              });
              readableStream.on("error", function (reason) {
                _this2._error(reason);
              });

              if (this._storedError) {
                this._readableStream.destroy(this._storedError);
              }
            }
          }]);

          return BaseRangeReader;
        }();

        function createRequestOptions(parsedUrl, headers) {
          return {
            protocol: parsedUrl.protocol,
            auth: parsedUrl.auth,
            host: parsedUrl.hostname,
            port: parsedUrl.port,
            path: parsedUrl.path,
            method: "GET",
            headers: headers
          };
        }

        var PDFNodeStreamFullReader = /*#__PURE__*/function (_BaseFullReader) {
          _inherits(PDFNodeStreamFullReader, _BaseFullReader);

          var _super = _createSuper(PDFNodeStreamFullReader);

          function PDFNodeStreamFullReader(stream) {
            var _this3;

            _classCallCheck(this, PDFNodeStreamFullReader);

            _this3 = _super.call(this, stream);

            var handleResponse = function handleResponse(response) {
              if (response.statusCode === 404) {
                var error = new _util.MissingPDFException("Missing PDF \"".concat(_this3._url, "\"."));
                _this3._storedError = error;

                _this3._headersCapability.reject(error);

                return;
              }

              _this3._headersCapability.resolve();

              _this3._setReadableStream(response);

              var getResponseHeader = function getResponseHeader(name) {
                return _this3._readableStream.headers[name.toLowerCase()];
              };

              var _validateRangeRequest = (0, _network_utils.validateRangeRequestCapabilities)({
                getResponseHeader: getResponseHeader,
                isHttp: stream.isHttp,
                rangeChunkSize: _this3._rangeChunkSize,
                disableRange: _this3._disableRange
              }),
                  allowRangeRequests = _validateRangeRequest.allowRangeRequests,
                  suggestedLength = _validateRangeRequest.suggestedLength;

              _this3._isRangeSupported = allowRangeRequests;
              _this3._contentLength = suggestedLength || _this3._contentLength;
              _this3._filename = (0, _network_utils.extractFilenameFromHeader)(getResponseHeader);
            };

            _this3._request = null;

            if (_this3._url.protocol === "http:") {
              _this3._request = http.request(createRequestOptions(_this3._url, stream.httpHeaders), handleResponse);
            } else {
              _this3._request = https.request(createRequestOptions(_this3._url, stream.httpHeaders), handleResponse);
            }

            _this3._request.on("error", function (reason) {
              _this3._storedError = reason;

              _this3._headersCapability.reject(reason);
            });

            _this3._request.end();

            return _this3;
          }

          return PDFNodeStreamFullReader;
        }(BaseFullReader);

        var PDFNodeStreamRangeReader = /*#__PURE__*/function (_BaseRangeReader) {
          _inherits(PDFNodeStreamRangeReader, _BaseRangeReader);

          var _super2 = _createSuper(PDFNodeStreamRangeReader);

          function PDFNodeStreamRangeReader(stream, start, end) {
            var _this4;

            _classCallCheck(this, PDFNodeStreamRangeReader);

            _this4 = _super2.call(this, stream);
            _this4._httpHeaders = {};

            for (var property in stream.httpHeaders) {
              var value = stream.httpHeaders[property];

              if (typeof value === "undefined") {
                continue;
              }

              _this4._httpHeaders[property] = value;
            }

            _this4._httpHeaders.Range = "bytes=".concat(start, "-").concat(end - 1);

            var handleResponse = function handleResponse(response) {
              if (response.statusCode === 404) {
                var error = new _util.MissingPDFException("Missing PDF \"".concat(_this4._url, "\"."));
                _this4._storedError = error;
                return;
              }

              _this4._setReadableStream(response);
            };

            _this4._request = null;

            if (_this4._url.protocol === "http:") {
              _this4._request = http.request(createRequestOptions(_this4._url, _this4._httpHeaders), handleResponse);
            } else {
              _this4._request = https.request(createRequestOptions(_this4._url, _this4._httpHeaders), handleResponse);
            }

            _this4._request.on("error", function (reason) {
              _this4._storedError = reason;
            });

            _this4._request.end();

            return _this4;
          }

          return PDFNodeStreamRangeReader;
        }(BaseRangeReader);

        var PDFNodeStreamFsFullReader = /*#__PURE__*/function (_BaseFullReader2) {
          _inherits(PDFNodeStreamFsFullReader, _BaseFullReader2);

          var _super3 = _createSuper(PDFNodeStreamFsFullReader);

          function PDFNodeStreamFsFullReader(stream) {
            var _this5;

            _classCallCheck(this, PDFNodeStreamFsFullReader);

            _this5 = _super3.call(this, stream);
            var path = decodeURIComponent(_this5._url.path);

            if (fileUriRegex.test(_this5._url.href)) {
              path = path.replace(/^\//, "");
            }

            fs.lstat(path, function (error, stat) {
              if (error) {
                if (error.code === "ENOENT") {
                  error = new _util.MissingPDFException("Missing PDF \"".concat(path, "\"."));
                }

                _this5._storedError = error;

                _this5._headersCapability.reject(error);

                return;
              }

              _this5._contentLength = stat.size;

              _this5._setReadableStream(fs.createReadStream(path));

              _this5._headersCapability.resolve();
            });
            return _this5;
          }

          return PDFNodeStreamFsFullReader;
        }(BaseFullReader);

        var PDFNodeStreamFsRangeReader = /*#__PURE__*/function (_BaseRangeReader2) {
          _inherits(PDFNodeStreamFsRangeReader, _BaseRangeReader2);

          var _super4 = _createSuper(PDFNodeStreamFsRangeReader);

          function PDFNodeStreamFsRangeReader(stream, start, end) {
            var _this6;

            _classCallCheck(this, PDFNodeStreamFsRangeReader);

            _this6 = _super4.call(this, stream);
            var path = decodeURIComponent(_this6._url.path);

            if (fileUriRegex.test(_this6._url.href)) {
              path = path.replace(/^\//, "");
            }

            _this6._setReadableStream(fs.createReadStream(path, {
              start: start,
              end: end - 1
            }));

            return _this6;
          }

          return PDFNodeStreamFsRangeReader;
        }(BaseRangeReader);
        /***/

      },
      /* 137 */

      /***/
      function (__unused_webpack_module, exports, __w_pdfjs_require__) {
        "use strict";

        Object.defineProperty(exports, "__esModule", {
          value: true
        });
        exports.createResponseStatusError = createResponseStatusError;
        exports.extractFilenameFromHeader = extractFilenameFromHeader;
        exports.validateRangeRequestCapabilities = validateRangeRequestCapabilities;
        exports.validateResponseStatus = validateResponseStatus;

        var _util = __w_pdfjs_require__(4);

        var _content_disposition = __w_pdfjs_require__(138);

        var _display_utils = __w_pdfjs_require__(1);

        function validateRangeRequestCapabilities(_ref) {
          var getResponseHeader = _ref.getResponseHeader,
              isHttp = _ref.isHttp,
              rangeChunkSize = _ref.rangeChunkSize,
              disableRange = _ref.disableRange;
          (0, _util.assert)(rangeChunkSize > 0, "Range chunk size must be larger than zero");
          var returnValues = {
            allowRangeRequests: false,
            suggestedLength: undefined
          };
          var length = parseInt(getResponseHeader("Content-Length"), 10);

          if (!Number.isInteger(length)) {
            return returnValues;
          }

          returnValues.suggestedLength = length;

          if (length <= 2 * rangeChunkSize) {
            return returnValues;
          }

          if (disableRange || !isHttp) {
            return returnValues;
          }

          if (getResponseHeader("Accept-Ranges") !== "bytes") {
            return returnValues;
          }

          var contentEncoding = getResponseHeader("Content-Encoding") || "identity";

          if (contentEncoding !== "identity") {
            return returnValues;
          }

          returnValues.allowRangeRequests = true;
          return returnValues;
        }

        function extractFilenameFromHeader(getResponseHeader) {
          var contentDisposition = getResponseHeader("Content-Disposition");

          if (contentDisposition) {
            var filename = (0, _content_disposition.getFilenameFromContentDispositionHeader)(contentDisposition);

            if (filename.includes("%")) {
              try {
                filename = decodeURIComponent(filename);
              } catch (ex) {}
            }

            if ((0, _display_utils.isPdfFile)(filename)) {
              return filename;
            }
          }

          return null;
        }

        function createResponseStatusError(status, url) {
          if (status === 404 || status === 0 && url.startsWith("file:")) {
            return new _util.MissingPDFException('Missing PDF "' + url + '".');
          }

          return new _util.UnexpectedResponseException("Unexpected server response (".concat(status, ") while retrieving PDF \"").concat(url, "\"."), status);
        }

        function validateResponseStatus(status) {
          return status === 200 || status === 206;
        }
        /***/

      },
      /* 138 */

      /***/
      function (__unused_webpack_module, exports, __w_pdfjs_require__) {
        "use strict";

        Object.defineProperty(exports, "__esModule", {
          value: true
        });
        exports.getFilenameFromContentDispositionHeader = getFilenameFromContentDispositionHeader;

        var _util = __w_pdfjs_require__(4);

        function _slicedToArray(arr, i) {
          return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
        }

        function _nonIterableRest() {
          throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
        }

        function _unsupportedIterableToArray(o, minLen) {
          if (!o) return;
          if (typeof o === "string") return _arrayLikeToArray(o, minLen);
          var n = Object.prototype.toString.call(o).slice(8, -1);
          if (n === "Object" && o.constructor) n = o.constructor.name;
          if (n === "Map" || n === "Set") return Array.from(o);
          if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
        }

        function _arrayLikeToArray(arr, len) {
          if (len == null || len > arr.length) len = arr.length;

          for (var i = 0, arr2 = new Array(len); i < len; i++) {
            arr2[i] = arr[i];
          }

          return arr2;
        }

        function _iterableToArrayLimit(arr, i) {
          var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];

          if (_i == null) return;
          var _arr = [];
          var _n = true;
          var _d = false;

          var _s, _e;

          try {
            for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
              _arr.push(_s.value);

              if (i && _arr.length === i) break;
            }
          } catch (err) {
            _d = true;
            _e = err;
          } finally {
            try {
              if (!_n && _i["return"] != null) _i["return"]();
            } finally {
              if (_d) throw _e;
            }
          }

          return _arr;
        }

        function _arrayWithHoles(arr) {
          if (Array.isArray(arr)) return arr;
        }

        function getFilenameFromContentDispositionHeader(contentDisposition) {
          var needsEncodingFixup = true;
          var tmp = toParamRegExp("filename\\*", "i").exec(contentDisposition);

          if (tmp) {
            tmp = tmp[1];
            var filename = rfc2616unquote(tmp);
            filename = unescape(filename);
            filename = rfc5987decode(filename);
            filename = rfc2047decode(filename);
            return fixupEncoding(filename);
          }

          tmp = rfc2231getparam(contentDisposition);

          if (tmp) {
            var _filename = rfc2047decode(tmp);

            return fixupEncoding(_filename);
          }

          tmp = toParamRegExp("filename", "i").exec(contentDisposition);

          if (tmp) {
            tmp = tmp[1];

            var _filename2 = rfc2616unquote(tmp);

            _filename2 = rfc2047decode(_filename2);
            return fixupEncoding(_filename2);
          }

          function toParamRegExp(attributePattern, flags) {
            return new RegExp("(?:^|;)\\s*" + attributePattern + "\\s*=\\s*" + "(" + '[^";\\s][^;\\s]*' + "|" + '"(?:[^"\\\\]|\\\\"?)+"?' + ")", flags);
          }

          function textdecode(encoding, value) {
            if (encoding) {
              if (!/^[\x00-\xFF]+$/.test(value)) {
                return value;
              }

              try {
                var decoder = new TextDecoder(encoding, {
                  fatal: true
                });
                var buffer = (0, _util.stringToBytes)(value);
                value = decoder.decode(buffer);
                needsEncodingFixup = false;
              } catch (e) {
                if (/^utf-?8$/i.test(encoding)) {
                  try {
                    value = decodeURIComponent(escape(value));
                    needsEncodingFixup = false;
                  } catch (err) {}
                }
              }
            }

            return value;
          }

          function fixupEncoding(value) {
            if (needsEncodingFixup && /[\x80-\xff]/.test(value)) {
              value = textdecode("utf-8", value);

              if (needsEncodingFixup) {
                value = textdecode("iso-8859-1", value);
              }
            }

            return value;
          }

          function rfc2231getparam(contentDispositionStr) {
            var matches = [];
            var match;
            var iter = toParamRegExp("filename\\*((?!0\\d)\\d+)(\\*?)", "ig");

            while ((match = iter.exec(contentDispositionStr)) !== null) {
              var _match = match,
                  _match2 = _slicedToArray(_match, 4),
                  n = _match2[1],
                  quot = _match2[2],
                  part = _match2[3];

              n = parseInt(n, 10);

              if (n in matches) {
                if (n === 0) {
                  break;
                }

                continue;
              }

              matches[n] = [quot, part];
            }

            var parts = [];

            for (var _n2 = 0; _n2 < matches.length; ++_n2) {
              if (!(_n2 in matches)) {
                break;
              }

              var _matches$_n = _slicedToArray(matches[_n2], 2),
                  _quot = _matches$_n[0],
                  _part = _matches$_n[1];

              _part = rfc2616unquote(_part);

              if (_quot) {
                _part = unescape(_part);

                if (_n2 === 0) {
                  _part = rfc5987decode(_part);
                }
              }

              parts.push(_part);
            }

            return parts.join("");
          }

          function rfc2616unquote(value) {
            if (value.startsWith('"')) {
              var parts = value.slice(1).split('\\"');

              for (var i = 0; i < parts.length; ++i) {
                var quotindex = parts[i].indexOf('"');

                if (quotindex !== -1) {
                  parts[i] = parts[i].slice(0, quotindex);
                  parts.length = i + 1;
                }

                parts[i] = parts[i].replace(/\\(.)/g, "$1");
              }

              value = parts.join('"');
            }

            return value;
          }

          function rfc5987decode(extvalue) {
            var encodingend = extvalue.indexOf("'");

            if (encodingend === -1) {
              return extvalue;
            }

            var encoding = extvalue.slice(0, encodingend);
            var langvalue = extvalue.slice(encodingend + 1);
            var value = langvalue.replace(/^[^']*'/, "");
            return textdecode(encoding, value);
          }

          function rfc2047decode(value) {
            if (!value.startsWith("=?") || /[\x00-\x19\x80-\xff]/.test(value)) {
              return value;
            }

            return value.replace(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g, function (matches, charset, encoding, text) {
              if (encoding === "q" || encoding === "Q") {
                text = text.replace(/_/g, " ");
                text = text.replace(/=([0-9a-fA-F]{2})/g, function (match, hex) {
                  return String.fromCharCode(parseInt(hex, 16));
                });
                return textdecode(charset, text);
              }

              try {
                text = atob(text);
              } catch (e) {}

              return textdecode(charset, text);
            });
          }

          return "";
        }
        /***/

      },
      /* 139 */

      /***/
      function (__unused_webpack_module, exports, __w_pdfjs_require__) {
        "use strict";

        Object.defineProperty(exports, "__esModule", {
          value: true
        });
        exports.PDFNetworkStream = void 0;

        var _regenerator = _interopRequireDefault(__w_pdfjs_require__(2));

        var _util = __w_pdfjs_require__(4);

        var _network_utils = __w_pdfjs_require__(137);

        function _interopRequireDefault(obj) {
          return obj && obj.__esModule ? obj : {
            "default": obj
          };
        }

        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 self = this,
                args = arguments;
            return new Promise(function (resolve, reject) {
              var gen = fn.apply(self, args);

              function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
              }

              function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
              }

              _next(undefined);
            });
          };
        }

        function _createForOfIteratorHelper(o, allowArrayLike) {
          var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];

          if (!it) {
            if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
              if (it) o = it;
              var i = 0;

              var F = function F() {};

              return {
                s: F,
                n: function n() {
                  if (i >= o.length) return {
                    done: true
                  };
                  return {
                    done: false,
                    value: o[i++]
                  };
                },
                e: function e(_e) {
                  throw _e;
                },
                f: F
              };
            }

            throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
          }

          var normalCompletion = true,
              didErr = false,
              err;
          return {
            s: function s() {
              it = it.call(o);
            },
            n: function n() {
              var step = it.next();
              normalCompletion = step.done;
              return step;
            },
            e: function e(_e2) {
              didErr = true;
              err = _e2;
            },
            f: function f() {
              try {
                if (!normalCompletion && it["return"] != null) it["return"]();
              } finally {
                if (didErr) throw err;
              }
            }
          };
        }

        function _unsupportedIterableToArray(o, minLen) {
          if (!o) return;
          if (typeof o === "string") return _arrayLikeToArray(o, minLen);
          var n = Object.prototype.toString.call(o).slice(8, -1);
          if (n === "Object" && o.constructor) n = o.constructor.name;
          if (n === "Map" || n === "Set") return Array.from(o);
          if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
        }

        function _arrayLikeToArray(arr, len) {
          if (len == null || len > arr.length) len = arr.length;

          for (var i = 0, arr2 = new Array(len); i < len; i++) {
            arr2[i] = arr[i];
          }

          return arr2;
        }

        function _classCallCheck(instance, Constructor) {
          if (!(instance instanceof Constructor)) {
            throw new TypeError("Cannot call a class as a function");
          }
        }

        function _defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];
            descriptor.enumerable = descriptor.enumerable || false;
            descriptor.configurable = true;
            if ("value" in descriptor) descriptor.writable = true;
            Object.defineProperty(target, descriptor.key, descriptor);
          }
        }

        function _createClass(Constructor, protoProps, staticProps) {
          if (protoProps) _defineProperties(Constructor.prototype, protoProps);
          if (staticProps) _defineProperties(Constructor, staticProps);
          return Constructor;
        }

        ;
        var OK_RESPONSE = 200;
        var PARTIAL_CONTENT_RESPONSE = 206;

        function getArrayBuffer(xhr) {
          var data = xhr.response;

          if (typeof data !== "string") {
            return data;
          }

          var array = (0, _util.stringToBytes)(data);
          return array.buffer;
        }

        var NetworkManager = /*#__PURE__*/function () {
          function NetworkManager(url) {
            var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

            _classCallCheck(this, NetworkManager);

            this.url = url;
            this.isHttp = /^https?:/i.test(url);
            this.httpHeaders = this.isHttp && args.httpHeaders || Object.create(null);
            this.withCredentials = args.withCredentials || false;

            this.getXhr = args.getXhr || function NetworkManager_getXhr() {
              return new XMLHttpRequest();
            };

            this.currXhrId = 0;
            this.pendingRequests = Object.create(null);
          }

          _createClass(NetworkManager, [{
            key: "requestRange",
            value: function requestRange(begin, end, listeners) {
              var args = {
                begin: begin,
                end: end
              };

              for (var prop in listeners) {
                args[prop] = listeners[prop];
              }

              return this.request(args);
            }
          }, {
            key: "requestFull",
            value: function requestFull(listeners) {
              return this.request(listeners);
            }
          }, {
            key: "request",
            value: function request(args) {
              var xhr = this.getXhr();
              var xhrId = this.currXhrId++;
              var pendingRequest = this.pendingRequests[xhrId] = {
                xhr: xhr
              };
              xhr.open("GET", this.url);
              xhr.withCredentials = this.withCredentials;

              for (var property in this.httpHeaders) {
                var value = this.httpHeaders[property];

                if (typeof value === "undefined") {
                  continue;
                }

                xhr.setRequestHeader(property, value);
              }

              if (this.isHttp && "begin" in args && "end" in args) {
                xhr.setRequestHeader("Range", "bytes=".concat(args.begin, "-").concat(args.end - 1));
                pendingRequest.expectedStatus = PARTIAL_CONTENT_RESPONSE;
              } else {
                pendingRequest.expectedStatus = OK_RESPONSE;
              }

              xhr.responseType = "arraybuffer";

              if (args.onError) {
                xhr.onerror = function (evt) {
                  args.onError(xhr.status);
                };
              }

              xhr.onreadystatechange = this.onStateChange.bind(this, xhrId);
              xhr.onprogress = this.onProgress.bind(this, xhrId);
              pendingRequest.onHeadersReceived = args.onHeadersReceived;
              pendingRequest.onDone = args.onDone;
              pendingRequest.onError = args.onError;
              pendingRequest.onProgress = args.onProgress;
              xhr.send(null);
              return xhrId;
            }
          }, {
            key: "onProgress",
            value: function onProgress(xhrId, evt) {
              var _pendingRequest$onPro;

              var pendingRequest = this.pendingRequests[xhrId];

              if (!pendingRequest) {
                return;
              }

              (_pendingRequest$onPro = pendingRequest.onProgress) === null || _pendingRequest$onPro === void 0 ? void 0 : _pendingRequest$onPro.call(pendingRequest, evt);
            }
          }, {
            key: "onStateChange",
            value: function onStateChange(xhrId, evt) {
              var pendingRequest = this.pendingRequests[xhrId];

              if (!pendingRequest) {
                return;
              }

              var xhr = pendingRequest.xhr;

              if (xhr.readyState >= 2 && pendingRequest.onHeadersReceived) {
                pendingRequest.onHeadersReceived();
                delete pendingRequest.onHeadersReceived;
              }

              if (xhr.readyState !== 4) {
                return;
              }

              if (!(xhrId in this.pendingRequests)) {
                return;
              }

              delete this.pendingRequests[xhrId];

              if (xhr.status === 0 && this.isHttp) {
                var _pendingRequest$onErr;

                (_pendingRequest$onErr = pendingRequest.onError) === null || _pendingRequest$onErr === void 0 ? void 0 : _pendingRequest$onErr.call(pendingRequest, xhr.status);
                return;
              }

              var xhrStatus = xhr.status || OK_RESPONSE;
              var ok_response_on_range_request = xhrStatus === OK_RESPONSE && pendingRequest.expectedStatus === PARTIAL_CONTENT_RESPONSE;

              if (!ok_response_on_range_request && xhrStatus !== pendingRequest.expectedStatus) {
                var _pendingRequest$onErr2;

                (_pendingRequest$onErr2 = pendingRequest.onError) === null || _pendingRequest$onErr2 === void 0 ? void 0 : _pendingRequest$onErr2.call(pendingRequest, xhr.status);
                return;
              }

              var chunk = getArrayBuffer(xhr);

              if (xhrStatus === PARTIAL_CONTENT_RESPONSE) {
                var rangeHeader = xhr.getResponseHeader("Content-Range");
                var matches = /bytes (\d+)-(\d+)\/(\d+)/.exec(rangeHeader);
                pendingRequest.onDone({
                  begin: parseInt(matches[1], 10),
                  chunk: chunk
                });
              } else if (chunk) {
                pendingRequest.onDone({
                  begin: 0,
                  chunk: chunk
                });
              } else {
                var _pendingRequest$onErr3;

                (_pendingRequest$onErr3 = pendingRequest.onError) === null || _pendingRequest$onErr3 === void 0 ? void 0 : _pendingRequest$onErr3.call(pendingRequest, xhr.status);
              }
            }
          }, {
            key: "getRequestXhr",
            value: function getRequestXhr(xhrId) {
              return this.pendingRequests[xhrId].xhr;
            }
          }, {
            key: "isPendingRequest",
            value: function isPendingRequest(xhrId) {
              return xhrId in this.pendingRequests;
            }
          }, {
            key: "abortRequest",
            value: function abortRequest(xhrId) {
              var xhr = this.pendingRequests[xhrId].xhr;
              delete this.pendingRequests[xhrId];
              xhr.abort();
            }
          }]);

          return NetworkManager;
        }();

        var PDFNetworkStream = /*#__PURE__*/function () {
          function PDFNetworkStream(source) {
            _classCallCheck(this, PDFNetworkStream);

            this._source = source;
            this._manager = new NetworkManager(source.url, {
              httpHeaders: source.httpHeaders,
              withCredentials: source.withCredentials
            });
            this._rangeChunkSize = source.rangeChunkSize;
            this._fullRequestReader = null;
            this._rangeRequestReaders = [];
          }

          _createClass(PDFNetworkStream, [{
            key: "_onRangeRequestReaderClosed",
            value: function _onRangeRequestReaderClosed(reader) {
              var i = this._rangeRequestReaders.indexOf(reader);

              if (i >= 0) {
                this._rangeRequestReaders.splice(i, 1);
              }
            }
          }, {
            key: "getFullReader",
            value: function getFullReader() {
              (0, _util.assert)(!this._fullRequestReader, "PDFNetworkStream.getFullReader can only be called once.");
              this._fullRequestReader = new PDFNetworkStreamFullRequestReader(this._manager, this._source);
              return this._fullRequestReader;
            }
          }, {
            key: "getRangeReader",
            value: function getRangeReader(begin, end) {
              var reader = new PDFNetworkStreamRangeRequestReader(this._manager, begin, end);
              reader.onClosed = this._onRangeRequestReaderClosed.bind(this);

              this._rangeRequestReaders.push(reader);

              return reader;
            }
          }, {
            key: "cancelAllRequests",
            value: function cancelAllRequests(reason) {
              var _this$_fullRequestRea;

              (_this$_fullRequestRea = this._fullRequestReader) === null || _this$_fullRequestRea === void 0 ? void 0 : _this$_fullRequestRea.cancel(reason);

              var _iterator = _createForOfIteratorHelper(this._rangeRequestReaders.slice(0)),
                  _step;

              try {
                for (_iterator.s(); !(_step = _iterator.n()).done;) {
                  var reader = _step.value;
                  reader.cancel(reason);
                }
              } catch (err) {
                _iterator.e(err);
              } finally {
                _iterator.f();
              }
            }
          }]);

          return PDFNetworkStream;
        }();

        exports.PDFNetworkStream = PDFNetworkStream;

        var PDFNetworkStreamFullRequestReader = /*#__PURE__*/function () {
          function PDFNetworkStreamFullRequestReader(manager, source) {
            _classCallCheck(this, PDFNetworkStreamFullRequestReader);

            this._manager = manager;
            var args = {
              onHeadersReceived: this._onHeadersReceived.bind(this),
              onDone: this._onDone.bind(this),
              onError: this._onError.bind(this),
              onProgress: this._onProgress.bind(this)
            };
            this._url = source.url;
            this._fullRequestId = manager.requestFull(args);
            this._headersReceivedCapability = (0, _util.createPromiseCapability)();
            this._disableRange = source.disableRange || false;
            this._contentLength = source.length;
            this._rangeChunkSize = source.rangeChunkSize;

            if (!this._rangeChunkSize && !this._disableRange) {
              this._disableRange = true;
            }

            this._isStreamingSupported = false;
            this._isRangeSupported = false;
            this._cachedChunks = [];
            this._requests = [];
            this._done = false;
            this._storedError = undefined;
            this._filename = null;
            this.onProgress = null;
          }

          _createClass(PDFNetworkStreamFullRequestReader, [{
            key: "_onHeadersReceived",
            value: function _onHeadersReceived() {
              var fullRequestXhrId = this._fullRequestId;

              var fullRequestXhr = this._manager.getRequestXhr(fullRequestXhrId);

              var getResponseHeader = function getResponseHeader(name) {
                return fullRequestXhr.getResponseHeader(name);
              };

              var _validateRangeRequest = (0, _network_utils.validateRangeRequestCapabilities)({
                getResponseHeader: getResponseHeader,
                isHttp: this._manager.isHttp,
                rangeChunkSize: this._rangeChunkSize,
                disableRange: this._disableRange
              }),
                  allowRangeRequests = _validateRangeRequest.allowRangeRequests,
                  suggestedLength = _validateRangeRequest.suggestedLength;

              if (allowRangeRequests) {
                this._isRangeSupported = true;
              }

              this._contentLength = suggestedLength || this._contentLength;
              this._filename = (0, _network_utils.extractFilenameFromHeader)(getResponseHeader);

              if (this._isRangeSupported) {
                this._manager.abortRequest(fullRequestXhrId);
              }

              this._headersReceivedCapability.resolve();
            }
          }, {
            key: "_onDone",
            value: function _onDone(data) {
              if (data) {
                if (this._requests.length > 0) {
                  var requestCapability = this._requests.shift();

                  requestCapability.resolve({
                    value: data.chunk,
                    done: false
                  });
                } else {
                  this._cachedChunks.push(data.chunk);
                }
              }

              this._done = true;

              if (this._cachedChunks.length > 0) {
                return;
              }

              var _iterator2 = _createForOfIteratorHelper(this._requests),
                  _step2;

              try {
                for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
                  var _requestCapability = _step2.value;

                  _requestCapability.resolve({
                    value: undefined,
                    done: true
                  });
                }
              } catch (err) {
                _iterator2.e(err);
              } finally {
                _iterator2.f();
              }

              this._requests.length = 0;
            }
          }, {
            key: "_onError",
            value: function _onError(status) {
              this._storedError = (0, _network_utils.createResponseStatusError)(status, this._url);

              this._headersReceivedCapability.reject(this._storedError);

              var _iterator3 = _createForOfIteratorHelper(this._requests),
                  _step3;

              try {
                for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
                  var requestCapability = _step3.value;
                  requestCapability.reject(this._storedError);
                }
              } catch (err) {
                _iterator3.e(err);
              } finally {
                _iterator3.f();
              }

              this._requests.length = 0;
              this._cachedChunks.length = 0;
            }
          }, {
            key: "_onProgress",
            value: function _onProgress(evt) {
              var _this$onProgress;

              (_this$onProgress = this.onProgress) === null || _this$onProgress === void 0 ? void 0 : _this$onProgress.call(this, {
                loaded: evt.loaded,
                total: evt.lengthComputable ? evt.total : this._contentLength
              });
            }
          }, {
            key: "filename",
            get: function get() {
              return this._filename;
            }
          }, {
            key: "isRangeSupported",
            get: function get() {
              return this._isRangeSupported;
            }
          }, {
            key: "isStreamingSupported",
            get: function get() {
              return this._isStreamingSupported;
            }
          }, {
            key: "contentLength",
            get: function get() {
              return this._contentLength;
            }
          }, {
            key: "headersReady",
            get: function get() {
              return this._headersReceivedCapability.promise;
            }
          }, {
            key: "read",
            value: function () {
              var _read = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
                var chunk, requestCapability;
                return _regenerator["default"].wrap(function _callee$(_context) {
                  while (1) {
                    switch (_context.prev = _context.next) {
                      case 0:
                        if (!this._storedError) {
                          _context.next = 2;
                          break;
                        }

                        throw this._storedError;

                      case 2:
                        if (!(this._cachedChunks.length > 0)) {
                          _context.next = 5;
                          break;
                        }

                        chunk = this._cachedChunks.shift();
                        return _context.abrupt("return", {
                          value: chunk,
                          done: false
                        });

                      case 5:
                        if (!this._done) {
                          _context.next = 7;
                          break;
                        }

                        return _context.abrupt("return", {
                          value: undefined,
                          done: true
                        });

                      case 7:
                        requestCapability = (0, _util.createPromiseCapability)();

                        this._requests.push(requestCapability);

                        return _context.abrupt("return", requestCapability.promise);

                      case 10:
                      case "end":
                        return _context.stop();
                    }
                  }
                }, _callee, this);
              }));

              function read() {
                return _read.apply(this, arguments);
              }

              return read;
            }()
          }, {
            key: "cancel",
            value: function cancel(reason) {
              this._done = true;

              this._headersReceivedCapability.reject(reason);

              var _iterator4 = _createForOfIteratorHelper(this._requests),
                  _step4;

              try {
                for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
                  var requestCapability = _step4.value;
                  requestCapability.resolve({
                    value: undefined,
                    done: true
                  });
                }
              } catch (err) {
                _iterator4.e(err);
              } finally {
                _iterator4.f();
              }

              this._requests.length = 0;

              if (this._manager.isPendingRequest(this._fullRequestId)) {
                this._manager.abortRequest(this._fullRequestId);
              }

              this._fullRequestReader = null;
            }
          }]);

          return PDFNetworkStreamFullRequestReader;
        }();

        var PDFNetworkStreamRangeRequestReader = /*#__PURE__*/function () {
          function PDFNetworkStreamRangeRequestReader(manager, begin, end) {
            _classCallCheck(this, PDFNetworkStreamRangeRequestReader);

            this._manager = manager;
            var args = {
              onDone: this._onDone.bind(this),
              onError: this._onError.bind(this),
              onProgress: this._onProgress.bind(this)
            };
            this._url = manager.url;
            this._requestId = manager.requestRange(begin, end, args);
            this._requests = [];
            this._queuedChunk = null;
            this._done = false;
            this._storedError = undefined;
            this.onProgress = null;
            this.onClosed = null;
          }

          _createClass(PDFNetworkStreamRangeRequestReader, [{
            key: "_close",
            value: function _close() {
              var _this$onClosed;

              (_this$onClosed = this.onClosed) === null || _this$onClosed === void 0 ? void 0 : _this$onClosed.call(this, this);
            }
          }, {
            key: "_onDone",
            value: function _onDone(data) {
              var chunk = data.chunk;

              if (this._requests.length > 0) {
                var requestCapability = this._requests.shift();

                requestCapability.resolve({
                  value: chunk,
                  done: false
                });
              } else {
                this._queuedChunk = chunk;
              }

              this._done = true;

              var _iterator5 = _createForOfIteratorHelper(this._requests),
                  _step5;

              try {
                for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
                  var _requestCapability2 = _step5.value;

                  _requestCapability2.resolve({
                    value: undefined,
                    done: true
                  });
                }
              } catch (err) {
                _iterator5.e(err);
              } finally {
                _iterator5.f();
              }

              this._requests.length = 0;

              this._close();
            }
          }, {
            key: "_onError",
            value: function _onError(status) {
              this._storedError = (0, _network_utils.createResponseStatusError)(status, this._url);

              var _iterator6 = _createForOfIteratorHelper(this._requests),
                  _step6;

              try {
                for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
                  var requestCapability = _step6.value;
                  requestCapability.reject(this._storedError);
                }
              } catch (err) {
                _iterator6.e(err);
              } finally {
                _iterator6.f();
              }

              this._requests.length = 0;
              this._queuedChunk = null;
            }
          }, {
            key: "_onProgress",
            value: function _onProgress(evt) {
              if (!this.isStreamingSupported) {
                var _this$onProgress2;

                (_this$onProgress2 = this.onProgress) === null || _this$onProgress2 === void 0 ? void 0 : _this$onProgress2.call(this, {
                  loaded: evt.loaded
                });
              }
            }
          }, {
            key: "isStreamingSupported",
            get: function get() {
              return false;
            }
          }, {
            key: "read",
            value: function () {
              var _read2 = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
                var chunk, requestCapability;
                return _regenerator["default"].wrap(function _callee2$(_context2) {
                  while (1) {
                    switch (_context2.prev = _context2.next) {
                      case 0:
                        if (!this._storedError) {
                          _context2.next = 2;
                          break;
                        }

                        throw this._storedError;

                      case 2:
                        if (!(this._queuedChunk !== null)) {
                          _context2.next = 6;
                          break;
                        }

                        chunk = this._queuedChunk;
                        this._queuedChunk = null;
                        return _context2.abrupt("return", {
                          value: chunk,
                          done: false
                        });

                      case 6:
                        if (!this._done) {
                          _context2.next = 8;
                          break;
                        }

                        return _context2.abrupt("return", {
                          value: undefined,
                          done: true
                        });

                      case 8:
                        requestCapability = (0, _util.createPromiseCapability)();

                        this._requests.push(requestCapability);

                        return _context2.abrupt("return", requestCapability.promise);

                      case 11:
                      case "end":
                        return _context2.stop();
                    }
                  }
                }, _callee2, this);
              }));

              function read() {
                return _read2.apply(this, arguments);
              }

              return read;
            }()
          }, {
            key: "cancel",
            value: function cancel(reason) {
              this._done = true;

              var _iterator7 = _createForOfIteratorHelper(this._requests),
                  _step7;

              try {
                for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
                  var requestCapability = _step7.value;
                  requestCapability.resolve({
                    value: undefined,
                    done: true
                  });
                }
              } catch (err) {
                _iterator7.e(err);
              } finally {
                _iterator7.f();
              }

              this._requests.length = 0;

              if (this._manager.isPendingRequest(this._requestId)) {
                this._manager.abortRequest(this._requestId);
              }

              this._close();
            }
          }]);

          return PDFNetworkStreamRangeRequestReader;
        }();
        /***/

      },
      /* 140 */

      /***/
      function (__unused_webpack_module, exports, __w_pdfjs_require__) {
        "use strict";

        Object.defineProperty(exports, "__esModule", {
          value: true
        });
        exports.PDFFetchStream = void 0;

        var _regenerator = _interopRequireDefault(__w_pdfjs_require__(2));

        var _util = __w_pdfjs_require__(4);

        var _network_utils = __w_pdfjs_require__(137);

        function _interopRequireDefault(obj) {
          return obj && obj.__esModule ? obj : {
            "default": obj
          };
        }

        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 self = this,
                args = arguments;
            return new Promise(function (resolve, reject) {
              var gen = fn.apply(self, args);

              function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
              }

              function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
              }

              _next(undefined);
            });
          };
        }

        function _createForOfIteratorHelper(o, allowArrayLike) {
          var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];

          if (!it) {
            if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
              if (it) o = it;
              var i = 0;

              var F = function F() {};

              return {
                s: F,
                n: function n() {
                  if (i >= o.length) return {
                    done: true
                  };
                  return {
                    done: false,
                    value: o[i++]
                  };
                },
                e: function e(_e) {
                  throw _e;
                },
                f: F
              };
            }

            throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
          }

          var normalCompletion = true,
              didErr = false,
              err;
          return {
            s: function s() {
              it = it.call(o);
            },
            n: function n() {
              var step = it.next();
              normalCompletion = step.done;
              return step;
            },
            e: function e(_e2) {
              didErr = true;
              err = _e2;
            },
            f: function f() {
              try {
                if (!normalCompletion && it["return"] != null) it["return"]();
              } finally {
                if (didErr) throw err;
              }
            }
          };
        }

        function _unsupportedIterableToArray(o, minLen) {
          if (!o) return;
          if (typeof o === "string") return _arrayLikeToArray(o, minLen);
          var n = Object.prototype.toString.call(o).slice(8, -1);
          if (n === "Object" && o.constructor) n = o.constructor.name;
          if (n === "Map" || n === "Set") return Array.from(o);
          if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
        }

        function _arrayLikeToArray(arr, len) {
          if (len == null || len > arr.length) len = arr.length;

          for (var i = 0, arr2 = new Array(len); i < len; i++) {
            arr2[i] = arr[i];
          }

          return arr2;
        }

        function _classCallCheck(instance, Constructor) {
          if (!(instance instanceof Constructor)) {
            throw new TypeError("Cannot call a class as a function");
          }
        }

        function _defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];
            descriptor.enumerable = descriptor.enumerable || false;
            descriptor.configurable = true;
            if ("value" in descriptor) descriptor.writable = true;
            Object.defineProperty(target, descriptor.key, descriptor);
          }
        }

        function _createClass(Constructor, protoProps, staticProps) {
          if (protoProps) _defineProperties(Constructor.prototype, protoProps);
          if (staticProps) _defineProperties(Constructor, staticProps);
          return Constructor;
        }

        ;

        function createFetchOptions(headers, withCredentials, abortController) {
          return {
            method: "GET",
            headers: headers,
            signal: abortController === null || abortController === void 0 ? void 0 : abortController.signal,
            mode: "cors",
            credentials: withCredentials ? "include" : "same-origin",
            redirect: "follow"
          };
        }

        function createHeaders(httpHeaders) {
          var headers = new Headers();

          for (var property in httpHeaders) {
            var value = httpHeaders[property];

            if (typeof value === "undefined") {
              continue;
            }

            headers.append(property, value);
          }

          return headers;
        }

        var PDFFetchStream = /*#__PURE__*/function () {
          function PDFFetchStream(source) {
            _classCallCheck(this, PDFFetchStream);

            this.source = source;
            this.isHttp = /^https?:/i.test(source.url);
            this.httpHeaders = this.isHttp && source.httpHeaders || {};
            this._fullRequestReader = null;
            this._rangeRequestReaders = [];
          }

          _createClass(PDFFetchStream, [{
            key: "_progressiveDataLength",
            get: function get() {
              var _this$_fullRequestRea, _this$_fullRequestRea2;

              return (_this$_fullRequestRea = (_this$_fullRequestRea2 = this._fullRequestReader) === null || _this$_fullRequestRea2 === void 0 ? void 0 : _this$_fullRequestRea2._loaded) !== null && _this$_fullRequestRea !== void 0 ? _this$_fullRequestRea : 0;
            }
          }, {
            key: "getFullReader",
            value: function getFullReader() {
              (0, _util.assert)(!this._fullRequestReader, "PDFFetchStream.getFullReader can only be called once.");
              this._fullRequestReader = new PDFFetchStreamReader(this);
              return this._fullRequestReader;
            }
          }, {
            key: "getRangeReader",
            value: function getRangeReader(begin, end) {
              if (end <= this._progressiveDataLength) {
                return null;
              }

              var reader = new PDFFetchStreamRangeReader(this, begin, end);

              this._rangeRequestReaders.push(reader);

              return reader;
            }
          }, {
            key: "cancelAllRequests",
            value: function cancelAllRequests(reason) {
              if (this._fullRequestReader) {
                this._fullRequestReader.cancel(reason);
              }

              var _iterator = _createForOfIteratorHelper(this._rangeRequestReaders.slice(0)),
                  _step;

              try {
                for (_iterator.s(); !(_step = _iterator.n()).done;) {
                  var reader = _step.value;
                  reader.cancel(reason);
                }
              } catch (err) {
                _iterator.e(err);
              } finally {
                _iterator.f();
              }
            }
          }]);

          return PDFFetchStream;
        }();

        exports.PDFFetchStream = PDFFetchStream;

        var PDFFetchStreamReader = /*#__PURE__*/function () {
          function PDFFetchStreamReader(stream) {
            var _this = this;

            _classCallCheck(this, PDFFetchStreamReader);

            this._stream = stream;
            this._reader = null;
            this._loaded = 0;
            this._filename = null;
            var source = stream.source;
            this._withCredentials = source.withCredentials || false;
            this._contentLength = source.length;
            this._headersCapability = (0, _util.createPromiseCapability)();
            this._disableRange = source.disableRange || false;
            this._rangeChunkSize = source.rangeChunkSize;

            if (!this._rangeChunkSize && !this._disableRange) {
              this._disableRange = true;
            }

            if (typeof AbortController !== "undefined") {
              this._abortController = new AbortController();
            }

            this._isStreamingSupported = !source.disableStream;
            this._isRangeSupported = !source.disableRange;
            this._headers = createHeaders(this._stream.httpHeaders);
            var url = source.url;
            fetch(url, createFetchOptions(this._headers, this._withCredentials, this._abortController)).then(function (response) {
              if (!(0, _network_utils.validateResponseStatus)(response.status)) {
                throw (0, _network_utils.createResponseStatusError)(response.status, url);
              }

              _this._reader = response.body.getReader();

              _this._headersCapability.resolve();

              var getResponseHeader = function getResponseHeader(name) {
                return response.headers.get(name);
              };

              var _validateRangeRequest = (0, _network_utils.validateRangeRequestCapabilities)({
                getResponseHeader: getResponseHeader,
                isHttp: _this._stream.isHttp,
                rangeChunkSize: _this._rangeChunkSize,
                disableRange: _this._disableRange
              }),
                  allowRangeRequests = _validateRangeRequest.allowRangeRequests,
                  suggestedLength = _validateRangeRequest.suggestedLength;

              _this._isRangeSupported = allowRangeRequests;
              _this._contentLength = suggestedLength || _this._contentLength;
              _this._filename = (0, _network_utils.extractFilenameFromHeader)(getResponseHeader);

              if (!_this._isStreamingSupported && _this._isRangeSupported) {
                _this.cancel(new _util.AbortException("Streaming is disabled."));
              }
            })["catch"](this._headersCapability.reject);
            this.onProgress = null;
          }

          _createClass(PDFFetchStreamReader, [{
            key: "headersReady",
            get: function get() {
              return this._headersCapability.promise;
            }
          }, {
            key: "filename",
            get: function get() {
              return this._filename;
            }
          }, {
            key: "contentLength",
            get: function get() {
              return this._contentLength;
            }
          }, {
            key: "isRangeSupported",
            get: function get() {
              return this._isRangeSupported;
            }
          }, {
            key: "isStreamingSupported",
            get: function get() {
              return this._isStreamingSupported;
            }
          }, {
            key: "read",
            value: function () {
              var _read = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
                var _yield$this$_reader$r, value, done, buffer;

                return _regenerator["default"].wrap(function _callee$(_context) {
                  while (1) {
                    switch (_context.prev = _context.next) {
                      case 0:
                        _context.next = 2;
                        return this._headersCapability.promise;

                      case 2:
                        _context.next = 4;
                        return this._reader.read();

                      case 4:
                        _yield$this$_reader$r = _context.sent;
                        value = _yield$this$_reader$r.value;
                        done = _yield$this$_reader$r.done;

                        if (!done) {
                          _context.next = 9;
                          break;
                        }

                        return _context.abrupt("return", {
                          value: value,
                          done: done
                        });

                      case 9:
                        this._loaded += value.byteLength;

                        if (this.onProgress) {
                          this.onProgress({
                            loaded: this._loaded,
                            total: this._contentLength
                          });
                        }

                        buffer = new Uint8Array(value).buffer;
                        return _context.abrupt("return", {
                          value: buffer,
                          done: false
                        });

                      case 13:
                      case "end":
                        return _context.stop();
                    }
                  }
                }, _callee, this);
              }));

              function read() {
                return _read.apply(this, arguments);
              }

              return read;
            }()
          }, {
            key: "cancel",
            value: function cancel(reason) {
              if (this._reader) {
                this._reader.cancel(reason);
              }

              if (this._abortController) {
                this._abortController.abort();
              }
            }
          }]);

          return PDFFetchStreamReader;
        }();

        var PDFFetchStreamRangeReader = /*#__PURE__*/function () {
          function PDFFetchStreamRangeReader(stream, begin, end) {
            var _this2 = this;

            _classCallCheck(this, PDFFetchStreamRangeReader);

            this._stream = stream;
            this._reader = null;
            this._loaded = 0;
            var source = stream.source;
            this._withCredentials = source.withCredentials || false;
            this._readCapability = (0, _util.createPromiseCapability)();
            this._isStreamingSupported = !source.disableStream;

            if (typeof AbortController !== "undefined") {
              this._abortController = new AbortController();
            }

            this._headers = createHeaders(this._stream.httpHeaders);

            this._headers.append("Range", "bytes=".concat(begin, "-").concat(end - 1));

            var url = source.url;
            fetch(url, createFetchOptions(this._headers, this._withCredentials, this._abortController)).then(function (response) {
              if (!(0, _network_utils.validateResponseStatus)(response.status)) {
                throw (0, _network_utils.createResponseStatusError)(response.status, url);
              }

              _this2._readCapability.resolve();

              _this2._reader = response.body.getReader();
            })["catch"](this._readCapability.reject);
            this.onProgress = null;
          }

          _createClass(PDFFetchStreamRangeReader, [{
            key: "isStreamingSupported",
            get: function get() {
              return this._isStreamingSupported;
            }
          }, {
            key: "read",
            value: function () {
              var _read2 = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
                var _yield$this$_reader$r2, value, done, buffer;

                return _regenerator["default"].wrap(function _callee2$(_context2) {
                  while (1) {
                    switch (_context2.prev = _context2.next) {
                      case 0:
                        _context2.next = 2;
                        return this._readCapability.promise;

                      case 2:
                        _context2.next = 4;
                        return this._reader.read();

                      case 4:
                        _yield$this$_reader$r2 = _context2.sent;
                        value = _yield$this$_reader$r2.value;
                        done = _yield$this$_reader$r2.done;

                        if (!done) {
                          _context2.next = 9;
                          break;
                        }

                        return _context2.abrupt("return", {
                          value: value,
                          done: done
                        });

                      case 9:
                        this._loaded += value.byteLength;

                        if (this.onProgress) {
                          this.onProgress({
                            loaded: this._loaded
                          });
                        }

                        buffer = new Uint8Array(value).buffer;
                        return _context2.abrupt("return", {
                          value: buffer,
                          done: false
                        });

                      case 13:
                      case "end":
                        return _context2.stop();
                    }
                  }
                }, _callee2, this);
              }));

              function read() {
                return _read2.apply(this, arguments);
              }

              return read;
            }()
          }, {
            key: "cancel",
            value: function cancel(reason) {
              if (this._reader) {
                this._reader.cancel(reason);
              }

              if (this._abortController) {
                this._abortController.abort();
              }
            }
          }]);

          return PDFFetchStreamRangeReader;
        }();
        /***/

      }
      /******/
      ];
      /************************************************************************/

      /******/
      // The module cache

      /******/

      var __webpack_module_cache__ = {};
      /******/

      /******/
      // The require function

      /******/

      function __w_pdfjs_require__(moduleId) {
        /******/
        // Check if module is in cache

        /******/
        var cachedModule = __webpack_module_cache__[moduleId];
        /******/

        if (cachedModule !== undefined) {
          /******/
          return cachedModule.exports;
          /******/
        }
        /******/
        // Create a new module (and put it into the cache)

        /******/


        var module = __webpack_module_cache__[moduleId] = {
          /******/
          id: moduleId,

          /******/
          loaded: false,

          /******/
          exports: {}
          /******/

        };
        /******/

        /******/
        // Execute the module function

        /******/

        __webpack_modules__[moduleId].call(module.exports, module, module.exports, __w_pdfjs_require__);
        /******/

        /******/
        // Flag the module as loaded

        /******/


        module.loaded = true;
        /******/

        /******/
        // Return the exports of the module

        /******/

        return module.exports;
        /******/
      }
      /******/

      /************************************************************************/

      /******/

      /* webpack/runtime/node module decorator */

      /******/


      (function () {
        /******/
        __w_pdfjs_require__.nmd = function (module) {
          /******/
          module.paths = [];
          /******/

          if (!module.children) module.children = [];
          /******/

          return module;
          /******/
        };
        /******/

      })();
      /******/

      /************************************************************************/


      var __webpack_exports__ = {}; // This entry need to be wrapped in an IIFE because it need to be in strict mode.

      (function () {
        "use strict";

        var exports = __webpack_exports__;
        Object.defineProperty(exports, "__esModule", {
          value: true
        });
        Object.defineProperty(exports, "addLinkAttributes", {
          enumerable: true,
          get: function get() {
            return _display_utils.addLinkAttributes;
          }
        });
        Object.defineProperty(exports, "getFilenameFromUrl", {
          enumerable: true,
          get: function get() {
            return _display_utils.getFilenameFromUrl;
          }
        });
        Object.defineProperty(exports, "getPdfFilenameFromUrl", {
          enumerable: true,
          get: function get() {
            return _display_utils.getPdfFilenameFromUrl;
          }
        });
        Object.defineProperty(exports, "getXfaPageViewport", {
          enumerable: true,
          get: function get() {
            return _display_utils.getXfaPageViewport;
          }
        });
        Object.defineProperty(exports, "isPdfFile", {
          enumerable: true,
          get: function get() {
            return _display_utils.isPdfFile;
          }
        });
        Object.defineProperty(exports, "LinkTarget", {
          enumerable: true,
          get: function get() {
            return _display_utils.LinkTarget;
          }
        });
        Object.defineProperty(exports, "loadScript", {
          enumerable: true,
          get: function get() {
            return _display_utils.loadScript;
          }
        });
        Object.defineProperty(exports, "PDFDateString", {
          enumerable: true,
          get: function get() {
            return _display_utils.PDFDateString;
          }
        });
        Object.defineProperty(exports, "PixelsPerInch", {
          enumerable: true,
          get: function get() {
            return _display_utils.PixelsPerInch;
          }
        });
        Object.defineProperty(exports, "RenderingCancelledException", {
          enumerable: true,
          get: function get() {
            return _display_utils.RenderingCancelledException;
          }
        });
        Object.defineProperty(exports, "AnnotationMode", {
          enumerable: true,
          get: function get() {
            return _util.AnnotationMode;
          }
        });
        Object.defineProperty(exports, "CMapCompressionType", {
          enumerable: true,
          get: function get() {
            return _util.CMapCompressionType;
          }
        });
        Object.defineProperty(exports, "createObjectURL", {
          enumerable: true,
          get: function get() {
            return _util.createObjectURL;
          }
        });
        Object.defineProperty(exports, "createPromiseCapability", {
          enumerable: true,
          get: function get() {
            return _util.createPromiseCapability;
          }
        });
        Object.defineProperty(exports, "createValidAbsoluteUrl", {
          enumerable: true,
          get: function get() {
            return _util.createValidAbsoluteUrl;
          }
        });
        Object.defineProperty(exports, "InvalidPDFException", {
          enumerable: true,
          get: function get() {
            return _util.InvalidPDFException;
          }
        });
        Object.defineProperty(exports, "MissingPDFException", {
          enumerable: true,
          get: function get() {
            return _util.MissingPDFException;
          }
        });
        Object.defineProperty(exports, "OPS", {
          enumerable: true,
          get: function get() {
            return _util.OPS;
          }
        });
        Object.defineProperty(exports, "PasswordResponses", {
          enumerable: true,
          get: function get() {
            return _util.PasswordResponses;
          }
        });
        Object.defineProperty(exports, "PermissionFlag", {
          enumerable: true,
          get: function get() {
            return _util.PermissionFlag;
          }
        });
        Object.defineProperty(exports, "removeNullCharacters", {
          enumerable: true,
          get: function get() {
            return _util.removeNullCharacters;
          }
        });
        Object.defineProperty(exports, "shadow", {
          enumerable: true,
          get: function get() {
            return _util.shadow;
          }
        });
        Object.defineProperty(exports, "UnexpectedResponseException", {
          enumerable: true,
          get: function get() {
            return _util.UnexpectedResponseException;
          }
        });
        Object.defineProperty(exports, "UNSUPPORTED_FEATURES", {
          enumerable: true,
          get: function get() {
            return _util.UNSUPPORTED_FEATURES;
          }
        });
        Object.defineProperty(exports, "Util", {
          enumerable: true,
          get: function get() {
            return _util.Util;
          }
        });
        Object.defineProperty(exports, "VerbosityLevel", {
          enumerable: true,
          get: function get() {
            return _util.VerbosityLevel;
          }
        });
        Object.defineProperty(exports, "build", {
          enumerable: true,
          get: function get() {
            return _api.build;
          }
        });
        Object.defineProperty(exports, "getDocument", {
          enumerable: true,
          get: function get() {
            return _api.getDocument;
          }
        });
        Object.defineProperty(exports, "LoopbackPort", {
          enumerable: true,
          get: function get() {
            return _api.LoopbackPort;
          }
        });
        Object.defineProperty(exports, "PDFDataRangeTransport", {
          enumerable: true,
          get: function get() {
            return _api.PDFDataRangeTransport;
          }
        });
        Object.defineProperty(exports, "PDFWorker", {
          enumerable: true,
          get: function get() {
            return _api.PDFWorker;
          }
        });
        Object.defineProperty(exports, "version", {
          enumerable: true,
          get: function get() {
            return _api.version;
          }
        });
        Object.defineProperty(exports, "AnnotationLayer", {
          enumerable: true,
          get: function get() {
            return _annotation_layer.AnnotationLayer;
          }
        });
        Object.defineProperty(exports, "GlobalWorkerOptions", {
          enumerable: true,
          get: function get() {
            return _worker_options.GlobalWorkerOptions;
          }
        });
        Object.defineProperty(exports, "renderTextLayer", {
          enumerable: true,
          get: function get() {
            return _text_layer.renderTextLayer;
          }
        });
        Object.defineProperty(exports, "SVGGraphics", {
          enumerable: true,
          get: function get() {
            return _svg.SVGGraphics;
          }
        });
        Object.defineProperty(exports, "XfaLayer", {
          enumerable: true,
          get: function get() {
            return _xfa_layer.XfaLayer;
          }
        });

        var _display_utils = __w_pdfjs_require__(1);

        var _util = __w_pdfjs_require__(4);

        var _api = __w_pdfjs_require__(119);

        var _annotation_layer = __w_pdfjs_require__(131);

        var _worker_options = __w_pdfjs_require__(125);

        var _is_node = __w_pdfjs_require__(6);

        var _text_layer = __w_pdfjs_require__(133);

        var _svg = __w_pdfjs_require__(134);

        var _xfa_layer = __w_pdfjs_require__(135);

        var pdfjsVersion = '2.11.338';
        var pdfjsBuild = 'dedff3c98';
        {
          if (_is_node.isNodeJS) {
            var _require = __w_pdfjs_require__(136),
                PDFNodeStream = _require.PDFNodeStream;

            (0, _api.setPDFNetworkStreamFactory)(function (params) {
              return new PDFNodeStream(params);
            });
          } else {
            var _require2 = __w_pdfjs_require__(139),
                PDFNetworkStream = _require2.PDFNetworkStream;

            var _require3 = __w_pdfjs_require__(140),
                PDFFetchStream = _require3.PDFFetchStream;

            (0, _api.setPDFNetworkStreamFactory)(function (params) {
              if ((0, _display_utils.isValidFetchUrl)(params.url)) {
                return new PDFFetchStream(params);
              }

              return new PDFNetworkStream(params);
            });
          }
        }
      })();
      /******/


      return __webpack_exports__;
      /******/
    }()
  );
});

/***/ }),

/***/ 615:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

/**
 * @licstart The following is the entire license notice for the
 * Javascript code in this page
 *
 * Copyright 2021 Mozilla Foundation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * @licend The above is the entire license notice for the
 * Javascript code in this page
 */
(function webpackUniversalModuleDefinition(root, factory) {
  if (true) module.exports = factory();else {}
})(this, function () {
  return (
    /******/
    function () {
      // webpackBootstrap

      /******/
      "use strict";
      /******/

      var __webpack_modules__ = [
        /* 0 */
      ,
      /* 1 */

      /***/
      function (__unused_webpack_module, exports, __w_pdfjs_require__) {
        Object.defineProperty(exports, "__esModule", {
          value: true
        });
        exports.DefaultAnnotationLayerFactory = exports.AnnotationLayerBuilder = void 0;

        var _regenerator = _interopRequireDefault(__w_pdfjs_require__(2));

        var _pdfjsLib = __w_pdfjs_require__(4);

        var _l10n_utils = __w_pdfjs_require__(5);

        var _pdf_link_service = __w_pdfjs_require__(6);

        function _interopRequireDefault(obj) {
          return obj && obj.__esModule ? obj : {
            "default": obj
          };
        }

        function _slicedToArray(arr, i) {
          return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
        }

        function _nonIterableRest() {
          throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
        }

        function _unsupportedIterableToArray(o, minLen) {
          if (!o) return;
          if (typeof o === "string") return _arrayLikeToArray(o, minLen);
          var n = Object.prototype.toString.call(o).slice(8, -1);
          if (n === "Object" && o.constructor) n = o.constructor.name;
          if (n === "Map" || n === "Set") return Array.from(o);
          if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
        }

        function _arrayLikeToArray(arr, len) {
          if (len == null || len > arr.length) len = arr.length;

          for (var i = 0, arr2 = new Array(len); i < len; i++) {
            arr2[i] = arr[i];
          }

          return arr2;
        }

        function _iterableToArrayLimit(arr, i) {
          var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];

          if (_i == null) return;
          var _arr = [];
          var _n = true;
          var _d = false;

          var _s, _e;

          try {
            for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
              _arr.push(_s.value);

              if (i && _arr.length === i) break;
            }
          } catch (err) {
            _d = true;
            _e = err;
          } finally {
            try {
              if (!_n && _i["return"] != null) _i["return"]();
            } finally {
              if (_d) throw _e;
            }
          }

          return _arr;
        }

        function _arrayWithHoles(arr) {
          if (Array.isArray(arr)) return arr;
        }

        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 self = this,
                args = arguments;
            return new Promise(function (resolve, reject) {
              var gen = fn.apply(self, args);

              function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
              }

              function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
              }

              _next(undefined);
            });
          };
        }

        function _classCallCheck(instance, Constructor) {
          if (!(instance instanceof Constructor)) {
            throw new TypeError("Cannot call a class as a function");
          }
        }

        function _defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];
            descriptor.enumerable = descriptor.enumerable || false;
            descriptor.configurable = true;
            if ("value" in descriptor) descriptor.writable = true;
            Object.defineProperty(target, descriptor.key, descriptor);
          }
        }

        function _createClass(Constructor, protoProps, staticProps) {
          if (protoProps) _defineProperties(Constructor.prototype, protoProps);
          if (staticProps) _defineProperties(Constructor, staticProps);
          return Constructor;
        }

        var AnnotationLayerBuilder = /*#__PURE__*/function () {
          function AnnotationLayerBuilder(_ref) {
            var pageDiv = _ref.pageDiv,
                pdfPage = _ref.pdfPage,
                linkService = _ref.linkService,
                downloadManager = _ref.downloadManager,
                _ref$annotationStorag = _ref.annotationStorage,
                annotationStorage = _ref$annotationStorag === void 0 ? null : _ref$annotationStorag,
                _ref$imageResourcesPa = _ref.imageResourcesPath,
                imageResourcesPath = _ref$imageResourcesPa === void 0 ? "" : _ref$imageResourcesPa,
                _ref$renderForms = _ref.renderForms,
                renderForms = _ref$renderForms === void 0 ? true : _ref$renderForms,
                _ref$l10n = _ref.l10n,
                l10n = _ref$l10n === void 0 ? _l10n_utils.NullL10n : _ref$l10n,
                _ref$enableScripting = _ref.enableScripting,
                enableScripting = _ref$enableScripting === void 0 ? false : _ref$enableScripting,
                _ref$hasJSActionsProm = _ref.hasJSActionsPromise,
                hasJSActionsPromise = _ref$hasJSActionsProm === void 0 ? null : _ref$hasJSActionsProm,
                _ref$fieldObjectsProm = _ref.fieldObjectsPromise,
                fieldObjectsPromise = _ref$fieldObjectsProm === void 0 ? null : _ref$fieldObjectsProm,
                _ref$mouseState = _ref.mouseState,
                mouseState = _ref$mouseState === void 0 ? null : _ref$mouseState;

            _classCallCheck(this, AnnotationLayerBuilder);

            this.pageDiv = pageDiv;
            this.pdfPage = pdfPage;
            this.linkService = linkService;
            this.downloadManager = downloadManager;
            this.imageResourcesPath = imageResourcesPath;
            this.renderForms = renderForms;
            this.l10n = l10n;
            this.annotationStorage = annotationStorage;
            this.enableScripting = enableScripting;
            this._hasJSActionsPromise = hasJSActionsPromise;
            this._fieldObjectsPromise = fieldObjectsPromise;
            this._mouseState = mouseState;
            this.div = null;
            this._cancelled = false;
          }

          _createClass(AnnotationLayerBuilder, [{
            key: "render",
            value: function () {
              var _render = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee(viewport) {
                var intent,
                    _yield$Promise$all,
                    _yield$Promise$all2,
                    annotations,
                    _yield$Promise$all2$,
                    hasJSActions,
                    _yield$Promise$all2$2,
                    fieldObjects,
                    parameters,
                    _args = arguments;

                return _regenerator["default"].wrap(function _callee$(_context) {
                  while (1) {
                    switch (_context.prev = _context.next) {
                      case 0:
                        intent = _args.length > 1 && _args[1] !== undefined ? _args[1] : "display";
                        _context.next = 3;
                        return Promise.all([this.pdfPage.getAnnotations({
                          intent: intent
                        }), this._hasJSActionsPromise, this._fieldObjectsPromise]);

                      case 3:
                        _yield$Promise$all = _context.sent;
                        _yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 3);
                        annotations = _yield$Promise$all2[0];
                        _yield$Promise$all2$ = _yield$Promise$all2[1];
                        hasJSActions = _yield$Promise$all2$ === void 0 ? false : _yield$Promise$all2$;
                        _yield$Promise$all2$2 = _yield$Promise$all2[2];
                        fieldObjects = _yield$Promise$all2$2 === void 0 ? null : _yield$Promise$all2$2;

                        if (!(this._cancelled || annotations.length === 0)) {
                          _context.next = 12;
                          break;
                        }

                        return _context.abrupt("return");

                      case 12:
                        parameters = {
                          viewport: viewport.clone({
                            dontFlip: true
                          }),
                          div: this.div,
                          annotations: annotations,
                          page: this.pdfPage,
                          imageResourcesPath: this.imageResourcesPath,
                          renderForms: this.renderForms,
                          linkService: this.linkService,
                          downloadManager: this.downloadManager,
                          annotationStorage: this.annotationStorage,
                          enableScripting: this.enableScripting,
                          hasJSActions: hasJSActions,
                          fieldObjects: fieldObjects,
                          mouseState: this._mouseState
                        };

                        if (this.div) {
                          _pdfjsLib.AnnotationLayer.update(parameters);
                        } else {
                          this.div = document.createElement("div");
                          this.div.className = "annotationLayer";
                          this.pageDiv.appendChild(this.div);
                          parameters.div = this.div;

                          _pdfjsLib.AnnotationLayer.render(parameters);

                          this.l10n.translate(this.div);
                        }

                      case 14:
                      case "end":
                        return _context.stop();
                    }
                  }
                }, _callee, this);
              }));

              function render(_x) {
                return _render.apply(this, arguments);
              }

              return render;
            }()
          }, {
            key: "cancel",
            value: function cancel() {
              this._cancelled = true;
            }
          }, {
            key: "hide",
            value: function hide() {
              if (!this.div) {
                return;
              }

              this.div.hidden = true;
            }
          }]);

          return AnnotationLayerBuilder;
        }();

        exports.AnnotationLayerBuilder = AnnotationLayerBuilder;

        var DefaultAnnotationLayerFactory = /*#__PURE__*/function () {
          function DefaultAnnotationLayerFactory() {
            _classCallCheck(this, DefaultAnnotationLayerFactory);
          }

          _createClass(DefaultAnnotationLayerFactory, [{
            key: "createAnnotationLayerBuilder",
            value: function createAnnotationLayerBuilder(pageDiv, pdfPage) {
              var annotationStorage = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
              var imageResourcesPath = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "";
              var renderForms = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
              var l10n = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : _l10n_utils.NullL10n;
              var enableScripting = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
              var hasJSActionsPromise = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : null;
              var mouseState = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : null;
              var fieldObjectsPromise = arguments.length > 9 && arguments[9] !== undefined ? arguments[9] : null;
              return new AnnotationLayerBuilder({
                pageDiv: pageDiv,
                pdfPage: pdfPage,
                imageResourcesPath: imageResourcesPath,
                renderForms: renderForms,
                linkService: new _pdf_link_service.SimpleLinkService(),
                l10n: l10n,
                annotationStorage: annotationStorage,
                enableScripting: enableScripting,
                hasJSActionsPromise: hasJSActionsPromise,
                fieldObjectsPromise: fieldObjectsPromise,
                mouseState: mouseState
              });
            }
          }]);

          return DefaultAnnotationLayerFactory;
        }();

        exports.DefaultAnnotationLayerFactory = DefaultAnnotationLayerFactory;
        /***/
      },
      /* 2 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        module.exports = __w_pdfjs_require__(3);
        /***/
      },
      /* 3 */

      /***/
      function (module, __unused_webpack_exports, __w_pdfjs_require__) {
        /* module decorator */
        module = __w_pdfjs_require__.nmd(module);

        function _typeof(obj) {
          "@babel/helpers - typeof";

          if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
            _typeof = function _typeof(obj) {
              return typeof obj;
            };
          } else {
            _typeof = function _typeof(obj) {
              return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
            };
          }

          return _typeof(obj);
        }

        var runtime = function (exports) {
          "use strict";

          var Op = Object.prototype;
          var hasOwn = Op.hasOwnProperty;
          var undefined;
          var $Symbol = typeof Symbol === "function" ? Symbol : {};
          var iteratorSymbol = $Symbol.iterator || "@@iterator";
          var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
          var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";

          function define(obj, key, value) {
            Object.defineProperty(obj, key, {
              value: value,
              enumerable: true,
              configurable: true,
              writable: true
            });
            return obj[key];
          }

          try {
            define({}, "");
          } catch (err) {
            define = function define(obj, key, value) {
              return obj[key] = value;
            };
          }

          function wrap(innerFn, outerFn, self, tryLocsList) {
            var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
            var generator = Object.create(protoGenerator.prototype);
            var context = new Context(tryLocsList || []);
            generator._invoke = makeInvokeMethod(innerFn, self, context);
            return generator;
          }

          exports.wrap = wrap;

          function tryCatch(fn, obj, arg) {
            try {
              return {
                type: "normal",
                arg: fn.call(obj, arg)
              };
            } catch (err) {
              return {
                type: "throw",
                arg: err
              };
            }
          }

          var GenStateSuspendedStart = "suspendedStart";
          var GenStateSuspendedYield = "suspendedYield";
          var GenStateExecuting = "executing";
          var GenStateCompleted = "completed";
          var ContinueSentinel = {};

          function Generator() {}

          function GeneratorFunction() {}

          function GeneratorFunctionPrototype() {}

          var IteratorPrototype = {};
          define(IteratorPrototype, iteratorSymbol, function () {
            return this;
          });
          var getProto = Object.getPrototypeOf;
          var NativeIteratorPrototype = getProto && getProto(getProto(values([])));

          if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
            IteratorPrototype = NativeIteratorPrototype;
          }

          var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
          GeneratorFunction.prototype = GeneratorFunctionPrototype;
          define(Gp, "constructor", GeneratorFunctionPrototype);
          define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
          GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction");

          function defineIteratorMethods(prototype) {
            ["next", "throw", "return"].forEach(function (method) {
              define(prototype, method, function (arg) {
                return this._invoke(method, arg);
              });
            });
          }

          exports.isGeneratorFunction = function (genFun) {
            var ctor = typeof genFun === "function" && genFun.constructor;
            return ctor ? ctor === GeneratorFunction || (ctor.displayName || ctor.name) === "GeneratorFunction" : false;
          };

          exports.mark = function (genFun) {
            if (Object.setPrototypeOf) {
              Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
            } else {
              genFun.__proto__ = GeneratorFunctionPrototype;
              define(genFun, toStringTagSymbol, "GeneratorFunction");
            }

            genFun.prototype = Object.create(Gp);
            return genFun;
          };

          exports.awrap = function (arg) {
            return {
              __await: arg
            };
          };

          function AsyncIterator(generator, PromiseImpl) {
            function invoke(method, arg, resolve, reject) {
              var record = tryCatch(generator[method], generator, arg);

              if (record.type === "throw") {
                reject(record.arg);
              } else {
                var result = record.arg;
                var value = result.value;

                if (value && _typeof(value) === "object" && hasOwn.call(value, "__await")) {
                  return PromiseImpl.resolve(value.__await).then(function (value) {
                    invoke("next", value, resolve, reject);
                  }, function (err) {
                    invoke("throw", err, resolve, reject);
                  });
                }

                return PromiseImpl.resolve(value).then(function (unwrapped) {
                  result.value = unwrapped;
                  resolve(result);
                }, function (error) {
                  return invoke("throw", error, resolve, reject);
                });
              }
            }

            var previousPromise;

            function enqueue(method, arg) {
              function callInvokeWithMethodAndArg() {
                return new PromiseImpl(function (resolve, reject) {
                  invoke(method, arg, resolve, reject);
                });
              }

              return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
            }

            this._invoke = enqueue;
          }

          defineIteratorMethods(AsyncIterator.prototype);
          define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
            return this;
          });
          exports.AsyncIterator = AsyncIterator;

          exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
            if (PromiseImpl === void 0) PromiseImpl = Promise;
            var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
            return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
              return result.done ? result.value : iter.next();
            });
          };

          function makeInvokeMethod(innerFn, self, context) {
            var state = GenStateSuspendedStart;
            return function invoke(method, arg) {
              if (state === GenStateExecuting) {
                throw new Error("Generator is already running");
              }

              if (state === GenStateCompleted) {
                if (method === "throw") {
                  throw arg;
                }

                return doneResult();
              }

              context.method = method;
              context.arg = arg;

              while (true) {
                var delegate = context.delegate;

                if (delegate) {
                  var delegateResult = maybeInvokeDelegate(delegate, context);

                  if (delegateResult) {
                    if (delegateResult === ContinueSentinel) continue;
                    return delegateResult;
                  }
                }

                if (context.method === "next") {
                  context.sent = context._sent = context.arg;
                } else if (context.method === "throw") {
                  if (state === GenStateSuspendedStart) {
                    state = GenStateCompleted;
                    throw context.arg;
                  }

                  context.dispatchException(context.arg);
                } else if (context.method === "return") {
                  context.abrupt("return", context.arg);
                }

                state = GenStateExecuting;
                var record = tryCatch(innerFn, self, context);

                if (record.type === "normal") {
                  state = context.done ? GenStateCompleted : GenStateSuspendedYield;

                  if (record.arg === ContinueSentinel) {
                    continue;
                  }

                  return {
                    value: record.arg,
                    done: context.done
                  };
                } else if (record.type === "throw") {
                  state = GenStateCompleted;
                  context.method = "throw";
                  context.arg = record.arg;
                }
              }
            };
          }

          function maybeInvokeDelegate(delegate, context) {
            var method = delegate.iterator[context.method];

            if (method === undefined) {
              context.delegate = null;

              if (context.method === "throw") {
                if (delegate.iterator["return"]) {
                  context.method = "return";
                  context.arg = undefined;
                  maybeInvokeDelegate(delegate, context);

                  if (context.method === "throw") {
                    return ContinueSentinel;
                  }
                }

                context.method = "throw";
                context.arg = new TypeError("The iterator does not provide a 'throw' method");
              }

              return ContinueSentinel;
            }

            var record = tryCatch(method, delegate.iterator, context.arg);

            if (record.type === "throw") {
              context.method = "throw";
              context.arg = record.arg;
              context.delegate = null;
              return ContinueSentinel;
            }

            var info = record.arg;

            if (!info) {
              context.method = "throw";
              context.arg = new TypeError("iterator result is not an object");
              context.delegate = null;
              return ContinueSentinel;
            }

            if (info.done) {
              context[delegate.resultName] = info.value;
              context.next = delegate.nextLoc;

              if (context.method !== "return") {
                context.method = "next";
                context.arg = undefined;
              }
            } else {
              return info;
            }

            context.delegate = null;
            return ContinueSentinel;
          }

          defineIteratorMethods(Gp);
          define(Gp, toStringTagSymbol, "Generator");
          define(Gp, iteratorSymbol, function () {
            return this;
          });
          define(Gp, "toString", function () {
            return "[object Generator]";
          });

          function pushTryEntry(locs) {
            var entry = {
              tryLoc: locs[0]
            };

            if (1 in locs) {
              entry.catchLoc = locs[1];
            }

            if (2 in locs) {
              entry.finallyLoc = locs[2];
              entry.afterLoc = locs[3];
            }

            this.tryEntries.push(entry);
          }

          function resetTryEntry(entry) {
            var record = entry.completion || {};
            record.type = "normal";
            delete record.arg;
            entry.completion = record;
          }

          function Context(tryLocsList) {
            this.tryEntries = [{
              tryLoc: "root"
            }];
            tryLocsList.forEach(pushTryEntry, this);
            this.reset(true);
          }

          exports.keys = function (object) {
            var keys = [];

            for (var key in object) {
              keys.push(key);
            }

            keys.reverse();
            return function next() {
              while (keys.length) {
                var key = keys.pop();

                if (key in object) {
                  next.value = key;
                  next.done = false;
                  return next;
                }
              }

              next.done = true;
              return next;
            };
          };

          function values(iterable) {
            if (iterable) {
              var iteratorMethod = iterable[iteratorSymbol];

              if (iteratorMethod) {
                return iteratorMethod.call(iterable);
              }

              if (typeof iterable.next === "function") {
                return iterable;
              }

              if (!isNaN(iterable.length)) {
                var i = -1,
                    next = function next() {
                  while (++i < iterable.length) {
                    if (hasOwn.call(iterable, i)) {
                      next.value = iterable[i];
                      next.done = false;
                      return next;
                    }
                  }

                  next.value = undefined;
                  next.done = true;
                  return next;
                };

                return next.next = next;
              }
            }

            return {
              next: doneResult
            };
          }

          exports.values = values;

          function doneResult() {
            return {
              value: undefined,
              done: true
            };
          }

          Context.prototype = {
            constructor: Context,
            reset: function reset(skipTempReset) {
              this.prev = 0;
              this.next = 0;
              this.sent = this._sent = undefined;
              this.done = false;
              this.delegate = null;
              this.method = "next";
              this.arg = undefined;
              this.tryEntries.forEach(resetTryEntry);

              if (!skipTempReset) {
                for (var name in this) {
                  if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) {
                    this[name] = undefined;
                  }
                }
              }
            },
            stop: function stop() {
              this.done = true;
              var rootEntry = this.tryEntries[0];
              var rootRecord = rootEntry.completion;

              if (rootRecord.type === "throw") {
                throw rootRecord.arg;
              }

              return this.rval;
            },
            dispatchException: function dispatchException(exception) {
              if (this.done) {
                throw exception;
              }

              var context = this;

              function handle(loc, caught) {
                record.type = "throw";
                record.arg = exception;
                context.next = loc;

                if (caught) {
                  context.method = "next";
                  context.arg = undefined;
                }

                return !!caught;
              }

              for (var i = this.tryEntries.length - 1; i >= 0; --i) {
                var entry = this.tryEntries[i];
                var record = entry.completion;

                if (entry.tryLoc === "root") {
                  return handle("end");
                }

                if (entry.tryLoc <= this.prev) {
                  var hasCatch = hasOwn.call(entry, "catchLoc");
                  var hasFinally = hasOwn.call(entry, "finallyLoc");

                  if (hasCatch && hasFinally) {
                    if (this.prev < entry.catchLoc) {
                      return handle(entry.catchLoc, true);
                    } else if (this.prev < entry.finallyLoc) {
                      return handle(entry.finallyLoc);
                    }
                  } else if (hasCatch) {
                    if (this.prev < entry.catchLoc) {
                      return handle(entry.catchLoc, true);
                    }
                  } else if (hasFinally) {
                    if (this.prev < entry.finallyLoc) {
                      return handle(entry.finallyLoc);
                    }
                  } else {
                    throw new Error("try statement without catch or finally");
                  }
                }
              }
            },
            abrupt: function abrupt(type, arg) {
              for (var i = this.tryEntries.length - 1; i >= 0; --i) {
                var entry = this.tryEntries[i];

                if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
                  var finallyEntry = entry;
                  break;
                }
              }

              if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) {
                finallyEntry = null;
              }

              var record = finallyEntry ? finallyEntry.completion : {};
              record.type = type;
              record.arg = arg;

              if (finallyEntry) {
                this.method = "next";
                this.next = finallyEntry.finallyLoc;
                return ContinueSentinel;
              }

              return this.complete(record);
            },
            complete: function complete(record, afterLoc) {
              if (record.type === "throw") {
                throw record.arg;
              }

              if (record.type === "break" || record.type === "continue") {
                this.next = record.arg;
              } else if (record.type === "return") {
                this.rval = this.arg = record.arg;
                this.method = "return";
                this.next = "end";
              } else if (record.type === "normal" && afterLoc) {
                this.next = afterLoc;
              }

              return ContinueSentinel;
            },
            finish: function finish(finallyLoc) {
              for (var i = this.tryEntries.length - 1; i >= 0; --i) {
                var entry = this.tryEntries[i];

                if (entry.finallyLoc === finallyLoc) {
                  this.complete(entry.completion, entry.afterLoc);
                  resetTryEntry(entry);
                  return ContinueSentinel;
                }
              }
            },
            "catch": function _catch(tryLoc) {
              for (var i = this.tryEntries.length - 1; i >= 0; --i) {
                var entry = this.tryEntries[i];

                if (entry.tryLoc === tryLoc) {
                  var record = entry.completion;

                  if (record.type === "throw") {
                    var thrown = record.arg;
                    resetTryEntry(entry);
                  }

                  return thrown;
                }
              }

              throw new Error("illegal catch attempt");
            },
            delegateYield: function delegateYield(iterable, resultName, nextLoc) {
              this.delegate = {
                iterator: values(iterable),
                resultName: resultName,
                nextLoc: nextLoc
              };

              if (this.method === "next") {
                this.arg = undefined;
              }

              return ContinueSentinel;
            }
          };
          return exports;
        }(( false ? 0 : _typeof(module)) === "object" ? module.exports : {});

        try {
          regeneratorRuntime = runtime;
        } catch (accidentalStrictMode) {
          if ((typeof globalThis === "undefined" ? "undefined" : _typeof(globalThis)) === "object") {
            globalThis.regeneratorRuntime = runtime;
          } else {
            Function("r", "regeneratorRuntime = r")(runtime);
          }
        }
        /***/

      },
      /* 4 */

      /***/
      function (module) {
        var pdfjsLib;

        if (typeof window !== "undefined" && window["pdfjs-dist/build/pdf"]) {
          pdfjsLib = window["pdfjs-dist/build/pdf"];
        } else {
          pdfjsLib = __webpack_require__(560);
        }

        module.exports = pdfjsLib;
        /***/
      },
      /* 5 */

      /***/
      function (__unused_webpack_module, exports, __w_pdfjs_require__) {
        Object.defineProperty(exports, "__esModule", {
          value: true
        });
        exports.fixupLangCode = fixupLangCode;
        exports.getL10nFallback = getL10nFallback;
        exports.NullL10n = void 0;

        var _regenerator = _interopRequireDefault(__w_pdfjs_require__(2));

        function _interopRequireDefault(obj) {
          return obj && obj.__esModule ? obj : {
            "default": obj
          };
        }

        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 self = this,
                args = arguments;
            return new Promise(function (resolve, reject) {
              var gen = fn.apply(self, args);

              function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
              }

              function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
              }

              _next(undefined);
            });
          };
        }

        var DEFAULT_L10N_STRINGS = {
          of_pages: "of {{pagesCount}}",
          page_of_pages: "({{pageNumber}} of {{pagesCount}})",
          document_properties_kb: "{{size_kb}} KB ({{size_b}} bytes)",
          document_properties_mb: "{{size_mb}} MB ({{size_b}} bytes)",
          document_properties_date_string: "{{date}}, {{time}}",
          document_properties_page_size_unit_inches: "in",
          document_properties_page_size_unit_millimeters: "mm",
          document_properties_page_size_orientation_portrait: "portrait",
          document_properties_page_size_orientation_landscape: "landscape",
          document_properties_page_size_name_a3: "A3",
          document_properties_page_size_name_a4: "A4",
          document_properties_page_size_name_letter: "Letter",
          document_properties_page_size_name_legal: "Legal",
          document_properties_page_size_dimension_string: "{{width}} × {{height}} {{unit}} ({{orientation}})",
          document_properties_page_size_dimension_name_string: "{{width}} × {{height}} {{unit}} ({{name}}, {{orientation}})",
          document_properties_linearized_yes: "Yes",
          document_properties_linearized_no: "No",
          print_progress_percent: "{{progress}}%",
          "toggle_sidebar.title": "Toggle Sidebar",
          "toggle_sidebar_notification2.title": "Toggle Sidebar (document contains outline/attachments/layers)",
          additional_layers: "Additional Layers",
          page_landmark: "Page {{page}}",
          thumb_page_title: "Page {{page}}",
          thumb_page_canvas: "Thumbnail of Page {{page}}",
          find_reached_top: "Reached top of document, continued from bottom",
          find_reached_bottom: "Reached end of document, continued from top",
          "find_match_count[one]": "{{current}} of {{total}} match",
          "find_match_count[other]": "{{current}} of {{total}} matches",
          "find_match_count_limit[one]": "More than {{limit}} match",
          "find_match_count_limit[other]": "More than {{limit}} matches",
          find_not_found: "Phrase not found",
          error_version_info: "PDF.js v{{version}} (build: {{build}})",
          error_message: "Message: {{message}}",
          error_stack: "Stack: {{stack}}",
          error_file: "File: {{file}}",
          error_line: "Line: {{line}}",
          rendering_error: "An error occurred while rendering the page.",
          page_scale_width: "Page Width",
          page_scale_fit: "Page Fit",
          page_scale_auto: "Automatic Zoom",
          page_scale_actual: "Actual Size",
          page_scale_percent: "{{scale}}%",
          loading: "Loading…",
          loading_error: "An error occurred while loading the PDF.",
          invalid_file_error: "Invalid or corrupted PDF file.",
          missing_file_error: "Missing PDF file.",
          unexpected_response_error: "Unexpected server response.",
          printing_not_supported: "Warning: Printing is not fully supported by this browser.",
          printing_not_ready: "Warning: The PDF is not fully loaded for printing.",
          web_fonts_disabled: "Web fonts are disabled: unable to use embedded PDF fonts."
        };

        function getL10nFallback(key, args) {
          switch (key) {
            case "find_match_count":
              key = "find_match_count[".concat(args.total === 1 ? "one" : "other", "]");
              break;

            case "find_match_count_limit":
              key = "find_match_count_limit[".concat(args.limit === 1 ? "one" : "other", "]");
              break;
          }

          return DEFAULT_L10N_STRINGS[key] || "";
        }

        var PARTIAL_LANG_CODES = {
          en: "en-US",
          es: "es-ES",
          fy: "fy-NL",
          ga: "ga-IE",
          gu: "gu-IN",
          hi: "hi-IN",
          hy: "hy-AM",
          nb: "nb-NO",
          ne: "ne-NP",
          nn: "nn-NO",
          pa: "pa-IN",
          pt: "pt-PT",
          sv: "sv-SE",
          zh: "zh-CN"
        };

        function fixupLangCode(langCode) {
          return PARTIAL_LANG_CODES[langCode === null || langCode === void 0 ? void 0 : langCode.toLowerCase()] || langCode;
        }

        function formatL10nValue(text, args) {
          if (!args) {
            return text;
          }

          return text.replace(/\{\{\s*(\w+)\s*\}\}/g, function (all, name) {
            return name in args ? args[name] : "{{" + name + "}}";
          });
        }

        var NullL10n = {
          getLanguage: function getLanguage() {
            return _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
              return _regenerator["default"].wrap(function _callee$(_context) {
                while (1) {
                  switch (_context.prev = _context.next) {
                    case 0:
                      return _context.abrupt("return", "en-us");

                    case 1:
                    case "end":
                      return _context.stop();
                  }
                }
              }, _callee);
            }))();
          },
          getDirection: function getDirection() {
            return _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
              return _regenerator["default"].wrap(function _callee2$(_context2) {
                while (1) {
                  switch (_context2.prev = _context2.next) {
                    case 0:
                      return _context2.abrupt("return", "ltr");

                    case 1:
                    case "end":
                      return _context2.stop();
                  }
                }
              }, _callee2);
            }))();
          },
          get: function get(key) {
            var _arguments = arguments;
            return _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
              var args, fallback;
              return _regenerator["default"].wrap(function _callee3$(_context3) {
                while (1) {
                  switch (_context3.prev = _context3.next) {
                    case 0:
                      args = _arguments.length > 1 && _arguments[1] !== undefined ? _arguments[1] : null;
                      fallback = _arguments.length > 2 && _arguments[2] !== undefined ? _arguments[2] : getL10nFallback(key, args);
                      return _context3.abrupt("return", formatL10nValue(fallback, args));

                    case 3:
                    case "end":
                      return _context3.stop();
                  }
                }
              }, _callee3);
            }))();
          },
          translate: function translate(element) {
            return _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
              return _regenerator["default"].wrap(function _callee4$(_context4) {
                while (1) {
                  switch (_context4.prev = _context4.next) {
                    case 0:
                    case "end":
                      return _context4.stop();
                  }
                }
              }, _callee4);
            }))();
          }
        };
        exports.NullL10n = NullL10n;
        /***/
      },
      /* 6 */

      /***/
      function (__unused_webpack_module, exports, __w_pdfjs_require__) {
        Object.defineProperty(exports, "__esModule", {
          value: true
        });
        exports.SimpleLinkService = exports.PDFLinkService = void 0;

        var _regenerator = _interopRequireDefault(__w_pdfjs_require__(2));

        var _pdfjsLib = __w_pdfjs_require__(4);

        var _ui_utils = __w_pdfjs_require__(7);

        function _interopRequireDefault(obj) {
          return obj && obj.__esModule ? obj : {
            "default": obj
          };
        }

        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 self = this,
                args = arguments;
            return new Promise(function (resolve, reject) {
              var gen = fn.apply(self, args);

              function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
              }

              function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
              }

              _next(undefined);
            });
          };
        }

        function _typeof(obj) {
          "@babel/helpers - typeof";

          if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
            _typeof = function _typeof(obj) {
              return typeof obj;
            };
          } else {
            _typeof = function _typeof(obj) {
              return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
            };
          }

          return _typeof(obj);
        }

        function _classCallCheck(instance, Constructor) {
          if (!(instance instanceof Constructor)) {
            throw new TypeError("Cannot call a class as a function");
          }
        }

        function _defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];
            descriptor.enumerable = descriptor.enumerable || false;
            descriptor.configurable = true;
            if ("value" in descriptor) descriptor.writable = true;
            Object.defineProperty(target, descriptor.key, descriptor);
          }
        }

        function _createClass(Constructor, protoProps, staticProps) {
          if (protoProps) _defineProperties(Constructor.prototype, protoProps);
          if (staticProps) _defineProperties(Constructor, staticProps);
          return Constructor;
        }

        var PDFLinkService = /*#__PURE__*/function () {
          function PDFLinkService() {
            var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
                eventBus = _ref.eventBus,
                _ref$externalLinkTarg = _ref.externalLinkTarget,
                externalLinkTarget = _ref$externalLinkTarg === void 0 ? null : _ref$externalLinkTarg,
                _ref$externalLinkRel = _ref.externalLinkRel,
                externalLinkRel = _ref$externalLinkRel === void 0 ? null : _ref$externalLinkRel,
                _ref$ignoreDestinatio = _ref.ignoreDestinationZoom,
                ignoreDestinationZoom = _ref$ignoreDestinatio === void 0 ? false : _ref$ignoreDestinatio;

            _classCallCheck(this, PDFLinkService);

            this.eventBus = eventBus;
            this.externalLinkTarget = externalLinkTarget;
            this.externalLinkRel = externalLinkRel;
            this.externalLinkEnabled = true;
            this._ignoreDestinationZoom = ignoreDestinationZoom;
            this.baseUrl = null;
            this.pdfDocument = null;
            this.pdfViewer = null;
            this.pdfHistory = null;
            this._pagesRefCache = null;
          }

          _createClass(PDFLinkService, [{
            key: "setDocument",
            value: function setDocument(pdfDocument) {
              var baseUrl = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
              this.baseUrl = baseUrl;
              this.pdfDocument = pdfDocument;
              this._pagesRefCache = Object.create(null);
            }
          }, {
            key: "setViewer",
            value: function setViewer(pdfViewer) {
              this.pdfViewer = pdfViewer;
            }
          }, {
            key: "setHistory",
            value: function setHistory(pdfHistory) {
              this.pdfHistory = pdfHistory;
            }
          }, {
            key: "pagesCount",
            get: function get() {
              return this.pdfDocument ? this.pdfDocument.numPages : 0;
            }
          }, {
            key: "page",
            get: function get() {
              return this.pdfViewer.currentPageNumber;
            },
            set: function set(value) {
              this.pdfViewer.currentPageNumber = value;
            }
          }, {
            key: "rotation",
            get: function get() {
              return this.pdfViewer.pagesRotation;
            },
            set: function set(value) {
              this.pdfViewer.pagesRotation = value;
            }
          }, {
            key: "_goToDestinationHelper",
            value: function _goToDestinationHelper(rawDest) {
              var _this = this;

              var namedDest = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
              var explicitDest = arguments.length > 2 ? arguments[2] : undefined;
              var destRef = explicitDest[0];
              var pageNumber;

              if (_typeof(destRef) === "object" && destRef !== null) {
                pageNumber = this._cachedPageNumber(destRef);

                if (pageNumber === null) {
                  this.pdfDocument.getPageIndex(destRef).then(function (pageIndex) {
                    _this.cachePageRef(pageIndex + 1, destRef);

                    _this._goToDestinationHelper(rawDest, namedDest, explicitDest);
                  })["catch"](function () {
                    console.error("PDFLinkService._goToDestinationHelper: \"".concat(destRef, "\" is not ") + "a valid page reference, for dest=\"".concat(rawDest, "\"."));
                  });
                  return;
                }
              } else if (Number.isInteger(destRef)) {
                pageNumber = destRef + 1;
              } else {
                console.error("PDFLinkService._goToDestinationHelper: \"".concat(destRef, "\" is not ") + "a valid destination reference, for dest=\"".concat(rawDest, "\"."));
                return;
              }

              if (!pageNumber || pageNumber < 1 || pageNumber > this.pagesCount) {
                console.error("PDFLinkService._goToDestinationHelper: \"".concat(pageNumber, "\" is not ") + "a valid page number, for dest=\"".concat(rawDest, "\"."));
                return;
              }

              if (this.pdfHistory) {
                this.pdfHistory.pushCurrentPosition();
                this.pdfHistory.push({
                  namedDest: namedDest,
                  explicitDest: explicitDest,
                  pageNumber: pageNumber
                });
              }

              this.pdfViewer.scrollPageIntoView({
                pageNumber: pageNumber,
                destArray: explicitDest,
                ignoreDestinationZoom: this._ignoreDestinationZoom
              });
            }
          }, {
            key: "goToDestination",
            value: function () {
              var _goToDestination = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee(dest) {
                var namedDest, explicitDest;
                return _regenerator["default"].wrap(function _callee$(_context) {
                  while (1) {
                    switch (_context.prev = _context.next) {
                      case 0:
                        if (this.pdfDocument) {
                          _context.next = 2;
                          break;
                        }

                        return _context.abrupt("return");

                      case 2:
                        if (!(typeof dest === "string")) {
                          _context.next = 9;
                          break;
                        }

                        namedDest = dest;
                        _context.next = 6;
                        return this.pdfDocument.getDestination(dest);

                      case 6:
                        explicitDest = _context.sent;
                        _context.next = 13;
                        break;

                      case 9:
                        namedDest = null;
                        _context.next = 12;
                        return dest;

                      case 12:
                        explicitDest = _context.sent;

                      case 13:
                        if (Array.isArray(explicitDest)) {
                          _context.next = 16;
                          break;
                        }

                        console.error("PDFLinkService.goToDestination: \"".concat(explicitDest, "\" is not ") + "a valid destination array, for dest=\"".concat(dest, "\"."));
                        return _context.abrupt("return");

                      case 16:
                        this._goToDestinationHelper(dest, namedDest, explicitDest);

                      case 17:
                      case "end":
                        return _context.stop();
                    }
                  }
                }, _callee, this);
              }));

              function goToDestination(_x) {
                return _goToDestination.apply(this, arguments);
              }

              return goToDestination;
            }()
          }, {
            key: "goToPage",
            value: function goToPage(val) {
              if (!this.pdfDocument) {
                return;
              }

              var pageNumber = typeof val === "string" && this.pdfViewer.pageLabelToPageNumber(val) || val | 0;

              if (!(Number.isInteger(pageNumber) && pageNumber > 0 && pageNumber <= this.pagesCount)) {
                console.error("PDFLinkService.goToPage: \"".concat(val, "\" is not a valid page."));
                return;
              }

              if (this.pdfHistory) {
                this.pdfHistory.pushCurrentPosition();
                this.pdfHistory.pushPage(pageNumber);
              }

              this.pdfViewer.scrollPageIntoView({
                pageNumber: pageNumber
              });
            }
          }, {
            key: "addLinkAttributes",
            value: function addLinkAttributes(link, url) {
              var newWindow = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
              (0, _pdfjsLib.addLinkAttributes)(link, {
                url: url,
                target: newWindow ? _pdfjsLib.LinkTarget.BLANK : this.externalLinkTarget,
                rel: this.externalLinkRel,
                enabled: this.externalLinkEnabled
              });
            }
          }, {
            key: "getDestinationHash",
            value: function getDestinationHash(dest) {
              if (typeof dest === "string") {
                if (dest.length > 0) {
                  return this.getAnchorUrl("#" + escape(dest));
                }
              } else if (Array.isArray(dest)) {
                var str = JSON.stringify(dest);

                if (str.length > 0) {
                  return this.getAnchorUrl("#" + escape(str));
                }
              }

              return this.getAnchorUrl("");
            }
          }, {
            key: "getAnchorUrl",
            value: function getAnchorUrl(anchor) {
              return (this.baseUrl || "") + anchor;
            }
          }, {
            key: "setHash",
            value: function setHash(hash) {
              if (!this.pdfDocument) {
                return;
              }

              var pageNumber, dest;

              if (hash.includes("=")) {
                var params = (0, _ui_utils.parseQueryString)(hash);

                if (params.has("search")) {
                  this.eventBus.dispatch("findfromurlhash", {
                    source: this,
                    query: params.get("search").replace(/"/g, ""),
                    phraseSearch: params.get("phrase") === "true"
                  });
                }

                if (params.has("page")) {
                  pageNumber = params.get("page") | 0 || 1;
                }

                if (params.has("zoom")) {
                  var zoomArgs = params.get("zoom").split(",");
                  var zoomArg = zoomArgs[0];
                  var zoomArgNumber = parseFloat(zoomArg);

                  if (!zoomArg.includes("Fit")) {
                    dest = [null, {
                      name: "XYZ"
                    }, zoomArgs.length > 1 ? zoomArgs[1] | 0 : null, zoomArgs.length > 2 ? zoomArgs[2] | 0 : null, zoomArgNumber ? zoomArgNumber / 100 : zoomArg];
                  } else {
                    if (zoomArg === "Fit" || zoomArg === "FitB") {
                      dest = [null, {
                        name: zoomArg
                      }];
                    } else if (zoomArg === "FitH" || zoomArg === "FitBH" || zoomArg === "FitV" || zoomArg === "FitBV") {
                      dest = [null, {
                        name: zoomArg
                      }, zoomArgs.length > 1 ? zoomArgs[1] | 0 : null];
                    } else if (zoomArg === "FitR") {
                      if (zoomArgs.length !== 5) {
                        console.error('PDFLinkService.setHash: Not enough parameters for "FitR".');
                      } else {
                        dest = [null, {
                          name: zoomArg
                        }, zoomArgs[1] | 0, zoomArgs[2] | 0, zoomArgs[3] | 0, zoomArgs[4] | 0];
                      }
                    } else {
                      console.error("PDFLinkService.setHash: \"".concat(zoomArg, "\" is not ") + "a valid zoom value.");
                    }
                  }
                }

                if (dest) {
                  this.pdfViewer.scrollPageIntoView({
                    pageNumber: pageNumber || this.page,
                    destArray: dest,
                    allowNegativeOffset: true
                  });
                } else if (pageNumber) {
                  this.page = pageNumber;
                }

                if (params.has("pagemode")) {
                  this.eventBus.dispatch("pagemode", {
                    source: this,
                    mode: params.get("pagemode")
                  });
                }

                if (params.has("nameddest")) {
                  this.goToDestination(params.get("nameddest"));
                }
              } else {
                dest = unescape(hash);

                try {
                  dest = JSON.parse(dest);

                  if (!Array.isArray(dest)) {
                    dest = dest.toString();
                  }
                } catch (ex) {}

                if (typeof dest === "string" || isValidExplicitDestination(dest)) {
                  this.goToDestination(dest);
                  return;
                }

                console.error("PDFLinkService.setHash: \"".concat(unescape(hash), "\" is not ") + "a valid destination.");
              }
            }
          }, {
            key: "executeNamedAction",
            value: function executeNamedAction(action) {
              var _this$pdfHistory, _this$pdfHistory2;

              switch (action) {
                case "GoBack":
                  (_this$pdfHistory = this.pdfHistory) === null || _this$pdfHistory === void 0 ? void 0 : _this$pdfHistory.back();
                  break;

                case "GoForward":
                  (_this$pdfHistory2 = this.pdfHistory) === null || _this$pdfHistory2 === void 0 ? void 0 : _this$pdfHistory2.forward();
                  break;

                case "NextPage":
                  this.pdfViewer.nextPage();
                  break;

                case "PrevPage":
                  this.pdfViewer.previousPage();
                  break;

                case "LastPage":
                  this.page = this.pagesCount;
                  break;

                case "FirstPage":
                  this.page = 1;
                  break;

                default:
                  break;
              }

              this.eventBus.dispatch("namedaction", {
                source: this,
                action: action
              });
            }
          }, {
            key: "cachePageRef",
            value: function cachePageRef(pageNum, pageRef) {
              if (!pageRef) {
                return;
              }

              var refStr = pageRef.gen === 0 ? "".concat(pageRef.num, "R") : "".concat(pageRef.num, "R").concat(pageRef.gen);
              this._pagesRefCache[refStr] = pageNum;
            }
          }, {
            key: "_cachedPageNumber",
            value: function _cachedPageNumber(pageRef) {
              var _this$_pagesRefCache;

              var refStr = pageRef.gen === 0 ? "".concat(pageRef.num, "R") : "".concat(pageRef.num, "R").concat(pageRef.gen);
              return ((_this$_pagesRefCache = this._pagesRefCache) === null || _this$_pagesRefCache === void 0 ? void 0 : _this$_pagesRefCache[refStr]) || null;
            }
          }, {
            key: "isPageVisible",
            value: function isPageVisible(pageNumber) {
              return this.pdfViewer.isPageVisible(pageNumber);
            }
          }, {
            key: "isPageCached",
            value: function isPageCached(pageNumber) {
              return this.pdfViewer.isPageCached(pageNumber);
            }
          }]);

          return PDFLinkService;
        }();

        exports.PDFLinkService = PDFLinkService;

        function isValidExplicitDestination(dest) {
          if (!Array.isArray(dest)) {
            return false;
          }

          var destLength = dest.length;

          if (destLength < 2) {
            return false;
          }

          var page = dest[0];

          if (!(_typeof(page) === "object" && Number.isInteger(page.num) && Number.isInteger(page.gen)) && !(Number.isInteger(page) && page >= 0)) {
            return false;
          }

          var zoom = dest[1];

          if (!(_typeof(zoom) === "object" && typeof zoom.name === "string")) {
            return false;
          }

          var allowNull = true;

          switch (zoom.name) {
            case "XYZ":
              if (destLength !== 5) {
                return false;
              }

              break;

            case "Fit":
            case "FitB":
              return destLength === 2;

            case "FitH":
            case "FitBH":
            case "FitV":
            case "FitBV":
              if (destLength !== 3) {
                return false;
              }

              break;

            case "FitR":
              if (destLength !== 6) {
                return false;
              }

              allowNull = false;
              break;

            default:
              return false;
          }

          for (var i = 2; i < destLength; i++) {
            var param = dest[i];

            if (!(typeof param === "number" || allowNull && param === null)) {
              return false;
            }
          }

          return true;
        }

        var SimpleLinkService = /*#__PURE__*/function () {
          function SimpleLinkService() {
            _classCallCheck(this, SimpleLinkService);

            this.externalLinkEnabled = true;
          }

          _createClass(SimpleLinkService, [{
            key: "pagesCount",
            get: function get() {
              return 0;
            }
          }, {
            key: "page",
            get: function get() {
              return 0;
            },
            set: function set(value) {}
          }, {
            key: "rotation",
            get: function get() {
              return 0;
            },
            set: function set(value) {}
          }, {
            key: "goToDestination",
            value: function () {
              var _goToDestination2 = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee2(dest) {
                return _regenerator["default"].wrap(function _callee2$(_context2) {
                  while (1) {
                    switch (_context2.prev = _context2.next) {
                      case 0:
                      case "end":
                        return _context2.stop();
                    }
                  }
                }, _callee2);
              }));

              function goToDestination(_x2) {
                return _goToDestination2.apply(this, arguments);
              }

              return goToDestination;
            }()
          }, {
            key: "goToPage",
            value: function goToPage(val) {}
          }, {
            key: "addLinkAttributes",
            value: function addLinkAttributes(link, url) {
              var newWindow = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
              (0, _pdfjsLib.addLinkAttributes)(link, {
                url: url,
                enabled: this.externalLinkEnabled
              });
            }
          }, {
            key: "getDestinationHash",
            value: function getDestinationHash(dest) {
              return "#";
            }
          }, {
            key: "getAnchorUrl",
            value: function getAnchorUrl(hash) {
              return "#";
            }
          }, {
            key: "setHash",
            value: function setHash(hash) {}
          }, {
            key: "executeNamedAction",
            value: function executeNamedAction(action) {}
          }, {
            key: "cachePageRef",
            value: function cachePageRef(pageNum, pageRef) {}
          }, {
            key: "isPageVisible",
            value: function isPageVisible(pageNumber) {
              return true;
            }
          }, {
            key: "isPageCached",
            value: function isPageCached(pageNumber) {
              return true;
            }
          }]);

          return SimpleLinkService;
        }();

        exports.SimpleLinkService = SimpleLinkService;
        /***/
      },
      /* 7 */

      /***/
      function (__unused_webpack_module, exports) {
        Object.defineProperty(exports, "__esModule", {
          value: true
        });
        exports.apiPageLayoutToSpreadMode = apiPageLayoutToSpreadMode;
        exports.apiPageModeToSidebarView = apiPageModeToSidebarView;
        exports.approximateFraction = approximateFraction;
        exports.backtrackBeforeAllVisibleElements = backtrackBeforeAllVisibleElements;
        exports.binarySearchFirstItem = binarySearchFirstItem;
        exports.getActiveOrFocusedElement = getActiveOrFocusedElement;
        exports.getOutputScale = getOutputScale;
        exports.getPageSizeInches = getPageSizeInches;
        exports.getVisibleElements = getVisibleElements;
        exports.isPortraitOrientation = isPortraitOrientation;
        exports.isValidRotation = isValidRotation;
        exports.isValidScrollMode = isValidScrollMode;
        exports.isValidSpreadMode = isValidSpreadMode;
        exports.moveToEndOfArray = moveToEndOfArray;
        exports.noContextMenuHandler = noContextMenuHandler;
        exports.normalizeWheelEventDelta = normalizeWheelEventDelta;
        exports.normalizeWheelEventDirection = normalizeWheelEventDirection;
        exports.parseQueryString = parseQueryString;
        exports.roundToDivide = roundToDivide;
        exports.scrollIntoView = scrollIntoView;
        exports.waitOnEventOrTimeout = waitOnEventOrTimeout;
        exports.watchScroll = watchScroll;
        exports.WaitOnType = exports.VERTICAL_PADDING = exports.UNKNOWN_SCALE = exports.TextLayerMode = exports.SpreadMode = exports.SidebarView = exports.ScrollMode = exports.SCROLLBAR_PADDING = exports.RendererType = exports.ProgressBar = exports.PresentationModeState = exports.MIN_SCALE = exports.MAX_SCALE = exports.MAX_AUTO_SCALE = exports.EventBus = exports.DEFAULT_SCALE_VALUE = exports.DEFAULT_SCALE_DELTA = exports.DEFAULT_SCALE = exports.AutoPrintRegExp = exports.AutomationEventBus = exports.animationStarted = void 0;

        function _inherits(subClass, superClass) {
          if (typeof superClass !== "function" && superClass !== null) {
            throw new TypeError("Super expression must either be null or a function");
          }

          subClass.prototype = Object.create(superClass && superClass.prototype, {
            constructor: {
              value: subClass,
              writable: true,
              configurable: true
            }
          });
          if (superClass) _setPrototypeOf(subClass, superClass);
        }

        function _setPrototypeOf(o, p) {
          _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
            o.__proto__ = p;
            return o;
          };

          return _setPrototypeOf(o, p);
        }

        function _createSuper(Derived) {
          var hasNativeReflectConstruct = _isNativeReflectConstruct();

          return function _createSuperInternal() {
            var Super = _getPrototypeOf(Derived),
                result;

            if (hasNativeReflectConstruct) {
              var NewTarget = _getPrototypeOf(this).constructor;

              result = Reflect.construct(Super, arguments, NewTarget);
            } else {
              result = Super.apply(this, arguments);
            }

            return _possibleConstructorReturn(this, result);
          };
        }

        function _possibleConstructorReturn(self, call) {
          if (call && (_typeof(call) === "object" || typeof call === "function")) {
            return call;
          } else if (call !== void 0) {
            throw new TypeError("Derived constructors may only return object or undefined");
          }

          return _assertThisInitialized(self);
        }

        function _assertThisInitialized(self) {
          if (self === void 0) {
            throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
          }

          return self;
        }

        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 (e) {
            return false;
          }
        }

        function _getPrototypeOf(o) {
          _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
            return o.__proto__ || Object.getPrototypeOf(o);
          };
          return _getPrototypeOf(o);
        }

        function _classCallCheck(instance, Constructor) {
          if (!(instance instanceof Constructor)) {
            throw new TypeError("Cannot call a class as a function");
          }
        }

        function _defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];
            descriptor.enumerable = descriptor.enumerable || false;
            descriptor.configurable = true;
            if ("value" in descriptor) descriptor.writable = true;
            Object.defineProperty(target, descriptor.key, descriptor);
          }
        }

        function _createClass(Constructor, protoProps, staticProps) {
          if (protoProps) _defineProperties(Constructor.prototype, protoProps);
          if (staticProps) _defineProperties(Constructor, staticProps);
          return Constructor;
        }

        function _typeof(obj) {
          "@babel/helpers - typeof";

          if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
            _typeof = function _typeof(obj) {
              return typeof obj;
            };
          } else {
            _typeof = function _typeof(obj) {
              return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
            };
          }

          return _typeof(obj);
        }

        function _slicedToArray(arr, i) {
          return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
        }

        function _nonIterableRest() {
          throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
        }

        function _iterableToArrayLimit(arr, i) {
          var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];

          if (_i == null) return;
          var _arr = [];
          var _n = true;
          var _d = false;

          var _s, _e;

          try {
            for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
              _arr.push(_s.value);

              if (i && _arr.length === i) break;
            }
          } catch (err) {
            _d = true;
            _e = err;
          } finally {
            try {
              if (!_n && _i["return"] != null) _i["return"]();
            } finally {
              if (_d) throw _e;
            }
          }

          return _arr;
        }

        function _arrayWithHoles(arr) {
          if (Array.isArray(arr)) return arr;
        }

        function _createForOfIteratorHelper(o, allowArrayLike) {
          var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];

          if (!it) {
            if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
              if (it) o = it;
              var i = 0;

              var F = function F() {};

              return {
                s: F,
                n: function n() {
                  if (i >= o.length) return {
                    done: true
                  };
                  return {
                    done: false,
                    value: o[i++]
                  };
                },
                e: function e(_e2) {
                  throw _e2;
                },
                f: F
              };
            }

            throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
          }

          var normalCompletion = true,
              didErr = false,
              err;
          return {
            s: function s() {
              it = it.call(o);
            },
            n: function n() {
              var step = it.next();
              normalCompletion = step.done;
              return step;
            },
            e: function e(_e3) {
              didErr = true;
              err = _e3;
            },
            f: function f() {
              try {
                if (!normalCompletion && it["return"] != null) it["return"]();
              } finally {
                if (didErr) throw err;
              }
            }
          };
        }

        function _unsupportedIterableToArray(o, minLen) {
          if (!o) return;
          if (typeof o === "string") return _arrayLikeToArray(o, minLen);
          var n = Object.prototype.toString.call(o).slice(8, -1);
          if (n === "Object" && o.constructor) n = o.constructor.name;
          if (n === "Map" || n === "Set") return Array.from(o);
          if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
        }

        function _arrayLikeToArray(arr, len) {
          if (len == null || len > arr.length) len = arr.length;

          for (var i = 0, arr2 = new Array(len); i < len; i++) {
            arr2[i] = arr[i];
          }

          return arr2;
        }

        var DEFAULT_SCALE_VALUE = "auto";
        exports.DEFAULT_SCALE_VALUE = DEFAULT_SCALE_VALUE;
        var DEFAULT_SCALE = 1.0;
        exports.DEFAULT_SCALE = DEFAULT_SCALE;
        var DEFAULT_SCALE_DELTA = 1.1;
        exports.DEFAULT_SCALE_DELTA = DEFAULT_SCALE_DELTA;
        var MIN_SCALE = 0.1;
        exports.MIN_SCALE = MIN_SCALE;
        var MAX_SCALE = 10.0;
        exports.MAX_SCALE = MAX_SCALE;
        var UNKNOWN_SCALE = 0;
        exports.UNKNOWN_SCALE = UNKNOWN_SCALE;
        var MAX_AUTO_SCALE = 1.25;
        exports.MAX_AUTO_SCALE = MAX_AUTO_SCALE;
        var SCROLLBAR_PADDING = 40;
        exports.SCROLLBAR_PADDING = SCROLLBAR_PADDING;
        var VERTICAL_PADDING = 5;
        exports.VERTICAL_PADDING = VERTICAL_PADDING;
        var LOADINGBAR_END_OFFSET_VAR = "--loadingBar-end-offset";
        var PresentationModeState = {
          UNKNOWN: 0,
          NORMAL: 1,
          CHANGING: 2,
          FULLSCREEN: 3
        };
        exports.PresentationModeState = PresentationModeState;
        var SidebarView = {
          UNKNOWN: -1,
          NONE: 0,
          THUMBS: 1,
          OUTLINE: 2,
          ATTACHMENTS: 3,
          LAYERS: 4
        };
        exports.SidebarView = SidebarView;
        var RendererType = {
          CANVAS: "canvas",
          SVG: "svg"
        };
        exports.RendererType = RendererType;
        var TextLayerMode = {
          DISABLE: 0,
          ENABLE: 1,
          ENABLE_ENHANCE: 2
        };
        exports.TextLayerMode = TextLayerMode;
        var ScrollMode = {
          UNKNOWN: -1,
          VERTICAL: 0,
          HORIZONTAL: 1,
          WRAPPED: 2
        };
        exports.ScrollMode = ScrollMode;
        var SpreadMode = {
          UNKNOWN: -1,
          NONE: 0,
          ODD: 1,
          EVEN: 2
        };
        exports.SpreadMode = SpreadMode;
        var AutoPrintRegExp = /\bprint\s*\(/;
        exports.AutoPrintRegExp = AutoPrintRegExp;

        function getOutputScale(ctx) {
          var devicePixelRatio = window.devicePixelRatio || 1;
          var backingStoreRatio = ctx.webkitBackingStorePixelRatio || ctx.mozBackingStorePixelRatio || ctx.backingStorePixelRatio || 1;
          var pixelRatio = devicePixelRatio / backingStoreRatio;
          return {
            sx: pixelRatio,
            sy: pixelRatio,
            scaled: pixelRatio !== 1
          };
        }

        function scrollIntoView(element, spot) {
          var scrollMatches = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
          var parent = element.offsetParent;

          if (!parent) {
            console.error("offsetParent is not set -- cannot scroll");
            return;
          }

          var offsetY = element.offsetTop + element.clientTop;
          var offsetX = element.offsetLeft + element.clientLeft;

          while (parent.clientHeight === parent.scrollHeight && parent.clientWidth === parent.scrollWidth || scrollMatches && (parent.classList.contains("markedContent") || getComputedStyle(parent).overflow === "hidden")) {
            offsetY += parent.offsetTop;
            offsetX += parent.offsetLeft;
            parent = parent.offsetParent;

            if (!parent) {
              return;
            }
          }

          if (spot) {
            if (spot.top !== undefined) {
              offsetY += spot.top;
            }

            if (spot.left !== undefined) {
              offsetX += spot.left;
              parent.scrollLeft = offsetX;
            }
          }

          parent.scrollTop = offsetY;
        }

        function watchScroll(viewAreaElement, callback) {
          var debounceScroll = function debounceScroll(evt) {
            if (rAF) {
              return;
            }

            rAF = window.requestAnimationFrame(function viewAreaElementScrolled() {
              rAF = null;
              var currentX = viewAreaElement.scrollLeft;
              var lastX = state.lastX;

              if (currentX !== lastX) {
                state.right = currentX > lastX;
              }

              state.lastX = currentX;
              var currentY = viewAreaElement.scrollTop;
              var lastY = state.lastY;

              if (currentY !== lastY) {
                state.down = currentY > lastY;
              }

              state.lastY = currentY;
              callback(state);
            });
          };

          var state = {
            right: true,
            down: true,
            lastX: viewAreaElement.scrollLeft,
            lastY: viewAreaElement.scrollTop,
            _eventHandler: debounceScroll
          };
          var rAF = null;
          viewAreaElement.addEventListener("scroll", debounceScroll, true);
          return state;
        }

        function parseQueryString(query) {
          var params = new Map();

          var _iterator = _createForOfIteratorHelper(query.split("&")),
              _step;

          try {
            for (_iterator.s(); !(_step = _iterator.n()).done;) {
              var part = _step.value;
              var param = part.split("="),
                  key = param[0].toLowerCase(),
                  value = param.length > 1 ? param[1] : "";
              params.set(decodeURIComponent(key), decodeURIComponent(value));
            }
          } catch (err) {
            _iterator.e(err);
          } finally {
            _iterator.f();
          }

          return params;
        }

        function binarySearchFirstItem(items, condition) {
          var minIndex = 0;
          var maxIndex = items.length - 1;

          if (maxIndex < 0 || !condition(items[maxIndex])) {
            return items.length;
          }

          if (condition(items[minIndex])) {
            return minIndex;
          }

          while (minIndex < maxIndex) {
            var currentIndex = minIndex + maxIndex >> 1;
            var currentItem = items[currentIndex];

            if (condition(currentItem)) {
              maxIndex = currentIndex;
            } else {
              minIndex = currentIndex + 1;
            }
          }

          return minIndex;
        }

        function approximateFraction(x) {
          if (Math.floor(x) === x) {
            return [x, 1];
          }

          var xinv = 1 / x;
          var limit = 8;

          if (xinv > limit) {
            return [1, limit];
          } else if (Math.floor(xinv) === xinv) {
            return [1, xinv];
          }

          var x_ = x > 1 ? xinv : x;
          var a = 0,
              b = 1,
              c = 1,
              d = 1;

          while (true) {
            var p = a + c,
                q = b + d;

            if (q > limit) {
              break;
            }

            if (x_ <= p / q) {
              c = p;
              d = q;
            } else {
              a = p;
              b = q;
            }
          }

          var result;

          if (x_ - a / b < c / d - x_) {
            result = x_ === x ? [a, b] : [b, a];
          } else {
            result = x_ === x ? [c, d] : [d, c];
          }

          return result;
        }

        function roundToDivide(x, div) {
          var r = x % div;
          return r === 0 ? x : Math.round(x - r + div);
        }

        function getPageSizeInches(_ref) {
          var view = _ref.view,
              userUnit = _ref.userUnit,
              rotate = _ref.rotate;

          var _view = _slicedToArray(view, 4),
              x1 = _view[0],
              y1 = _view[1],
              x2 = _view[2],
              y2 = _view[3];

          var changeOrientation = rotate % 180 !== 0;
          var width = (x2 - x1) / 72 * userUnit;
          var height = (y2 - y1) / 72 * userUnit;
          return {
            width: changeOrientation ? height : width,
            height: changeOrientation ? width : height
          };
        }

        function backtrackBeforeAllVisibleElements(index, views, top) {
          if (index < 2) {
            return index;
          }

          var elt = views[index].div;
          var pageTop = elt.offsetTop + elt.clientTop;

          if (pageTop >= top) {
            elt = views[index - 1].div;
            pageTop = elt.offsetTop + elt.clientTop;
          }

          for (var i = index - 2; i >= 0; --i) {
            elt = views[i].div;

            if (elt.offsetTop + elt.clientTop + elt.clientHeight <= pageTop) {
              break;
            }

            index = i;
          }

          return index;
        }

        function getVisibleElements(_ref2) {
          var scrollEl = _ref2.scrollEl,
              views = _ref2.views,
              _ref2$sortByVisibilit = _ref2.sortByVisibility,
              sortByVisibility = _ref2$sortByVisibilit === void 0 ? false : _ref2$sortByVisibilit,
              _ref2$horizontal = _ref2.horizontal,
              horizontal = _ref2$horizontal === void 0 ? false : _ref2$horizontal,
              _ref2$rtl = _ref2.rtl,
              rtl = _ref2$rtl === void 0 ? false : _ref2$rtl;
          var top = scrollEl.scrollTop,
              bottom = top + scrollEl.clientHeight;
          var left = scrollEl.scrollLeft,
              right = left + scrollEl.clientWidth;

          function isElementBottomAfterViewTop(view) {
            var element = view.div;
            var elementBottom = element.offsetTop + element.clientTop + element.clientHeight;
            return elementBottom > top;
          }

          function isElementNextAfterViewHorizontally(view) {
            var element = view.div;
            var elementLeft = element.offsetLeft + element.clientLeft;
            var elementRight = elementLeft + element.clientWidth;
            return rtl ? elementLeft < right : elementRight > left;
          }

          var visible = [],
              numViews = views.length;
          var firstVisibleElementInd = binarySearchFirstItem(views, horizontal ? isElementNextAfterViewHorizontally : isElementBottomAfterViewTop);

          if (firstVisibleElementInd > 0 && firstVisibleElementInd < numViews && !horizontal) {
            firstVisibleElementInd = backtrackBeforeAllVisibleElements(firstVisibleElementInd, views, top);
          }

          var lastEdge = horizontal ? right : -1;

          for (var i = firstVisibleElementInd; i < numViews; i++) {
            var view = views[i],
                element = view.div;
            var currentWidth = element.offsetLeft + element.clientLeft;
            var currentHeight = element.offsetTop + element.clientTop;
            var viewWidth = element.clientWidth,
                viewHeight = element.clientHeight;
            var viewRight = currentWidth + viewWidth;
            var viewBottom = currentHeight + viewHeight;

            if (lastEdge === -1) {
              if (viewBottom >= bottom) {
                lastEdge = viewBottom;
              }
            } else if ((horizontal ? currentWidth : currentHeight) > lastEdge) {
              break;
            }

            if (viewBottom <= top || currentHeight >= bottom || viewRight <= left || currentWidth >= right) {
              continue;
            }

            var hiddenHeight = Math.max(0, top - currentHeight) + Math.max(0, viewBottom - bottom);
            var hiddenWidth = Math.max(0, left - currentWidth) + Math.max(0, viewRight - right);
            var fractionHeight = (viewHeight - hiddenHeight) / viewHeight,
                fractionWidth = (viewWidth - hiddenWidth) / viewWidth;
            var percent = fractionHeight * fractionWidth * 100 | 0;
            visible.push({
              id: view.id,
              x: currentWidth,
              y: currentHeight,
              view: view,
              percent: percent,
              widthPercent: fractionWidth * 100 | 0
            });
          }

          var first = visible[0],
              last = visible[visible.length - 1];

          if (sortByVisibility) {
            visible.sort(function (a, b) {
              var pc = a.percent - b.percent;

              if (Math.abs(pc) > 0.001) {
                return -pc;
              }

              return a.id - b.id;
            });
          }

          return {
            first: first,
            last: last,
            views: visible
          };
        }

        function noContextMenuHandler(evt) {
          evt.preventDefault();
        }

        function normalizeWheelEventDirection(evt) {
          var delta = Math.hypot(evt.deltaX, evt.deltaY);
          var angle = Math.atan2(evt.deltaY, evt.deltaX);

          if (-0.25 * Math.PI < angle && angle < 0.75 * Math.PI) {
            delta = -delta;
          }

          return delta;
        }

        function normalizeWheelEventDelta(evt) {
          var delta = normalizeWheelEventDirection(evt);
          var MOUSE_DOM_DELTA_PIXEL_MODE = 0;
          var MOUSE_DOM_DELTA_LINE_MODE = 1;
          var MOUSE_PIXELS_PER_LINE = 30;
          var MOUSE_LINES_PER_PAGE = 30;

          if (evt.deltaMode === MOUSE_DOM_DELTA_PIXEL_MODE) {
            delta /= MOUSE_PIXELS_PER_LINE * MOUSE_LINES_PER_PAGE;
          } else if (evt.deltaMode === MOUSE_DOM_DELTA_LINE_MODE) {
            delta /= MOUSE_LINES_PER_PAGE;
          }

          return delta;
        }

        function isValidRotation(angle) {
          return Number.isInteger(angle) && angle % 90 === 0;
        }

        function isValidScrollMode(mode) {
          return Number.isInteger(mode) && Object.values(ScrollMode).includes(mode) && mode !== ScrollMode.UNKNOWN;
        }

        function isValidSpreadMode(mode) {
          return Number.isInteger(mode) && Object.values(SpreadMode).includes(mode) && mode !== SpreadMode.UNKNOWN;
        }

        function isPortraitOrientation(size) {
          return size.width <= size.height;
        }

        var WaitOnType = {
          EVENT: "event",
          TIMEOUT: "timeout"
        };
        exports.WaitOnType = WaitOnType;

        function waitOnEventOrTimeout(_ref3) {
          var target = _ref3.target,
              name = _ref3.name,
              _ref3$delay = _ref3.delay,
              delay = _ref3$delay === void 0 ? 0 : _ref3$delay;
          return new Promise(function (resolve, reject) {
            if (_typeof(target) !== "object" || !(name && typeof name === "string") || !(Number.isInteger(delay) && delay >= 0)) {
              throw new Error("waitOnEventOrTimeout - invalid parameters.");
            }

            function handler(type) {
              if (target instanceof EventBus) {
                target._off(name, eventHandler);
              } else {
                target.removeEventListener(name, eventHandler);
              }

              if (timeout) {
                clearTimeout(timeout);
              }

              resolve(type);
            }

            var eventHandler = handler.bind(null, WaitOnType.EVENT);

            if (target instanceof EventBus) {
              target._on(name, eventHandler);
            } else {
              target.addEventListener(name, eventHandler);
            }

            var timeoutHandler = handler.bind(null, WaitOnType.TIMEOUT);
            var timeout = setTimeout(timeoutHandler, delay);
          });
        }

        var animationStarted = new Promise(function (resolve) {
          window.requestAnimationFrame(resolve);
        });
        exports.animationStarted = animationStarted;

        var EventBus = /*#__PURE__*/function () {
          function EventBus() {
            _classCallCheck(this, EventBus);

            this._listeners = Object.create(null);
          }

          _createClass(EventBus, [{
            key: "on",
            value: function on(eventName, listener) {
              var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;

              this._on(eventName, listener, {
                external: true,
                once: options === null || options === void 0 ? void 0 : options.once
              });
            }
          }, {
            key: "off",
            value: function off(eventName, listener) {
              var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;

              this._off(eventName, listener, {
                external: true,
                once: options === null || options === void 0 ? void 0 : options.once
              });
            }
          }, {
            key: "dispatch",
            value: function dispatch(eventName, data) {
              var eventListeners = this._listeners[eventName];

              if (!eventListeners || eventListeners.length === 0) {
                return;
              }

              var externalListeners;

              var _iterator2 = _createForOfIteratorHelper(eventListeners.slice(0)),
                  _step2;

              try {
                for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
                  var _step2$value = _step2.value,
                      _listener = _step2$value.listener,
                      external = _step2$value.external,
                      once = _step2$value.once;

                  if (once) {
                    this._off(eventName, _listener);
                  }

                  if (external) {
                    (externalListeners || (externalListeners = [])).push(_listener);
                    continue;
                  }

                  _listener(data);
                }
              } catch (err) {
                _iterator2.e(err);
              } finally {
                _iterator2.f();
              }

              if (externalListeners) {
                var _iterator3 = _createForOfIteratorHelper(externalListeners),
                    _step3;

                try {
                  for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
                    var listener = _step3.value;
                    listener(data);
                  }
                } catch (err) {
                  _iterator3.e(err);
                } finally {
                  _iterator3.f();
                }

                externalListeners = null;
              }
            }
          }, {
            key: "_on",
            value: function _on(eventName, listener) {
              var _this$_listeners;

              var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
              var eventListeners = (_this$_listeners = this._listeners)[eventName] || (_this$_listeners[eventName] = []);
              eventListeners.push({
                listener: listener,
                external: (options === null || options === void 0 ? void 0 : options.external) === true,
                once: (options === null || options === void 0 ? void 0 : options.once) === true
              });
            }
          }, {
            key: "_off",
            value: function _off(eventName, listener) {
              var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
              var eventListeners = this._listeners[eventName];

              if (!eventListeners) {
                return;
              }

              for (var i = 0, ii = eventListeners.length; i < ii; i++) {
                if (eventListeners[i].listener === listener) {
                  eventListeners.splice(i, 1);
                  return;
                }
              }
            }
          }]);

          return EventBus;
        }();

        exports.EventBus = EventBus;

        var AutomationEventBus = /*#__PURE__*/function (_EventBus) {
          _inherits(AutomationEventBus, _EventBus);

          var _super = _createSuper(AutomationEventBus);

          function AutomationEventBus() {
            _classCallCheck(this, AutomationEventBus);

            return _super.apply(this, arguments);
          }

          _createClass(AutomationEventBus, [{
            key: "dispatch",
            value: function dispatch(eventName, data) {
              throw new Error("Not implemented: AutomationEventBus.dispatch");
            }
          }]);

          return AutomationEventBus;
        }(EventBus);

        exports.AutomationEventBus = AutomationEventBus;

        function clamp(v, min, max) {
          return Math.min(Math.max(v, min), max);
        }

        var ProgressBar = /*#__PURE__*/function () {
          function ProgressBar(id) {
            var _ref4 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
                height = _ref4.height,
                width = _ref4.width,
                units = _ref4.units;

            _classCallCheck(this, ProgressBar);

            this.visible = true;
            this.div = document.querySelector(id + " .progress");
            this.bar = this.div.parentNode;
            this.height = height || 100;
            this.width = width || 100;
            this.units = units || "%";
            this.div.style.height = this.height + this.units;
            this.percent = 0;
          }

          _createClass(ProgressBar, [{
            key: "_updateBar",
            value: function _updateBar() {
              if (this._indeterminate) {
                this.div.classList.add("indeterminate");
                this.div.style.width = this.width + this.units;
                return;
              }

              this.div.classList.remove("indeterminate");
              var progressSize = this.width * this._percent / 100;
              this.div.style.width = progressSize + this.units;
            }
          }, {
            key: "percent",
            get: function get() {
              return this._percent;
            },
            set: function set(val) {
              this._indeterminate = isNaN(val);
              this._percent = clamp(val, 0, 100);

              this._updateBar();
            }
          }, {
            key: "setWidth",
            value: function setWidth(viewer) {
              if (!viewer) {
                return;
              }

              var container = viewer.parentNode;
              var scrollbarWidth = container.offsetWidth - viewer.offsetWidth;

              if (scrollbarWidth > 0) {
                var doc = document.documentElement;
                doc.style.setProperty(LOADINGBAR_END_OFFSET_VAR, "".concat(scrollbarWidth, "px"));
              }
            }
          }, {
            key: "hide",
            value: function hide() {
              if (!this.visible) {
                return;
              }

              this.visible = false;
              this.bar.classList.add("hidden");
            }
          }, {
            key: "show",
            value: function show() {
              if (this.visible) {
                return;
              }

              this.visible = true;
              this.bar.classList.remove("hidden");
            }
          }]);

          return ProgressBar;
        }();

        exports.ProgressBar = ProgressBar;

        function moveToEndOfArray(arr, condition) {
          var moved = [],
              len = arr.length;
          var write = 0;

          for (var read = 0; read < len; ++read) {
            if (condition(arr[read])) {
              moved.push(arr[read]);
            } else {
              arr[write] = arr[read];
              ++write;
            }
          }

          for (var _read = 0; write < len; ++_read, ++write) {
            arr[write] = moved[_read];
          }
        }

        function getActiveOrFocusedElement() {
          var curRoot = document;
          var curActiveOrFocused = curRoot.activeElement || curRoot.querySelector(":focus");

          while ((_curActiveOrFocused = curActiveOrFocused) !== null && _curActiveOrFocused !== void 0 && _curActiveOrFocused.shadowRoot) {
            var _curActiveOrFocused;

            curRoot = curActiveOrFocused.shadowRoot;
            curActiveOrFocused = curRoot.activeElement || curRoot.querySelector(":focus");
          }

          return curActiveOrFocused;
        }

        function apiPageLayoutToSpreadMode(layout) {
          switch (layout) {
            case "SinglePage":
            case "OneColumn":
              return SpreadMode.NONE;

            case "TwoColumnLeft":
            case "TwoPageLeft":
              return SpreadMode.ODD;

            case "TwoColumnRight":
            case "TwoPageRight":
              return SpreadMode.EVEN;
          }

          return SpreadMode.NONE;
        }

        function apiPageModeToSidebarView(mode) {
          switch (mode) {
            case "UseNone":
              return SidebarView.NONE;

            case "UseThumbs":
              return SidebarView.THUMBS;

            case "UseOutlines":
              return SidebarView.OUTLINE;

            case "UseAttachments":
              return SidebarView.ATTACHMENTS;

            case "UseOC":
              return SidebarView.LAYERS;
          }

          return SidebarView.NONE;
        }
        /***/

      },
      /* 8 */

      /***/
      function (__unused_webpack_module, exports) {
        Object.defineProperty(exports, "__esModule", {
          value: true
        });
        exports.StructTreeLayerBuilder = exports.DefaultStructTreeLayerFactory = void 0;

        function _createForOfIteratorHelper(o, allowArrayLike) {
          var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];

          if (!it) {
            if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
              if (it) o = it;
              var i = 0;

              var F = function F() {};

              return {
                s: F,
                n: function n() {
                  if (i >= o.length) return {
                    done: true
                  };
                  return {
                    done: false,
                    value: o[i++]
                  };
                },
                e: function e(_e) {
                  throw _e;
                },
                f: F
              };
            }

            throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
          }

          var normalCompletion = true,
              didErr = false,
              err;
          return {
            s: function s() {
              it = it.call(o);
            },
            n: function n() {
              var step = it.next();
              normalCompletion = step.done;
              return step;
            },
            e: function e(_e2) {
              didErr = true;
              err = _e2;
            },
            f: function f() {
              try {
                if (!normalCompletion && it["return"] != null) it["return"]();
              } finally {
                if (didErr) throw err;
              }
            }
          };
        }

        function _unsupportedIterableToArray(o, minLen) {
          if (!o) return;
          if (typeof o === "string") return _arrayLikeToArray(o, minLen);
          var n = Object.prototype.toString.call(o).slice(8, -1);
          if (n === "Object" && o.constructor) n = o.constructor.name;
          if (n === "Map" || n === "Set") return Array.from(o);
          if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
        }

        function _arrayLikeToArray(arr, len) {
          if (len == null || len > arr.length) len = arr.length;

          for (var i = 0, arr2 = new Array(len); i < len; i++) {
            arr2[i] = arr[i];
          }

          return arr2;
        }

        function _classCallCheck(instance, Constructor) {
          if (!(instance instanceof Constructor)) {
            throw new TypeError("Cannot call a class as a function");
          }
        }

        function _defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];
            descriptor.enumerable = descriptor.enumerable || false;
            descriptor.configurable = true;
            if ("value" in descriptor) descriptor.writable = true;
            Object.defineProperty(target, descriptor.key, descriptor);
          }
        }

        function _createClass(Constructor, protoProps, staticProps) {
          if (protoProps) _defineProperties(Constructor.prototype, protoProps);
          if (staticProps) _defineProperties(Constructor, staticProps);
          return Constructor;
        }

        var PDF_ROLE_TO_HTML_ROLE = {
          Document: null,
          DocumentFragment: null,
          Part: "group",
          Sect: "group",
          Div: "group",
          Aside: "note",
          NonStruct: "none",
          P: null,
          H: "heading",
          Title: null,
          FENote: "note",
          Sub: "group",
          Lbl: null,
          Span: null,
          Em: null,
          Strong: null,
          Link: "link",
          Annot: "note",
          Form: "form",
          Ruby: null,
          RB: null,
          RT: null,
          RP: null,
          Warichu: null,
          WT: null,
          WP: null,
          L: "list",
          LI: "listitem",
          LBody: null,
          Table: "table",
          TR: "row",
          TH: "columnheader",
          TD: "cell",
          THead: "columnheader",
          TBody: null,
          TFoot: null,
          Caption: null,
          Figure: "figure",
          Formula: null,
          Artifact: null
        };
        var HEADING_PATTERN = /^H(\d+)$/;

        var StructTreeLayerBuilder = /*#__PURE__*/function () {
          function StructTreeLayerBuilder(_ref) {
            var pdfPage = _ref.pdfPage;

            _classCallCheck(this, StructTreeLayerBuilder);

            this.pdfPage = pdfPage;
          }

          _createClass(StructTreeLayerBuilder, [{
            key: "render",
            value: function render(structTree) {
              return this._walk(structTree);
            }
          }, {
            key: "_setAttributes",
            value: function _setAttributes(structElement, htmlElement) {
              if (structElement.alt !== undefined) {
                htmlElement.setAttribute("aria-label", structElement.alt);
              }

              if (structElement.id !== undefined) {
                htmlElement.setAttribute("aria-owns", structElement.id);
              }
            }
          }, {
            key: "_walk",
            value: function _walk(node) {
              if (!node) {
                return null;
              }

              var element = document.createElement("span");

              if ("role" in node) {
                var role = node.role;
                var match = role.match(HEADING_PATTERN);

                if (match) {
                  element.setAttribute("role", "heading");
                  element.setAttribute("aria-level", match[1]);
                } else if (PDF_ROLE_TO_HTML_ROLE[role]) {
                  element.setAttribute("role", PDF_ROLE_TO_HTML_ROLE[role]);
                }
              }

              this._setAttributes(node, element);

              if (node.children) {
                if (node.children.length === 1 && "id" in node.children[0]) {
                  this._setAttributes(node.children[0], element);
                } else {
                  var _iterator = _createForOfIteratorHelper(node.children),
                      _step;

                  try {
                    for (_iterator.s(); !(_step = _iterator.n()).done;) {
                      var kid = _step.value;
                      element.appendChild(this._walk(kid));
                    }
                  } catch (err) {
                    _iterator.e(err);
                  } finally {
                    _iterator.f();
                  }
                }
              }

              return element;
            }
          }]);

          return StructTreeLayerBuilder;
        }();

        exports.StructTreeLayerBuilder = StructTreeLayerBuilder;

        var DefaultStructTreeLayerFactory = /*#__PURE__*/function () {
          function DefaultStructTreeLayerFactory() {
            _classCallCheck(this, DefaultStructTreeLayerFactory);
          }

          _createClass(DefaultStructTreeLayerFactory, [{
            key: "createStructTreeLayerBuilder",
            value: function createStructTreeLayerBuilder(pdfPage) {
              return new StructTreeLayerBuilder({
                pdfPage: pdfPage
              });
            }
          }]);

          return DefaultStructTreeLayerFactory;
        }();

        exports.DefaultStructTreeLayerFactory = DefaultStructTreeLayerFactory;
        /***/
      },
      /* 9 */

      /***/
      function (__unused_webpack_module, exports, __w_pdfjs_require__) {
        Object.defineProperty(exports, "__esModule", {
          value: true
        });
        exports.TextLayerBuilder = exports.DefaultTextLayerFactory = void 0;

        var _pdfjsLib = __w_pdfjs_require__(4);

        function _classCallCheck(instance, Constructor) {
          if (!(instance instanceof Constructor)) {
            throw new TypeError("Cannot call a class as a function");
          }
        }

        function _defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];
            descriptor.enumerable = descriptor.enumerable || false;
            descriptor.configurable = true;
            if ("value" in descriptor) descriptor.writable = true;
            Object.defineProperty(target, descriptor.key, descriptor);
          }
        }

        function _createClass(Constructor, protoProps, staticProps) {
          if (protoProps) _defineProperties(Constructor.prototype, protoProps);
          if (staticProps) _defineProperties(Constructor, staticProps);
          return Constructor;
        }

        var EXPAND_DIVS_TIMEOUT = 300;

        var TextLayerBuilder = /*#__PURE__*/function () {
          function TextLayerBuilder(_ref) {
            var textLayerDiv = _ref.textLayerDiv,
                eventBus = _ref.eventBus,
                pageIndex = _ref.pageIndex,
                viewport = _ref.viewport,
                _ref$highlighter = _ref.highlighter,
                highlighter = _ref$highlighter === void 0 ? null : _ref$highlighter,
                _ref$enhanceTextSelec = _ref.enhanceTextSelection,
                enhanceTextSelection = _ref$enhanceTextSelec === void 0 ? false : _ref$enhanceTextSelec;

            _classCallCheck(this, TextLayerBuilder);

            this.textLayerDiv = textLayerDiv;
            this.eventBus = eventBus;
            this.textContent = null;
            this.textContentItemsStr = [];
            this.textContentStream = null;
            this.renderingDone = false;
            this.pageNumber = pageIndex + 1;
            this.viewport = viewport;
            this.textDivs = [];
            this.textLayerRenderTask = null;
            this.highlighter = highlighter;
            this.enhanceTextSelection = enhanceTextSelection;

            this._bindMouse();
          }

          _createClass(TextLayerBuilder, [{
            key: "_finishRendering",
            value: function _finishRendering() {
              this.renderingDone = true;

              if (!this.enhanceTextSelection) {
                var endOfContent = document.createElement("div");
                endOfContent.className = "endOfContent";
                this.textLayerDiv.appendChild(endOfContent);
              }

              this.eventBus.dispatch("textlayerrendered", {
                source: this,
                pageNumber: this.pageNumber,
                numTextDivs: this.textDivs.length
              });
            }
          }, {
            key: "render",
            value: function render() {
              var _this$highlighter,
                  _this = this;

              var timeout = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;

              if (!(this.textContent || this.textContentStream) || this.renderingDone) {
                return;
              }

              this.cancel();
              this.textDivs.length = 0;
              (_this$highlighter = this.highlighter) === null || _this$highlighter === void 0 ? void 0 : _this$highlighter.setTextMapping(this.textDivs, this.textContentItemsStr);
              var textLayerFrag = document.createDocumentFragment();
              this.textLayerRenderTask = (0, _pdfjsLib.renderTextLayer)({
                textContent: this.textContent,
                textContentStream: this.textContentStream,
                container: textLayerFrag,
                viewport: this.viewport,
                textDivs: this.textDivs,
                textContentItemsStr: this.textContentItemsStr,
                timeout: timeout,
                enhanceTextSelection: this.enhanceTextSelection
              });
              this.textLayerRenderTask.promise.then(function () {
                var _this$highlighter2;

                _this.textLayerDiv.appendChild(textLayerFrag);

                _this._finishRendering();

                (_this$highlighter2 = _this.highlighter) === null || _this$highlighter2 === void 0 ? void 0 : _this$highlighter2.enable();
              }, function (reason) {});
            }
          }, {
            key: "cancel",
            value: function cancel() {
              var _this$highlighter3;

              if (this.textLayerRenderTask) {
                this.textLayerRenderTask.cancel();
                this.textLayerRenderTask = null;
              }

              (_this$highlighter3 = this.highlighter) === null || _this$highlighter3 === void 0 ? void 0 : _this$highlighter3.disable();
            }
          }, {
            key: "setTextContentStream",
            value: function setTextContentStream(readableStream) {
              this.cancel();
              this.textContentStream = readableStream;
            }
          }, {
            key: "setTextContent",
            value: function setTextContent(textContent) {
              this.cancel();
              this.textContent = textContent;
            }
          }, {
            key: "_bindMouse",
            value: function _bindMouse() {
              var _this2 = this;

              var div = this.textLayerDiv;
              var expandDivsTimer = null;
              div.addEventListener("mousedown", function (evt) {
                if (_this2.enhanceTextSelection && _this2.textLayerRenderTask) {
                  _this2.textLayerRenderTask.expandTextDivs(true);

                  if (expandDivsTimer) {
                    clearTimeout(expandDivsTimer);
                    expandDivsTimer = null;
                  }

                  return;
                }

                var end = div.querySelector(".endOfContent");

                if (!end) {
                  return;
                }

                var adjustTop = evt.target !== div;
                adjustTop = adjustTop && window.getComputedStyle(end).getPropertyValue("-moz-user-select") !== "none";

                if (adjustTop) {
                  var divBounds = div.getBoundingClientRect();
                  var r = Math.max(0, (evt.pageY - divBounds.top) / divBounds.height);
                  end.style.top = (r * 100).toFixed(2) + "%";
                }

                end.classList.add("active");
              });
              div.addEventListener("mouseup", function () {
                if (_this2.enhanceTextSelection && _this2.textLayerRenderTask) {
                  expandDivsTimer = setTimeout(function () {
                    if (_this2.textLayerRenderTask) {
                      _this2.textLayerRenderTask.expandTextDivs(false);
                    }

                    expandDivsTimer = null;
                  }, EXPAND_DIVS_TIMEOUT);
                  return;
                }

                var end = div.querySelector(".endOfContent");

                if (!end) {
                  return;
                }

                end.style.top = "";
                end.classList.remove("active");
              });
            }
          }]);

          return TextLayerBuilder;
        }();

        exports.TextLayerBuilder = TextLayerBuilder;

        var DefaultTextLayerFactory = /*#__PURE__*/function () {
          function DefaultTextLayerFactory() {
            _classCallCheck(this, DefaultTextLayerFactory);
          }

          _createClass(DefaultTextLayerFactory, [{
            key: "createTextLayerBuilder",
            value: function createTextLayerBuilder(textLayerDiv, pageIndex, viewport) {
              var enhanceTextSelection = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
              var eventBus = arguments.length > 4 ? arguments[4] : undefined;
              var highlighter = arguments.length > 5 ? arguments[5] : undefined;
              return new TextLayerBuilder({
                textLayerDiv: textLayerDiv,
                pageIndex: pageIndex,
                viewport: viewport,
                enhanceTextSelection: enhanceTextSelection,
                eventBus: eventBus,
                highlighter: highlighter
              });
            }
          }]);

          return DefaultTextLayerFactory;
        }();

        exports.DefaultTextLayerFactory = DefaultTextLayerFactory;
        /***/
      },
      /* 10 */

      /***/
      function (__unused_webpack_module, exports, __w_pdfjs_require__) {
        Object.defineProperty(exports, "__esModule", {
          value: true
        });
        exports.XfaLayerBuilder = exports.DefaultXfaLayerFactory = void 0;

        var _pdf_link_service = __w_pdfjs_require__(6);

        var _pdfjsLib = __w_pdfjs_require__(4);

        function _classCallCheck(instance, Constructor) {
          if (!(instance instanceof Constructor)) {
            throw new TypeError("Cannot call a class as a function");
          }
        }

        function _defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];
            descriptor.enumerable = descriptor.enumerable || false;
            descriptor.configurable = true;
            if ("value" in descriptor) descriptor.writable = true;
            Object.defineProperty(target, descriptor.key, descriptor);
          }
        }

        function _createClass(Constructor, protoProps, staticProps) {
          if (protoProps) _defineProperties(Constructor.prototype, protoProps);
          if (staticProps) _defineProperties(Constructor, staticProps);
          return Constructor;
        }

        var XfaLayerBuilder = /*#__PURE__*/function () {
          function XfaLayerBuilder(_ref) {
            var pageDiv = _ref.pageDiv,
                pdfPage = _ref.pdfPage,
                annotationStorage = _ref.annotationStorage,
                linkService = _ref.linkService,
                xfaHtml = _ref.xfaHtml;

            _classCallCheck(this, XfaLayerBuilder);

            this.pageDiv = pageDiv;
            this.pdfPage = pdfPage;
            this.annotationStorage = annotationStorage;
            this.linkService = linkService;
            this.xfaHtml = xfaHtml;
            this.div = null;
            this._cancelled = false;
          }

          _createClass(XfaLayerBuilder, [{
            key: "render",
            value: function render(viewport) {
              var _this = this;

              var intent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "display";

              if (intent === "print") {
                var parameters = {
                  viewport: viewport.clone({
                    dontFlip: true
                  }),
                  div: this.div,
                  xfa: this.xfaHtml,
                  page: null,
                  annotationStorage: this.annotationStorage,
                  linkService: this.linkService,
                  intent: intent
                };
                var div = document.createElement("div");
                this.pageDiv.appendChild(div);
                parameters.div = div;

                var result = _pdfjsLib.XfaLayer.render(parameters);

                return Promise.resolve(result);
              }

              return this.pdfPage.getXfa().then(function (xfa) {
                if (_this._cancelled || !xfa) {
                  return {
                    textDivs: []
                  };
                }

                var parameters = {
                  viewport: viewport.clone({
                    dontFlip: true
                  }),
                  div: _this.div,
                  xfa: xfa,
                  page: _this.pdfPage,
                  annotationStorage: _this.annotationStorage,
                  linkService: _this.linkService,
                  intent: intent
                };

                if (_this.div) {
                  return _pdfjsLib.XfaLayer.update(parameters);
                }

                _this.div = document.createElement("div");

                _this.pageDiv.appendChild(_this.div);

                parameters.div = _this.div;
                return _pdfjsLib.XfaLayer.render(parameters);
              })["catch"](function (error) {
                console.error(error);
              });
            }
          }, {
            key: "cancel",
            value: function cancel() {
              this._cancelled = true;
            }
          }, {
            key: "hide",
            value: function hide() {
              if (!this.div) {
                return;
              }

              this.div.hidden = true;
            }
          }]);

          return XfaLayerBuilder;
        }();

        exports.XfaLayerBuilder = XfaLayerBuilder;

        var DefaultXfaLayerFactory = /*#__PURE__*/function () {
          function DefaultXfaLayerFactory() {
            _classCallCheck(this, DefaultXfaLayerFactory);
          }

          _createClass(DefaultXfaLayerFactory, [{
            key: "createXfaLayerBuilder",
            value: function createXfaLayerBuilder(pageDiv, pdfPage) {
              var annotationStorage = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
              var xfaHtml = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
              return new XfaLayerBuilder({
                pageDiv: pageDiv,
                pdfPage: pdfPage,
                annotationStorage: annotationStorage,
                linkService: new _pdf_link_service.SimpleLinkService(),
                xfaHtml: xfaHtml
              });
            }
          }]);

          return DefaultXfaLayerFactory;
        }();

        exports.DefaultXfaLayerFactory = DefaultXfaLayerFactory;
        /***/
      },
      /* 11 */

      /***/
      function (__unused_webpack_module, exports, __w_pdfjs_require__) {
        Object.defineProperty(exports, "__esModule", {
          value: true
        });
        exports.DownloadManager = void 0;

        var _pdfjsLib = __w_pdfjs_require__(4);

        var _app_options = __w_pdfjs_require__(12);

        function _classCallCheck(instance, Constructor) {
          if (!(instance instanceof Constructor)) {
            throw new TypeError("Cannot call a class as a function");
          }
        }

        function _defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];
            descriptor.enumerable = descriptor.enumerable || false;
            descriptor.configurable = true;
            if ("value" in descriptor) descriptor.writable = true;
            Object.defineProperty(target, descriptor.key, descriptor);
          }
        }

        function _createClass(Constructor, protoProps, staticProps) {
          if (protoProps) _defineProperties(Constructor.prototype, protoProps);
          if (staticProps) _defineProperties(Constructor, staticProps);
          return Constructor;
        }

        ;

        function _download(blobUrl, filename) {
          var a = document.createElement("a");

          if (!a.click) {
            throw new Error('DownloadManager: "a.click()" is not supported.');
          }

          a.href = blobUrl;
          a.target = "_parent";

          if ("download" in a) {
            a.download = filename;
          }

          (document.body || document.documentElement).appendChild(a);
          a.click();
          a.remove();
        }

        var DownloadManager = /*#__PURE__*/function () {
          function DownloadManager() {
            _classCallCheck(this, DownloadManager);

            this._openBlobUrls = new WeakMap();
          }

          _createClass(DownloadManager, [{
            key: "downloadUrl",
            value: function downloadUrl(url, filename) {
              if (!(0, _pdfjsLib.createValidAbsoluteUrl)(url, "http://example.com")) {
                console.error("downloadUrl - not a valid URL: ".concat(url));
                return;
              }

              _download(url + "#pdfjs.action=download", filename);
            }
          }, {
            key: "downloadData",
            value: function downloadData(data, filename, contentType) {
              var blobUrl = (0, _pdfjsLib.createObjectURL)(data, contentType, _app_options.compatibilityParams.disableCreateObjectURL);

              _download(blobUrl, filename);
            }
          }, {
            key: "openOrDownloadData",
            value: function openOrDownloadData(element, data, filename) {
              var isPdfData = (0, _pdfjsLib.isPdfFile)(filename);
              var contentType = isPdfData ? "application/pdf" : "";

              if (isPdfData && !_app_options.compatibilityParams.disableCreateObjectURL) {
                var blobUrl = this._openBlobUrls.get(element);

                if (!blobUrl) {
                  blobUrl = URL.createObjectURL(new Blob([data], {
                    type: contentType
                  }));

                  this._openBlobUrls.set(element, blobUrl);
                }

                var viewerUrl;
                viewerUrl = "?file=" + encodeURIComponent(blobUrl + "#" + filename);

                try {
                  window.open(viewerUrl);
                  return true;
                } catch (ex) {
                  console.error("openOrDownloadData: ".concat(ex));
                  URL.revokeObjectURL(blobUrl);

                  this._openBlobUrls["delete"](element);
                }
              }

              this.downloadData(data, filename, contentType);
              return false;
            }
          }, {
            key: "download",
            value: function download(blob, url, filename) {
              var sourceEventType = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "download";

              if (_app_options.compatibilityParams.disableCreateObjectURL) {
                this.downloadUrl(url, filename);
                return;
              }

              var blobUrl = URL.createObjectURL(blob);

              _download(blobUrl, filename);
            }
          }]);

          return DownloadManager;
        }();

        exports.DownloadManager = DownloadManager;
        /***/
      },
      /* 12 */

      /***/
      function (__unused_webpack_module, exports) {
        Object.defineProperty(exports, "__esModule", {
          value: true
        });
        exports.OptionKind = exports.compatibilityParams = exports.AppOptions = void 0;

        function _typeof(obj) {
          "@babel/helpers - typeof";

          if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
            _typeof = function _typeof(obj) {
              return typeof obj;
            };
          } else {
            _typeof = function _typeof(obj) {
              return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
            };
          }

          return _typeof(obj);
        }

        function _classCallCheck(instance, Constructor) {
          if (!(instance instanceof Constructor)) {
            throw new TypeError("Cannot call a class as a function");
          }
        }

        function _defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];
            descriptor.enumerable = descriptor.enumerable || false;
            descriptor.configurable = true;
            if ("value" in descriptor) descriptor.writable = true;
            Object.defineProperty(target, descriptor.key, descriptor);
          }
        }

        function _createClass(Constructor, protoProps, staticProps) {
          if (protoProps) _defineProperties(Constructor.prototype, protoProps);
          if (staticProps) _defineProperties(Constructor, staticProps);
          return Constructor;
        }

        var compatibilityParams = Object.create(null);
        exports.compatibilityParams = compatibilityParams;
        {
          var userAgent = typeof navigator !== "undefined" && navigator.userAgent || "";
          var platform = typeof navigator !== "undefined" && navigator.platform || "";
          var maxTouchPoints = typeof navigator !== "undefined" && navigator.maxTouchPoints || 1;
          var isAndroid = /Android/.test(userAgent);
          var isIOS = /\b(iPad|iPhone|iPod)(?=;)/.test(userAgent) || platform === "MacIntel" && maxTouchPoints > 1;
          var isIOSChrome = /CriOS/.test(userAgent);

          (function checkOnBlobSupport() {
            if (isIOSChrome) {
              compatibilityParams.disableCreateObjectURL = true;
            }
          })();

          (function checkCanvasSizeLimitation() {
            if (isIOS || isAndroid) {
              compatibilityParams.maxCanvasPixels = 5242880;
            }
          })();
        }
        var OptionKind = {
          VIEWER: 0x02,
          API: 0x04,
          WORKER: 0x08,
          PREFERENCE: 0x80
        };
        exports.OptionKind = OptionKind;
        var defaultOptions = {
          annotationMode: {
            value: 2,
            kind: OptionKind.VIEWER + OptionKind.PREFERENCE
          },
          cursorToolOnLoad: {
            value: 0,
            kind: OptionKind.VIEWER + OptionKind.PREFERENCE
          },
          defaultUrl: {
            value: "compressed.tracemonkey-pldi-09.pdf",
            kind: OptionKind.VIEWER
          },
          defaultZoomValue: {
            value: "",
            kind: OptionKind.VIEWER + OptionKind.PREFERENCE
          },
          disableHistory: {
            value: false,
            kind: OptionKind.VIEWER
          },
          disablePageLabels: {
            value: false,
            kind: OptionKind.VIEWER + OptionKind.PREFERENCE
          },
          enablePermissions: {
            value: false,
            kind: OptionKind.VIEWER + OptionKind.PREFERENCE
          },
          enablePrintAutoRotate: {
            value: true,
            kind: OptionKind.VIEWER + OptionKind.PREFERENCE
          },
          enableScripting: {
            value: true,
            kind: OptionKind.VIEWER + OptionKind.PREFERENCE
          },
          externalLinkRel: {
            value: "noopener noreferrer nofollow",
            kind: OptionKind.VIEWER
          },
          externalLinkTarget: {
            value: 0,
            kind: OptionKind.VIEWER + OptionKind.PREFERENCE
          },
          historyUpdateUrl: {
            value: false,
            kind: OptionKind.VIEWER + OptionKind.PREFERENCE
          },
          ignoreDestinationZoom: {
            value: false,
            kind: OptionKind.VIEWER + OptionKind.PREFERENCE
          },
          imageResourcesPath: {
            value: "./images/",
            kind: OptionKind.VIEWER
          },
          maxCanvasPixels: {
            value: 16777216,
            compatibility: compatibilityParams.maxCanvasPixels,
            kind: OptionKind.VIEWER
          },
          pdfBugEnabled: {
            value: false,
            kind: OptionKind.VIEWER + OptionKind.PREFERENCE
          },
          printResolution: {
            value: 150,
            kind: OptionKind.VIEWER
          },
          renderer: {
            value: "canvas",
            kind: OptionKind.VIEWER
          },
          sidebarViewOnLoad: {
            value: -1,
            kind: OptionKind.VIEWER + OptionKind.PREFERENCE
          },
          scrollModeOnLoad: {
            value: -1,
            kind: OptionKind.VIEWER + OptionKind.PREFERENCE
          },
          spreadModeOnLoad: {
            value: -1,
            kind: OptionKind.VIEWER + OptionKind.PREFERENCE
          },
          textLayerMode: {
            value: 1,
            kind: OptionKind.VIEWER + OptionKind.PREFERENCE
          },
          useOnlyCssZoom: {
            value: false,
            kind: OptionKind.VIEWER + OptionKind.PREFERENCE
          },
          viewerCssTheme: {
            value: 0,
            kind: OptionKind.VIEWER + OptionKind.PREFERENCE
          },
          viewOnLoad: {
            value: 0,
            kind: OptionKind.VIEWER + OptionKind.PREFERENCE
          },
          cMapPacked: {
            value: true,
            kind: OptionKind.API
          },
          cMapUrl: {
            value: "../web/cmaps/",
            kind: OptionKind.API
          },
          disableAutoFetch: {
            value: false,
            kind: OptionKind.API + OptionKind.PREFERENCE
          },
          disableFontFace: {
            value: false,
            kind: OptionKind.API + OptionKind.PREFERENCE
          },
          disableRange: {
            value: false,
            kind: OptionKind.API + OptionKind.PREFERENCE
          },
          disableStream: {
            value: false,
            kind: OptionKind.API + OptionKind.PREFERENCE
          },
          docBaseUrl: {
            value: "",
            kind: OptionKind.API
          },
          enableXfa: {
            value: true,
            kind: OptionKind.API + OptionKind.PREFERENCE
          },
          fontExtraProperties: {
            value: false,
            kind: OptionKind.API
          },
          isEvalSupported: {
            value: true,
            kind: OptionKind.API
          },
          maxImageSize: {
            value: -1,
            kind: OptionKind.API
          },
          pdfBug: {
            value: false,
            kind: OptionKind.API
          },
          standardFontDataUrl: {
            value: "../web/standard_fonts/",
            kind: OptionKind.API
          },
          verbosity: {
            value: 1,
            kind: OptionKind.API
          },
          workerPort: {
            value: null,
            kind: OptionKind.WORKER
          },
          workerSrc: {
            value: "../build/pdf.worker.js",
            kind: OptionKind.WORKER
          }
        };
        {
          defaultOptions.disablePreferences = {
            value: false,
            kind: OptionKind.VIEWER
          };
          defaultOptions.locale = {
            value: typeof navigator !== "undefined" ? navigator.language : "en-US",
            kind: OptionKind.VIEWER
          };
          defaultOptions.sandboxBundleSrc = {
            value: "../build/pdf.sandbox.js",
            kind: OptionKind.VIEWER
          };
          defaultOptions.renderer.kind += OptionKind.PREFERENCE;
        }
        var userOptions = Object.create(null);

        var AppOptions = /*#__PURE__*/function () {
          function AppOptions() {
            _classCallCheck(this, AppOptions);

            throw new Error("Cannot initialize AppOptions.");
          }

          _createClass(AppOptions, null, [{
            key: "get",
            value: function get(name) {
              var userOption = userOptions[name];

              if (userOption !== undefined) {
                return userOption;
              }

              var defaultOption = defaultOptions[name];

              if (defaultOption !== undefined) {
                var _defaultOption$compat;

                return (_defaultOption$compat = defaultOption.compatibility) !== null && _defaultOption$compat !== void 0 ? _defaultOption$compat : defaultOption.value;
              }

              return undefined;
            }
          }, {
            key: "getAll",
            value: function getAll() {
              var kind = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
              var options = Object.create(null);

              for (var name in defaultOptions) {
                var _defaultOption$compat2;

                var defaultOption = defaultOptions[name];

                if (kind) {
                  if ((kind & defaultOption.kind) === 0) {
                    continue;
                  }

                  if (kind === OptionKind.PREFERENCE) {
                    var value = defaultOption.value,
                        valueType = _typeof(value);

                    if (valueType === "boolean" || valueType === "string" || valueType === "number" && Number.isInteger(value)) {
                      options[name] = value;
                      continue;
                    }

                    throw new Error("Invalid type for preference: ".concat(name));
                  }
                }

                var userOption = userOptions[name];
                options[name] = userOption !== undefined ? userOption : (_defaultOption$compat2 = defaultOption.compatibility) !== null && _defaultOption$compat2 !== void 0 ? _defaultOption$compat2 : defaultOption.value;
              }

              return options;
            }
          }, {
            key: "set",
            value: function set(name, value) {
              userOptions[name] = value;
            }
          }, {
            key: "setAll",
            value: function setAll(options) {
              for (var name in options) {
                userOptions[name] = options[name];
              }
            }
          }, {
            key: "remove",
            value: function remove(name) {
              delete userOptions[name];
            }
          }, {
            key: "_hasUserOptions",
            value: function _hasUserOptions() {
              return Object.keys(userOptions).length > 0;
            }
          }]);

          return AppOptions;
        }();

        exports.AppOptions = AppOptions;
        /***/
      },
      /* 13 */

      /***/
      function (__unused_webpack_module, exports, __w_pdfjs_require__) {
        Object.defineProperty(exports, "__esModule", {
          value: true
        });
        exports.GenericL10n = void 0;

        var _regenerator = _interopRequireDefault(__w_pdfjs_require__(2));

        __w_pdfjs_require__(14);

        var _l10n_utils = __w_pdfjs_require__(5);

        function _interopRequireDefault(obj) {
          return obj && obj.__esModule ? obj : {
            "default": obj
          };
        }

        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 self = this,
                args = arguments;
            return new Promise(function (resolve, reject) {
              var gen = fn.apply(self, args);

              function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
              }

              function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
              }

              _next(undefined);
            });
          };
        }

        function _classCallCheck(instance, Constructor) {
          if (!(instance instanceof Constructor)) {
            throw new TypeError("Cannot call a class as a function");
          }
        }

        function _defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];
            descriptor.enumerable = descriptor.enumerable || false;
            descriptor.configurable = true;
            if ("value" in descriptor) descriptor.writable = true;
            Object.defineProperty(target, descriptor.key, descriptor);
          }
        }

        function _createClass(Constructor, protoProps, staticProps) {
          if (protoProps) _defineProperties(Constructor.prototype, protoProps);
          if (staticProps) _defineProperties(Constructor, staticProps);
          return Constructor;
        }

        var webL10n = document.webL10n;

        var GenericL10n = /*#__PURE__*/function () {
          function GenericL10n(lang) {
            _classCallCheck(this, GenericL10n);

            this._lang = lang;
            this._ready = new Promise(function (resolve, reject) {
              webL10n.setLanguage((0, _l10n_utils.fixupLangCode)(lang), function () {
                resolve(webL10n);
              });
            });
          }

          _createClass(GenericL10n, [{
            key: "getLanguage",
            value: function () {
              var _getLanguage = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
                var l10n;
                return _regenerator["default"].wrap(function _callee$(_context) {
                  while (1) {
                    switch (_context.prev = _context.next) {
                      case 0:
                        _context.next = 2;
                        return this._ready;

                      case 2:
                        l10n = _context.sent;
                        return _context.abrupt("return", l10n.getLanguage());

                      case 4:
                      case "end":
                        return _context.stop();
                    }
                  }
                }, _callee, this);
              }));

              function getLanguage() {
                return _getLanguage.apply(this, arguments);
              }

              return getLanguage;
            }()
          }, {
            key: "getDirection",
            value: function () {
              var _getDirection = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
                var l10n;
                return _regenerator["default"].wrap(function _callee2$(_context2) {
                  while (1) {
                    switch (_context2.prev = _context2.next) {
                      case 0:
                        _context2.next = 2;
                        return this._ready;

                      case 2:
                        l10n = _context2.sent;
                        return _context2.abrupt("return", l10n.getDirection());

                      case 4:
                      case "end":
                        return _context2.stop();
                    }
                  }
                }, _callee2, this);
              }));

              function getDirection() {
                return _getDirection.apply(this, arguments);
              }

              return getDirection;
            }()
          }, {
            key: "get",
            value: function () {
              var _get = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee3(key) {
                var args,
                    fallback,
                    l10n,
                    _args3 = arguments;
                return _regenerator["default"].wrap(function _callee3$(_context3) {
                  while (1) {
                    switch (_context3.prev = _context3.next) {
                      case 0:
                        args = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : null;
                        fallback = _args3.length > 2 && _args3[2] !== undefined ? _args3[2] : (0, _l10n_utils.getL10nFallback)(key, args);
                        _context3.next = 4;
                        return this._ready;

                      case 4:
                        l10n = _context3.sent;
                        return _context3.abrupt("return", l10n.get(key, args, fallback));

                      case 6:
                      case "end":
                        return _context3.stop();
                    }
                  }
                }, _callee3, this);
              }));

              function get(_x) {
                return _get.apply(this, arguments);
              }

              return get;
            }()
          }, {
            key: "translate",
            value: function () {
              var _translate = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee4(element) {
                var l10n;
                return _regenerator["default"].wrap(function _callee4$(_context4) {
                  while (1) {
                    switch (_context4.prev = _context4.next) {
                      case 0:
                        _context4.next = 2;
                        return this._ready;

                      case 2:
                        l10n = _context4.sent;
                        return _context4.abrupt("return", l10n.translate(element));

                      case 4:
                      case "end":
                        return _context4.stop();
                    }
                  }
                }, _callee4, this);
              }));

              function translate(_x2) {
                return _translate.apply(this, arguments);
              }

              return translate;
            }()
          }]);

          return GenericL10n;
        }();

        exports.GenericL10n = GenericL10n;
        /***/
      },
      /* 14 */

      /***/
      function () {
        document.webL10n = function (window, document, undefined) {
          var gL10nData = {};
          var gTextData = '';
          var gTextProp = 'textContent';
          var gLanguage = '';
          var gMacros = {};
          var gReadyState = 'loading';
          var gAsyncResourceLoading = true;

          function getL10nResourceLinks() {
            return document.querySelectorAll('link[type="application/l10n"]');
          }

          function getL10nDictionary() {
            var script = document.querySelector('script[type="application/l10n"]');
            return script ? JSON.parse(script.innerHTML) : null;
          }

          function getTranslatableChildren(element) {
            return element ? element.querySelectorAll('*[data-l10n-id]') : [];
          }

          function getL10nAttributes(element) {
            if (!element) return {};
            var l10nId = element.getAttribute('data-l10n-id');
            var l10nArgs = element.getAttribute('data-l10n-args');
            var args = {};

            if (l10nArgs) {
              try {
                args = JSON.parse(l10nArgs);
              } catch (e) {
                console.warn('could not parse arguments for #' + l10nId);
              }
            }

            return {
              id: l10nId,
              args: args
            };
          }

          function xhrLoadText(url, onSuccess, onFailure) {
            onSuccess = onSuccess || function _onSuccess(data) {};

            onFailure = onFailure || function _onFailure() {};

            var xhr = new XMLHttpRequest();
            xhr.open('GET', url, gAsyncResourceLoading);

            if (xhr.overrideMimeType) {
              xhr.overrideMimeType('text/plain; charset=utf-8');
            }

            xhr.onreadystatechange = function () {
              if (xhr.readyState == 4) {
                if (xhr.status == 200 || xhr.status === 0) {
                  onSuccess(xhr.responseText);
                } else {
                  onFailure();
                }
              }
            };

            xhr.onerror = onFailure;
            xhr.ontimeout = onFailure;

            try {
              xhr.send(null);
            } catch (e) {
              onFailure();
            }
          }

          function parseResource(href, lang, successCallback, failureCallback) {
            var baseURL = href.replace(/[^\/]*$/, '') || './';

            function evalString(text) {
              if (text.lastIndexOf('\\') < 0) return text;
              return text.replace(/\\\\/g, '\\').replace(/\\n/g, '\n').replace(/\\r/g, '\r').replace(/\\t/g, '\t').replace(/\\b/g, '\b').replace(/\\f/g, '\f').replace(/\\{/g, '{').replace(/\\}/g, '}').replace(/\\"/g, '"').replace(/\\'/g, "'");
            }

            function parseProperties(text, parsedPropertiesCallback) {
              var dictionary = {};
              var reBlank = /^\s*|\s*$/;
              var reComment = /^\s*#|^\s*$/;
              var reSection = /^\s*\[(.*)\]\s*$/;
              var reImport = /^\s*@import\s+url\((.*)\)\s*$/i;
              var reSplit = /^([^=\s]*)\s*=\s*(.+)$/;

              function parseRawLines(rawText, extendedSyntax, parsedRawLinesCallback) {
                var entries = rawText.replace(reBlank, '').split(/[\r\n]+/);
                var currentLang = '*';
                var genericLang = lang.split('-', 1)[0];
                var skipLang = false;
                var match = '';

                function nextEntry() {
                  while (true) {
                    if (!entries.length) {
                      parsedRawLinesCallback();
                      return;
                    }

                    var line = entries.shift();
                    if (reComment.test(line)) continue;

                    if (extendedSyntax) {
                      match = reSection.exec(line);

                      if (match) {
                        currentLang = match[1].toLowerCase();
                        skipLang = currentLang !== '*' && currentLang !== lang && currentLang !== genericLang;
                        continue;
                      } else if (skipLang) {
                        continue;
                      }

                      match = reImport.exec(line);

                      if (match) {
                        loadImport(baseURL + match[1], nextEntry);
                        return;
                      }
                    }

                    var tmp = line.match(reSplit);

                    if (tmp && tmp.length == 3) {
                      dictionary[tmp[1]] = evalString(tmp[2]);
                    }
                  }
                }

                nextEntry();
              }

              function loadImport(url, callback) {
                xhrLoadText(url, function (content) {
                  parseRawLines(content, false, callback);
                }, function () {
                  console.warn(url + ' not found.');
                  callback();
                });
              }

              parseRawLines(text, true, function () {
                parsedPropertiesCallback(dictionary);
              });
            }

            xhrLoadText(href, function (response) {
              gTextData += response;
              parseProperties(response, function (data) {
                for (var key in data) {
                  var id,
                      prop,
                      index = key.lastIndexOf('.');

                  if (index > 0) {
                    id = key.substring(0, index);
                    prop = key.substring(index + 1);
                  } else {
                    id = key;
                    prop = gTextProp;
                  }

                  if (!gL10nData[id]) {
                    gL10nData[id] = {};
                  }

                  gL10nData[id][prop] = data[key];
                }

                if (successCallback) {
                  successCallback();
                }
              });
            }, failureCallback);
          }

          function loadLocale(lang, callback) {
            if (lang) {
              lang = lang.toLowerCase();
            }

            callback = callback || function _callback() {};

            clear();
            gLanguage = lang;
            var langLinks = getL10nResourceLinks();
            var langCount = langLinks.length;

            if (langCount === 0) {
              var dict = getL10nDictionary();

              if (dict && dict.locales && dict.default_locale) {
                console.log('using the embedded JSON directory, early way out');
                gL10nData = dict.locales[lang];

                if (!gL10nData) {
                  var defaultLocale = dict.default_locale.toLowerCase();

                  for (var anyCaseLang in dict.locales) {
                    anyCaseLang = anyCaseLang.toLowerCase();

                    if (anyCaseLang === lang) {
                      gL10nData = dict.locales[lang];
                      break;
                    } else if (anyCaseLang === defaultLocale) {
                      gL10nData = dict.locales[defaultLocale];
                    }
                  }
                }

                callback();
              } else {
                console.log('no resource to load, early way out');
              }

              gReadyState = 'complete';
              return;
            }

            var onResourceLoaded = null;
            var gResourceCount = 0;

            onResourceLoaded = function onResourceLoaded() {
              gResourceCount++;

              if (gResourceCount >= langCount) {
                callback();
                gReadyState = 'complete';
              }
            };

            function L10nResourceLink(link) {
              var href = link.href;

              this.load = function (lang, callback) {
                parseResource(href, lang, callback, function () {
                  console.warn(href + ' not found.');
                  console.warn('"' + lang + '" resource not found');
                  gLanguage = '';
                  callback();
                });
              };
            }

            for (var i = 0; i < langCount; i++) {
              var resource = new L10nResourceLink(langLinks[i]);
              resource.load(lang, onResourceLoaded);
            }
          }

          function clear() {
            gL10nData = {};
            gTextData = '';
            gLanguage = '';
          }

          function getPluralRules(lang) {
            var locales2rules = {
              'af': 3,
              'ak': 4,
              'am': 4,
              'ar': 1,
              'asa': 3,
              'az': 0,
              'be': 11,
              'bem': 3,
              'bez': 3,
              'bg': 3,
              'bh': 4,
              'bm': 0,
              'bn': 3,
              'bo': 0,
              'br': 20,
              'brx': 3,
              'bs': 11,
              'ca': 3,
              'cgg': 3,
              'chr': 3,
              'cs': 12,
              'cy': 17,
              'da': 3,
              'de': 3,
              'dv': 3,
              'dz': 0,
              'ee': 3,
              'el': 3,
              'en': 3,
              'eo': 3,
              'es': 3,
              'et': 3,
              'eu': 3,
              'fa': 0,
              'ff': 5,
              'fi': 3,
              'fil': 4,
              'fo': 3,
              'fr': 5,
              'fur': 3,
              'fy': 3,
              'ga': 8,
              'gd': 24,
              'gl': 3,
              'gsw': 3,
              'gu': 3,
              'guw': 4,
              'gv': 23,
              'ha': 3,
              'haw': 3,
              'he': 2,
              'hi': 4,
              'hr': 11,
              'hu': 0,
              'id': 0,
              'ig': 0,
              'ii': 0,
              'is': 3,
              'it': 3,
              'iu': 7,
              'ja': 0,
              'jmc': 3,
              'jv': 0,
              'ka': 0,
              'kab': 5,
              'kaj': 3,
              'kcg': 3,
              'kde': 0,
              'kea': 0,
              'kk': 3,
              'kl': 3,
              'km': 0,
              'kn': 0,
              'ko': 0,
              'ksb': 3,
              'ksh': 21,
              'ku': 3,
              'kw': 7,
              'lag': 18,
              'lb': 3,
              'lg': 3,
              'ln': 4,
              'lo': 0,
              'lt': 10,
              'lv': 6,
              'mas': 3,
              'mg': 4,
              'mk': 16,
              'ml': 3,
              'mn': 3,
              'mo': 9,
              'mr': 3,
              'ms': 0,
              'mt': 15,
              'my': 0,
              'nah': 3,
              'naq': 7,
              'nb': 3,
              'nd': 3,
              'ne': 3,
              'nl': 3,
              'nn': 3,
              'no': 3,
              'nr': 3,
              'nso': 4,
              'ny': 3,
              'nyn': 3,
              'om': 3,
              'or': 3,
              'pa': 3,
              'pap': 3,
              'pl': 13,
              'ps': 3,
              'pt': 3,
              'rm': 3,
              'ro': 9,
              'rof': 3,
              'ru': 11,
              'rwk': 3,
              'sah': 0,
              'saq': 3,
              'se': 7,
              'seh': 3,
              'ses': 0,
              'sg': 0,
              'sh': 11,
              'shi': 19,
              'sk': 12,
              'sl': 14,
              'sma': 7,
              'smi': 7,
              'smj': 7,
              'smn': 7,
              'sms': 7,
              'sn': 3,
              'so': 3,
              'sq': 3,
              'sr': 11,
              'ss': 3,
              'ssy': 3,
              'st': 3,
              'sv': 3,
              'sw': 3,
              'syr': 3,
              'ta': 3,
              'te': 3,
              'teo': 3,
              'th': 0,
              'ti': 4,
              'tig': 3,
              'tk': 3,
              'tl': 4,
              'tn': 3,
              'to': 0,
              'tr': 0,
              'ts': 3,
              'tzm': 22,
              'uk': 11,
              'ur': 3,
              've': 3,
              'vi': 0,
              'vun': 3,
              'wa': 4,
              'wae': 3,
              'wo': 0,
              'xh': 3,
              'xog': 3,
              'yo': 0,
              'zh': 0,
              'zu': 3
            };

            function isIn(n, list) {
              return list.indexOf(n) !== -1;
            }

            function isBetween(n, start, end) {
              return start <= n && n <= end;
            }

            var pluralRules = {
              '0': function _(n) {
                return 'other';
              },
              '1': function _(n) {
                if (isBetween(n % 100, 3, 10)) return 'few';
                if (n === 0) return 'zero';
                if (isBetween(n % 100, 11, 99)) return 'many';
                if (n == 2) return 'two';
                if (n == 1) return 'one';
                return 'other';
              },
              '2': function _(n) {
                if (n !== 0 && n % 10 === 0) return 'many';
                if (n == 2) return 'two';
                if (n == 1) return 'one';
                return 'other';
              },
              '3': function _(n) {
                if (n == 1) return 'one';
                return 'other';
              },
              '4': function _(n) {
                if (isBetween(n, 0, 1)) return 'one';
                return 'other';
              },
              '5': function _(n) {
                if (isBetween(n, 0, 2) && n != 2) return 'one';
                return 'other';
              },
              '6': function _(n) {
                if (n === 0) return 'zero';
                if (n % 10 == 1 && n % 100 != 11) return 'one';
                return 'other';
              },
              '7': function _(n) {
                if (n == 2) return 'two';
                if (n == 1) return 'one';
                return 'other';
              },
              '8': function _(n) {
                if (isBetween(n, 3, 6)) return 'few';
                if (isBetween(n, 7, 10)) return 'many';
                if (n == 2) return 'two';
                if (n == 1) return 'one';
                return 'other';
              },
              '9': function _(n) {
                if (n === 0 || n != 1 && isBetween(n % 100, 1, 19)) return 'few';
                if (n == 1) return 'one';
                return 'other';
              },
              '10': function _(n) {
                if (isBetween(n % 10, 2, 9) && !isBetween(n % 100, 11, 19)) return 'few';
                if (n % 10 == 1 && !isBetween(n % 100, 11, 19)) return 'one';
                return 'other';
              },
              '11': function _(n) {
                if (isBetween(n % 10, 2, 4) && !isBetween(n % 100, 12, 14)) return 'few';
                if (n % 10 === 0 || isBetween(n % 10, 5, 9) || isBetween(n % 100, 11, 14)) return 'many';
                if (n % 10 == 1 && n % 100 != 11) return 'one';
                return 'other';
              },
              '12': function _(n) {
                if (isBetween(n, 2, 4)) return 'few';
                if (n == 1) return 'one';
                return 'other';
              },
              '13': function _(n) {
                if (isBetween(n % 10, 2, 4) && !isBetween(n % 100, 12, 14)) return 'few';
                if (n != 1 && isBetween(n % 10, 0, 1) || isBetween(n % 10, 5, 9) || isBetween(n % 100, 12, 14)) return 'many';
                if (n == 1) return 'one';
                return 'other';
              },
              '14': function _(n) {
                if (isBetween(n % 100, 3, 4)) return 'few';
                if (n % 100 == 2) return 'two';
                if (n % 100 == 1) return 'one';
                return 'other';
              },
              '15': function _(n) {
                if (n === 0 || isBetween(n % 100, 2, 10)) return 'few';
                if (isBetween(n % 100, 11, 19)) return 'many';
                if (n == 1) return 'one';
                return 'other';
              },
              '16': function _(n) {
                if (n % 10 == 1 && n != 11) return 'one';
                return 'other';
              },
              '17': function _(n) {
                if (n == 3) return 'few';
                if (n === 0) return 'zero';
                if (n == 6) return 'many';
                if (n == 2) return 'two';
                if (n == 1) return 'one';
                return 'other';
              },
              '18': function _(n) {
                if (n === 0) return 'zero';
                if (isBetween(n, 0, 2) && n !== 0 && n != 2) return 'one';
                return 'other';
              },
              '19': function _(n) {
                if (isBetween(n, 2, 10)) return 'few';
                if (isBetween(n, 0, 1)) return 'one';
                return 'other';
              },
              '20': function _(n) {
                if ((isBetween(n % 10, 3, 4) || n % 10 == 9) && !(isBetween(n % 100, 10, 19) || isBetween(n % 100, 70, 79) || isBetween(n % 100, 90, 99))) return 'few';
                if (n % 1000000 === 0 && n !== 0) return 'many';
                if (n % 10 == 2 && !isIn(n % 100, [12, 72, 92])) return 'two';
                if (n % 10 == 1 && !isIn(n % 100, [11, 71, 91])) return 'one';
                return 'other';
              },
              '21': function _(n) {
                if (n === 0) return 'zero';
                if (n == 1) return 'one';
                return 'other';
              },
              '22': function _(n) {
                if (isBetween(n, 0, 1) || isBetween(n, 11, 99)) return 'one';
                return 'other';
              },
              '23': function _(n) {
                if (isBetween(n % 10, 1, 2) || n % 20 === 0) return 'one';
                return 'other';
              },
              '24': function _(n) {
                if (isBetween(n, 3, 10) || isBetween(n, 13, 19)) return 'few';
                if (isIn(n, [2, 12])) return 'two';
                if (isIn(n, [1, 11])) return 'one';
                return 'other';
              }
            };
            var index = locales2rules[lang.replace(/-.*$/, '')];

            if (!(index in pluralRules)) {
              console.warn('plural form unknown for [' + lang + ']');
              return function () {
                return 'other';
              };
            }

            return pluralRules[index];
          }

          gMacros.plural = function (str, param, key, prop) {
            var n = parseFloat(param);
            if (isNaN(n)) return str;
            if (prop != gTextProp) return str;

            if (!gMacros._pluralRules) {
              gMacros._pluralRules = getPluralRules(gLanguage);
            }

            var index = '[' + gMacros._pluralRules(n) + ']';

            if (n === 0 && key + '[zero]' in gL10nData) {
              str = gL10nData[key + '[zero]'][prop];
            } else if (n == 1 && key + '[one]' in gL10nData) {
              str = gL10nData[key + '[one]'][prop];
            } else if (n == 2 && key + '[two]' in gL10nData) {
              str = gL10nData[key + '[two]'][prop];
            } else if (key + index in gL10nData) {
              str = gL10nData[key + index][prop];
            } else if (key + '[other]' in gL10nData) {
              str = gL10nData[key + '[other]'][prop];
            }

            return str;
          };

          function getL10nData(key, args, fallback) {
            var data = gL10nData[key];

            if (!data) {
              console.warn('#' + key + ' is undefined.');

              if (!fallback) {
                return null;
              }

              data = fallback;
            }

            var rv = {};

            for (var prop in data) {
              var str = data[prop];
              str = substIndexes(str, args, key, prop);
              str = substArguments(str, args, key);
              rv[prop] = str;
            }

            return rv;
          }

          function substIndexes(str, args, key, prop) {
            var reIndex = /\{\[\s*([a-zA-Z]+)\(([a-zA-Z]+)\)\s*\]\}/;
            var reMatch = reIndex.exec(str);
            if (!reMatch || !reMatch.length) return str;
            var macroName = reMatch[1];
            var paramName = reMatch[2];
            var param;

            if (args && paramName in args) {
              param = args[paramName];
            } else if (paramName in gL10nData) {
              param = gL10nData[paramName];
            }

            if (macroName in gMacros) {
              var macro = gMacros[macroName];
              str = macro(str, param, key, prop);
            }

            return str;
          }

          function substArguments(str, args, key) {
            var reArgs = /\{\{\s*(.+?)\s*\}\}/g;
            return str.replace(reArgs, function (matched_text, arg) {
              if (args && arg in args) {
                return args[arg];
              }

              if (arg in gL10nData) {
                return gL10nData[arg];
              }

              console.log('argument {{' + arg + '}} for #' + key + ' is undefined.');
              return matched_text;
            });
          }

          function translateElement(element) {
            var l10n = getL10nAttributes(element);
            if (!l10n.id) return;
            var data = getL10nData(l10n.id, l10n.args);

            if (!data) {
              console.warn('#' + l10n.id + ' is undefined.');
              return;
            }

            if (data[gTextProp]) {
              if (getChildElementCount(element) === 0) {
                element[gTextProp] = data[gTextProp];
              } else {
                var children = element.childNodes;
                var found = false;

                for (var i = 0, l = children.length; i < l; i++) {
                  if (children[i].nodeType === 3 && /\S/.test(children[i].nodeValue)) {
                    if (found) {
                      children[i].nodeValue = '';
                    } else {
                      children[i].nodeValue = data[gTextProp];
                      found = true;
                    }
                  }
                }

                if (!found) {
                  var textNode = document.createTextNode(data[gTextProp]);
                  element.insertBefore(textNode, element.firstChild);
                }
              }

              delete data[gTextProp];
            }

            for (var k in data) {
              element[k] = data[k];
            }
          }

          function getChildElementCount(element) {
            if (element.children) {
              return element.children.length;
            }

            if (typeof element.childElementCount !== 'undefined') {
              return element.childElementCount;
            }

            var count = 0;

            for (var i = 0; i < element.childNodes.length; i++) {
              count += element.nodeType === 1 ? 1 : 0;
            }

            return count;
          }

          function translateFragment(element) {
            element = element || document.documentElement;
            var children = getTranslatableChildren(element);
            var elementCount = children.length;

            for (var i = 0; i < elementCount; i++) {
              translateElement(children[i]);
            }

            translateElement(element);
          }

          return {
            get: function get(key, args, fallbackString) {
              var index = key.lastIndexOf('.');
              var prop = gTextProp;

              if (index > 0) {
                prop = key.substring(index + 1);
                key = key.substring(0, index);
              }

              var fallback;

              if (fallbackString) {
                fallback = {};
                fallback[prop] = fallbackString;
              }

              var data = getL10nData(key, args, fallback);

              if (data && prop in data) {
                return data[prop];
              }

              return '{{' + key + '}}';
            },
            getData: function getData() {
              return gL10nData;
            },
            getText: function getText() {
              return gTextData;
            },
            getLanguage: function getLanguage() {
              return gLanguage;
            },
            setLanguage: function setLanguage(lang, callback) {
              loadLocale(lang, function () {
                if (callback) callback();
              });
            },
            getDirection: function getDirection() {
              var rtlList = ['ar', 'he', 'fa', 'ps', 'ur'];
              var shortCode = gLanguage.split('-', 1)[0];
              return rtlList.indexOf(shortCode) >= 0 ? 'rtl' : 'ltr';
            },
            translate: translateFragment,
            getReadyState: function getReadyState() {
              return gReadyState;
            },
            ready: function ready(callback) {
              if (!callback) {
                return;
              } else if (gReadyState == 'complete' || gReadyState == 'interactive') {
                window.setTimeout(function () {
                  callback();
                });
              } else if (document.addEventListener) {
                document.addEventListener('localized', function once() {
                  document.removeEventListener('localized', once);
                  callback();
                });
              }
            }
          };
        }(window, document);
        /***/

      },
      /* 15 */

      /***/
      function (__unused_webpack_module, exports, __w_pdfjs_require__) {
        Object.defineProperty(exports, "__esModule", {
          value: true
        });
        exports.PDFFindController = exports.FindState = void 0;

        var _pdfjsLib = __w_pdfjs_require__(4);

        var _pdf_find_utils = __w_pdfjs_require__(16);

        var _ui_utils = __w_pdfjs_require__(7);

        function _classCallCheck(instance, Constructor) {
          if (!(instance instanceof Constructor)) {
            throw new TypeError("Cannot call a class as a function");
          }
        }

        function _defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];
            descriptor.enumerable = descriptor.enumerable || false;
            descriptor.configurable = true;
            if ("value" in descriptor) descriptor.writable = true;
            Object.defineProperty(target, descriptor.key, descriptor);
          }
        }

        function _createClass(Constructor, protoProps, staticProps) {
          if (protoProps) _defineProperties(Constructor.prototype, protoProps);
          if (staticProps) _defineProperties(Constructor, staticProps);
          return Constructor;
        }

        function _slicedToArray(arr, i) {
          return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
        }

        function _nonIterableRest() {
          throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
        }

        function _iterableToArrayLimit(arr, i) {
          var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];

          if (_i == null) return;
          var _arr = [];
          var _n = true;
          var _d = false;

          var _s, _e;

          try {
            for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
              _arr.push(_s.value);

              if (i && _arr.length === i) break;
            }
          } catch (err) {
            _d = true;
            _e = err;
          } finally {
            try {
              if (!_n && _i["return"] != null) _i["return"]();
            } finally {
              if (_d) throw _e;
            }
          }

          return _arr;
        }

        function _arrayWithHoles(arr) {
          if (Array.isArray(arr)) return arr;
        }

        function _createForOfIteratorHelper(o, allowArrayLike) {
          var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];

          if (!it) {
            if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
              if (it) o = it;
              var i = 0;

              var F = function F() {};

              return {
                s: F,
                n: function n() {
                  if (i >= o.length) return {
                    done: true
                  };
                  return {
                    done: false,
                    value: o[i++]
                  };
                },
                e: function e(_e2) {
                  throw _e2;
                },
                f: F
              };
            }

            throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
          }

          var normalCompletion = true,
              didErr = false,
              err;
          return {
            s: function s() {
              it = it.call(o);
            },
            n: function n() {
              var step = it.next();
              normalCompletion = step.done;
              return step;
            },
            e: function e(_e3) {
              didErr = true;
              err = _e3;
            },
            f: function f() {
              try {
                if (!normalCompletion && it["return"] != null) it["return"]();
              } finally {
                if (didErr) throw err;
              }
            }
          };
        }

        function _unsupportedIterableToArray(o, minLen) {
          if (!o) return;
          if (typeof o === "string") return _arrayLikeToArray(o, minLen);
          var n = Object.prototype.toString.call(o).slice(8, -1);
          if (n === "Object" && o.constructor) n = o.constructor.name;
          if (n === "Map" || n === "Set") return Array.from(o);
          if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
        }

        function _arrayLikeToArray(arr, len) {
          if (len == null || len > arr.length) len = arr.length;

          for (var i = 0, arr2 = new Array(len); i < len; i++) {
            arr2[i] = arr[i];
          }

          return arr2;
        }

        var FindState = {
          FOUND: 0,
          NOT_FOUND: 1,
          WRAPPED: 2,
          PENDING: 3
        };
        exports.FindState = FindState;
        var FIND_TIMEOUT = 250;
        var MATCH_SCROLL_OFFSET_TOP = -50;
        var MATCH_SCROLL_OFFSET_LEFT = -400;
        var CHARACTERS_TO_NORMALIZE = {
          "\u2010": "-",
          "\u2018": "'",
          "\u2019": "'",
          "\u201A": "'",
          "\u201B": "'",
          "\u201C": '"',
          "\u201D": '"',
          "\u201E": '"',
          "\u201F": '"',
          "\xBC": "1/4",
          "\xBD": "1/2",
          "\xBE": "3/4"
        };
        var normalizationRegex = null;

        function normalize(text) {
          if (!normalizationRegex) {
            var replace = Object.keys(CHARACTERS_TO_NORMALIZE).join("");
            normalizationRegex = new RegExp("[".concat(replace, "]"), "g");
          }

          var diffs = null;
          var normalizedText = text.replace(normalizationRegex, function (ch, index) {
            var normalizedCh = CHARACTERS_TO_NORMALIZE[ch],
                diff = normalizedCh.length - ch.length;

            if (diff !== 0) {
              (diffs || (diffs = [])).push([index, diff]);
            }

            return normalizedCh;
          });
          return [normalizedText, diffs];
        }

        function getOriginalIndex(matchIndex) {
          var diffs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

          if (!diffs) {
            return matchIndex;
          }

          var totalDiff = 0;

          var _iterator = _createForOfIteratorHelper(diffs),
              _step;

          try {
            for (_iterator.s(); !(_step = _iterator.n()).done;) {
              var _step$value = _slicedToArray(_step.value, 2),
                  index = _step$value[0],
                  diff = _step$value[1];

              var currentIndex = index + totalDiff;

              if (currentIndex >= matchIndex) {
                break;
              }

              if (currentIndex + diff > matchIndex) {
                totalDiff += matchIndex - currentIndex;
                break;
              }

              totalDiff += diff;
            }
          } catch (err) {
            _iterator.e(err);
          } finally {
            _iterator.f();
          }

          return matchIndex - totalDiff;
        }

        var PDFFindController = /*#__PURE__*/function () {
          function PDFFindController(_ref) {
            var linkService = _ref.linkService,
                eventBus = _ref.eventBus;

            _classCallCheck(this, PDFFindController);

            this._linkService = linkService;
            this._eventBus = eventBus;

            this._reset();

            eventBus._on("findbarclose", this._onFindBarClose.bind(this));
          }

          _createClass(PDFFindController, [{
            key: "highlightMatches",
            get: function get() {
              return this._highlightMatches;
            }
          }, {
            key: "pageMatches",
            get: function get() {
              return this._pageMatches;
            }
          }, {
            key: "pageMatchesLength",
            get: function get() {
              return this._pageMatchesLength;
            }
          }, {
            key: "selected",
            get: function get() {
              return this._selected;
            }
          }, {
            key: "state",
            get: function get() {
              return this._state;
            }
          }, {
            key: "setDocument",
            value: function setDocument(pdfDocument) {
              if (this._pdfDocument) {
                this._reset();
              }

              if (!pdfDocument) {
                return;
              }

              this._pdfDocument = pdfDocument;

              this._firstPageCapability.resolve();
            }
          }, {
            key: "executeCommand",
            value: function executeCommand(cmd, state) {
              var _this = this;

              if (!state) {
                return;
              }

              var pdfDocument = this._pdfDocument;

              if (this._state === null || this._shouldDirtyMatch(cmd, state)) {
                this._dirtyMatch = true;
              }

              this._state = state;

              if (cmd !== "findhighlightallchange") {
                this._updateUIState(FindState.PENDING);
              }

              this._firstPageCapability.promise.then(function () {
                if (!_this._pdfDocument || pdfDocument && _this._pdfDocument !== pdfDocument) {
                  return;
                }

                _this._extractText();

                var findbarClosed = !_this._highlightMatches;
                var pendingTimeout = !!_this._findTimeout;

                if (_this._findTimeout) {
                  clearTimeout(_this._findTimeout);
                  _this._findTimeout = null;
                }

                if (cmd === "find") {
                  _this._findTimeout = setTimeout(function () {
                    _this._nextMatch();

                    _this._findTimeout = null;
                  }, FIND_TIMEOUT);
                } else if (_this._dirtyMatch) {
                  _this._nextMatch();
                } else if (cmd === "findagain") {
                  _this._nextMatch();

                  if (findbarClosed && _this._state.highlightAll) {
                    _this._updateAllPages();
                  }
                } else if (cmd === "findhighlightallchange") {
                  if (pendingTimeout) {
                    _this._nextMatch();
                  } else {
                    _this._highlightMatches = true;
                  }

                  _this._updateAllPages();
                } else {
                  _this._nextMatch();
                }
              });
            }
          }, {
            key: "scrollMatchIntoView",
            value: function scrollMatchIntoView(_ref2) {
              var _ref2$element = _ref2.element,
                  element = _ref2$element === void 0 ? null : _ref2$element,
                  _ref2$selectedLeft = _ref2.selectedLeft,
                  selectedLeft = _ref2$selectedLeft === void 0 ? 0 : _ref2$selectedLeft,
                  _ref2$pageIndex = _ref2.pageIndex,
                  pageIndex = _ref2$pageIndex === void 0 ? -1 : _ref2$pageIndex,
                  _ref2$matchIndex = _ref2.matchIndex,
                  matchIndex = _ref2$matchIndex === void 0 ? -1 : _ref2$matchIndex;

              if (!this._scrollMatches || !element) {
                return;
              } else if (matchIndex === -1 || matchIndex !== this._selected.matchIdx) {
                return;
              } else if (pageIndex === -1 || pageIndex !== this._selected.pageIdx) {
                return;
              }

              this._scrollMatches = false;
              var spot = {
                top: MATCH_SCROLL_OFFSET_TOP,
                left: selectedLeft + MATCH_SCROLL_OFFSET_LEFT
              };
              (0, _ui_utils.scrollIntoView)(element, spot, true);
            }
          }, {
            key: "_reset",
            value: function _reset() {
              this._highlightMatches = false;
              this._scrollMatches = false;
              this._pdfDocument = null;
              this._pageMatches = [];
              this._pageMatchesLength = [];
              this._state = null;
              this._selected = {
                pageIdx: -1,
                matchIdx: -1
              };
              this._offset = {
                pageIdx: null,
                matchIdx: null,
                wrapped: false
              };
              this._extractTextPromises = [];
              this._pageContents = [];
              this._pageDiffs = [];
              this._matchesCountTotal = 0;
              this._pagesToSearch = null;
              this._pendingFindMatches = new Set();
              this._resumePageIdx = null;
              this._dirtyMatch = false;
              clearTimeout(this._findTimeout);
              this._findTimeout = null;
              this._firstPageCapability = (0, _pdfjsLib.createPromiseCapability)();
            }
          }, {
            key: "_query",
            get: function get() {
              if (this._state.query !== this._rawQuery) {
                this._rawQuery = this._state.query;

                var _normalize = normalize(this._state.query);

                var _normalize2 = _slicedToArray(_normalize, 1);

                this._normalizedQuery = _normalize2[0];
              }

              return this._normalizedQuery;
            }
          }, {
            key: "_shouldDirtyMatch",
            value: function _shouldDirtyMatch(cmd, state) {
              if (state.query !== this._state.query) {
                return true;
              }

              switch (cmd) {
                case "findagain":
                  var pageNumber = this._selected.pageIdx + 1;
                  var linkService = this._linkService;

                  if (pageNumber >= 1 && pageNumber <= linkService.pagesCount && pageNumber !== linkService.page && !linkService.isPageVisible(pageNumber)) {
                    return true;
                  }

                  return false;

                case "findhighlightallchange":
                  return false;
              }

              return true;
            }
          }, {
            key: "_prepareMatches",
            value: function _prepareMatches(matchesWithLength, matches, matchesLength) {
              function isSubTerm(currentIndex) {
                var currentElem = matchesWithLength[currentIndex];
                var nextElem = matchesWithLength[currentIndex + 1];

                if (currentIndex < matchesWithLength.length - 1 && currentElem.match === nextElem.match) {
                  currentElem.skipped = true;
                  return true;
                }

                for (var i = currentIndex - 1; i >= 0; i--) {
                  var prevElem = matchesWithLength[i];

                  if (prevElem.skipped) {
                    continue;
                  }

                  if (prevElem.match + prevElem.matchLength < currentElem.match) {
                    break;
                  }

                  if (prevElem.match + prevElem.matchLength >= currentElem.match + currentElem.matchLength) {
                    currentElem.skipped = true;
                    return true;
                  }
                }

                return false;
              }

              matchesWithLength.sort(function (a, b) {
                return a.match === b.match ? a.matchLength - b.matchLength : a.match - b.match;
              });

              for (var i = 0, len = matchesWithLength.length; i < len; i++) {
                if (isSubTerm(i)) {
                  continue;
                }

                matches.push(matchesWithLength[i].match);
                matchesLength.push(matchesWithLength[i].matchLength);
              }
            }
          }, {
            key: "_isEntireWord",
            value: function _isEntireWord(content, startIdx, length) {
              if (startIdx > 0) {
                var first = content.charCodeAt(startIdx);
                var limit = content.charCodeAt(startIdx - 1);

                if ((0, _pdf_find_utils.getCharacterType)(first) === (0, _pdf_find_utils.getCharacterType)(limit)) {
                  return false;
                }
              }

              var endIdx = startIdx + length - 1;

              if (endIdx < content.length - 1) {
                var last = content.charCodeAt(endIdx);

                var _limit = content.charCodeAt(endIdx + 1);

                if ((0, _pdf_find_utils.getCharacterType)(last) === (0, _pdf_find_utils.getCharacterType)(_limit)) {
                  return false;
                }
              }

              return true;
            }
          }, {
            key: "_calculatePhraseMatch",
            value: function _calculatePhraseMatch(query, pageIndex, pageContent, pageDiffs, entireWord) {
              var matches = [],
                  matchesLength = [];
              var queryLen = query.length;
              var matchIdx = -queryLen;

              while (true) {
                matchIdx = pageContent.indexOf(query, matchIdx + queryLen);

                if (matchIdx === -1) {
                  break;
                }

                if (entireWord && !this._isEntireWord(pageContent, matchIdx, queryLen)) {
                  continue;
                }

                var originalMatchIdx = getOriginalIndex(matchIdx, pageDiffs),
                    matchEnd = matchIdx + queryLen - 1,
                    originalQueryLen = getOriginalIndex(matchEnd, pageDiffs) - originalMatchIdx + 1;
                matches.push(originalMatchIdx);
                matchesLength.push(originalQueryLen);
              }

              this._pageMatches[pageIndex] = matches;
              this._pageMatchesLength[pageIndex] = matchesLength;
            }
          }, {
            key: "_calculateWordMatch",
            value: function _calculateWordMatch(query, pageIndex, pageContent, pageDiffs, entireWord) {
              var matchesWithLength = [];
              var queryArray = query.match(/\S+/g);

              for (var i = 0, len = queryArray.length; i < len; i++) {
                var subquery = queryArray[i];
                var subqueryLen = subquery.length;
                var matchIdx = -subqueryLen;

                while (true) {
                  matchIdx = pageContent.indexOf(subquery, matchIdx + subqueryLen);

                  if (matchIdx === -1) {
                    break;
                  }

                  if (entireWord && !this._isEntireWord(pageContent, matchIdx, subqueryLen)) {
                    continue;
                  }

                  var originalMatchIdx = getOriginalIndex(matchIdx, pageDiffs),
                      matchEnd = matchIdx + subqueryLen - 1,
                      originalQueryLen = getOriginalIndex(matchEnd, pageDiffs) - originalMatchIdx + 1;
                  matchesWithLength.push({
                    match: originalMatchIdx,
                    matchLength: originalQueryLen,
                    skipped: false
                  });
                }
              }

              this._pageMatchesLength[pageIndex] = [];
              this._pageMatches[pageIndex] = [];

              this._prepareMatches(matchesWithLength, this._pageMatches[pageIndex], this._pageMatchesLength[pageIndex]);
            }
          }, {
            key: "_calculateMatch",
            value: function _calculateMatch(pageIndex) {
              var pageContent = this._pageContents[pageIndex];
              var pageDiffs = this._pageDiffs[pageIndex];
              var query = this._query;
              var _this$_state = this._state,
                  caseSensitive = _this$_state.caseSensitive,
                  entireWord = _this$_state.entireWord,
                  phraseSearch = _this$_state.phraseSearch;

              if (query.length === 0) {
                return;
              }

              if (!caseSensitive) {
                pageContent = pageContent.toLowerCase();
                query = query.toLowerCase();
              }

              if (phraseSearch) {
                this._calculatePhraseMatch(query, pageIndex, pageContent, pageDiffs, entireWord);
              } else {
                this._calculateWordMatch(query, pageIndex, pageContent, pageDiffs, entireWord);
              }

              if (this._state.highlightAll) {
                this._updatePage(pageIndex);
              }

              if (this._resumePageIdx === pageIndex) {
                this._resumePageIdx = null;

                this._nextPageMatch();
              }

              var pageMatchesCount = this._pageMatches[pageIndex].length;

              if (pageMatchesCount > 0) {
                this._matchesCountTotal += pageMatchesCount;

                this._updateUIResultsCount();
              }
            }
          }, {
            key: "_extractText",
            value: function _extractText() {
              var _this2 = this;

              if (this._extractTextPromises.length > 0) {
                return;
              }

              var promise = Promise.resolve();

              var _loop = function _loop(i, ii) {
                var extractTextCapability = (0, _pdfjsLib.createPromiseCapability)();
                _this2._extractTextPromises[i] = extractTextCapability.promise;
                promise = promise.then(function () {
                  return _this2._pdfDocument.getPage(i + 1).then(function (pdfPage) {
                    return pdfPage.getTextContent({
                      normalizeWhitespace: true
                    });
                  }).then(function (textContent) {
                    var textItems = textContent.items;
                    var strBuf = [];

                    for (var j = 0, jj = textItems.length; j < jj; j++) {
                      strBuf.push(textItems[j].str);
                    }

                    var _normalize3 = normalize(strBuf.join(""));

                    var _normalize4 = _slicedToArray(_normalize3, 2);

                    _this2._pageContents[i] = _normalize4[0];
                    _this2._pageDiffs[i] = _normalize4[1];
                    extractTextCapability.resolve(i);
                  }, function (reason) {
                    console.error("Unable to get text content for page ".concat(i + 1), reason);
                    _this2._pageContents[i] = "";
                    _this2._pageDiffs[i] = null;
                    extractTextCapability.resolve(i);
                  });
                });
              };

              for (var i = 0, ii = this._linkService.pagesCount; i < ii; i++) {
                _loop(i, ii);
              }
            }
          }, {
            key: "_updatePage",
            value: function _updatePage(index) {
              if (this._scrollMatches && this._selected.pageIdx === index) {
                this._linkService.page = index + 1;
              }

              this._eventBus.dispatch("updatetextlayermatches", {
                source: this,
                pageIndex: index
              });
            }
          }, {
            key: "_updateAllPages",
            value: function _updateAllPages() {
              this._eventBus.dispatch("updatetextlayermatches", {
                source: this,
                pageIndex: -1
              });
            }
          }, {
            key: "_nextMatch",
            value: function _nextMatch() {
              var _this3 = this;

              var previous = this._state.findPrevious;
              var currentPageIndex = this._linkService.page - 1;
              var numPages = this._linkService.pagesCount;
              this._highlightMatches = true;

              if (this._dirtyMatch) {
                this._dirtyMatch = false;
                this._selected.pageIdx = this._selected.matchIdx = -1;
                this._offset.pageIdx = currentPageIndex;
                this._offset.matchIdx = null;
                this._offset.wrapped = false;
                this._resumePageIdx = null;
                this._pageMatches.length = 0;
                this._pageMatchesLength.length = 0;
                this._matchesCountTotal = 0;

                this._updateAllPages();

                for (var i = 0; i < numPages; i++) {
                  if (this._pendingFindMatches.has(i)) {
                    continue;
                  }

                  this._pendingFindMatches.add(i);

                  this._extractTextPromises[i].then(function (pageIdx) {
                    _this3._pendingFindMatches["delete"](pageIdx);

                    _this3._calculateMatch(pageIdx);
                  });
                }
              }

              if (this._query === "") {
                this._updateUIState(FindState.FOUND);

                return;
              }

              if (this._resumePageIdx) {
                return;
              }

              var offset = this._offset;
              this._pagesToSearch = numPages;

              if (offset.matchIdx !== null) {
                var numPageMatches = this._pageMatches[offset.pageIdx].length;

                if (!previous && offset.matchIdx + 1 < numPageMatches || previous && offset.matchIdx > 0) {
                  offset.matchIdx = previous ? offset.matchIdx - 1 : offset.matchIdx + 1;

                  this._updateMatch(true);

                  return;
                }

                this._advanceOffsetPage(previous);
              }

              this._nextPageMatch();
            }
          }, {
            key: "_matchesReady",
            value: function _matchesReady(matches) {
              var offset = this._offset;
              var numMatches = matches.length;
              var previous = this._state.findPrevious;

              if (numMatches) {
                offset.matchIdx = previous ? numMatches - 1 : 0;

                this._updateMatch(true);

                return true;
              }

              this._advanceOffsetPage(previous);

              if (offset.wrapped) {
                offset.matchIdx = null;

                if (this._pagesToSearch < 0) {
                  this._updateMatch(false);

                  return true;
                }
              }

              return false;
            }
          }, {
            key: "_nextPageMatch",
            value: function _nextPageMatch() {
              if (this._resumePageIdx !== null) {
                console.error("There can only be one pending page.");
              }

              var matches = null;

              do {
                var pageIdx = this._offset.pageIdx;
                matches = this._pageMatches[pageIdx];

                if (!matches) {
                  this._resumePageIdx = pageIdx;
                  break;
                }
              } while (!this._matchesReady(matches));
            }
          }, {
            key: "_advanceOffsetPage",
            value: function _advanceOffsetPage(previous) {
              var offset = this._offset;
              var numPages = this._linkService.pagesCount;
              offset.pageIdx = previous ? offset.pageIdx - 1 : offset.pageIdx + 1;
              offset.matchIdx = null;
              this._pagesToSearch--;

              if (offset.pageIdx >= numPages || offset.pageIdx < 0) {
                offset.pageIdx = previous ? numPages - 1 : 0;
                offset.wrapped = true;
              }
            }
          }, {
            key: "_updateMatch",
            value: function _updateMatch() {
              var found = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
              var state = FindState.NOT_FOUND;
              var wrapped = this._offset.wrapped;
              this._offset.wrapped = false;

              if (found) {
                var previousPage = this._selected.pageIdx;
                this._selected.pageIdx = this._offset.pageIdx;
                this._selected.matchIdx = this._offset.matchIdx;
                state = wrapped ? FindState.WRAPPED : FindState.FOUND;

                if (previousPage !== -1 && previousPage !== this._selected.pageIdx) {
                  this._updatePage(previousPage);
                }
              }

              this._updateUIState(state, this._state.findPrevious);

              if (this._selected.pageIdx !== -1) {
                this._scrollMatches = true;

                this._updatePage(this._selected.pageIdx);
              }
            }
          }, {
            key: "_onFindBarClose",
            value: function _onFindBarClose(evt) {
              var _this4 = this;

              var pdfDocument = this._pdfDocument;

              this._firstPageCapability.promise.then(function () {
                if (!_this4._pdfDocument || pdfDocument && _this4._pdfDocument !== pdfDocument) {
                  return;
                }

                if (_this4._findTimeout) {
                  clearTimeout(_this4._findTimeout);
                  _this4._findTimeout = null;
                }

                if (_this4._resumePageIdx) {
                  _this4._resumePageIdx = null;
                  _this4._dirtyMatch = true;
                }

                _this4._updateUIState(FindState.FOUND);

                _this4._highlightMatches = false;

                _this4._updateAllPages();
              });
            }
          }, {
            key: "_requestMatchesCount",
            value: function _requestMatchesCount() {
              var _this$_selected = this._selected,
                  pageIdx = _this$_selected.pageIdx,
                  matchIdx = _this$_selected.matchIdx;
              var current = 0,
                  total = this._matchesCountTotal;

              if (matchIdx !== -1) {
                for (var i = 0; i < pageIdx; i++) {
                  var _this$_pageMatches$i;

                  current += ((_this$_pageMatches$i = this._pageMatches[i]) === null || _this$_pageMatches$i === void 0 ? void 0 : _this$_pageMatches$i.length) || 0;
                }

                current += matchIdx + 1;
              }

              if (current < 1 || current > total) {
                current = total = 0;
              }

              return {
                current: current,
                total: total
              };
            }
          }, {
            key: "_updateUIResultsCount",
            value: function _updateUIResultsCount() {
              this._eventBus.dispatch("updatefindmatchescount", {
                source: this,
                matchesCount: this._requestMatchesCount()
              });
            }
          }, {
            key: "_updateUIState",
            value: function _updateUIState(state, previous) {
              var _this$_state$query, _this$_state2;

              this._eventBus.dispatch("updatefindcontrolstate", {
                source: this,
                state: state,
                previous: previous,
                matchesCount: this._requestMatchesCount(),
                rawQuery: (_this$_state$query = (_this$_state2 = this._state) === null || _this$_state2 === void 0 ? void 0 : _this$_state2.query) !== null && _this$_state$query !== void 0 ? _this$_state$query : null
              });
            }
          }]);

          return PDFFindController;
        }();

        exports.PDFFindController = PDFFindController;
        /***/
      },
      /* 16 */

      /***/
      function (__unused_webpack_module, exports) {
        Object.defineProperty(exports, "__esModule", {
          value: true
        });
        exports.getCharacterType = getCharacterType;
        exports.CharacterType = void 0;
        var CharacterType = {
          SPACE: 0,
          ALPHA_LETTER: 1,
          PUNCT: 2,
          HAN_LETTER: 3,
          KATAKANA_LETTER: 4,
          HIRAGANA_LETTER: 5,
          HALFWIDTH_KATAKANA_LETTER: 6,
          THAI_LETTER: 7
        };
        exports.CharacterType = CharacterType;

        function isAlphabeticalScript(charCode) {
          return charCode < 0x2e80;
        }

        function isAscii(charCode) {
          return (charCode & 0xff80) === 0;
        }

        function isAsciiAlpha(charCode) {
          return charCode >= 0x61 && charCode <= 0x7a || charCode >= 0x41 && charCode <= 0x5a;
        }

        function isAsciiDigit(charCode) {
          return charCode >= 0x30 && charCode <= 0x39;
        }

        function isAsciiSpace(charCode) {
          return charCode === 0x20 || charCode === 0x09 || charCode === 0x0d || charCode === 0x0a;
        }

        function isHan(charCode) {
          return charCode >= 0x3400 && charCode <= 0x9fff || charCode >= 0xf900 && charCode <= 0xfaff;
        }

        function isKatakana(charCode) {
          return charCode >= 0x30a0 && charCode <= 0x30ff;
        }

        function isHiragana(charCode) {
          return charCode >= 0x3040 && charCode <= 0x309f;
        }

        function isHalfwidthKatakana(charCode) {
          return charCode >= 0xff60 && charCode <= 0xff9f;
        }

        function isThai(charCode) {
          return (charCode & 0xff80) === 0x0e00;
        }

        function getCharacterType(charCode) {
          if (isAlphabeticalScript(charCode)) {
            if (isAscii(charCode)) {
              if (isAsciiSpace(charCode)) {
                return CharacterType.SPACE;
              } else if (isAsciiAlpha(charCode) || isAsciiDigit(charCode) || charCode === 0x5f) {
                return CharacterType.ALPHA_LETTER;
              }

              return CharacterType.PUNCT;
            } else if (isThai(charCode)) {
              return CharacterType.THAI_LETTER;
            } else if (charCode === 0xa0) {
              return CharacterType.SPACE;
            }

            return CharacterType.ALPHA_LETTER;
          }

          if (isHan(charCode)) {
            return CharacterType.HAN_LETTER;
          } else if (isKatakana(charCode)) {
            return CharacterType.KATAKANA_LETTER;
          } else if (isHiragana(charCode)) {
            return CharacterType.HIRAGANA_LETTER;
          } else if (isHalfwidthKatakana(charCode)) {
            return CharacterType.HALFWIDTH_KATAKANA_LETTER;
          }

          return CharacterType.ALPHA_LETTER;
        }
        /***/

      },
      /* 17 */

      /***/
      function (__unused_webpack_module, exports, __w_pdfjs_require__) {
        Object.defineProperty(exports, "__esModule", {
          value: true
        });
        exports.isDestArraysEqual = isDestArraysEqual;
        exports.isDestHashesEqual = isDestHashesEqual;
        exports.PDFHistory = void 0;

        var _ui_utils = __w_pdfjs_require__(7);

        function _typeof(obj) {
          "@babel/helpers - typeof";

          if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
            _typeof = function _typeof(obj) {
              return typeof obj;
            };
          } else {
            _typeof = function _typeof(obj) {
              return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
            };
          }

          return _typeof(obj);
        }

        function _slicedToArray(arr, i) {
          return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
        }

        function _nonIterableRest() {
          throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
        }

        function _unsupportedIterableToArray(o, minLen) {
          if (!o) return;
          if (typeof o === "string") return _arrayLikeToArray(o, minLen);
          var n = Object.prototype.toString.call(o).slice(8, -1);
          if (n === "Object" && o.constructor) n = o.constructor.name;
          if (n === "Map" || n === "Set") return Array.from(o);
          if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
        }

        function _arrayLikeToArray(arr, len) {
          if (len == null || len > arr.length) len = arr.length;

          for (var i = 0, arr2 = new Array(len); i < len; i++) {
            arr2[i] = arr[i];
          }

          return arr2;
        }

        function _iterableToArrayLimit(arr, i) {
          var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];

          if (_i == null) return;
          var _arr = [];
          var _n = true;
          var _d = false;

          var _s, _e;

          try {
            for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
              _arr.push(_s.value);

              if (i && _arr.length === i) break;
            }
          } catch (err) {
            _d = true;
            _e = err;
          } finally {
            try {
              if (!_n && _i["return"] != null) _i["return"]();
            } finally {
              if (_d) throw _e;
            }
          }

          return _arr;
        }

        function _arrayWithHoles(arr) {
          if (Array.isArray(arr)) return arr;
        }

        function _classCallCheck(instance, Constructor) {
          if (!(instance instanceof Constructor)) {
            throw new TypeError("Cannot call a class as a function");
          }
        }

        function _defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];
            descriptor.enumerable = descriptor.enumerable || false;
            descriptor.configurable = true;
            if ("value" in descriptor) descriptor.writable = true;
            Object.defineProperty(target, descriptor.key, descriptor);
          }
        }

        function _createClass(Constructor, protoProps, staticProps) {
          if (protoProps) _defineProperties(Constructor.prototype, protoProps);
          if (staticProps) _defineProperties(Constructor, staticProps);
          return Constructor;
        }

        var HASH_CHANGE_TIMEOUT = 1000;
        var POSITION_UPDATED_THRESHOLD = 50;
        var UPDATE_VIEWAREA_TIMEOUT = 1000;

        function getCurrentHash() {
          return document.location.hash;
        }

        var PDFHistory = /*#__PURE__*/function () {
          function PDFHistory(_ref) {
            var _this = this;

            var linkService = _ref.linkService,
                eventBus = _ref.eventBus;

            _classCallCheck(this, PDFHistory);

            this.linkService = linkService;
            this.eventBus = eventBus;
            this._initialized = false;
            this._fingerprint = "";
            this.reset();
            this._boundEvents = null;
            this._isViewerInPresentationMode = false;

            this.eventBus._on("presentationmodechanged", function (evt) {
              _this._isViewerInPresentationMode = evt.state !== _ui_utils.PresentationModeState.NORMAL;
            });

            this.eventBus._on("pagesinit", function () {
              _this._isPagesLoaded = false;

              _this.eventBus._on("pagesloaded", function (evt) {
                _this._isPagesLoaded = !!evt.pagesCount;
              }, {
                once: true
              });
            });
          }

          _createClass(PDFHistory, [{
            key: "initialize",
            value: function initialize(_ref2) {
              var fingerprint = _ref2.fingerprint,
                  _ref2$resetHistory = _ref2.resetHistory,
                  resetHistory = _ref2$resetHistory === void 0 ? false : _ref2$resetHistory,
                  _ref2$updateUrl = _ref2.updateUrl,
                  updateUrl = _ref2$updateUrl === void 0 ? false : _ref2$updateUrl;

              if (!fingerprint || typeof fingerprint !== "string") {
                console.error('PDFHistory.initialize: The "fingerprint" must be a non-empty string.');
                return;
              }

              if (this._initialized) {
                this.reset();
              }

              var reInitialized = this._fingerprint !== "" && this._fingerprint !== fingerprint;
              this._fingerprint = fingerprint;
              this._updateUrl = updateUrl === true;
              this._initialized = true;

              this._bindEvents();

              var state = window.history.state;
              this._popStateInProgress = false;
              this._blockHashChange = 0;
              this._currentHash = getCurrentHash();
              this._numPositionUpdates = 0;
              this._uid = this._maxUid = 0;
              this._destination = null;
              this._position = null;

              if (!this._isValidState(state, true) || resetHistory) {
                var _this$_parseCurrentHa = this._parseCurrentHash(true),
                    hash = _this$_parseCurrentHa.hash,
                    page = _this$_parseCurrentHa.page,
                    rotation = _this$_parseCurrentHa.rotation;

                if (!hash || reInitialized || resetHistory) {
                  this._pushOrReplaceState(null, true);

                  return;
                }

                this._pushOrReplaceState({
                  hash: hash,
                  page: page,
                  rotation: rotation
                }, true);

                return;
              }

              var destination = state.destination;

              this._updateInternalState(destination, state.uid, true);

              if (destination.rotation !== undefined) {
                this._initialRotation = destination.rotation;
              }

              if (destination.dest) {
                this._initialBookmark = JSON.stringify(destination.dest);
                this._destination.page = null;
              } else if (destination.hash) {
                this._initialBookmark = destination.hash;
              } else if (destination.page) {
                this._initialBookmark = "page=".concat(destination.page);
              }
            }
          }, {
            key: "reset",
            value: function reset() {
              if (this._initialized) {
                this._pageHide();

                this._initialized = false;

                this._unbindEvents();
              }

              if (this._updateViewareaTimeout) {
                clearTimeout(this._updateViewareaTimeout);
                this._updateViewareaTimeout = null;
              }

              this._initialBookmark = null;
              this._initialRotation = null;
            }
          }, {
            key: "push",
            value: function push(_ref3) {
              var _this2 = this;

              var _ref3$namedDest = _ref3.namedDest,
                  namedDest = _ref3$namedDest === void 0 ? null : _ref3$namedDest,
                  explicitDest = _ref3.explicitDest,
                  pageNumber = _ref3.pageNumber;

              if (!this._initialized) {
                return;
              }

              if (namedDest && typeof namedDest !== "string") {
                console.error("PDFHistory.push: " + "\"".concat(namedDest, "\" is not a valid namedDest parameter."));
                return;
              } else if (!Array.isArray(explicitDest)) {
                console.error("PDFHistory.push: " + "\"".concat(explicitDest, "\" is not a valid explicitDest parameter."));
                return;
              } else if (!this._isValidPage(pageNumber)) {
                if (pageNumber !== null || this._destination) {
                  console.error("PDFHistory.push: " + "\"".concat(pageNumber, "\" is not a valid pageNumber parameter."));
                  return;
                }
              }

              var hash = namedDest || JSON.stringify(explicitDest);

              if (!hash) {
                return;
              }

              var forceReplace = false;

              if (this._destination && (isDestHashesEqual(this._destination.hash, hash) || isDestArraysEqual(this._destination.dest, explicitDest))) {
                if (this._destination.page) {
                  return;
                }

                forceReplace = true;
              }

              if (this._popStateInProgress && !forceReplace) {
                return;
              }

              this._pushOrReplaceState({
                dest: explicitDest,
                hash: hash,
                page: pageNumber,
                rotation: this.linkService.rotation
              }, forceReplace);

              if (!this._popStateInProgress) {
                this._popStateInProgress = true;
                Promise.resolve().then(function () {
                  _this2._popStateInProgress = false;
                });
              }
            }
          }, {
            key: "pushPage",
            value: function pushPage(pageNumber) {
              var _this$_destination,
                  _this3 = this;

              if (!this._initialized) {
                return;
              }

              if (!this._isValidPage(pageNumber)) {
                console.error("PDFHistory.pushPage: \"".concat(pageNumber, "\" is not a valid page number."));
                return;
              }

              if (((_this$_destination = this._destination) === null || _this$_destination === void 0 ? void 0 : _this$_destination.page) === pageNumber) {
                return;
              }

              if (this._popStateInProgress) {
                return;
              }

              this._pushOrReplaceState({
                dest: null,
                hash: "page=".concat(pageNumber),
                page: pageNumber,
                rotation: this.linkService.rotation
              });

              if (!this._popStateInProgress) {
                this._popStateInProgress = true;
                Promise.resolve().then(function () {
                  _this3._popStateInProgress = false;
                });
              }
            }
          }, {
            key: "pushCurrentPosition",
            value: function pushCurrentPosition() {
              if (!this._initialized || this._popStateInProgress) {
                return;
              }

              this._tryPushCurrentPosition();
            }
          }, {
            key: "back",
            value: function back() {
              if (!this._initialized || this._popStateInProgress) {
                return;
              }

              var state = window.history.state;

              if (this._isValidState(state) && state.uid > 0) {
                window.history.back();
              }
            }
          }, {
            key: "forward",
            value: function forward() {
              if (!this._initialized || this._popStateInProgress) {
                return;
              }

              var state = window.history.state;

              if (this._isValidState(state) && state.uid < this._maxUid) {
                window.history.forward();
              }
            }
          }, {
            key: "popStateInProgress",
            get: function get() {
              return this._initialized && (this._popStateInProgress || this._blockHashChange > 0);
            }
          }, {
            key: "initialBookmark",
            get: function get() {
              return this._initialized ? this._initialBookmark : null;
            }
          }, {
            key: "initialRotation",
            get: function get() {
              return this._initialized ? this._initialRotation : null;
            }
          }, {
            key: "_pushOrReplaceState",
            value: function _pushOrReplaceState(destination) {
              var forceReplace = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
              var shouldReplace = forceReplace || !this._destination;
              var newState = {
                fingerprint: this._fingerprint,
                uid: shouldReplace ? this._uid : this._uid + 1,
                destination: destination
              };

              this._updateInternalState(destination, newState.uid);

              var newUrl;

              if (this._updateUrl && destination !== null && destination !== void 0 && destination.hash) {
                var baseUrl = document.location.href.split("#")[0];

                if (!baseUrl.startsWith("file://")) {
                  newUrl = "".concat(baseUrl, "#").concat(destination.hash);
                }
              }

              if (shouldReplace) {
                window.history.replaceState(newState, "", newUrl);
              } else {
                window.history.pushState(newState, "", newUrl);
              }
            }
          }, {
            key: "_tryPushCurrentPosition",
            value: function _tryPushCurrentPosition() {
              var temporary = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;

              if (!this._position) {
                return;
              }

              var position = this._position;

              if (temporary) {
                position = Object.assign(Object.create(null), this._position);
                position.temporary = true;
              }

              if (!this._destination) {
                this._pushOrReplaceState(position);

                return;
              }

              if (this._destination.temporary) {
                this._pushOrReplaceState(position, true);

                return;
              }

              if (this._destination.hash === position.hash) {
                return;
              }

              if (!this._destination.page && (POSITION_UPDATED_THRESHOLD <= 0 || this._numPositionUpdates <= POSITION_UPDATED_THRESHOLD)) {
                return;
              }

              var forceReplace = false;

              if (this._destination.page >= position.first && this._destination.page <= position.page) {
                if (this._destination.dest !== undefined || !this._destination.first) {
                  return;
                }

                forceReplace = true;
              }

              this._pushOrReplaceState(position, forceReplace);
            }
          }, {
            key: "_isValidPage",
            value: function _isValidPage(val) {
              return Number.isInteger(val) && val > 0 && val <= this.linkService.pagesCount;
            }
          }, {
            key: "_isValidState",
            value: function _isValidState(state) {
              var checkReload = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;

              if (!state) {
                return false;
              }

              if (state.fingerprint !== this._fingerprint) {
                if (checkReload) {
                  if (typeof state.fingerprint !== "string" || state.fingerprint.length !== this._fingerprint.length) {
                    return false;
                  }

                  var _performance$getEntri = performance.getEntriesByType("navigation"),
                      _performance$getEntri2 = _slicedToArray(_performance$getEntri, 1),
                      perfEntry = _performance$getEntri2[0];

                  if ((perfEntry === null || perfEntry === void 0 ? void 0 : perfEntry.type) !== "reload") {
                    return false;
                  }
                } else {
                  return false;
                }
              }

              if (!Number.isInteger(state.uid) || state.uid < 0) {
                return false;
              }

              if (state.destination === null || _typeof(state.destination) !== "object") {
                return false;
              }

              return true;
            }
          }, {
            key: "_updateInternalState",
            value: function _updateInternalState(destination, uid) {
              var removeTemporary = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;

              if (this._updateViewareaTimeout) {
                clearTimeout(this._updateViewareaTimeout);
                this._updateViewareaTimeout = null;
              }

              if (removeTemporary && destination !== null && destination !== void 0 && destination.temporary) {
                delete destination.temporary;
              }

              this._destination = destination;
              this._uid = uid;
              this._maxUid = Math.max(this._maxUid, uid);
              this._numPositionUpdates = 0;
            }
          }, {
            key: "_parseCurrentHash",
            value: function _parseCurrentHash() {
              var checkNameddest = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
              var hash = unescape(getCurrentHash()).substring(1);
              var params = (0, _ui_utils.parseQueryString)(hash);
              var nameddest = params.get("nameddest") || "";
              var page = params.get("page") | 0;

              if (!this._isValidPage(page) || checkNameddest && nameddest.length > 0) {
                page = null;
              }

              return {
                hash: hash,
                page: page,
                rotation: this.linkService.rotation
              };
            }
          }, {
            key: "_updateViewarea",
            value: function _updateViewarea(_ref4) {
              var _this4 = this;

              var location = _ref4.location;

              if (this._updateViewareaTimeout) {
                clearTimeout(this._updateViewareaTimeout);
                this._updateViewareaTimeout = null;
              }

              this._position = {
                hash: this._isViewerInPresentationMode ? "page=".concat(location.pageNumber) : location.pdfOpenParams.substring(1),
                page: this.linkService.page,
                first: location.pageNumber,
                rotation: location.rotation
              };

              if (this._popStateInProgress) {
                return;
              }

              if (POSITION_UPDATED_THRESHOLD > 0 && this._isPagesLoaded && this._destination && !this._destination.page) {
                this._numPositionUpdates++;
              }

              if (UPDATE_VIEWAREA_TIMEOUT > 0) {
                this._updateViewareaTimeout = setTimeout(function () {
                  if (!_this4._popStateInProgress) {
                    _this4._tryPushCurrentPosition(true);
                  }

                  _this4._updateViewareaTimeout = null;
                }, UPDATE_VIEWAREA_TIMEOUT);
              }
            }
          }, {
            key: "_popState",
            value: function _popState(_ref5) {
              var _this5 = this;

              var state = _ref5.state;
              var newHash = getCurrentHash(),
                  hashChanged = this._currentHash !== newHash;
              this._currentHash = newHash;

              if (!state) {
                this._uid++;

                var _this$_parseCurrentHa2 = this._parseCurrentHash(),
                    hash = _this$_parseCurrentHa2.hash,
                    page = _this$_parseCurrentHa2.page,
                    rotation = _this$_parseCurrentHa2.rotation;

                this._pushOrReplaceState({
                  hash: hash,
                  page: page,
                  rotation: rotation
                }, true);

                return;
              }

              if (!this._isValidState(state)) {
                return;
              }

              this._popStateInProgress = true;

              if (hashChanged) {
                this._blockHashChange++;
                (0, _ui_utils.waitOnEventOrTimeout)({
                  target: window,
                  name: "hashchange",
                  delay: HASH_CHANGE_TIMEOUT
                }).then(function () {
                  _this5._blockHashChange--;
                });
              }

              var destination = state.destination;

              this._updateInternalState(destination, state.uid, true);

              if ((0, _ui_utils.isValidRotation)(destination.rotation)) {
                this.linkService.rotation = destination.rotation;
              }

              if (destination.dest) {
                this.linkService.goToDestination(destination.dest);
              } else if (destination.hash) {
                this.linkService.setHash(destination.hash);
              } else if (destination.page) {
                this.linkService.page = destination.page;
              }

              Promise.resolve().then(function () {
                _this5._popStateInProgress = false;
              });
            }
          }, {
            key: "_pageHide",
            value: function _pageHide() {
              if (!this._destination || this._destination.temporary) {
                this._tryPushCurrentPosition();
              }
            }
          }, {
            key: "_bindEvents",
            value: function _bindEvents() {
              if (this._boundEvents) {
                return;
              }

              this._boundEvents = {
                updateViewarea: this._updateViewarea.bind(this),
                popState: this._popState.bind(this),
                pageHide: this._pageHide.bind(this)
              };

              this.eventBus._on("updateviewarea", this._boundEvents.updateViewarea);

              window.addEventListener("popstate", this._boundEvents.popState);
              window.addEventListener("pagehide", this._boundEvents.pageHide);
            }
          }, {
            key: "_unbindEvents",
            value: function _unbindEvents() {
              if (!this._boundEvents) {
                return;
              }

              this.eventBus._off("updateviewarea", this._boundEvents.updateViewarea);

              window.removeEventListener("popstate", this._boundEvents.popState);
              window.removeEventListener("pagehide", this._boundEvents.pageHide);
              this._boundEvents = null;
            }
          }]);

          return PDFHistory;
        }();

        exports.PDFHistory = PDFHistory;

        function isDestHashesEqual(destHash, pushHash) {
          if (typeof destHash !== "string" || typeof pushHash !== "string") {
            return false;
          }

          if (destHash === pushHash) {
            return true;
          }

          var nameddest = (0, _ui_utils.parseQueryString)(destHash).get("nameddest");

          if (nameddest === pushHash) {
            return true;
          }

          return false;
        }

        function isDestArraysEqual(firstDest, secondDest) {
          function isEntryEqual(first, second) {
            if (_typeof(first) !== _typeof(second)) {
              return false;
            }

            if (Array.isArray(first) || Array.isArray(second)) {
              return false;
            }

            if (first !== null && _typeof(first) === "object" && second !== null) {
              if (Object.keys(first).length !== Object.keys(second).length) {
                return false;
              }

              for (var key in first) {
                if (!isEntryEqual(first[key], second[key])) {
                  return false;
                }
              }

              return true;
            }

            return first === second || Number.isNaN(first) && Number.isNaN(second);
          }

          if (!(Array.isArray(firstDest) && Array.isArray(secondDest))) {
            return false;
          }

          if (firstDest.length !== secondDest.length) {
            return false;
          }

          for (var i = 0, ii = firstDest.length; i < ii; i++) {
            if (!isEntryEqual(firstDest[i], secondDest[i])) {
              return false;
            }
          }

          return true;
        }
        /***/

      },
      /* 18 */

      /***/
      function (__unused_webpack_module, exports, __w_pdfjs_require__) {
        Object.defineProperty(exports, "__esModule", {
          value: true
        });
        exports.PDFPageView = void 0;

        var _regenerator = _interopRequireDefault(__w_pdfjs_require__(2));

        var _pdfjsLib = __w_pdfjs_require__(4);

        var _ui_utils = __w_pdfjs_require__(7);

        var _app_options = __w_pdfjs_require__(12);

        var _l10n_utils = __w_pdfjs_require__(5);

        var _pdf_rendering_queue = __w_pdfjs_require__(19);

        function _interopRequireDefault(obj) {
          return obj && obj.__esModule ? obj : {
            "default": obj
          };
        }

        function _typeof(obj) {
          "@babel/helpers - typeof";

          if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
            _typeof = function _typeof(obj) {
              return typeof obj;
            };
          } else {
            _typeof = function _typeof(obj) {
              return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
            };
          }

          return _typeof(obj);
        }

        function _createForOfIteratorHelper(o, allowArrayLike) {
          var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];

          if (!it) {
            if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
              if (it) o = it;
              var i = 0;

              var F = function F() {};

              return {
                s: F,
                n: function n() {
                  if (i >= o.length) return {
                    done: true
                  };
                  return {
                    done: false,
                    value: o[i++]
                  };
                },
                e: function e(_e) {
                  throw _e;
                },
                f: F
              };
            }

            throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
          }

          var normalCompletion = true,
              didErr = false,
              err;
          return {
            s: function s() {
              it = it.call(o);
            },
            n: function n() {
              var step = it.next();
              normalCompletion = step.done;
              return step;
            },
            e: function e(_e2) {
              didErr = true;
              err = _e2;
            },
            f: function f() {
              try {
                if (!normalCompletion && it["return"] != null) it["return"]();
              } finally {
                if (didErr) throw err;
              }
            }
          };
        }

        function _unsupportedIterableToArray(o, minLen) {
          if (!o) return;
          if (typeof o === "string") return _arrayLikeToArray(o, minLen);
          var n = Object.prototype.toString.call(o).slice(8, -1);
          if (n === "Object" && o.constructor) n = o.constructor.name;
          if (n === "Map" || n === "Set") return Array.from(o);
          if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
        }

        function _arrayLikeToArray(arr, len) {
          if (len == null || len > arr.length) len = arr.length;

          for (var i = 0, arr2 = new Array(len); i < len; i++) {
            arr2[i] = arr[i];
          }

          return arr2;
        }

        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 self = this,
                args = arguments;
            return new Promise(function (resolve, reject) {
              var gen = fn.apply(self, args);

              function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
              }

              function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
              }

              _next(undefined);
            });
          };
        }

        function _classCallCheck(instance, Constructor) {
          if (!(instance instanceof Constructor)) {
            throw new TypeError("Cannot call a class as a function");
          }
        }

        function _defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];
            descriptor.enumerable = descriptor.enumerable || false;
            descriptor.configurable = true;
            if ("value" in descriptor) descriptor.writable = true;
            Object.defineProperty(target, descriptor.key, descriptor);
          }
        }

        function _createClass(Constructor, protoProps, staticProps) {
          if (protoProps) _defineProperties(Constructor.prototype, protoProps);
          if (staticProps) _defineProperties(Constructor, staticProps);
          return Constructor;
        }

        var MAX_CANVAS_PIXELS = _app_options.compatibilityParams.maxCanvasPixels || 16777216;

        var PDFPageView = /*#__PURE__*/function () {
          function PDFPageView(options) {
            var _options$textLayerMod, _options$annotationMo, _options$textHighligh, _this$renderingQueue;

            _classCallCheck(this, PDFPageView);

            var container = options.container;
            var defaultViewport = options.defaultViewport;
            this.id = options.id;
            this.renderingId = "page" + this.id;
            this.pdfPage = null;
            this.pageLabel = null;
            this.rotation = 0;
            this.scale = options.scale || _ui_utils.DEFAULT_SCALE;
            this.viewport = defaultViewport;
            this.pdfPageRotate = defaultViewport.rotation;
            this._optionalContentConfigPromise = options.optionalContentConfigPromise || null;
            this.hasRestrictedScaling = false;
            this.textLayerMode = (_options$textLayerMod = options.textLayerMode) !== null && _options$textLayerMod !== void 0 ? _options$textLayerMod : _ui_utils.TextLayerMode.ENABLE;
            this._annotationMode = (_options$annotationMo = options.annotationMode) !== null && _options$annotationMo !== void 0 ? _options$annotationMo : _pdfjsLib.AnnotationMode.ENABLE_FORMS;
            this.imageResourcesPath = options.imageResourcesPath || "";
            this.useOnlyCssZoom = options.useOnlyCssZoom || false;
            this.maxCanvasPixels = options.maxCanvasPixels || MAX_CANVAS_PIXELS;
            this.eventBus = options.eventBus;
            this.renderingQueue = options.renderingQueue;
            this.textLayerFactory = options.textLayerFactory;
            this.annotationLayerFactory = options.annotationLayerFactory;
            this.xfaLayerFactory = options.xfaLayerFactory;
            this.textHighlighter = (_options$textHighligh = options.textHighlighterFactory) === null || _options$textHighligh === void 0 ? void 0 : _options$textHighligh.createTextHighlighter(this.id - 1, this.eventBus);
            this.structTreeLayerFactory = options.structTreeLayerFactory;
            this.renderer = options.renderer || _ui_utils.RendererType.CANVAS;
            this.l10n = options.l10n || _l10n_utils.NullL10n;
            this.paintTask = null;
            this.paintedViewportMap = new WeakMap();
            this.renderingState = _pdf_rendering_queue.RenderingStates.INITIAL;
            this.resume = null;
            this._renderError = null;
            this._isStandalone = !((_this$renderingQueue = this.renderingQueue) !== null && _this$renderingQueue !== void 0 && _this$renderingQueue.hasViewer());
            this.annotationLayer = null;
            this.textLayer = null;
            this.zoomLayer = null;
            this.xfaLayer = null;
            this.structTreeLayer = null;
            var div = document.createElement("div");
            div.className = "page";
            div.style.width = Math.floor(this.viewport.width) + "px";
            div.style.height = Math.floor(this.viewport.height) + "px";
            div.setAttribute("data-page-number", this.id);
            div.setAttribute("role", "region");
            this.l10n.get("page_landmark", {
              page: this.id
            }).then(function (msg) {
              div.setAttribute("aria-label", msg);
            });
            this.div = div;
            container.appendChild(div);
          }

          _createClass(PDFPageView, [{
            key: "setPdfPage",
            value: function setPdfPage(pdfPage) {
              this.pdfPage = pdfPage;
              this.pdfPageRotate = pdfPage.rotate;
              var totalRotation = (this.rotation + this.pdfPageRotate) % 360;
              this.viewport = pdfPage.getViewport({
                scale: this.scale * _pdfjsLib.PixelsPerInch.PDF_TO_CSS_UNITS,
                rotation: totalRotation
              });
              this.reset();
            }
          }, {
            key: "destroy",
            value: function destroy() {
              this.reset();

              if (this.pdfPage) {
                this.pdfPage.cleanup();
              }
            }
          }, {
            key: "_renderAnnotationLayer",
            value: function () {
              var _renderAnnotationLayer2 = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
                var error;
                return _regenerator["default"].wrap(function _callee$(_context) {
                  while (1) {
                    switch (_context.prev = _context.next) {
                      case 0:
                        error = null;
                        _context.prev = 1;
                        _context.next = 4;
                        return this.annotationLayer.render(this.viewport, "display");

                      case 4:
                        _context.next = 9;
                        break;

                      case 6:
                        _context.prev = 6;
                        _context.t0 = _context["catch"](1);
                        error = _context.t0;

                      case 9:
                        _context.prev = 9;
                        this.eventBus.dispatch("annotationlayerrendered", {
                          source: this,
                          pageNumber: this.id,
                          error: error
                        });
                        return _context.finish(9);

                      case 12:
                      case "end":
                        return _context.stop();
                    }
                  }
                }, _callee, this, [[1, 6, 9, 12]]);
              }));

              function _renderAnnotationLayer() {
                return _renderAnnotationLayer2.apply(this, arguments);
              }

              return _renderAnnotationLayer;
            }()
          }, {
            key: "_renderXfaLayer",
            value: function () {
              var _renderXfaLayer2 = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
                var error, result;
                return _regenerator["default"].wrap(function _callee2$(_context2) {
                  while (1) {
                    switch (_context2.prev = _context2.next) {
                      case 0:
                        error = null;
                        _context2.prev = 1;
                        _context2.next = 4;
                        return this.xfaLayer.render(this.viewport, "display");

                      case 4:
                        result = _context2.sent;

                        if (this.textHighlighter) {
                          this._buildXfaTextContentItems(result.textDivs);
                        }

                        _context2.next = 11;
                        break;

                      case 8:
                        _context2.prev = 8;
                        _context2.t0 = _context2["catch"](1);
                        error = _context2.t0;

                      case 11:
                        _context2.prev = 11;
                        this.eventBus.dispatch("xfalayerrendered", {
                          source: this,
                          pageNumber: this.id,
                          error: error
                        });
                        return _context2.finish(11);

                      case 14:
                      case "end":
                        return _context2.stop();
                    }
                  }
                }, _callee2, this, [[1, 8, 11, 14]]);
              }));

              function _renderXfaLayer() {
                return _renderXfaLayer2.apply(this, arguments);
              }

              return _renderXfaLayer;
            }()
          }, {
            key: "_buildXfaTextContentItems",
            value: function () {
              var _buildXfaTextContentItems2 = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee3(textDivs) {
                var text, items, _iterator, _step, item;

                return _regenerator["default"].wrap(function _callee3$(_context3) {
                  while (1) {
                    switch (_context3.prev = _context3.next) {
                      case 0:
                        _context3.next = 2;
                        return this.pdfPage.getTextContent();

                      case 2:
                        text = _context3.sent;
                        items = [];
                        _iterator = _createForOfIteratorHelper(text.items);

                        try {
                          for (_iterator.s(); !(_step = _iterator.n()).done;) {
                            item = _step.value;
                            items.push(item.str);
                          }
                        } catch (err) {
                          _iterator.e(err);
                        } finally {
                          _iterator.f();
                        }

                        this.textHighlighter.setTextMapping(textDivs, items);
                        this.textHighlighter.enable();

                      case 8:
                      case "end":
                        return _context3.stop();
                    }
                  }
                }, _callee3, this);
              }));

              function _buildXfaTextContentItems(_x) {
                return _buildXfaTextContentItems2.apply(this, arguments);
              }

              return _buildXfaTextContentItems;
            }()
          }, {
            key: "_resetZoomLayer",
            value: function _resetZoomLayer() {
              var removeFromDOM = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;

              if (!this.zoomLayer) {
                return;
              }

              var zoomLayerCanvas = this.zoomLayer.firstChild;
              this.paintedViewportMap["delete"](zoomLayerCanvas);
              zoomLayerCanvas.width = 0;
              zoomLayerCanvas.height = 0;

              if (removeFromDOM) {
                this.zoomLayer.remove();
              }

              this.zoomLayer = null;
            }
          }, {
            key: "reset",
            value: function reset() {
              var _this$annotationLayer,
                  _this$xfaLayer,
                  _this = this;

              var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
                  _ref$keepZoomLayer = _ref.keepZoomLayer,
                  keepZoomLayer = _ref$keepZoomLayer === void 0 ? false : _ref$keepZoomLayer,
                  _ref$keepAnnotationLa = _ref.keepAnnotationLayer,
                  keepAnnotationLayer = _ref$keepAnnotationLa === void 0 ? false : _ref$keepAnnotationLa,
                  _ref$keepXfaLayer = _ref.keepXfaLayer,
                  keepXfaLayer = _ref$keepXfaLayer === void 0 ? false : _ref$keepXfaLayer;

              this.cancelRendering({
                keepAnnotationLayer: keepAnnotationLayer,
                keepXfaLayer: keepXfaLayer
              });
              this.renderingState = _pdf_rendering_queue.RenderingStates.INITIAL;
              var div = this.div;
              div.style.width = Math.floor(this.viewport.width) + "px";
              div.style.height = Math.floor(this.viewport.height) + "px";
              var childNodes = div.childNodes,
                  zoomLayerNode = keepZoomLayer && this.zoomLayer || null,
                  annotationLayerNode = keepAnnotationLayer && ((_this$annotationLayer = this.annotationLayer) === null || _this$annotationLayer === void 0 ? void 0 : _this$annotationLayer.div) || null,
                  xfaLayerNode = keepXfaLayer && ((_this$xfaLayer = this.xfaLayer) === null || _this$xfaLayer === void 0 ? void 0 : _this$xfaLayer.div) || null;

              for (var i = childNodes.length - 1; i >= 0; i--) {
                var node = childNodes[i];

                switch (node) {
                  case zoomLayerNode:
                  case annotationLayerNode:
                  case xfaLayerNode:
                    continue;
                }

                div.removeChild(node);
              }

              div.removeAttribute("data-loaded");

              if (annotationLayerNode) {
                this.annotationLayer.hide();
              }

              if (xfaLayerNode) {
                this.xfaLayer.hide();
              }

              if (!zoomLayerNode) {
                if (this.canvas) {
                  this.paintedViewportMap["delete"](this.canvas);
                  this.canvas.width = 0;
                  this.canvas.height = 0;
                  delete this.canvas;
                }

                this._resetZoomLayer();
              }

              if (this.svg) {
                this.paintedViewportMap["delete"](this.svg);
                delete this.svg;
              }

              this.loadingIconDiv = document.createElement("div");
              this.loadingIconDiv.className = "loadingIcon";
              this.loadingIconDiv.setAttribute("role", "img");
              this.l10n.get("loading").then(function (msg) {
                var _this$loadingIconDiv;

                (_this$loadingIconDiv = _this.loadingIconDiv) === null || _this$loadingIconDiv === void 0 ? void 0 : _this$loadingIconDiv.setAttribute("aria-label", msg);
              });
              div.appendChild(this.loadingIconDiv);
            }
          }, {
            key: "update",
            value: function update(_ref2) {
              var _ref2$scale = _ref2.scale,
                  scale = _ref2$scale === void 0 ? 0 : _ref2$scale,
                  _ref2$rotation = _ref2.rotation,
                  rotation = _ref2$rotation === void 0 ? null : _ref2$rotation,
                  _ref2$optionalContent = _ref2.optionalContentConfigPromise,
                  optionalContentConfigPromise = _ref2$optionalContent === void 0 ? null : _ref2$optionalContent;

              if (_typeof(arguments[0]) !== "object") {
                console.error("PDFPageView.update called with separate parameters, please use an object instead.");
                this.update({
                  scale: arguments[0],
                  rotation: arguments[1],
                  optionalContentConfigPromise: arguments[2]
                });
                return;
              }

              this.scale = scale || this.scale;

              if (typeof rotation === "number") {
                this.rotation = rotation;
              }

              if (optionalContentConfigPromise instanceof Promise) {
                this._optionalContentConfigPromise = optionalContentConfigPromise;
              }

              if (this._isStandalone) {
                var doc = document.documentElement;
                doc.style.setProperty("--zoom-factor", this.scale);
              }

              var totalRotation = (this.rotation + this.pdfPageRotate) % 360;
              this.viewport = this.viewport.clone({
                scale: this.scale * _pdfjsLib.PixelsPerInch.PDF_TO_CSS_UNITS,
                rotation: totalRotation
              });

              if (this.svg) {
                this.cssTransform({
                  target: this.svg,
                  redrawAnnotationLayer: true,
                  redrawXfaLayer: true
                });
                this.eventBus.dispatch("pagerendered", {
                  source: this,
                  pageNumber: this.id,
                  cssTransform: true,
                  timestamp: performance.now(),
                  error: this._renderError
                });
                return;
              }

              var isScalingRestricted = false;

              if (this.canvas && this.maxCanvasPixels > 0) {
                var outputScale = this.outputScale;

                if ((Math.floor(this.viewport.width) * outputScale.sx | 0) * (Math.floor(this.viewport.height) * outputScale.sy | 0) > this.maxCanvasPixels) {
                  isScalingRestricted = true;
                }
              }

              if (this.canvas) {
                if (this.useOnlyCssZoom || this.hasRestrictedScaling && isScalingRestricted) {
                  this.cssTransform({
                    target: this.canvas,
                    redrawAnnotationLayer: true,
                    redrawXfaLayer: true
                  });
                  this.eventBus.dispatch("pagerendered", {
                    source: this,
                    pageNumber: this.id,
                    cssTransform: true,
                    timestamp: performance.now(),
                    error: this._renderError
                  });
                  return;
                }

                if (!this.zoomLayer && !this.canvas.hidden) {
                  this.zoomLayer = this.canvas.parentNode;
                  this.zoomLayer.style.position = "absolute";
                }
              }

              if (this.zoomLayer) {
                this.cssTransform({
                  target: this.zoomLayer.firstChild
                });
              }

              this.reset({
                keepZoomLayer: true,
                keepAnnotationLayer: true,
                keepXfaLayer: true
              });
            }
          }, {
            key: "cancelRendering",
            value: function cancelRendering() {
              var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
                  _ref3$keepAnnotationL = _ref3.keepAnnotationLayer,
                  keepAnnotationLayer = _ref3$keepAnnotationL === void 0 ? false : _ref3$keepAnnotationL,
                  _ref3$keepXfaLayer = _ref3.keepXfaLayer,
                  keepXfaLayer = _ref3$keepXfaLayer === void 0 ? false : _ref3$keepXfaLayer;

              if (this.paintTask) {
                this.paintTask.cancel();
                this.paintTask = null;
              }

              this.resume = null;

              if (this.textLayer) {
                this.textLayer.cancel();
                this.textLayer = null;
              }

              if (this.annotationLayer && (!keepAnnotationLayer || !this.annotationLayer.div)) {
                this.annotationLayer.cancel();
                this.annotationLayer = null;
              }

              if (this.xfaLayer && (!keepXfaLayer || !this.xfaLayer.div)) {
                var _this$textHighlighter;

                this.xfaLayer.cancel();
                this.xfaLayer = null;
                (_this$textHighlighter = this.textHighlighter) === null || _this$textHighlighter === void 0 ? void 0 : _this$textHighlighter.disable();
              }

              if (this._onTextLayerRendered) {
                this.eventBus._off("textlayerrendered", this._onTextLayerRendered);

                this._onTextLayerRendered = null;
              }
            }
          }, {
            key: "cssTransform",
            value: function cssTransform(_ref4) {
              var target = _ref4.target,
                  _ref4$redrawAnnotatio = _ref4.redrawAnnotationLayer,
                  redrawAnnotationLayer = _ref4$redrawAnnotatio === void 0 ? false : _ref4$redrawAnnotatio,
                  _ref4$redrawXfaLayer = _ref4.redrawXfaLayer,
                  redrawXfaLayer = _ref4$redrawXfaLayer === void 0 ? false : _ref4$redrawXfaLayer;
              var width = this.viewport.width;
              var height = this.viewport.height;
              var div = this.div;
              target.style.width = target.parentNode.style.width = div.style.width = Math.floor(width) + "px";
              target.style.height = target.parentNode.style.height = div.style.height = Math.floor(height) + "px";
              var relativeRotation = this.viewport.rotation - this.paintedViewportMap.get(target).rotation;
              var absRotation = Math.abs(relativeRotation);
              var scaleX = 1,
                  scaleY = 1;

              if (absRotation === 90 || absRotation === 270) {
                scaleX = height / width;
                scaleY = width / height;
              }

              target.style.transform = "rotate(".concat(relativeRotation, "deg) scale(").concat(scaleX, ", ").concat(scaleY, ")");

              if (this.textLayer) {
                var textLayerViewport = this.textLayer.viewport;
                var textRelativeRotation = this.viewport.rotation - textLayerViewport.rotation;
                var textAbsRotation = Math.abs(textRelativeRotation);
                var scale = width / textLayerViewport.width;

                if (textAbsRotation === 90 || textAbsRotation === 270) {
                  scale = width / textLayerViewport.height;
                }

                var textLayerDiv = this.textLayer.textLayerDiv;
                var transX, transY;

                switch (textAbsRotation) {
                  case 0:
                    transX = transY = 0;
                    break;

                  case 90:
                    transX = 0;
                    transY = "-" + textLayerDiv.style.height;
                    break;

                  case 180:
                    transX = "-" + textLayerDiv.style.width;
                    transY = "-" + textLayerDiv.style.height;
                    break;

                  case 270:
                    transX = "-" + textLayerDiv.style.width;
                    transY = 0;
                    break;

                  default:
                    console.error("Bad rotation value.");
                    break;
                }

                textLayerDiv.style.transform = "rotate(".concat(textAbsRotation, "deg) ") + "scale(".concat(scale, ") ") + "translate(".concat(transX, ", ").concat(transY, ")");
                textLayerDiv.style.transformOrigin = "0% 0%";
              }

              if (redrawAnnotationLayer && this.annotationLayer) {
                this._renderAnnotationLayer();
              }

              if (redrawXfaLayer && this.xfaLayer) {
                this._renderXfaLayer();
              }
            }
          }, {
            key: "width",
            get: function get() {
              return this.viewport.width;
            }
          }, {
            key: "height",
            get: function get() {
              return this.viewport.height;
            }
          }, {
            key: "getPagePoint",
            value: function getPagePoint(x, y) {
              return this.viewport.convertToPdfPoint(x, y);
            }
          }, {
            key: "draw",
            value: function draw() {
              var _this$annotationLayer2,
                  _this$xfaLayer2,
                  _this2 = this;

              if (this.renderingState !== _pdf_rendering_queue.RenderingStates.INITIAL) {
                console.error("Must be in new state before drawing");
                this.reset();
              }

              var div = this.div,
                  pdfPage = this.pdfPage;

              if (!pdfPage) {
                this.renderingState = _pdf_rendering_queue.RenderingStates.FINISHED;

                if (this.loadingIconDiv) {
                  div.removeChild(this.loadingIconDiv);
                  delete this.loadingIconDiv;
                }

                return Promise.reject(new Error("pdfPage is not loaded"));
              }

              this.renderingState = _pdf_rendering_queue.RenderingStates.RUNNING;
              var canvasWrapper = document.createElement("div");
              canvasWrapper.style.width = div.style.width;
              canvasWrapper.style.height = div.style.height;
              canvasWrapper.classList.add("canvasWrapper");

              if ((_this$annotationLayer2 = this.annotationLayer) !== null && _this$annotationLayer2 !== void 0 && _this$annotationLayer2.div) {
                div.insertBefore(canvasWrapper, this.annotationLayer.div);
              } else {
                div.appendChild(canvasWrapper);
              }

              var textLayer = null;

              if (this.textLayerMode !== _ui_utils.TextLayerMode.DISABLE && this.textLayerFactory) {
                var _this$annotationLayer3;

                var textLayerDiv = document.createElement("div");
                textLayerDiv.className = "textLayer";
                textLayerDiv.style.width = canvasWrapper.style.width;
                textLayerDiv.style.height = canvasWrapper.style.height;

                if ((_this$annotationLayer3 = this.annotationLayer) !== null && _this$annotationLayer3 !== void 0 && _this$annotationLayer3.div) {
                  div.insertBefore(textLayerDiv, this.annotationLayer.div);
                } else {
                  div.appendChild(textLayerDiv);
                }

                textLayer = this.textLayerFactory.createTextLayerBuilder(textLayerDiv, this.id - 1, this.viewport, this.textLayerMode === _ui_utils.TextLayerMode.ENABLE_ENHANCE, this.eventBus, this.textHighlighter);
              }

              this.textLayer = textLayer;

              if ((_this$xfaLayer2 = this.xfaLayer) !== null && _this$xfaLayer2 !== void 0 && _this$xfaLayer2.div) {
                div.appendChild(this.xfaLayer.div);
              }

              var renderContinueCallback = null;

              if (this.renderingQueue) {
                renderContinueCallback = function renderContinueCallback(cont) {
                  if (!_this2.renderingQueue.isHighestPriority(_this2)) {
                    _this2.renderingState = _pdf_rendering_queue.RenderingStates.PAUSED;

                    _this2.resume = function () {
                      _this2.renderingState = _pdf_rendering_queue.RenderingStates.RUNNING;
                      cont();
                    };

                    return;
                  }

                  cont();
                };
              }

              var finishPaintTask = /*#__PURE__*/function () {
                var _ref5 = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
                  var error,
                      _args4 = arguments;
                  return _regenerator["default"].wrap(function _callee4$(_context4) {
                    while (1) {
                      switch (_context4.prev = _context4.next) {
                        case 0:
                          error = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : null;

                          if (paintTask === _this2.paintTask) {
                            _this2.paintTask = null;
                          }

                          if (!(error instanceof _pdfjsLib.RenderingCancelledException)) {
                            _context4.next = 5;
                            break;
                          }

                          _this2._renderError = null;
                          return _context4.abrupt("return");

                        case 5:
                          _this2._renderError = error;
                          _this2.renderingState = _pdf_rendering_queue.RenderingStates.FINISHED;

                          if (_this2.loadingIconDiv) {
                            div.removeChild(_this2.loadingIconDiv);
                            delete _this2.loadingIconDiv;
                          }

                          _this2._resetZoomLayer(true);

                          _this2.eventBus.dispatch("pagerendered", {
                            source: _this2,
                            pageNumber: _this2.id,
                            cssTransform: false,
                            timestamp: performance.now(),
                            error: _this2._renderError
                          });

                          if (!error) {
                            _context4.next = 12;
                            break;
                          }

                          throw error;

                        case 12:
                        case "end":
                          return _context4.stop();
                      }
                    }
                  }, _callee4);
                }));

                return function finishPaintTask() {
                  return _ref5.apply(this, arguments);
                };
              }();

              var paintTask = this.renderer === _ui_utils.RendererType.SVG ? this.paintOnSvg(canvasWrapper) : this.paintOnCanvas(canvasWrapper);
              paintTask.onRenderContinue = renderContinueCallback;
              this.paintTask = paintTask;
              var resultPromise = paintTask.promise.then(function () {
                return finishPaintTask(null).then(function () {
                  if (textLayer) {
                    var readableStream = pdfPage.streamTextContent({
                      normalizeWhitespace: true,
                      includeMarkedContent: true
                    });
                    textLayer.setTextContentStream(readableStream);
                    textLayer.render();
                  }
                });
              }, function (reason) {
                return finishPaintTask(reason);
              });

              if (this._annotationMode !== _pdfjsLib.AnnotationMode.DISABLE && this.annotationLayerFactory) {
                if (!this.annotationLayer) {
                  this.annotationLayer = this.annotationLayerFactory.createAnnotationLayerBuilder(div, pdfPage, null, this.imageResourcesPath, this._annotationMode === _pdfjsLib.AnnotationMode.ENABLE_FORMS, this.l10n, null, null, null, null);
                }

                this._renderAnnotationLayer();
              }

              if (this.xfaLayerFactory) {
                if (!this.xfaLayer) {
                  this.xfaLayer = this.xfaLayerFactory.createXfaLayerBuilder(div, pdfPage, null);
                }

                this._renderXfaLayer();
              }

              if (this.structTreeLayerFactory && this.textLayer && this.canvas) {
                this._onTextLayerRendered = function (event) {
                  if (event.pageNumber !== _this2.id) {
                    return;
                  }

                  _this2.eventBus._off("textlayerrendered", _this2._onTextLayerRendered);

                  _this2._onTextLayerRendered = null;

                  if (!_this2.canvas) {
                    return;
                  }

                  _this2.pdfPage.getStructTree().then(function (tree) {
                    if (!tree) {
                      return;
                    }

                    if (!_this2.canvas) {
                      return;
                    }

                    var treeDom = _this2.structTreeLayer.render(tree);

                    treeDom.classList.add("structTree");

                    _this2.canvas.appendChild(treeDom);
                  });
                };

                this.eventBus._on("textlayerrendered", this._onTextLayerRendered);

                this.structTreeLayer = this.structTreeLayerFactory.createStructTreeLayerBuilder(pdfPage);
              }

              div.setAttribute("data-loaded", true);
              this.eventBus.dispatch("pagerender", {
                source: this,
                pageNumber: this.id
              });
              return resultPromise;
            }
          }, {
            key: "paintOnCanvas",
            value: function paintOnCanvas(canvasWrapper) {
              var renderCapability = (0, _pdfjsLib.createPromiseCapability)();
              var result = {
                promise: renderCapability.promise,
                onRenderContinue: function onRenderContinue(cont) {
                  cont();
                },
                cancel: function cancel() {
                  renderTask.cancel();
                }
              };
              var viewport = this.viewport;
              var canvas = document.createElement("canvas");
              canvas.hidden = true;
              var isCanvasHidden = true;

              var showCanvas = function showCanvas() {
                if (isCanvasHidden) {
                  canvas.hidden = false;
                  isCanvasHidden = false;
                }
              };

              canvasWrapper.appendChild(canvas);
              this.canvas = canvas;
              canvas.mozOpaque = true;
              var ctx = canvas.getContext("2d", {
                alpha: false
              });
              var outputScale = (0, _ui_utils.getOutputScale)(ctx);
              this.outputScale = outputScale;

              if (this.useOnlyCssZoom) {
                var actualSizeViewport = viewport.clone({
                  scale: _pdfjsLib.PixelsPerInch.PDF_TO_CSS_UNITS
                });
                outputScale.sx *= actualSizeViewport.width / viewport.width;
                outputScale.sy *= actualSizeViewport.height / viewport.height;
                outputScale.scaled = true;
              }

              if (this.maxCanvasPixels > 0) {
                var pixelsInViewport = viewport.width * viewport.height;
                var maxScale = Math.sqrt(this.maxCanvasPixels / pixelsInViewport);

                if (outputScale.sx > maxScale || outputScale.sy > maxScale) {
                  outputScale.sx = maxScale;
                  outputScale.sy = maxScale;
                  outputScale.scaled = true;
                  this.hasRestrictedScaling = true;
                } else {
                  this.hasRestrictedScaling = false;
                }
              }

              var sfx = (0, _ui_utils.approximateFraction)(outputScale.sx);
              var sfy = (0, _ui_utils.approximateFraction)(outputScale.sy);
              canvas.width = (0, _ui_utils.roundToDivide)(viewport.width * outputScale.sx, sfx[0]);
              canvas.height = (0, _ui_utils.roundToDivide)(viewport.height * outputScale.sy, sfy[0]);
              canvas.style.width = (0, _ui_utils.roundToDivide)(viewport.width, sfx[1]) + "px";
              canvas.style.height = (0, _ui_utils.roundToDivide)(viewport.height, sfy[1]) + "px";
              this.paintedViewportMap.set(canvas, viewport);
              var transform = !outputScale.scaled ? null : [outputScale.sx, 0, 0, outputScale.sy, 0, 0];
              var renderContext = {
                canvasContext: ctx,
                transform: transform,
                viewport: this.viewport,
                annotationMode: this._annotationMode,
                optionalContentConfigPromise: this._optionalContentConfigPromise
              };
              var renderTask = this.pdfPage.render(renderContext);

              renderTask.onContinue = function (cont) {
                showCanvas();

                if (result.onRenderContinue) {
                  result.onRenderContinue(cont);
                } else {
                  cont();
                }
              };

              renderTask.promise.then(function () {
                showCanvas();
                renderCapability.resolve(undefined);
              }, function (error) {
                showCanvas();
                renderCapability.reject(error);
              });
              return result;
            }
          }, {
            key: "paintOnSvg",
            value: function paintOnSvg(wrapper) {
              var _this3 = this;

              var cancelled = false;

              var ensureNotCancelled = function ensureNotCancelled() {
                if (cancelled) {
                  throw new _pdfjsLib.RenderingCancelledException("Rendering cancelled, page ".concat(_this3.id), "svg");
                }
              };

              var pdfPage = this.pdfPage;
              var actualSizeViewport = this.viewport.clone({
                scale: _pdfjsLib.PixelsPerInch.PDF_TO_CSS_UNITS
              });
              var promise = pdfPage.getOperatorList({
                annotationMode: this._annotationMode
              }).then(function (opList) {
                ensureNotCancelled();
                var svgGfx = new _pdfjsLib.SVGGraphics(pdfPage.commonObjs, pdfPage.objs, _app_options.compatibilityParams.disableCreateObjectURL);
                return svgGfx.getSVG(opList, actualSizeViewport).then(function (svg) {
                  ensureNotCancelled();
                  _this3.svg = svg;

                  _this3.paintedViewportMap.set(svg, actualSizeViewport);

                  svg.style.width = wrapper.style.width;
                  svg.style.height = wrapper.style.height;
                  _this3.renderingState = _pdf_rendering_queue.RenderingStates.FINISHED;
                  wrapper.appendChild(svg);
                });
              });
              return {
                promise: promise,
                onRenderContinue: function onRenderContinue(cont) {
                  cont();
                },
                cancel: function cancel() {
                  cancelled = true;
                }
              };
            }
          }, {
            key: "setPageLabel",
            value: function setPageLabel(label) {
              this.pageLabel = typeof label === "string" ? label : null;

              if (this.pageLabel !== null) {
                this.div.setAttribute("data-page-label", this.pageLabel);
              } else {
                this.div.removeAttribute("data-page-label");
              }
            }
          }]);

          return PDFPageView;
        }();

        exports.PDFPageView = PDFPageView;
        /***/
      },
      /* 19 */

      /***/
      function (__unused_webpack_module, exports, __w_pdfjs_require__) {
        Object.defineProperty(exports, "__esModule", {
          value: true
        });
        exports.RenderingStates = exports.PDFRenderingQueue = void 0;

        var _pdfjsLib = __w_pdfjs_require__(4);

        function _classCallCheck(instance, Constructor) {
          if (!(instance instanceof Constructor)) {
            throw new TypeError("Cannot call a class as a function");
          }
        }

        function _defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];
            descriptor.enumerable = descriptor.enumerable || false;
            descriptor.configurable = true;
            if ("value" in descriptor) descriptor.writable = true;
            Object.defineProperty(target, descriptor.key, descriptor);
          }
        }

        function _createClass(Constructor, protoProps, staticProps) {
          if (protoProps) _defineProperties(Constructor.prototype, protoProps);
          if (staticProps) _defineProperties(Constructor, staticProps);
          return Constructor;
        }

        var CLEANUP_TIMEOUT = 30000;
        var RenderingStates = {
          INITIAL: 0,
          RUNNING: 1,
          PAUSED: 2,
          FINISHED: 3
        };
        exports.RenderingStates = RenderingStates;

        var PDFRenderingQueue = /*#__PURE__*/function () {
          function PDFRenderingQueue() {
            _classCallCheck(this, PDFRenderingQueue);

            this.pdfViewer = null;
            this.pdfThumbnailViewer = null;
            this.onIdle = null;
            this.highestPriorityPage = null;
            this.idleTimeout = null;
            this.printing = false;
            this.isThumbnailViewEnabled = false;
          }

          _createClass(PDFRenderingQueue, [{
            key: "setViewer",
            value: function setViewer(pdfViewer) {
              this.pdfViewer = pdfViewer;
            }
          }, {
            key: "setThumbnailViewer",
            value: function setThumbnailViewer(pdfThumbnailViewer) {
              this.pdfThumbnailViewer = pdfThumbnailViewer;
            }
          }, {
            key: "isHighestPriority",
            value: function isHighestPriority(view) {
              return this.highestPriorityPage === view.renderingId;
            }
          }, {
            key: "hasViewer",
            value: function hasViewer() {
              return !!this.pdfViewer;
            }
          }, {
            key: "renderHighestPriority",
            value: function renderHighestPriority(currentlyVisiblePages) {
              if (this.idleTimeout) {
                clearTimeout(this.idleTimeout);
                this.idleTimeout = null;
              }

              if (this.pdfViewer.forceRendering(currentlyVisiblePages)) {
                return;
              }

              if (this.pdfThumbnailViewer && this.isThumbnailViewEnabled) {
                if (this.pdfThumbnailViewer.forceRendering()) {
                  return;
                }
              }

              if (this.printing) {
                return;
              }

              if (this.onIdle) {
                this.idleTimeout = setTimeout(this.onIdle.bind(this), CLEANUP_TIMEOUT);
              }
            }
          }, {
            key: "getHighestPriority",
            value: function getHighestPriority(visible, views, scrolledDown) {
              var preRenderExtra = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
              var visibleViews = visible.views;
              var numVisible = visibleViews.length;

              if (numVisible === 0) {
                return null;
              }

              for (var i = 0; i < numVisible; ++i) {
                var view = visibleViews[i].view;

                if (!this.isViewFinished(view)) {
                  return view;
                }
              }

              var preRenderIndex = scrolledDown ? visible.last.id : visible.first.id - 2;
              var preRenderView = views[preRenderIndex];

              if (preRenderView && !this.isViewFinished(preRenderView)) {
                return preRenderView;
              }

              if (preRenderExtra) {
                preRenderIndex += scrolledDown ? 1 : -1;
                preRenderView = views[preRenderIndex];

                if (preRenderView && !this.isViewFinished(preRenderView)) {
                  return preRenderView;
                }
              }

              return null;
            }
          }, {
            key: "isViewFinished",
            value: function isViewFinished(view) {
              return view.renderingState === RenderingStates.FINISHED;
            }
          }, {
            key: "renderView",
            value: function renderView(view) {
              var _this = this;

              switch (view.renderingState) {
                case RenderingStates.FINISHED:
                  return false;

                case RenderingStates.PAUSED:
                  this.highestPriorityPage = view.renderingId;
                  view.resume();
                  break;

                case RenderingStates.RUNNING:
                  this.highestPriorityPage = view.renderingId;
                  break;

                case RenderingStates.INITIAL:
                  this.highestPriorityPage = view.renderingId;
                  view.draw()["finally"](function () {
                    _this.renderHighestPriority();
                  })["catch"](function (reason) {
                    if (reason instanceof _pdfjsLib.RenderingCancelledException) {
                      return;
                    }

                    console.error("renderView: \"".concat(reason, "\""));
                  });
                  break;
              }

              return true;
            }
          }]);

          return PDFRenderingQueue;
        }();

        exports.PDFRenderingQueue = PDFRenderingQueue;
        /***/
      },
      /* 20 */

      /***/
      function (__unused_webpack_module, exports, __w_pdfjs_require__) {
        Object.defineProperty(exports, "__esModule", {
          value: true
        });
        exports.PDFScriptingManager = void 0;

        var _regenerator = _interopRequireDefault(__w_pdfjs_require__(2));

        var _pdfjsLib = __w_pdfjs_require__(4);

        var _ui_utils = __w_pdfjs_require__(7);

        var _pdf_rendering_queue = __w_pdfjs_require__(19);

        function _interopRequireDefault(obj) {
          return obj && obj.__esModule ? obj : {
            "default": obj
          };
        }

        function _toConsumableArray(arr) {
          return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
        }

        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.");
        }

        function _iterableToArray(iter) {
          if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
        }

        function _arrayWithoutHoles(arr) {
          if (Array.isArray(arr)) return _arrayLikeToArray(arr);
        }

        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 i = 1; i < arguments.length; i++) {
            var source = arguments[i] != null ? arguments[i] : {};

            if (i % 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;
        }

        function _defineProperty(obj, key, value) {
          if (key in obj) {
            Object.defineProperty(obj, key, {
              value: value,
              enumerable: true,
              configurable: true,
              writable: true
            });
          } else {
            obj[key] = value;
          }

          return obj;
        }

        function _createForOfIteratorHelper(o, allowArrayLike) {
          var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];

          if (!it) {
            if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
              if (it) o = it;
              var i = 0;

              var F = function F() {};

              return {
                s: F,
                n: function n() {
                  if (i >= o.length) return {
                    done: true
                  };
                  return {
                    done: false,
                    value: o[i++]
                  };
                },
                e: function e(_e2) {
                  throw _e2;
                },
                f: F
              };
            }

            throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
          }

          var normalCompletion = true,
              didErr = false,
              err;
          return {
            s: function s() {
              it = it.call(o);
            },
            n: function n() {
              var step = it.next();
              normalCompletion = step.done;
              return step;
            },
            e: function e(_e3) {
              didErr = true;
              err = _e3;
            },
            f: function f() {
              try {
                if (!normalCompletion && it["return"] != null) it["return"]();
              } finally {
                if (didErr) throw err;
              }
            }
          };
        }

        function _slicedToArray(arr, i) {
          return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
        }

        function _nonIterableRest() {
          throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
        }

        function _unsupportedIterableToArray(o, minLen) {
          if (!o) return;
          if (typeof o === "string") return _arrayLikeToArray(o, minLen);
          var n = Object.prototype.toString.call(o).slice(8, -1);
          if (n === "Object" && o.constructor) n = o.constructor.name;
          if (n === "Map" || n === "Set") return Array.from(o);
          if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
        }

        function _arrayLikeToArray(arr, len) {
          if (len == null || len > arr.length) len = arr.length;

          for (var i = 0, arr2 = new Array(len); i < len; i++) {
            arr2[i] = arr[i];
          }

          return arr2;
        }

        function _iterableToArrayLimit(arr, i) {
          var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];

          if (_i == null) return;
          var _arr = [];
          var _n = true;
          var _d = false;

          var _s, _e;

          try {
            for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
              _arr.push(_s.value);

              if (i && _arr.length === i) break;
            }
          } catch (err) {
            _d = true;
            _e = err;
          } finally {
            try {
              if (!_n && _i["return"] != null) _i["return"]();
            } finally {
              if (_d) throw _e;
            }
          }

          return _arr;
        }

        function _arrayWithHoles(arr) {
          if (Array.isArray(arr)) return arr;
        }

        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 self = this,
                args = arguments;
            return new Promise(function (resolve, reject) {
              var gen = fn.apply(self, args);

              function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
              }

              function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
              }

              _next(undefined);
            });
          };
        }

        function _classCallCheck(instance, Constructor) {
          if (!(instance instanceof Constructor)) {
            throw new TypeError("Cannot call a class as a function");
          }
        }

        function _defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];
            descriptor.enumerable = descriptor.enumerable || false;
            descriptor.configurable = true;
            if ("value" in descriptor) descriptor.writable = true;
            Object.defineProperty(target, descriptor.key, descriptor);
          }
        }

        function _createClass(Constructor, protoProps, staticProps) {
          if (protoProps) _defineProperties(Constructor.prototype, protoProps);
          if (staticProps) _defineProperties(Constructor, staticProps);
          return Constructor;
        }

        var PDFScriptingManager = /*#__PURE__*/function () {
          function PDFScriptingManager(_ref) {
            var _this = this;

            var eventBus = _ref.eventBus,
                _ref$sandboxBundleSrc = _ref.sandboxBundleSrc,
                sandboxBundleSrc = _ref$sandboxBundleSrc === void 0 ? null : _ref$sandboxBundleSrc,
                _ref$scriptingFactory = _ref.scriptingFactory,
                scriptingFactory = _ref$scriptingFactory === void 0 ? null : _ref$scriptingFactory,
                _ref$docPropertiesLoo = _ref.docPropertiesLookup,
                docPropertiesLookup = _ref$docPropertiesLoo === void 0 ? null : _ref$docPropertiesLoo;

            _classCallCheck(this, PDFScriptingManager);

            this._pdfDocument = null;
            this._pdfViewer = null;
            this._closeCapability = null;
            this._destroyCapability = null;
            this._scripting = null;
            this._mouseState = Object.create(null);
            this._ready = false;
            this._eventBus = eventBus;
            this._sandboxBundleSrc = sandboxBundleSrc;
            this._scriptingFactory = scriptingFactory;
            this._docPropertiesLookup = docPropertiesLookup;

            if (!this._scriptingFactory) {
              window.addEventListener("updatefromsandbox", function (event) {
                _this._eventBus.dispatch("updatefromsandbox", {
                  source: window,
                  detail: event.detail
                });
              });
            }
          }

          _createClass(PDFScriptingManager, [{
            key: "setViewer",
            value: function setViewer(pdfViewer) {
              this._pdfViewer = pdfViewer;
            }
          }, {
            key: "setDocument",
            value: function () {
              var _setDocument = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee2(pdfDocument) {
                var _this2 = this,
                    _this$_scripting;

                var _yield$Promise$all, _yield$Promise$all2, objects, calculationOrder, docActions, _iterator, _step, _step$value, name, listener, _iterator2, _step2, _step2$value, _name, _listener, docProperties;

                return _regenerator["default"].wrap(function _callee2$(_context2) {
                  while (1) {
                    switch (_context2.prev = _context2.next) {
                      case 0:
                        if (!this._pdfDocument) {
                          _context2.next = 3;
                          break;
                        }

                        _context2.next = 3;
                        return this._destroyScripting();

                      case 3:
                        this._pdfDocument = pdfDocument;

                        if (pdfDocument) {
                          _context2.next = 6;
                          break;
                        }

                        return _context2.abrupt("return");

                      case 6:
                        _context2.next = 8;
                        return Promise.all([pdfDocument.getFieldObjects(), pdfDocument.getCalculationOrderIds(), pdfDocument.getJSActions()]);

                      case 8:
                        _yield$Promise$all = _context2.sent;
                        _yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 3);
                        objects = _yield$Promise$all2[0];
                        calculationOrder = _yield$Promise$all2[1];
                        docActions = _yield$Promise$all2[2];

                        if (!(!objects && !docActions)) {
                          _context2.next = 17;
                          break;
                        }

                        _context2.next = 16;
                        return this._destroyScripting();

                      case 16:
                        return _context2.abrupt("return");

                      case 17:
                        if (!(pdfDocument !== this._pdfDocument)) {
                          _context2.next = 19;
                          break;
                        }

                        return _context2.abrupt("return");

                      case 19:
                        _context2.prev = 19;
                        this._scripting = this._createScripting();
                        _context2.next = 29;
                        break;

                      case 23:
                        _context2.prev = 23;
                        _context2.t0 = _context2["catch"](19);
                        console.error("PDFScriptingManager.setDocument: \"".concat(_context2.t0 === null || _context2.t0 === void 0 ? void 0 : _context2.t0.message, "\"."));
                        _context2.next = 28;
                        return this._destroyScripting();

                      case 28:
                        return _context2.abrupt("return");

                      case 29:
                        this._internalEvents.set("updatefromsandbox", function (event) {
                          if ((event === null || event === void 0 ? void 0 : event.source) !== window) {
                            return;
                          }

                          _this2._updateFromSandbox(event.detail);
                        });

                        this._internalEvents.set("dispatcheventinsandbox", function (event) {
                          var _this2$_scripting;

                          (_this2$_scripting = _this2._scripting) === null || _this2$_scripting === void 0 ? void 0 : _this2$_scripting.dispatchEventInSandbox(event.detail);
                        });

                        this._internalEvents.set("pagechanging", function (_ref2) {
                          var pageNumber = _ref2.pageNumber,
                              previous = _ref2.previous;

                          if (pageNumber === previous) {
                            return;
                          }

                          _this2._dispatchPageClose(previous);

                          _this2._dispatchPageOpen(pageNumber);
                        });

                        this._internalEvents.set("pagerendered", function (_ref3) {
                          var pageNumber = _ref3.pageNumber;

                          if (!_this2._pageOpenPending.has(pageNumber)) {
                            return;
                          }

                          if (pageNumber !== _this2._pdfViewer.currentPageNumber) {
                            return;
                          }

                          _this2._dispatchPageOpen(pageNumber);
                        });

                        this._internalEvents.set("pagesdestroy", /*#__PURE__*/function () {
                          var _ref4 = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee(event) {
                            var _this2$_scripting2, _this2$_closeCapabili;

                            return _regenerator["default"].wrap(function _callee$(_context) {
                              while (1) {
                                switch (_context.prev = _context.next) {
                                  case 0:
                                    _context.next = 2;
                                    return _this2._dispatchPageClose(_this2._pdfViewer.currentPageNumber);

                                  case 2:
                                    _context.next = 4;
                                    return (_this2$_scripting2 = _this2._scripting) === null || _this2$_scripting2 === void 0 ? void 0 : _this2$_scripting2.dispatchEventInSandbox({
                                      id: "doc",
                                      name: "WillClose"
                                    });

                                  case 4:
                                    (_this2$_closeCapabili = _this2._closeCapability) === null || _this2$_closeCapabili === void 0 ? void 0 : _this2$_closeCapabili.resolve();

                                  case 5:
                                  case "end":
                                    return _context.stop();
                                }
                              }
                            }, _callee);
                          }));

                          return function (_x2) {
                            return _ref4.apply(this, arguments);
                          };
                        }());

                        this._domEvents.set("mousedown", function (event) {
                          _this2._mouseState.isDown = true;
                        });

                        this._domEvents.set("mouseup", function (event) {
                          _this2._mouseState.isDown = false;
                        });

                        _iterator = _createForOfIteratorHelper(this._internalEvents);

                        try {
                          for (_iterator.s(); !(_step = _iterator.n()).done;) {
                            _step$value = _slicedToArray(_step.value, 2), name = _step$value[0], listener = _step$value[1];

                            this._eventBus._on(name, listener);
                          }
                        } catch (err) {
                          _iterator.e(err);
                        } finally {
                          _iterator.f();
                        }

                        _iterator2 = _createForOfIteratorHelper(this._domEvents);

                        try {
                          for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
                            _step2$value = _slicedToArray(_step2.value, 2), _name = _step2$value[0], _listener = _step2$value[1];
                            window.addEventListener(_name, _listener);
                          }
                        } catch (err) {
                          _iterator2.e(err);
                        } finally {
                          _iterator2.f();
                        }

                        _context2.prev = 40;
                        _context2.next = 43;
                        return this._getDocProperties();

                      case 43:
                        docProperties = _context2.sent;

                        if (!(pdfDocument !== this._pdfDocument)) {
                          _context2.next = 46;
                          break;
                        }

                        return _context2.abrupt("return");

                      case 46:
                        _context2.next = 48;
                        return this._scripting.createSandbox({
                          objects: objects,
                          calculationOrder: calculationOrder,
                          appInfo: {
                            platform: navigator.platform,
                            language: navigator.language
                          },
                          docInfo: _objectSpread(_objectSpread({}, docProperties), {}, {
                            actions: docActions
                          })
                        });

                      case 48:
                        this._eventBus.dispatch("sandboxcreated", {
                          source: this
                        });

                        _context2.next = 57;
                        break;

                      case 51:
                        _context2.prev = 51;
                        _context2.t1 = _context2["catch"](40);
                        console.error("PDFScriptingManager.setDocument: \"".concat(_context2.t1 === null || _context2.t1 === void 0 ? void 0 : _context2.t1.message, "\"."));
                        _context2.next = 56;
                        return this._destroyScripting();

                      case 56:
                        return _context2.abrupt("return");

                      case 57:
                        _context2.next = 59;
                        return (_this$_scripting = this._scripting) === null || _this$_scripting === void 0 ? void 0 : _this$_scripting.dispatchEventInSandbox({
                          id: "doc",
                          name: "Open"
                        });

                      case 59:
                        _context2.next = 61;
                        return this._dispatchPageOpen(this._pdfViewer.currentPageNumber, true);

                      case 61:
                        Promise.resolve().then(function () {
                          if (pdfDocument === _this2._pdfDocument) {
                            _this2._ready = true;
                          }
                        });

                      case 62:
                      case "end":
                        return _context2.stop();
                    }
                  }
                }, _callee2, this, [[19, 23], [40, 51]]);
              }));

              function setDocument(_x) {
                return _setDocument.apply(this, arguments);
              }

              return setDocument;
            }()
          }, {
            key: "dispatchWillSave",
            value: function () {
              var _dispatchWillSave = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee3(detail) {
                var _this$_scripting2;

                return _regenerator["default"].wrap(function _callee3$(_context3) {
                  while (1) {
                    switch (_context3.prev = _context3.next) {
                      case 0:
                        return _context3.abrupt("return", (_this$_scripting2 = this._scripting) === null || _this$_scripting2 === void 0 ? void 0 : _this$_scripting2.dispatchEventInSandbox({
                          id: "doc",
                          name: "WillSave"
                        }));

                      case 1:
                      case "end":
                        return _context3.stop();
                    }
                  }
                }, _callee3, this);
              }));

              function dispatchWillSave(_x3) {
                return _dispatchWillSave.apply(this, arguments);
              }

              return dispatchWillSave;
            }()
          }, {
            key: "dispatchDidSave",
            value: function () {
              var _dispatchDidSave = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee4(detail) {
                var _this$_scripting3;

                return _regenerator["default"].wrap(function _callee4$(_context4) {
                  while (1) {
                    switch (_context4.prev = _context4.next) {
                      case 0:
                        return _context4.abrupt("return", (_this$_scripting3 = this._scripting) === null || _this$_scripting3 === void 0 ? void 0 : _this$_scripting3.dispatchEventInSandbox({
                          id: "doc",
                          name: "DidSave"
                        }));

                      case 1:
                      case "end":
                        return _context4.stop();
                    }
                  }
                }, _callee4, this);
              }));

              function dispatchDidSave(_x4) {
                return _dispatchDidSave.apply(this, arguments);
              }

              return dispatchDidSave;
            }()
          }, {
            key: "dispatchWillPrint",
            value: function () {
              var _dispatchWillPrint = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee5(detail) {
                var _this$_scripting4;

                return _regenerator["default"].wrap(function _callee5$(_context5) {
                  while (1) {
                    switch (_context5.prev = _context5.next) {
                      case 0:
                        return _context5.abrupt("return", (_this$_scripting4 = this._scripting) === null || _this$_scripting4 === void 0 ? void 0 : _this$_scripting4.dispatchEventInSandbox({
                          id: "doc",
                          name: "WillPrint"
                        }));

                      case 1:
                      case "end":
                        return _context5.stop();
                    }
                  }
                }, _callee5, this);
              }));

              function dispatchWillPrint(_x5) {
                return _dispatchWillPrint.apply(this, arguments);
              }

              return dispatchWillPrint;
            }()
          }, {
            key: "dispatchDidPrint",
            value: function () {
              var _dispatchDidPrint = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee6(detail) {
                var _this$_scripting5;

                return _regenerator["default"].wrap(function _callee6$(_context6) {
                  while (1) {
                    switch (_context6.prev = _context6.next) {
                      case 0:
                        return _context6.abrupt("return", (_this$_scripting5 = this._scripting) === null || _this$_scripting5 === void 0 ? void 0 : _this$_scripting5.dispatchEventInSandbox({
                          id: "doc",
                          name: "DidPrint"
                        }));

                      case 1:
                      case "end":
                        return _context6.stop();
                    }
                  }
                }, _callee6, this);
              }));

              function dispatchDidPrint(_x6) {
                return _dispatchDidPrint.apply(this, arguments);
              }

              return dispatchDidPrint;
            }()
          }, {
            key: "mouseState",
            get: function get() {
              return this._mouseState;
            }
          }, {
            key: "destroyPromise",
            get: function get() {
              var _this$_destroyCapabil;

              return ((_this$_destroyCapabil = this._destroyCapability) === null || _this$_destroyCapabil === void 0 ? void 0 : _this$_destroyCapabil.promise) || null;
            }
          }, {
            key: "ready",
            get: function get() {
              return this._ready;
            }
          }, {
            key: "_internalEvents",
            get: function get() {
              return (0, _pdfjsLib.shadow)(this, "_internalEvents", new Map());
            }
          }, {
            key: "_domEvents",
            get: function get() {
              return (0, _pdfjsLib.shadow)(this, "_domEvents", new Map());
            }
          }, {
            key: "_pageOpenPending",
            get: function get() {
              return (0, _pdfjsLib.shadow)(this, "_pageOpenPending", new Set());
            }
          }, {
            key: "_visitedPages",
            get: function get() {
              return (0, _pdfjsLib.shadow)(this, "_visitedPages", new Map());
            }
          }, {
            key: "_updateFromSandbox",
            value: function () {
              var _updateFromSandbox2 = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee7(detail) {
                var isInPresentationMode, id, siblings, command, value, ids, _iterator3, _step3, elementId, element, _this$_pdfDocument;

                return _regenerator["default"].wrap(function _callee7$(_context7) {
                  while (1) {
                    switch (_context7.prev = _context7.next) {
                      case 0:
                        isInPresentationMode = this._pdfViewer.isInPresentationMode || this._pdfViewer.isChangingPresentationMode;
                        id = detail.id, siblings = detail.siblings, command = detail.command, value = detail.value;

                        if (id) {
                          _context7.next = 43;
                          break;
                        }

                        _context7.t0 = command;
                        _context7.next = _context7.t0 === "clear" ? 6 : _context7.t0 === "error" ? 8 : _context7.t0 === "layout" ? 10 : _context7.t0 === "page-num" ? 12 : _context7.t0 === "print" ? 14 : _context7.t0 === "println" ? 18 : _context7.t0 === "zoom" ? 20 : _context7.t0 === "SaveAs" ? 24 : _context7.t0 === "FirstPage" ? 26 : _context7.t0 === "LastPage" ? 28 : _context7.t0 === "NextPage" ? 30 : _context7.t0 === "PrevPage" ? 32 : _context7.t0 === "ZoomViewIn" ? 34 : _context7.t0 === "ZoomViewOut" ? 38 : 42;
                        break;

                      case 6:
                        console.clear();
                        return _context7.abrupt("break", 42);

                      case 8:
                        console.error(value);
                        return _context7.abrupt("break", 42);

                      case 10:
                        this._pdfViewer.spreadMode = (0, _ui_utils.apiPageLayoutToSpreadMode)(value);
                        return _context7.abrupt("break", 42);

                      case 12:
                        this._pdfViewer.currentPageNumber = value + 1;
                        return _context7.abrupt("break", 42);

                      case 14:
                        _context7.next = 16;
                        return this._pdfViewer.pagesPromise;

                      case 16:
                        this._eventBus.dispatch("print", {
                          source: this
                        });

                        return _context7.abrupt("break", 42);

                      case 18:
                        console.log(value);
                        return _context7.abrupt("break", 42);

                      case 20:
                        if (!isInPresentationMode) {
                          _context7.next = 22;
                          break;
                        }

                        return _context7.abrupt("return");

                      case 22:
                        this._pdfViewer.currentScaleValue = value;
                        return _context7.abrupt("break", 42);

                      case 24:
                        this._eventBus.dispatch("save", {
                          source: this
                        });

                        return _context7.abrupt("break", 42);

                      case 26:
                        this._pdfViewer.currentPageNumber = 1;
                        return _context7.abrupt("break", 42);

                      case 28:
                        this._pdfViewer.currentPageNumber = this._pdfViewer.pagesCount;
                        return _context7.abrupt("break", 42);

                      case 30:
                        this._pdfViewer.nextPage();

                        return _context7.abrupt("break", 42);

                      case 32:
                        this._pdfViewer.previousPage();

                        return _context7.abrupt("break", 42);

                      case 34:
                        if (!isInPresentationMode) {
                          _context7.next = 36;
                          break;
                        }

                        return _context7.abrupt("return");

                      case 36:
                        this._pdfViewer.increaseScale();

                        return _context7.abrupt("break", 42);

                      case 38:
                        if (!isInPresentationMode) {
                          _context7.next = 40;
                          break;
                        }

                        return _context7.abrupt("return");

                      case 40:
                        this._pdfViewer.decreaseScale();

                        return _context7.abrupt("break", 42);

                      case 42:
                        return _context7.abrupt("return");

                      case 43:
                        if (!isInPresentationMode) {
                          _context7.next = 46;
                          break;
                        }

                        if (!detail.focus) {
                          _context7.next = 46;
                          break;
                        }

                        return _context7.abrupt("return");

                      case 46:
                        delete detail.id;
                        delete detail.siblings;
                        ids = siblings ? [id].concat(_toConsumableArray(siblings)) : [id];
                        _iterator3 = _createForOfIteratorHelper(ids);

                        try {
                          for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
                            elementId = _step3.value;
                            element = document.getElementById(elementId);

                            if (element) {
                              element.dispatchEvent(new CustomEvent("updatefromsandbox", {
                                detail: detail
                              }));
                            } else {
                              (_this$_pdfDocument = this._pdfDocument) === null || _this$_pdfDocument === void 0 ? void 0 : _this$_pdfDocument.annotationStorage.setValue(elementId, detail);
                            }
                          }
                        } catch (err) {
                          _iterator3.e(err);
                        } finally {
                          _iterator3.f();
                        }

                      case 51:
                      case "end":
                        return _context7.stop();
                    }
                  }
                }, _callee7, this);
              }));

              function _updateFromSandbox(_x7) {
                return _updateFromSandbox2.apply(this, arguments);
              }

              return _updateFromSandbox;
            }()
          }, {
            key: "_dispatchPageOpen",
            value: function () {
              var _dispatchPageOpen2 = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee9(pageNumber) {
                var _this3 = this;

                var initialize,
                    pdfDocument,
                    visitedPages,
                    pageView,
                    actionsPromise,
                    _args9 = arguments;
                return _regenerator["default"].wrap(function _callee9$(_context9) {
                  while (1) {
                    switch (_context9.prev = _context9.next) {
                      case 0:
                        initialize = _args9.length > 1 && _args9[1] !== undefined ? _args9[1] : false;
                        pdfDocument = this._pdfDocument, visitedPages = this._visitedPages;

                        if (initialize) {
                          this._closeCapability = (0, _pdfjsLib.createPromiseCapability)();
                        }

                        if (this._closeCapability) {
                          _context9.next = 5;
                          break;
                        }

                        return _context9.abrupt("return");

                      case 5:
                        pageView = this._pdfViewer.getPageView(pageNumber - 1);

                        if (!((pageView === null || pageView === void 0 ? void 0 : pageView.renderingState) !== _pdf_rendering_queue.RenderingStates.FINISHED)) {
                          _context9.next = 9;
                          break;
                        }

                        this._pageOpenPending.add(pageNumber);

                        return _context9.abrupt("return");

                      case 9:
                        this._pageOpenPending["delete"](pageNumber);

                        actionsPromise = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee8() {
                          var _pageView$pdfPage, _this3$_scripting;

                          var actions;
                          return _regenerator["default"].wrap(function _callee8$(_context8) {
                            while (1) {
                              switch (_context8.prev = _context8.next) {
                                case 0:
                                  _context8.next = 2;
                                  return !visitedPages.has(pageNumber) ? (_pageView$pdfPage = pageView.pdfPage) === null || _pageView$pdfPage === void 0 ? void 0 : _pageView$pdfPage.getJSActions() : null;

                                case 2:
                                  actions = _context8.sent;

                                  if (!(pdfDocument !== _this3._pdfDocument)) {
                                    _context8.next = 5;
                                    break;
                                  }

                                  return _context8.abrupt("return");

                                case 5:
                                  _context8.next = 7;
                                  return (_this3$_scripting = _this3._scripting) === null || _this3$_scripting === void 0 ? void 0 : _this3$_scripting.dispatchEventInSandbox({
                                    id: "page",
                                    name: "PageOpen",
                                    pageNumber: pageNumber,
                                    actions: actions
                                  });

                                case 7:
                                case "end":
                                  return _context8.stop();
                              }
                            }
                          }, _callee8);
                        }))();
                        visitedPages.set(pageNumber, actionsPromise);

                      case 12:
                      case "end":
                        return _context9.stop();
                    }
                  }
                }, _callee9, this);
              }));

              function _dispatchPageOpen(_x8) {
                return _dispatchPageOpen2.apply(this, arguments);
              }

              return _dispatchPageOpen;
            }()
          }, {
            key: "_dispatchPageClose",
            value: function () {
              var _dispatchPageClose2 = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee10(pageNumber) {
                var _this$_scripting6;

                var pdfDocument, visitedPages, actionsPromise;
                return _regenerator["default"].wrap(function _callee10$(_context10) {
                  while (1) {
                    switch (_context10.prev = _context10.next) {
                      case 0:
                        pdfDocument = this._pdfDocument, visitedPages = this._visitedPages;

                        if (this._closeCapability) {
                          _context10.next = 3;
                          break;
                        }

                        return _context10.abrupt("return");

                      case 3:
                        if (!this._pageOpenPending.has(pageNumber)) {
                          _context10.next = 5;
                          break;
                        }

                        return _context10.abrupt("return");

                      case 5:
                        actionsPromise = visitedPages.get(pageNumber);

                        if (actionsPromise) {
                          _context10.next = 8;
                          break;
                        }

                        return _context10.abrupt("return");

                      case 8:
                        visitedPages.set(pageNumber, null);
                        _context10.next = 11;
                        return actionsPromise;

                      case 11:
                        if (!(pdfDocument !== this._pdfDocument)) {
                          _context10.next = 13;
                          break;
                        }

                        return _context10.abrupt("return");

                      case 13:
                        _context10.next = 15;
                        return (_this$_scripting6 = this._scripting) === null || _this$_scripting6 === void 0 ? void 0 : _this$_scripting6.dispatchEventInSandbox({
                          id: "page",
                          name: "PageClose",
                          pageNumber: pageNumber
                        });

                      case 15:
                      case "end":
                        return _context10.stop();
                    }
                  }
                }, _callee10, this);
              }));

              function _dispatchPageClose(_x9) {
                return _dispatchPageClose2.apply(this, arguments);
              }

              return _dispatchPageClose;
            }()
          }, {
            key: "_getDocProperties",
            value: function () {
              var _getDocProperties2 = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee11() {
                var _require, docPropertiesLookup;

                return _regenerator["default"].wrap(function _callee11$(_context11) {
                  while (1) {
                    switch (_context11.prev = _context11.next) {
                      case 0:
                        if (!this._docPropertiesLookup) {
                          _context11.next = 2;
                          break;
                        }

                        return _context11.abrupt("return", this._docPropertiesLookup(this._pdfDocument));

                      case 2:
                        _require = __w_pdfjs_require__(21), docPropertiesLookup = _require.docPropertiesLookup;
                        return _context11.abrupt("return", docPropertiesLookup(this._pdfDocument));

                      case 4:
                      case "end":
                        return _context11.stop();
                    }
                  }
                }, _callee11, this);
              }));

              function _getDocProperties() {
                return _getDocProperties2.apply(this, arguments);
              }

              return _getDocProperties;
            }()
          }, {
            key: "_createScripting",
            value: function _createScripting() {
              this._destroyCapability = (0, _pdfjsLib.createPromiseCapability)();

              if (this._scripting) {
                throw new Error("_createScripting: Scripting already exists.");
              }

              if (this._scriptingFactory) {
                return this._scriptingFactory.createScripting({
                  sandboxBundleSrc: this._sandboxBundleSrc
                });
              }

              var _require2 = __w_pdfjs_require__(21),
                  GenericScripting = _require2.GenericScripting;

              return new GenericScripting(this._sandboxBundleSrc);
            }
          }, {
            key: "_destroyScripting",
            value: function () {
              var _destroyScripting2 = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee12() {
                var _this$_destroyCapabil3;

                var _this$_destroyCapabil2, _iterator4, _step4, _step4$value, name, listener, _iterator5, _step5, _step5$value, _name2, _listener2;

                return _regenerator["default"].wrap(function _callee12$(_context12) {
                  while (1) {
                    switch (_context12.prev = _context12.next) {
                      case 0:
                        if (this._scripting) {
                          _context12.next = 4;
                          break;
                        }

                        this._pdfDocument = null;
                        (_this$_destroyCapabil2 = this._destroyCapability) === null || _this$_destroyCapabil2 === void 0 ? void 0 : _this$_destroyCapabil2.resolve();
                        return _context12.abrupt("return");

                      case 4:
                        if (!this._closeCapability) {
                          _context12.next = 8;
                          break;
                        }

                        _context12.next = 7;
                        return Promise.race([this._closeCapability.promise, new Promise(function (resolve) {
                          setTimeout(resolve, 1000);
                        })])["catch"](function (reason) {});

                      case 7:
                        this._closeCapability = null;

                      case 8:
                        this._pdfDocument = null;
                        _context12.prev = 9;
                        _context12.next = 12;
                        return this._scripting.destroySandbox();

                      case 12:
                        _context12.next = 16;
                        break;

                      case 14:
                        _context12.prev = 14;
                        _context12.t0 = _context12["catch"](9);

                      case 16:
                        _iterator4 = _createForOfIteratorHelper(this._internalEvents);

                        try {
                          for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
                            _step4$value = _slicedToArray(_step4.value, 2), name = _step4$value[0], listener = _step4$value[1];

                            this._eventBus._off(name, listener);
                          }
                        } catch (err) {
                          _iterator4.e(err);
                        } finally {
                          _iterator4.f();
                        }

                        this._internalEvents.clear();

                        _iterator5 = _createForOfIteratorHelper(this._domEvents);

                        try {
                          for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
                            _step5$value = _slicedToArray(_step5.value, 2), _name2 = _step5$value[0], _listener2 = _step5$value[1];
                            window.removeEventListener(_name2, _listener2);
                          }
                        } catch (err) {
                          _iterator5.e(err);
                        } finally {
                          _iterator5.f();
                        }

                        this._domEvents.clear();

                        this._pageOpenPending.clear();

                        this._visitedPages.clear();

                        this._scripting = null;
                        delete this._mouseState.isDown;
                        this._ready = false;
                        (_this$_destroyCapabil3 = this._destroyCapability) === null || _this$_destroyCapabil3 === void 0 ? void 0 : _this$_destroyCapabil3.resolve();

                      case 28:
                      case "end":
                        return _context12.stop();
                    }
                  }
                }, _callee12, this, [[9, 14]]);
              }));

              function _destroyScripting() {
                return _destroyScripting2.apply(this, arguments);
              }

              return _destroyScripting;
            }()
          }]);

          return PDFScriptingManager;
        }();

        exports.PDFScriptingManager = PDFScriptingManager;
        /***/
      },
      /* 21 */

      /***/
      function (__unused_webpack_module, exports, __w_pdfjs_require__) {
        Object.defineProperty(exports, "__esModule", {
          value: true
        });
        exports.docPropertiesLookup = docPropertiesLookup;
        exports.GenericScripting = void 0;

        var _regenerator = _interopRequireDefault(__w_pdfjs_require__(2));

        var _pdfjsLib = __w_pdfjs_require__(4);

        function _interopRequireDefault(obj) {
          return obj && obj.__esModule ? obj : {
            "default": obj
          };
        }

        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 i = 1; i < arguments.length; i++) {
            var source = arguments[i] != null ? arguments[i] : {};

            if (i % 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;
        }

        function _defineProperty(obj, key, value) {
          if (key in obj) {
            Object.defineProperty(obj, key, {
              value: value,
              enumerable: true,
              configurable: true,
              writable: true
            });
          } else {
            obj[key] = value;
          }

          return obj;
        }

        function _classCallCheck(instance, Constructor) {
          if (!(instance instanceof Constructor)) {
            throw new TypeError("Cannot call a class as a function");
          }
        }

        function _defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];
            descriptor.enumerable = descriptor.enumerable || false;
            descriptor.configurable = true;
            if ("value" in descriptor) descriptor.writable = true;
            Object.defineProperty(target, descriptor.key, descriptor);
          }
        }

        function _createClass(Constructor, protoProps, staticProps) {
          if (protoProps) _defineProperties(Constructor.prototype, protoProps);
          if (staticProps) _defineProperties(Constructor, staticProps);
          return Constructor;
        }

        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 self = this,
                args = arguments;
            return new Promise(function (resolve, reject) {
              var gen = fn.apply(self, args);

              function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
              }

              function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
              }

              _next(undefined);
            });
          };
        }

        function docPropertiesLookup(_x) {
          return _docPropertiesLookup.apply(this, arguments);
        }

        function _docPropertiesLookup() {
          _docPropertiesLookup = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee4(pdfDocument) {
            var url, baseUrl, _yield$pdfDocument$ge, info, metadata, contentDispositionFilename, contentLength, _yield$pdfDocument$ge2, length;

            return _regenerator["default"].wrap(function _callee4$(_context4) {
              while (1) {
                switch (_context4.prev = _context4.next) {
                  case 0:
                    url = "", baseUrl = url.split("#")[0];
                    _context4.next = 3;
                    return pdfDocument.getMetadata();

                  case 3:
                    _yield$pdfDocument$ge = _context4.sent;
                    info = _yield$pdfDocument$ge.info;
                    metadata = _yield$pdfDocument$ge.metadata;
                    contentDispositionFilename = _yield$pdfDocument$ge.contentDispositionFilename;
                    contentLength = _yield$pdfDocument$ge.contentLength;

                    if (contentLength) {
                      _context4.next = 14;
                      break;
                    }

                    _context4.next = 11;
                    return pdfDocument.getDownloadInfo();

                  case 11:
                    _yield$pdfDocument$ge2 = _context4.sent;
                    length = _yield$pdfDocument$ge2.length;
                    contentLength = length;

                  case 14:
                    return _context4.abrupt("return", _objectSpread(_objectSpread({}, info), {}, {
                      baseURL: baseUrl,
                      filesize: contentLength,
                      filename: contentDispositionFilename || (0, _pdfjsLib.getPdfFilenameFromUrl)(url),
                      metadata: metadata === null || metadata === void 0 ? void 0 : metadata.getRaw(),
                      authors: metadata === null || metadata === void 0 ? void 0 : metadata.get("dc:creator"),
                      numPages: pdfDocument.numPages,
                      URL: url
                    }));

                  case 15:
                  case "end":
                    return _context4.stop();
                }
              }
            }, _callee4);
          }));
          return _docPropertiesLookup.apply(this, arguments);
        }

        var GenericScripting = /*#__PURE__*/function () {
          function GenericScripting(sandboxBundleSrc) {
            _classCallCheck(this, GenericScripting);

            this._ready = (0, _pdfjsLib.loadScript)(sandboxBundleSrc, true).then(function () {
              return window.pdfjsSandbox.QuickJSSandbox();
            });
          }

          _createClass(GenericScripting, [{
            key: "createSandbox",
            value: function () {
              var _createSandbox = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee(data) {
                var sandbox;
                return _regenerator["default"].wrap(function _callee$(_context) {
                  while (1) {
                    switch (_context.prev = _context.next) {
                      case 0:
                        _context.next = 2;
                        return this._ready;

                      case 2:
                        sandbox = _context.sent;
                        sandbox.create(data);

                      case 4:
                      case "end":
                        return _context.stop();
                    }
                  }
                }, _callee, this);
              }));

              function createSandbox(_x2) {
                return _createSandbox.apply(this, arguments);
              }

              return createSandbox;
            }()
          }, {
            key: "dispatchEventInSandbox",
            value: function () {
              var _dispatchEventInSandbox = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee2(event) {
                var sandbox;
                return _regenerator["default"].wrap(function _callee2$(_context2) {
                  while (1) {
                    switch (_context2.prev = _context2.next) {
                      case 0:
                        _context2.next = 2;
                        return this._ready;

                      case 2:
                        sandbox = _context2.sent;
                        sandbox.dispatchEvent(event);

                      case 4:
                      case "end":
                        return _context2.stop();
                    }
                  }
                }, _callee2, this);
              }));

              function dispatchEventInSandbox(_x3) {
                return _dispatchEventInSandbox.apply(this, arguments);
              }

              return dispatchEventInSandbox;
            }()
          }, {
            key: "destroySandbox",
            value: function () {
              var _destroySandbox = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
                var sandbox;
                return _regenerator["default"].wrap(function _callee3$(_context3) {
                  while (1) {
                    switch (_context3.prev = _context3.next) {
                      case 0:
                        _context3.next = 2;
                        return this._ready;

                      case 2:
                        sandbox = _context3.sent;
                        sandbox.nukeSandbox();

                      case 4:
                      case "end":
                        return _context3.stop();
                    }
                  }
                }, _callee3, this);
              }));

              function destroySandbox() {
                return _destroySandbox.apply(this, arguments);
              }

              return destroySandbox;
            }()
          }]);

          return GenericScripting;
        }();

        exports.GenericScripting = GenericScripting;
        /***/
      },
      /* 22 */

      /***/
      function (__unused_webpack_module, exports, __w_pdfjs_require__) {
        function _typeof(obj) {
          "@babel/helpers - typeof";

          if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
            _typeof = function _typeof(obj) {
              return typeof obj;
            };
          } else {
            _typeof = function _typeof(obj) {
              return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
            };
          }

          return _typeof(obj);
        }

        Object.defineProperty(exports, "__esModule", {
          value: true
        });
        exports.PDFSinglePageViewer = void 0;

        var _base_viewer = __w_pdfjs_require__(23);

        var _pdfjsLib = __w_pdfjs_require__(4);

        function _classCallCheck(instance, Constructor) {
          if (!(instance instanceof Constructor)) {
            throw new TypeError("Cannot call a class as a function");
          }
        }

        function _defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];
            descriptor.enumerable = descriptor.enumerable || false;
            descriptor.configurable = true;
            if ("value" in descriptor) descriptor.writable = true;
            Object.defineProperty(target, descriptor.key, descriptor);
          }
        }

        function _createClass(Constructor, protoProps, staticProps) {
          if (protoProps) _defineProperties(Constructor.prototype, protoProps);
          if (staticProps) _defineProperties(Constructor, staticProps);
          return Constructor;
        }

        function _get(target, property, receiver) {
          if (typeof Reflect !== "undefined" && Reflect.get) {
            _get = Reflect.get;
          } else {
            _get = function _get(target, property, receiver) {
              var base = _superPropBase(target, property);

              if (!base) return;
              var desc = Object.getOwnPropertyDescriptor(base, property);

              if (desc.get) {
                return desc.get.call(receiver);
              }

              return desc.value;
            };
          }

          return _get(target, property, receiver || target);
        }

        function _superPropBase(object, property) {
          while (!Object.prototype.hasOwnProperty.call(object, property)) {
            object = _getPrototypeOf(object);
            if (object === null) break;
          }

          return object;
        }

        function _inherits(subClass, superClass) {
          if (typeof superClass !== "function" && superClass !== null) {
            throw new TypeError("Super expression must either be null or a function");
          }

          subClass.prototype = Object.create(superClass && superClass.prototype, {
            constructor: {
              value: subClass,
              writable: true,
              configurable: true
            }
          });
          if (superClass) _setPrototypeOf(subClass, superClass);
        }

        function _setPrototypeOf(o, p) {
          _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
            o.__proto__ = p;
            return o;
          };

          return _setPrototypeOf(o, p);
        }

        function _createSuper(Derived) {
          var hasNativeReflectConstruct = _isNativeReflectConstruct();

          return function _createSuperInternal() {
            var Super = _getPrototypeOf(Derived),
                result;

            if (hasNativeReflectConstruct) {
              var NewTarget = _getPrototypeOf(this).constructor;

              result = Reflect.construct(Super, arguments, NewTarget);
            } else {
              result = Super.apply(this, arguments);
            }

            return _possibleConstructorReturn(this, result);
          };
        }

        function _possibleConstructorReturn(self, call) {
          if (call && (_typeof(call) === "object" || typeof call === "function")) {
            return call;
          } else if (call !== void 0) {
            throw new TypeError("Derived constructors may only return object or undefined");
          }

          return _assertThisInitialized(self);
        }

        function _assertThisInitialized(self) {
          if (self === void 0) {
            throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
          }

          return self;
        }

        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 (e) {
            return false;
          }
        }

        function _getPrototypeOf(o) {
          _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
            return o.__proto__ || Object.getPrototypeOf(o);
          };
          return _getPrototypeOf(o);
        }

        var PDFSinglePageViewer = /*#__PURE__*/function (_BaseViewer) {
          _inherits(PDFSinglePageViewer, _BaseViewer);

          var _super = _createSuper(PDFSinglePageViewer);

          function PDFSinglePageViewer(options) {
            var _this;

            _classCallCheck(this, PDFSinglePageViewer);

            _this = _super.call(this, options);

            _this.eventBus._on("pagesinit", function (evt) {
              _this._ensurePageViewVisible();
            });

            return _this;
          }

          _createClass(PDFSinglePageViewer, [{
            key: "_viewerElement",
            get: function get() {
              return (0, _pdfjsLib.shadow)(this, "_viewerElement", this._shadowViewer);
            }
          }, {
            key: "_pageWidthScaleFactor",
            get: function get() {
              return 1;
            }
          }, {
            key: "_resetView",
            value: function _resetView() {
              _get(_getPrototypeOf(PDFSinglePageViewer.prototype), "_resetView", this).call(this);

              this._previousPageNumber = 1;
              this._shadowViewer = document.createDocumentFragment();
              this._updateScrollDown = null;
            }
          }, {
            key: "_ensurePageViewVisible",
            value: function _ensurePageViewVisible() {
              var pageView = this._pages[this._currentPageNumber - 1];
              var previousPageView = this._pages[this._previousPageNumber - 1];
              var viewerNodes = this.viewer.childNodes;

              switch (viewerNodes.length) {
                case 0:
                  this.viewer.appendChild(pageView.div);
                  break;

                case 1:
                  if (viewerNodes[0] !== previousPageView.div) {
                    throw new Error("_ensurePageViewVisible: Unexpected previously visible page.");
                  }

                  if (pageView === previousPageView) {
                    break;
                  }

                  this._shadowViewer.appendChild(previousPageView.div);

                  this.viewer.appendChild(pageView.div);
                  this.container.scrollTop = 0;
                  break;

                default:
                  throw new Error("_ensurePageViewVisible: Only one page should be visible at a time.");
              }

              this._previousPageNumber = this._currentPageNumber;
            }
          }, {
            key: "_scrollUpdate",
            value: function _scrollUpdate() {
              if (this._updateScrollDown) {
                this._updateScrollDown();
              }

              _get(_getPrototypeOf(PDFSinglePageViewer.prototype), "_scrollUpdate", this).call(this);
            }
          }, {
            key: "_scrollIntoView",
            value: function _scrollIntoView(_ref) {
              var _this2 = this;

              var pageDiv = _ref.pageDiv,
                  _ref$pageSpot = _ref.pageSpot,
                  pageSpot = _ref$pageSpot === void 0 ? null : _ref$pageSpot,
                  _ref$pageNumber = _ref.pageNumber,
                  pageNumber = _ref$pageNumber === void 0 ? null : _ref$pageNumber;

              if (pageNumber) {
                this._setCurrentPageNumber(pageNumber);
              }

              var scrolledDown = this._currentPageNumber >= this._previousPageNumber;

              this._ensurePageViewVisible();

              this.update();

              _get(_getPrototypeOf(PDFSinglePageViewer.prototype), "_scrollIntoView", this).call(this, {
                pageDiv: pageDiv,
                pageSpot: pageSpot,
                pageNumber: pageNumber
              });

              this._updateScrollDown = function () {
                _this2.scroll.down = scrolledDown;
                _this2._updateScrollDown = null;
              };
            }
          }, {
            key: "_getVisiblePages",
            value: function _getVisiblePages() {
              return this._getCurrentVisiblePage();
            }
          }, {
            key: "_updateHelper",
            value: function _updateHelper(visiblePages) {}
          }, {
            key: "_isScrollModeHorizontal",
            get: function get() {
              return (0, _pdfjsLib.shadow)(this, "_isScrollModeHorizontal", false);
            }
          }, {
            key: "_updateScrollMode",
            value: function _updateScrollMode() {}
          }, {
            key: "_updateSpreadMode",
            value: function _updateSpreadMode() {}
          }, {
            key: "_getPageAdvance",
            value: function _getPageAdvance() {
              return 1;
            }
          }]);

          return PDFSinglePageViewer;
        }(_base_viewer.BaseViewer);

        exports.PDFSinglePageViewer = PDFSinglePageViewer;
        /***/
      },
      /* 23 */

      /***/
      function (__unused_webpack_module, exports, __w_pdfjs_require__) {
        Object.defineProperty(exports, "__esModule", {
          value: true
        });
        exports.BaseViewer = void 0;

        var _pdfjsLib = __w_pdfjs_require__(4);

        var _ui_utils = __w_pdfjs_require__(7);

        var _pdf_rendering_queue = __w_pdfjs_require__(19);

        var _annotation_layer_builder = __w_pdfjs_require__(1);

        var _l10n_utils = __w_pdfjs_require__(5);

        var _pdf_page_view = __w_pdfjs_require__(18);

        var _pdf_link_service = __w_pdfjs_require__(6);

        var _struct_tree_layer_builder = __w_pdfjs_require__(8);

        var _text_highlighter = __w_pdfjs_require__(24);

        var _text_layer_builder = __w_pdfjs_require__(9);

        var _xfa_layer_builder = __w_pdfjs_require__(10);

        function _createForOfIteratorHelper(o, allowArrayLike) {
          var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];

          if (!it) {
            if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
              if (it) o = it;
              var i = 0;

              var F = function F() {};

              return {
                s: F,
                n: function n() {
                  if (i >= o.length) return {
                    done: true
                  };
                  return {
                    done: false,
                    value: o[i++]
                  };
                },
                e: function e(_e) {
                  throw _e;
                },
                f: F
              };
            }

            throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
          }

          var normalCompletion = true,
              didErr = false,
              err;
          return {
            s: function s() {
              it = it.call(o);
            },
            n: function n() {
              var step = it.next();
              normalCompletion = step.done;
              return step;
            },
            e: function e(_e2) {
              didErr = true;
              err = _e2;
            },
            f: function f() {
              try {
                if (!normalCompletion && it["return"] != null) it["return"]();
              } finally {
                if (didErr) throw err;
              }
            }
          };
        }

        function _unsupportedIterableToArray(o, minLen) {
          if (!o) return;
          if (typeof o === "string") return _arrayLikeToArray(o, minLen);
          var n = Object.prototype.toString.call(o).slice(8, -1);
          if (n === "Object" && o.constructor) n = o.constructor.name;
          if (n === "Map" || n === "Set") return Array.from(o);
          if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
        }

        function _arrayLikeToArray(arr, len) {
          if (len == null || len > arr.length) len = arr.length;

          for (var i = 0, arr2 = new Array(len); i < len; i++) {
            arr2[i] = arr[i];
          }

          return arr2;
        }

        function _classCallCheck(instance, Constructor) {
          if (!(instance instanceof Constructor)) {
            throw new TypeError("Cannot call a class as a function");
          }
        }

        function _defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];
            descriptor.enumerable = descriptor.enumerable || false;
            descriptor.configurable = true;
            if ("value" in descriptor) descriptor.writable = true;
            Object.defineProperty(target, descriptor.key, descriptor);
          }
        }

        function _createClass(Constructor, protoProps, staticProps) {
          if (protoProps) _defineProperties(Constructor.prototype, protoProps);
          if (staticProps) _defineProperties(Constructor, staticProps);
          return Constructor;
        }

        var DEFAULT_CACHE_SIZE = 10;

        function PDFPageViewBuffer(size) {
          var data = [];

          this.push = function (view) {
            var i = data.indexOf(view);

            if (i >= 0) {
              data.splice(i, 1);
            }

            data.push(view);

            if (data.length > size) {
              data.shift().destroy();
            }
          };

          this.resize = function (newSize, pagesToKeep) {
            size = newSize;

            if (pagesToKeep) {
              var pageIdsToKeep = new Set();

              for (var i = 0, iMax = pagesToKeep.length; i < iMax; ++i) {
                pageIdsToKeep.add(pagesToKeep[i].id);
              }

              (0, _ui_utils.moveToEndOfArray)(data, function (page) {
                return pageIdsToKeep.has(page.id);
              });
            }

            while (data.length > size) {
              data.shift().destroy();
            }
          };

          this.has = function (view) {
            return data.includes(view);
          };
        }

        function isSameScale(oldScale, newScale) {
          if (newScale === oldScale) {
            return true;
          }

          if (Math.abs(newScale - oldScale) < 1e-15) {
            return true;
          }

          return false;
        }

        var BaseViewer = /*#__PURE__*/function () {
          function BaseViewer(options) {
            var _this$container,
                _this$viewer,
                _options$textLayerMod,
                _options$annotationMo,
                _this = this;

            _classCallCheck(this, BaseViewer);

            if (this.constructor === BaseViewer) {
              throw new Error("Cannot initialize BaseViewer.");
            }

            var viewerVersion = '2.11.338';

            if (_pdfjsLib.version !== viewerVersion) {
              throw new Error("The API version \"".concat(_pdfjsLib.version, "\" does not match the Viewer version \"").concat(viewerVersion, "\"."));
            }

            this.container = options.container;
            this.viewer = options.viewer || options.container.firstElementChild;

            if (!(((_this$container = this.container) === null || _this$container === void 0 ? void 0 : _this$container.tagName.toUpperCase()) === "DIV" && ((_this$viewer = this.viewer) === null || _this$viewer === void 0 ? void 0 : _this$viewer.tagName.toUpperCase()) === "DIV")) {
              throw new Error("Invalid `container` and/or `viewer` option.");
            }

            if (this.container.offsetParent && getComputedStyle(this.container).position !== "absolute") {
              throw new Error("The `container` must be absolutely positioned.");
            }

            this.eventBus = options.eventBus;
            this.linkService = options.linkService || new _pdf_link_service.SimpleLinkService();
            this.downloadManager = options.downloadManager || null;
            this.findController = options.findController || null;
            this._scriptingManager = options.scriptingManager || null;
            this.removePageBorders = options.removePageBorders || false;
            this.textLayerMode = (_options$textLayerMod = options.textLayerMode) !== null && _options$textLayerMod !== void 0 ? _options$textLayerMod : _ui_utils.TextLayerMode.ENABLE;
            this._annotationMode = (_options$annotationMo = options.annotationMode) !== null && _options$annotationMo !== void 0 ? _options$annotationMo : _pdfjsLib.AnnotationMode.ENABLE_FORMS;
            this.imageResourcesPath = options.imageResourcesPath || "";
            this.enablePrintAutoRotate = options.enablePrintAutoRotate || false;
            this.renderer = options.renderer || _ui_utils.RendererType.CANVAS;
            this.useOnlyCssZoom = options.useOnlyCssZoom || false;
            this.maxCanvasPixels = options.maxCanvasPixels;
            this.l10n = options.l10n || _l10n_utils.NullL10n;
            this.defaultRenderingQueue = !options.renderingQueue;

            if (this.defaultRenderingQueue) {
              this.renderingQueue = new _pdf_rendering_queue.PDFRenderingQueue();
              this.renderingQueue.setViewer(this);
            } else {
              this.renderingQueue = options.renderingQueue;
            }

            this._doc = document.documentElement;
            this.scroll = (0, _ui_utils.watchScroll)(this.container, this._scrollUpdate.bind(this));
            this.presentationModeState = _ui_utils.PresentationModeState.UNKNOWN;
            this._onBeforeDraw = this._onAfterDraw = null;

            this._resetView();

            if (this.removePageBorders) {
              this.viewer.classList.add("removePageBorders");
            }

            Promise.resolve().then(function () {
              _this.eventBus.dispatch("baseviewerinit", {
                source: _this
              });
            });
          }

          _createClass(BaseViewer, [{
            key: "pagesCount",
            get: function get() {
              return this._pages.length;
            }
          }, {
            key: "getPageView",
            value: function getPageView(index) {
              return this._pages[index];
            }
          }, {
            key: "pageViewsReady",
            get: function get() {
              if (!this._pagesCapability.settled) {
                return false;
              }

              return this._pages.every(function (pageView) {
                return pageView === null || pageView === void 0 ? void 0 : pageView.pdfPage;
              });
            }
          }, {
            key: "renderForms",
            get: function get() {
              return this._annotationMode === _pdfjsLib.AnnotationMode.ENABLE_FORMS;
            }
          }, {
            key: "enableScripting",
            get: function get() {
              return !!this._scriptingManager;
            }
          }, {
            key: "currentPageNumber",
            get: function get() {
              return this._currentPageNumber;
            },
            set: function set(val) {
              if (!Number.isInteger(val)) {
                throw new Error("Invalid page number.");
              }

              if (!this.pdfDocument) {
                return;
              }

              if (!this._setCurrentPageNumber(val, true)) {
                console.error("currentPageNumber: \"".concat(val, "\" is not a valid page."));
              }
            }
          }, {
            key: "_setCurrentPageNumber",
            value: function _setCurrentPageNumber(val) {
              var _this$_pageLabels, _this$_pageLabels2;

              var resetCurrentPageView = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;

              if (this._currentPageNumber === val) {
                if (resetCurrentPageView) {
                  this._resetCurrentPageView();
                }

                return true;
              }

              if (!(0 < val && val <= this.pagesCount)) {
                return false;
              }

              var previous = this._currentPageNumber;
              this._currentPageNumber = val;
              this.eventBus.dispatch("pagechanging", {
                source: this,
                pageNumber: val,
                pageLabel: (_this$_pageLabels = (_this$_pageLabels2 = this._pageLabels) === null || _this$_pageLabels2 === void 0 ? void 0 : _this$_pageLabels2[val - 1]) !== null && _this$_pageLabels !== void 0 ? _this$_pageLabels : null,
                previous: previous
              });

              if (resetCurrentPageView) {
                this._resetCurrentPageView();
              }

              return true;
            }
          }, {
            key: "currentPageLabel",
            get: function get() {
              var _this$_pageLabels3, _this$_pageLabels4;

              return (_this$_pageLabels3 = (_this$_pageLabels4 = this._pageLabels) === null || _this$_pageLabels4 === void 0 ? void 0 : _this$_pageLabels4[this._currentPageNumber - 1]) !== null && _this$_pageLabels3 !== void 0 ? _this$_pageLabels3 : null;
            },
            set: function set(val) {
              if (!this.pdfDocument) {
                return;
              }

              var page = val | 0;

              if (this._pageLabels) {
                var i = this._pageLabels.indexOf(val);

                if (i >= 0) {
                  page = i + 1;
                }
              }

              if (!this._setCurrentPageNumber(page, true)) {
                console.error("currentPageLabel: \"".concat(val, "\" is not a valid page."));
              }
            }
          }, {
            key: "currentScale",
            get: function get() {
              return this._currentScale !== _ui_utils.UNKNOWN_SCALE ? this._currentScale : _ui_utils.DEFAULT_SCALE;
            },
            set: function set(val) {
              if (isNaN(val)) {
                throw new Error("Invalid numeric scale.");
              }

              if (!this.pdfDocument) {
                return;
              }

              this._setScale(val, false);
            }
          }, {
            key: "currentScaleValue",
            get: function get() {
              return this._currentScaleValue;
            },
            set: function set(val) {
              if (!this.pdfDocument) {
                return;
              }

              this._setScale(val, false);
            }
          }, {
            key: "pagesRotation",
            get: function get() {
              return this._pagesRotation;
            },
            set: function set(rotation) {
              if (!(0, _ui_utils.isValidRotation)(rotation)) {
                throw new Error("Invalid pages rotation angle.");
              }

              if (!this.pdfDocument) {
                return;
              }

              rotation %= 360;

              if (rotation < 0) {
                rotation += 360;
              }

              if (this._pagesRotation === rotation) {
                return;
              }

              this._pagesRotation = rotation;
              var pageNumber = this._currentPageNumber;
              var updateArgs = {
                rotation: rotation
              };

              var _iterator = _createForOfIteratorHelper(this._pages),
                  _step;

              try {
                for (_iterator.s(); !(_step = _iterator.n()).done;) {
                  var pageView = _step.value;
                  pageView.update(updateArgs);
                }
              } catch (err) {
                _iterator.e(err);
              } finally {
                _iterator.f();
              }

              if (this._currentScaleValue) {
                this._setScale(this._currentScaleValue, true);
              }

              this.eventBus.dispatch("rotationchanging", {
                source: this,
                pagesRotation: rotation,
                pageNumber: pageNumber
              });

              if (this.defaultRenderingQueue) {
                this.update();
              }
            }
          }, {
            key: "firstPagePromise",
            get: function get() {
              return this.pdfDocument ? this._firstPageCapability.promise : null;
            }
          }, {
            key: "onePageRendered",
            get: function get() {
              return this.pdfDocument ? this._onePageRenderedCapability.promise : null;
            }
          }, {
            key: "pagesPromise",
            get: function get() {
              return this.pdfDocument ? this._pagesCapability.promise : null;
            }
          }, {
            key: "_viewerElement",
            get: function get() {
              throw new Error("Not implemented: _viewerElement");
            }
          }, {
            key: "_onePageRenderedOrForceFetch",
            value: function _onePageRenderedOrForceFetch() {
              if (!this.container.offsetParent || this._getVisiblePages().views.length === 0) {
                return Promise.resolve();
              }

              return this._onePageRenderedCapability.promise;
            }
          }, {
            key: "setDocument",
            value: function setDocument(pdfDocument) {
              var _this2 = this;

              if (this.pdfDocument) {
                this.eventBus.dispatch("pagesdestroy", {
                  source: this
                });

                this._cancelRendering();

                this._resetView();

                if (this.findController) {
                  this.findController.setDocument(null);
                }

                if (this._scriptingManager) {
                  this._scriptingManager.setDocument(null);
                }
              }

              this.pdfDocument = pdfDocument;

              if (!pdfDocument) {
                return;
              }

              var isPureXfa = pdfDocument.isPureXfa;
              var pagesCount = pdfDocument.numPages;
              var firstPagePromise = pdfDocument.getPage(1);
              var optionalContentConfigPromise = pdfDocument.getOptionalContentConfig();

              this._pagesCapability.promise.then(function () {
                _this2.eventBus.dispatch("pagesloaded", {
                  source: _this2,
                  pagesCount: pagesCount
                });
              });

              this._onBeforeDraw = function (evt) {
                var pageView = _this2._pages[evt.pageNumber - 1];

                if (!pageView) {
                  return;
                }

                _this2._buffer.push(pageView);
              };

              this.eventBus._on("pagerender", this._onBeforeDraw);

              this._onAfterDraw = function (evt) {
                if (evt.cssTransform || _this2._onePageRenderedCapability.settled) {
                  return;
                }

                _this2._onePageRenderedCapability.resolve();

                _this2.eventBus._off("pagerendered", _this2._onAfterDraw);

                _this2._onAfterDraw = null;
              };

              this.eventBus._on("pagerendered", this._onAfterDraw);

              firstPagePromise.then(function (firstPdfPage) {
                _this2._firstPageCapability.resolve(firstPdfPage);

                _this2._optionalContentConfigPromise = optionalContentConfigPromise;
                var scale = _this2.currentScale;
                var viewport = firstPdfPage.getViewport({
                  scale: scale * _pdfjsLib.PixelsPerInch.PDF_TO_CSS_UNITS
                });
                var textLayerFactory = _this2.textLayerMode !== _ui_utils.TextLayerMode.DISABLE && !isPureXfa ? _this2 : null;
                var annotationLayerFactory = _this2._annotationMode !== _pdfjsLib.AnnotationMode.DISABLE ? _this2 : null;
                var xfaLayerFactory = isPureXfa ? _this2 : null;

                for (var pageNum = 1; pageNum <= pagesCount; ++pageNum) {
                  var pageView = new _pdf_page_view.PDFPageView({
                    container: _this2._viewerElement,
                    eventBus: _this2.eventBus,
                    id: pageNum,
                    scale: scale,
                    defaultViewport: viewport.clone(),
                    optionalContentConfigPromise: optionalContentConfigPromise,
                    renderingQueue: _this2.renderingQueue,
                    textLayerFactory: textLayerFactory,
                    textLayerMode: _this2.textLayerMode,
                    annotationLayerFactory: annotationLayerFactory,
                    annotationMode: _this2._annotationMode,
                    xfaLayerFactory: xfaLayerFactory,
                    textHighlighterFactory: _this2,
                    structTreeLayerFactory: _this2,
                    imageResourcesPath: _this2.imageResourcesPath,
                    renderer: _this2.renderer,
                    useOnlyCssZoom: _this2.useOnlyCssZoom,
                    maxCanvasPixels: _this2.maxCanvasPixels,
                    l10n: _this2.l10n
                  });

                  _this2._pages.push(pageView);
                }

                var firstPageView = _this2._pages[0];

                if (firstPageView) {
                  firstPageView.setPdfPage(firstPdfPage);

                  _this2.linkService.cachePageRef(1, firstPdfPage.ref);
                }

                if (_this2._spreadMode !== _ui_utils.SpreadMode.NONE) {
                  _this2._updateSpreadMode();
                }

                _this2._onePageRenderedOrForceFetch().then(function () {
                  if (_this2.findController) {
                    _this2.findController.setDocument(pdfDocument);
                  }

                  if (_this2._scriptingManager) {
                    _this2._scriptingManager.setDocument(pdfDocument);
                  }

                  if (pdfDocument.loadingParams.disableAutoFetch || pagesCount > 7500) {
                    _this2._pagesCapability.resolve();

                    return;
                  }

                  var getPagesLeft = pagesCount - 1;

                  if (getPagesLeft <= 0) {
                    _this2._pagesCapability.resolve();

                    return;
                  }

                  var _loop = function _loop(_pageNum) {
                    pdfDocument.getPage(_pageNum).then(function (pdfPage) {
                      var pageView = _this2._pages[_pageNum - 1];

                      if (!pageView.pdfPage) {
                        pageView.setPdfPage(pdfPage);
                      }

                      _this2.linkService.cachePageRef(_pageNum, pdfPage.ref);

                      if (--getPagesLeft === 0) {
                        _this2._pagesCapability.resolve();
                      }
                    }, function (reason) {
                      console.error("Unable to get page ".concat(_pageNum, " to initialize viewer"), reason);

                      if (--getPagesLeft === 0) {
                        _this2._pagesCapability.resolve();
                      }
                    });
                  };

                  for (var _pageNum = 2; _pageNum <= pagesCount; ++_pageNum) {
                    _loop(_pageNum);
                  }
                });

                _this2.eventBus.dispatch("pagesinit", {
                  source: _this2
                });

                if (_this2.defaultRenderingQueue) {
                  _this2.update();
                }
              })["catch"](function (reason) {
                console.error("Unable to initialize viewer", reason);
              });
            }
          }, {
            key: "setPageLabels",
            value: function setPageLabels(labels) {
              if (!this.pdfDocument) {
                return;
              }

              if (!labels) {
                this._pageLabels = null;
              } else if (!(Array.isArray(labels) && this.pdfDocument.numPages === labels.length)) {
                this._pageLabels = null;
                console.error("setPageLabels: Invalid page labels.");
              } else {
                this._pageLabels = labels;
              }

              for (var i = 0, ii = this._pages.length; i < ii; i++) {
                var _this$_pageLabels$i, _this$_pageLabels5;

                this._pages[i].setPageLabel((_this$_pageLabels$i = (_this$_pageLabels5 = this._pageLabels) === null || _this$_pageLabels5 === void 0 ? void 0 : _this$_pageLabels5[i]) !== null && _this$_pageLabels$i !== void 0 ? _this$_pageLabels$i : null);
              }
            }
          }, {
            key: "_resetView",
            value: function _resetView() {
              this._pages = [];
              this._currentPageNumber = 1;
              this._currentScale = _ui_utils.UNKNOWN_SCALE;
              this._currentScaleValue = null;
              this._pageLabels = null;
              this._buffer = new PDFPageViewBuffer(DEFAULT_CACHE_SIZE);
              this._location = null;
              this._pagesRotation = 0;
              this._optionalContentConfigPromise = null;
              this._pagesRequests = new WeakMap();
              this._firstPageCapability = (0, _pdfjsLib.createPromiseCapability)();
              this._onePageRenderedCapability = (0, _pdfjsLib.createPromiseCapability)();
              this._pagesCapability = (0, _pdfjsLib.createPromiseCapability)();
              this._scrollMode = _ui_utils.ScrollMode.VERTICAL;
              this._spreadMode = _ui_utils.SpreadMode.NONE;

              if (this._onBeforeDraw) {
                this.eventBus._off("pagerender", this._onBeforeDraw);

                this._onBeforeDraw = null;
              }

              if (this._onAfterDraw) {
                this.eventBus._off("pagerendered", this._onAfterDraw);

                this._onAfterDraw = null;
              }

              this.viewer.textContent = "";

              this._updateScrollMode();
            }
          }, {
            key: "_scrollUpdate",
            value: function _scrollUpdate() {
              if (this.pagesCount === 0) {
                return;
              }

              this.update();
            }
          }, {
            key: "_scrollIntoView",
            value: function _scrollIntoView(_ref) {
              var pageDiv = _ref.pageDiv,
                  _ref$pageSpot = _ref.pageSpot,
                  pageSpot = _ref$pageSpot === void 0 ? null : _ref$pageSpot,
                  _ref$pageNumber = _ref.pageNumber,
                  pageNumber = _ref$pageNumber === void 0 ? null : _ref$pageNumber;
              (0, _ui_utils.scrollIntoView)(pageDiv, pageSpot);
            }
          }, {
            key: "_setScaleUpdatePages",
            value: function _setScaleUpdatePages(newScale, newValue) {
              var noScroll = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
              var preset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
              this._currentScaleValue = newValue.toString();

              if (isSameScale(this._currentScale, newScale)) {
                if (preset) {
                  this.eventBus.dispatch("scalechanging", {
                    source: this,
                    scale: newScale,
                    presetValue: newValue
                  });
                }

                return;
              }

              this._doc.style.setProperty("--zoom-factor", newScale);

              var updateArgs = {
                scale: newScale
              };

              var _iterator2 = _createForOfIteratorHelper(this._pages),
                  _step2;

              try {
                for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
                  var pageView = _step2.value;
                  pageView.update(updateArgs);
                }
              } catch (err) {
                _iterator2.e(err);
              } finally {
                _iterator2.f();
              }

              this._currentScale = newScale;

              if (!noScroll) {
                var page = this._currentPageNumber,
                    dest;

                if (this._location && !(this.isInPresentationMode || this.isChangingPresentationMode)) {
                  page = this._location.pageNumber;
                  dest = [null, {
                    name: "XYZ"
                  }, this._location.left, this._location.top, null];
                }

                this.scrollPageIntoView({
                  pageNumber: page,
                  destArray: dest,
                  allowNegativeOffset: true
                });
              }

              this.eventBus.dispatch("scalechanging", {
                source: this,
                scale: newScale,
                presetValue: preset ? newValue : undefined
              });

              if (this.defaultRenderingQueue) {
                this.update();
              }
            }
          }, {
            key: "_pageWidthScaleFactor",
            get: function get() {
              if (this._spreadMode !== _ui_utils.SpreadMode.NONE && this._scrollMode !== _ui_utils.ScrollMode.HORIZONTAL && !this.isInPresentationMode) {
                return 2;
              }

              return 1;
            }
          }, {
            key: "_setScale",
            value: function _setScale(value) {
              var noScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
              var scale = parseFloat(value);

              if (scale > 0) {
                this._setScaleUpdatePages(scale, value, noScroll, false);
              } else {
                var currentPage = this._pages[this._currentPageNumber - 1];

                if (!currentPage) {
                  return;
                }

                var noPadding = this.isInPresentationMode || this.removePageBorders;
                var hPadding = noPadding ? 0 : _ui_utils.SCROLLBAR_PADDING;
                var vPadding = noPadding ? 0 : _ui_utils.VERTICAL_PADDING;

                if (!noPadding && this._isScrollModeHorizontal) {
                  var _ref2 = [vPadding, hPadding];
                  hPadding = _ref2[0];
                  vPadding = _ref2[1];
                }

                var pageWidthScale = (this.container.clientWidth - hPadding) / currentPage.width * currentPage.scale / this._pageWidthScaleFactor;
                var pageHeightScale = (this.container.clientHeight - vPadding) / currentPage.height * currentPage.scale;

                switch (value) {
                  case "page-actual":
                    scale = 1;
                    break;

                  case "page-width":
                    scale = pageWidthScale;
                    break;

                  case "page-height":
                    scale = pageHeightScale;
                    break;

                  case "page-fit":
                    scale = Math.min(pageWidthScale, pageHeightScale);
                    break;

                  case "auto":
                    var horizontalScale = (0, _ui_utils.isPortraitOrientation)(currentPage) ? pageWidthScale : Math.min(pageHeightScale, pageWidthScale);
                    scale = Math.min(_ui_utils.MAX_AUTO_SCALE, horizontalScale);
                    break;

                  default:
                    console.error("_setScale: \"".concat(value, "\" is an unknown zoom value."));
                    return;
                }

                this._setScaleUpdatePages(scale, value, noScroll, true);
              }
            }
          }, {
            key: "_resetCurrentPageView",
            value: function _resetCurrentPageView() {
              if (this.isInPresentationMode) {
                this._setScale(this._currentScaleValue, true);
              }

              var pageView = this._pages[this._currentPageNumber - 1];

              this._scrollIntoView({
                pageDiv: pageView.div
              });
            }
          }, {
            key: "pageLabelToPageNumber",
            value: function pageLabelToPageNumber(label) {
              if (!this._pageLabels) {
                return null;
              }

              var i = this._pageLabels.indexOf(label);

              if (i < 0) {
                return null;
              }

              return i + 1;
            }
          }, {
            key: "scrollPageIntoView",
            value: function scrollPageIntoView(_ref3) {
              var pageNumber = _ref3.pageNumber,
                  _ref3$destArray = _ref3.destArray,
                  destArray = _ref3$destArray === void 0 ? null : _ref3$destArray,
                  _ref3$allowNegativeOf = _ref3.allowNegativeOffset,
                  allowNegativeOffset = _ref3$allowNegativeOf === void 0 ? false : _ref3$allowNegativeOf,
                  _ref3$ignoreDestinati = _ref3.ignoreDestinationZoom,
                  ignoreDestinationZoom = _ref3$ignoreDestinati === void 0 ? false : _ref3$ignoreDestinati;

              if (!this.pdfDocument) {
                return;
              }

              var pageView = Number.isInteger(pageNumber) && this._pages[pageNumber - 1];

              if (!pageView) {
                console.error("scrollPageIntoView: \"".concat(pageNumber, "\" is not a valid pageNumber parameter."));
                return;
              }

              if (this.isInPresentationMode || !destArray) {
                this._setCurrentPageNumber(pageNumber, true);

                return;
              }

              var x = 0,
                  y = 0;
              var width = 0,
                  height = 0,
                  widthScale,
                  heightScale;
              var changeOrientation = pageView.rotation % 180 !== 0;
              var pageWidth = (changeOrientation ? pageView.height : pageView.width) / pageView.scale / _pdfjsLib.PixelsPerInch.PDF_TO_CSS_UNITS;
              var pageHeight = (changeOrientation ? pageView.width : pageView.height) / pageView.scale / _pdfjsLib.PixelsPerInch.PDF_TO_CSS_UNITS;
              var scale = 0;

              switch (destArray[1].name) {
                case "XYZ":
                  x = destArray[2];
                  y = destArray[3];
                  scale = destArray[4];
                  x = x !== null ? x : 0;
                  y = y !== null ? y : pageHeight;
                  break;

                case "Fit":
                case "FitB":
                  scale = "page-fit";
                  break;

                case "FitH":
                case "FitBH":
                  y = destArray[2];
                  scale = "page-width";

                  if (y === null && this._location) {
                    x = this._location.left;
                    y = this._location.top;
                  } else if (typeof y !== "number") {
                    y = pageHeight;
                  }

                  break;

                case "FitV":
                case "FitBV":
                  x = destArray[2];
                  width = pageWidth;
                  height = pageHeight;
                  scale = "page-height";
                  break;

                case "FitR":
                  x = destArray[2];
                  y = destArray[3];
                  width = destArray[4] - x;
                  height = destArray[5] - y;
                  var hPadding = this.removePageBorders ? 0 : _ui_utils.SCROLLBAR_PADDING;
                  var vPadding = this.removePageBorders ? 0 : _ui_utils.VERTICAL_PADDING;
                  widthScale = (this.container.clientWidth - hPadding) / width / _pdfjsLib.PixelsPerInch.PDF_TO_CSS_UNITS;
                  heightScale = (this.container.clientHeight - vPadding) / height / _pdfjsLib.PixelsPerInch.PDF_TO_CSS_UNITS;
                  scale = Math.min(Math.abs(widthScale), Math.abs(heightScale));
                  break;

                default:
                  console.error("scrollPageIntoView: \"".concat(destArray[1].name, "\" is not a valid destination type."));
                  return;
              }

              if (!ignoreDestinationZoom) {
                if (scale && scale !== this._currentScale) {
                  this.currentScaleValue = scale;
                } else if (this._currentScale === _ui_utils.UNKNOWN_SCALE) {
                  this.currentScaleValue = _ui_utils.DEFAULT_SCALE_VALUE;
                }
              }

              if (scale === "page-fit" && !destArray[4]) {
                this._scrollIntoView({
                  pageDiv: pageView.div,
                  pageNumber: pageNumber
                });

                return;
              }

              var boundingRect = [pageView.viewport.convertToViewportPoint(x, y), pageView.viewport.convertToViewportPoint(x + width, y + height)];
              var left = Math.min(boundingRect[0][0], boundingRect[1][0]);
              var top = Math.min(boundingRect[0][1], boundingRect[1][1]);

              if (!allowNegativeOffset) {
                left = Math.max(left, 0);
                top = Math.max(top, 0);
              }

              this._scrollIntoView({
                pageDiv: pageView.div,
                pageSpot: {
                  left: left,
                  top: top
                },
                pageNumber: pageNumber
              });
            }
          }, {
            key: "_updateLocation",
            value: function _updateLocation(firstPage) {
              var currentScale = this._currentScale;
              var currentScaleValue = this._currentScaleValue;
              var normalizedScaleValue = parseFloat(currentScaleValue) === currentScale ? Math.round(currentScale * 10000) / 100 : currentScaleValue;
              var pageNumber = firstPage.id;
              var pdfOpenParams = "#page=" + pageNumber;
              pdfOpenParams += "&zoom=" + normalizedScaleValue;
              var currentPageView = this._pages[pageNumber - 1];
              var container = this.container;
              var topLeft = currentPageView.getPagePoint(container.scrollLeft - firstPage.x, container.scrollTop - firstPage.y);
              var intLeft = Math.round(topLeft[0]);
              var intTop = Math.round(topLeft[1]);
              pdfOpenParams += "," + intLeft + "," + intTop;
              this._location = {
                pageNumber: pageNumber,
                scale: normalizedScaleValue,
                top: intTop,
                left: intLeft,
                rotation: this._pagesRotation,
                pdfOpenParams: pdfOpenParams
              };
            }
          }, {
            key: "_updateHelper",
            value: function _updateHelper(visiblePages) {
              throw new Error("Not implemented: _updateHelper");
            }
          }, {
            key: "update",
            value: function update() {
              var visible = this._getVisiblePages();

              var visiblePages = visible.views,
                  numVisiblePages = visiblePages.length;

              if (numVisiblePages === 0) {
                return;
              }

              var newCacheSize = Math.max(DEFAULT_CACHE_SIZE, 2 * numVisiblePages + 1);

              this._buffer.resize(newCacheSize, visiblePages);

              this.renderingQueue.renderHighestPriority(visible);

              this._updateHelper(visiblePages);

              this._updateLocation(visible.first);

              this.eventBus.dispatch("updateviewarea", {
                source: this,
                location: this._location
              });
            }
          }, {
            key: "containsElement",
            value: function containsElement(element) {
              return this.container.contains(element);
            }
          }, {
            key: "focus",
            value: function focus() {
              this.container.focus();
            }
          }, {
            key: "_isScrollModeHorizontal",
            get: function get() {
              return this.isInPresentationMode ? false : this._scrollMode === _ui_utils.ScrollMode.HORIZONTAL;
            }
          }, {
            key: "_isContainerRtl",
            get: function get() {
              return getComputedStyle(this.container).direction === "rtl";
            }
          }, {
            key: "isInPresentationMode",
            get: function get() {
              return this.presentationModeState === _ui_utils.PresentationModeState.FULLSCREEN;
            }
          }, {
            key: "isChangingPresentationMode",
            get: function get() {
              return this.presentationModeState === _ui_utils.PresentationModeState.CHANGING;
            }
          }, {
            key: "isHorizontalScrollbarEnabled",
            get: function get() {
              return this.isInPresentationMode ? false : this.container.scrollWidth > this.container.clientWidth;
            }
          }, {
            key: "isVerticalScrollbarEnabled",
            get: function get() {
              return this.isInPresentationMode ? false : this.container.scrollHeight > this.container.clientHeight;
            }
          }, {
            key: "_getCurrentVisiblePage",
            value: function _getCurrentVisiblePage() {
              if (!this.pagesCount) {
                return {
                  views: []
                };
              }

              var pageView = this._pages[this._currentPageNumber - 1];
              var element = pageView.div;
              var view = {
                id: pageView.id,
                x: element.offsetLeft + element.clientLeft,
                y: element.offsetTop + element.clientTop,
                view: pageView
              };
              return {
                first: view,
                last: view,
                views: [view]
              };
            }
          }, {
            key: "_getVisiblePages",
            value: function _getVisiblePages() {
              return (0, _ui_utils.getVisibleElements)({
                scrollEl: this.container,
                views: this._pages,
                sortByVisibility: true,
                horizontal: this._isScrollModeHorizontal,
                rtl: this._isScrollModeHorizontal && this._isContainerRtl
              });
            }
          }, {
            key: "isPageVisible",
            value: function isPageVisible(pageNumber) {
              if (!this.pdfDocument) {
                return false;
              }

              if (!(Number.isInteger(pageNumber) && pageNumber > 0 && pageNumber <= this.pagesCount)) {
                console.error("isPageVisible: \"".concat(pageNumber, "\" is not a valid page."));
                return false;
              }

              return this._getVisiblePages().views.some(function (view) {
                return view.id === pageNumber;
              });
            }
          }, {
            key: "isPageCached",
            value: function isPageCached(pageNumber) {
              if (!this.pdfDocument || !this._buffer) {
                return false;
              }

              if (!(Number.isInteger(pageNumber) && pageNumber > 0 && pageNumber <= this.pagesCount)) {
                console.error("isPageCached: \"".concat(pageNumber, "\" is not a valid page."));
                return false;
              }

              var pageView = this._pages[pageNumber - 1];

              if (!pageView) {
                return false;
              }

              return this._buffer.has(pageView);
            }
          }, {
            key: "cleanup",
            value: function cleanup() {
              for (var i = 0, ii = this._pages.length; i < ii; i++) {
                if (this._pages[i] && this._pages[i].renderingState !== _pdf_rendering_queue.RenderingStates.FINISHED) {
                  this._pages[i].reset();
                }
              }
            }
          }, {
            key: "_cancelRendering",
            value: function _cancelRendering() {
              for (var i = 0, ii = this._pages.length; i < ii; i++) {
                if (this._pages[i]) {
                  this._pages[i].cancelRendering();
                }
              }
            }
          }, {
            key: "_ensurePdfPageLoaded",
            value: function _ensurePdfPageLoaded(pageView) {
              var _this3 = this;

              if (pageView.pdfPage) {
                return Promise.resolve(pageView.pdfPage);
              }

              if (this._pagesRequests.has(pageView)) {
                return this._pagesRequests.get(pageView);
              }

              var promise = this.pdfDocument.getPage(pageView.id).then(function (pdfPage) {
                if (!pageView.pdfPage) {
                  pageView.setPdfPage(pdfPage);
                }

                _this3._pagesRequests["delete"](pageView);

                return pdfPage;
              })["catch"](function (reason) {
                console.error("Unable to get page for page view", reason);

                _this3._pagesRequests["delete"](pageView);
              });

              this._pagesRequests.set(pageView, promise);

              return promise;
            }
          }, {
            key: "forceRendering",
            value: function forceRendering(currentlyVisiblePages) {
              var _this4 = this;

              var visiblePages = currentlyVisiblePages || this._getVisiblePages();

              var scrollAhead = this._isScrollModeHorizontal ? this.scroll.right : this.scroll.down;
              var preRenderExtra = this._scrollMode === _ui_utils.ScrollMode.VERTICAL && this._spreadMode !== _ui_utils.SpreadMode.NONE && !this.isInPresentationMode;
              var pageView = this.renderingQueue.getHighestPriority(visiblePages, this._pages, scrollAhead, preRenderExtra);

              if (pageView) {
                this._ensurePdfPageLoaded(pageView).then(function () {
                  _this4.renderingQueue.renderView(pageView);
                });

                return true;
              }

              return false;
            }
          }, {
            key: "createTextLayerBuilder",
            value: function createTextLayerBuilder(textLayerDiv, pageIndex, viewport) {
              var enhanceTextSelection = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
              var eventBus = arguments.length > 4 ? arguments[4] : undefined;
              var highlighter = arguments.length > 5 ? arguments[5] : undefined;
              return new _text_layer_builder.TextLayerBuilder({
                textLayerDiv: textLayerDiv,
                eventBus: eventBus,
                pageIndex: pageIndex,
                viewport: viewport,
                enhanceTextSelection: this.isInPresentationMode ? false : enhanceTextSelection,
                highlighter: highlighter
              });
            }
          }, {
            key: "createTextHighlighter",
            value: function createTextHighlighter(pageIndex, eventBus) {
              return new _text_highlighter.TextHighlighter({
                eventBus: eventBus,
                pageIndex: pageIndex,
                findController: this.isInPresentationMode ? null : this.findController
              });
            }
          }, {
            key: "createAnnotationLayerBuilder",
            value: function createAnnotationLayerBuilder(pageDiv, pdfPage) {
              var _this$pdfDocument, _this$pdfDocument2, _this$pdfDocument3, _this$_scriptingManag;

              var annotationStorage = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
              var imageResourcesPath = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "";
              var renderForms = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
              var l10n = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : _l10n_utils.NullL10n;
              var enableScripting = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : null;
              var hasJSActionsPromise = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : null;
              var mouseState = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : null;
              var fieldObjectsPromise = arguments.length > 9 && arguments[9] !== undefined ? arguments[9] : null;
              return new _annotation_layer_builder.AnnotationLayerBuilder({
                pageDiv: pageDiv,
                pdfPage: pdfPage,
                annotationStorage: annotationStorage || ((_this$pdfDocument = this.pdfDocument) === null || _this$pdfDocument === void 0 ? void 0 : _this$pdfDocument.annotationStorage),
                imageResourcesPath: imageResourcesPath,
                renderForms: renderForms,
                linkService: this.linkService,
                downloadManager: this.downloadManager,
                l10n: l10n,
                enableScripting: enableScripting !== null && enableScripting !== void 0 ? enableScripting : this.enableScripting,
                hasJSActionsPromise: hasJSActionsPromise || ((_this$pdfDocument2 = this.pdfDocument) === null || _this$pdfDocument2 === void 0 ? void 0 : _this$pdfDocument2.hasJSActions()),
                fieldObjectsPromise: fieldObjectsPromise || ((_this$pdfDocument3 = this.pdfDocument) === null || _this$pdfDocument3 === void 0 ? void 0 : _this$pdfDocument3.getFieldObjects()),
                mouseState: mouseState || ((_this$_scriptingManag = this._scriptingManager) === null || _this$_scriptingManag === void 0 ? void 0 : _this$_scriptingManag.mouseState)
              });
            }
          }, {
            key: "createXfaLayerBuilder",
            value: function createXfaLayerBuilder(pageDiv, pdfPage) {
              var _this$pdfDocument4;

              var annotationStorage = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
              return new _xfa_layer_builder.XfaLayerBuilder({
                pageDiv: pageDiv,
                pdfPage: pdfPage,
                annotationStorage: annotationStorage || ((_this$pdfDocument4 = this.pdfDocument) === null || _this$pdfDocument4 === void 0 ? void 0 : _this$pdfDocument4.annotationStorage),
                linkService: this.linkService
              });
            }
          }, {
            key: "createStructTreeLayerBuilder",
            value: function createStructTreeLayerBuilder(pdfPage) {
              return new _struct_tree_layer_builder.StructTreeLayerBuilder({
                pdfPage: pdfPage
              });
            }
          }, {
            key: "hasEqualPageSizes",
            get: function get() {
              var firstPageView = this._pages[0];

              for (var i = 1, ii = this._pages.length; i < ii; ++i) {
                var pageView = this._pages[i];

                if (pageView.width !== firstPageView.width || pageView.height !== firstPageView.height) {
                  return false;
                }
              }

              return true;
            }
          }, {
            key: "getPagesOverview",
            value: function getPagesOverview() {
              var _this5 = this;

              return this._pages.map(function (pageView) {
                var viewport = pageView.pdfPage.getViewport({
                  scale: 1
                });

                if (!_this5.enablePrintAutoRotate || (0, _ui_utils.isPortraitOrientation)(viewport)) {
                  return {
                    width: viewport.width,
                    height: viewport.height,
                    rotation: viewport.rotation
                  };
                }

                return {
                  width: viewport.height,
                  height: viewport.width,
                  rotation: (viewport.rotation - 90) % 360
                };
              });
            }
          }, {
            key: "optionalContentConfigPromise",
            get: function get() {
              if (!this.pdfDocument) {
                return Promise.resolve(null);
              }

              if (!this._optionalContentConfigPromise) {
                return this.pdfDocument.getOptionalContentConfig();
              }

              return this._optionalContentConfigPromise;
            },
            set: function set(promise) {
              if (!(promise instanceof Promise)) {
                throw new Error("Invalid optionalContentConfigPromise: ".concat(promise));
              }

              if (!this.pdfDocument) {
                return;
              }

              if (!this._optionalContentConfigPromise) {
                return;
              }

              this._optionalContentConfigPromise = promise;
              var updateArgs = {
                optionalContentConfigPromise: promise
              };

              var _iterator3 = _createForOfIteratorHelper(this._pages),
                  _step3;

              try {
                for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
                  var pageView = _step3.value;
                  pageView.update(updateArgs);
                }
              } catch (err) {
                _iterator3.e(err);
              } finally {
                _iterator3.f();
              }

              this.update();
              this.eventBus.dispatch("optionalcontentconfigchanged", {
                source: this,
                promise: promise
              });
            }
          }, {
            key: "scrollMode",
            get: function get() {
              return this._scrollMode;
            },
            set: function set(mode) {
              if (this._scrollMode === mode) {
                return;
              }

              if (!(0, _ui_utils.isValidScrollMode)(mode)) {
                throw new Error("Invalid scroll mode: ".concat(mode));
              }

              this._scrollMode = mode;
              this.eventBus.dispatch("scrollmodechanged", {
                source: this,
                mode: mode
              });

              this._updateScrollMode(this._currentPageNumber);
            }
          }, {
            key: "_updateScrollMode",
            value: function _updateScrollMode() {
              var pageNumber = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
              var scrollMode = this._scrollMode,
                  viewer = this.viewer;
              viewer.classList.toggle("scrollHorizontal", scrollMode === _ui_utils.ScrollMode.HORIZONTAL);
              viewer.classList.toggle("scrollWrapped", scrollMode === _ui_utils.ScrollMode.WRAPPED);

              if (!this.pdfDocument || !pageNumber) {
                return;
              }

              if (this._currentScaleValue && isNaN(this._currentScaleValue)) {
                this._setScale(this._currentScaleValue, true);
              }

              this._setCurrentPageNumber(pageNumber, true);

              this.update();
            }
          }, {
            key: "spreadMode",
            get: function get() {
              return this._spreadMode;
            },
            set: function set(mode) {
              if (this._spreadMode === mode) {
                return;
              }

              if (!(0, _ui_utils.isValidSpreadMode)(mode)) {
                throw new Error("Invalid spread mode: ".concat(mode));
              }

              this._spreadMode = mode;
              this.eventBus.dispatch("spreadmodechanged", {
                source: this,
                mode: mode
              });

              this._updateSpreadMode(this._currentPageNumber);
            }
          }, {
            key: "_updateSpreadMode",
            value: function _updateSpreadMode() {
              var pageNumber = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;

              if (!this.pdfDocument) {
                return;
              }

              var viewer = this.viewer,
                  pages = this._pages;
              viewer.textContent = "";

              if (this._spreadMode === _ui_utils.SpreadMode.NONE) {
                for (var i = 0, iMax = pages.length; i < iMax; ++i) {
                  viewer.appendChild(pages[i].div);
                }
              } else {
                var parity = this._spreadMode - 1;
                var spread = null;

                for (var _i = 0, _iMax = pages.length; _i < _iMax; ++_i) {
                  if (spread === null) {
                    spread = document.createElement("div");
                    spread.className = "spread";
                    viewer.appendChild(spread);
                  } else if (_i % 2 === parity) {
                    spread = spread.cloneNode(false);
                    viewer.appendChild(spread);
                  }

                  spread.appendChild(pages[_i].div);
                }
              }

              if (!pageNumber) {
                return;
              }

              if (this._currentScaleValue && isNaN(this._currentScaleValue)) {
                this._setScale(this._currentScaleValue, true);
              }

              this._setCurrentPageNumber(pageNumber, true);

              this.update();
            }
          }, {
            key: "_getPageAdvance",
            value: function _getPageAdvance(currentPageNumber) {
              var previous = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;

              if (this.isInPresentationMode) {
                return 1;
              }

              switch (this._scrollMode) {
                case _ui_utils.ScrollMode.WRAPPED:
                  {
                    var _this$_getVisiblePage = this._getVisiblePages(),
                        views = _this$_getVisiblePage.views,
                        pageLayout = new Map();

                    var _iterator4 = _createForOfIteratorHelper(views),
                        _step4;

                    try {
                      for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
                        var _step4$value = _step4.value,
                            id = _step4$value.id,
                            y = _step4$value.y,
                            percent = _step4$value.percent,
                            widthPercent = _step4$value.widthPercent;

                        if (percent === 0 || widthPercent < 100) {
                          continue;
                        }

                        var yArray = pageLayout.get(y);

                        if (!yArray) {
                          pageLayout.set(y, yArray || (yArray = []));
                        }

                        yArray.push(id);
                      }
                    } catch (err) {
                      _iterator4.e(err);
                    } finally {
                      _iterator4.f();
                    }

                    var _iterator5 = _createForOfIteratorHelper(pageLayout.values()),
                        _step5;

                    try {
                      for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
                        var _yArray = _step5.value;

                        var currentIndex = _yArray.indexOf(currentPageNumber);

                        if (currentIndex === -1) {
                          continue;
                        }

                        var numPages = _yArray.length;

                        if (numPages === 1) {
                          break;
                        }

                        if (previous) {
                          for (var i = currentIndex - 1, ii = 0; i >= ii; i--) {
                            var currentId = _yArray[i],
                                expectedId = _yArray[i + 1] - 1;

                            if (currentId < expectedId) {
                              return currentPageNumber - expectedId;
                            }
                          }
                        } else {
                          for (var _i2 = currentIndex + 1, _ii = numPages; _i2 < _ii; _i2++) {
                            var _currentId = _yArray[_i2],
                                _expectedId = _yArray[_i2 - 1] + 1;

                            if (_currentId > _expectedId) {
                              return _expectedId - currentPageNumber;
                            }
                          }
                        }

                        if (previous) {
                          var firstId = _yArray[0];

                          if (firstId < currentPageNumber) {
                            return currentPageNumber - firstId + 1;
                          }
                        } else {
                          var lastId = _yArray[numPages - 1];

                          if (lastId > currentPageNumber) {
                            return lastId - currentPageNumber + 1;
                          }
                        }

                        break;
                      }
                    } catch (err) {
                      _iterator5.e(err);
                    } finally {
                      _iterator5.f();
                    }

                    break;
                  }

                case _ui_utils.ScrollMode.HORIZONTAL:
                  {
                    break;
                  }

                case _ui_utils.ScrollMode.VERTICAL:
                  {
                    if (this._spreadMode === _ui_utils.SpreadMode.NONE) {
                      break;
                    }

                    var parity = this._spreadMode - 1;

                    if (previous && currentPageNumber % 2 !== parity) {
                      break;
                    } else if (!previous && currentPageNumber % 2 === parity) {
                      break;
                    }

                    var _this$_getVisiblePage2 = this._getVisiblePages(),
                        _views = _this$_getVisiblePage2.views,
                        _expectedId2 = previous ? currentPageNumber - 1 : currentPageNumber + 1;

                    var _iterator6 = _createForOfIteratorHelper(_views),
                        _step6;

                    try {
                      for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
                        var _step6$value = _step6.value,
                            _id = _step6$value.id,
                            _percent = _step6$value.percent,
                            _widthPercent = _step6$value.widthPercent;

                        if (_id !== _expectedId2) {
                          continue;
                        }

                        if (_percent > 0 && _widthPercent === 100) {
                          return 2;
                        }

                        break;
                      }
                    } catch (err) {
                      _iterator6.e(err);
                    } finally {
                      _iterator6.f();
                    }

                    break;
                  }
              }

              return 1;
            }
          }, {
            key: "nextPage",
            value: function nextPage() {
              var currentPageNumber = this._currentPageNumber,
                  pagesCount = this.pagesCount;

              if (currentPageNumber >= pagesCount) {
                return false;
              }

              var advance = this._getPageAdvance(currentPageNumber, false) || 1;
              this.currentPageNumber = Math.min(currentPageNumber + advance, pagesCount);
              return true;
            }
          }, {
            key: "previousPage",
            value: function previousPage() {
              var currentPageNumber = this._currentPageNumber;

              if (currentPageNumber <= 1) {
                return false;
              }

              var advance = this._getPageAdvance(currentPageNumber, true) || 1;
              this.currentPageNumber = Math.max(currentPageNumber - advance, 1);
              return true;
            }
          }, {
            key: "increaseScale",
            value: function increaseScale() {
              var steps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
              var newScale = this._currentScale;

              do {
                newScale = (newScale * _ui_utils.DEFAULT_SCALE_DELTA).toFixed(2);
                newScale = Math.ceil(newScale * 10) / 10;
                newScale = Math.min(_ui_utils.MAX_SCALE, newScale);
              } while (--steps > 0 && newScale < _ui_utils.MAX_SCALE);

              this.currentScaleValue = newScale;
            }
          }, {
            key: "decreaseScale",
            value: function decreaseScale() {
              var steps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
              var newScale = this._currentScale;

              do {
                newScale = (newScale / _ui_utils.DEFAULT_SCALE_DELTA).toFixed(2);
                newScale = Math.floor(newScale * 10) / 10;
                newScale = Math.max(_ui_utils.MIN_SCALE, newScale);
              } while (--steps > 0 && newScale > _ui_utils.MIN_SCALE);

              this.currentScaleValue = newScale;
            }
          }]);

          return BaseViewer;
        }();

        exports.BaseViewer = BaseViewer;
        /***/
      },
      /* 24 */

      /***/
      function (__unused_webpack_module, exports) {
        Object.defineProperty(exports, "__esModule", {
          value: true
        });
        exports.TextHighlighter = void 0;

        function _classCallCheck(instance, Constructor) {
          if (!(instance instanceof Constructor)) {
            throw new TypeError("Cannot call a class as a function");
          }
        }

        function _defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];
            descriptor.enumerable = descriptor.enumerable || false;
            descriptor.configurable = true;
            if ("value" in descriptor) descriptor.writable = true;
            Object.defineProperty(target, descriptor.key, descriptor);
          }
        }

        function _createClass(Constructor, protoProps, staticProps) {
          if (protoProps) _defineProperties(Constructor.prototype, protoProps);
          if (staticProps) _defineProperties(Constructor, staticProps);
          return Constructor;
        }

        var TextHighlighter = /*#__PURE__*/function () {
          function TextHighlighter(_ref) {
            var findController = _ref.findController,
                eventBus = _ref.eventBus,
                pageIndex = _ref.pageIndex;

            _classCallCheck(this, TextHighlighter);

            this.findController = findController;
            this.matches = [];
            this.eventBus = eventBus;
            this.pageIdx = pageIndex;
            this._onUpdateTextLayerMatches = null;
            this.textDivs = null;
            this.textContentItemsStr = null;
            this.enabled = false;
          }

          _createClass(TextHighlighter, [{
            key: "setTextMapping",
            value: function setTextMapping(divs, texts) {
              this.textDivs = divs;
              this.textContentItemsStr = texts;
            }
          }, {
            key: "enable",
            value: function enable() {
              var _this = this;

              if (!this.textDivs || !this.textContentItemsStr) {
                throw new Error("Text divs and strings have not been set.");
              }

              if (this.enabled) {
                throw new Error("TextHighlighter is already enabled.");
              }

              this.enabled = true;

              if (!this._onUpdateTextLayerMatches) {
                this._onUpdateTextLayerMatches = function (evt) {
                  if (evt.pageIndex === _this.pageIdx || evt.pageIndex === -1) {
                    _this._updateMatches();
                  }
                };

                this.eventBus._on("updatetextlayermatches", this._onUpdateTextLayerMatches);
              }

              this._updateMatches();
            }
          }, {
            key: "disable",
            value: function disable() {
              if (!this.enabled) {
                return;
              }

              this.enabled = false;

              if (this._onUpdateTextLayerMatches) {
                this.eventBus._off("updatetextlayermatches", this._onUpdateTextLayerMatches);

                this._onUpdateTextLayerMatches = null;
              }
            }
          }, {
            key: "_convertMatches",
            value: function _convertMatches(matches, matchesLength) {
              if (!matches) {
                return [];
              }

              var textContentItemsStr = this.textContentItemsStr;
              var i = 0,
                  iIndex = 0;
              var end = textContentItemsStr.length - 1;
              var result = [];

              for (var m = 0, mm = matches.length; m < mm; m++) {
                var matchIdx = matches[m];

                while (i !== end && matchIdx >= iIndex + textContentItemsStr[i].length) {
                  iIndex += textContentItemsStr[i].length;
                  i++;
                }

                if (i === textContentItemsStr.length) {
                  console.error("Could not find a matching mapping");
                }

                var match = {
                  begin: {
                    divIdx: i,
                    offset: matchIdx - iIndex
                  }
                };
                matchIdx += matchesLength[m];

                while (i !== end && matchIdx > iIndex + textContentItemsStr[i].length) {
                  iIndex += textContentItemsStr[i].length;
                  i++;
                }

                match.end = {
                  divIdx: i,
                  offset: matchIdx - iIndex
                };
                result.push(match);
              }

              return result;
            }
          }, {
            key: "_renderMatches",
            value: function _renderMatches(matches) {
              if (matches.length === 0) {
                return;
              }

              var findController = this.findController,
                  pageIdx = this.pageIdx;
              var textContentItemsStr = this.textContentItemsStr,
                  textDivs = this.textDivs;
              var isSelectedPage = pageIdx === findController.selected.pageIdx;
              var selectedMatchIdx = findController.selected.matchIdx;
              var highlightAll = findController.state.highlightAll;
              var prevEnd = null;
              var infinity = {
                divIdx: -1,
                offset: undefined
              };

              function beginText(begin, className) {
                var divIdx = begin.divIdx;
                textDivs[divIdx].textContent = "";
                return appendTextToDiv(divIdx, 0, begin.offset, className);
              }

              function appendTextToDiv(divIdx, fromOffset, toOffset, className) {
                var div = textDivs[divIdx];

                if (div.nodeType === Node.TEXT_NODE) {
                  var span = document.createElement("span");
                  div.parentNode.insertBefore(span, div);
                  span.appendChild(div);
                  textDivs[divIdx] = span;
                  div = span;
                }

                var content = textContentItemsStr[divIdx].substring(fromOffset, toOffset);
                var node = document.createTextNode(content);

                if (className) {
                  var _span = document.createElement("span");

                  _span.className = "".concat(className, " appended");

                  _span.appendChild(node);

                  div.appendChild(_span);
                  return className.includes("selected") ? _span.offsetLeft : 0;
                }

                div.appendChild(node);
                return 0;
              }

              var i0 = selectedMatchIdx,
                  i1 = i0 + 1;

              if (highlightAll) {
                i0 = 0;
                i1 = matches.length;
              } else if (!isSelectedPage) {
                return;
              }

              for (var i = i0; i < i1; i++) {
                var match = matches[i];
                var begin = match.begin;
                var end = match.end;
                var isSelected = isSelectedPage && i === selectedMatchIdx;
                var highlightSuffix = isSelected ? " selected" : "";
                var selectedLeft = 0;

                if (!prevEnd || begin.divIdx !== prevEnd.divIdx) {
                  if (prevEnd !== null) {
                    appendTextToDiv(prevEnd.divIdx, prevEnd.offset, infinity.offset);
                  }

                  beginText(begin);
                } else {
                  appendTextToDiv(prevEnd.divIdx, prevEnd.offset, begin.offset);
                }

                if (begin.divIdx === end.divIdx) {
                  selectedLeft = appendTextToDiv(begin.divIdx, begin.offset, end.offset, "highlight" + highlightSuffix);
                } else {
                  selectedLeft = appendTextToDiv(begin.divIdx, begin.offset, infinity.offset, "highlight begin" + highlightSuffix);

                  for (var n0 = begin.divIdx + 1, n1 = end.divIdx; n0 < n1; n0++) {
                    textDivs[n0].className = "highlight middle" + highlightSuffix;
                  }

                  beginText(end, "highlight end" + highlightSuffix);
                }

                prevEnd = end;

                if (isSelected) {
                  findController.scrollMatchIntoView({
                    element: textDivs[begin.divIdx],
                    selectedLeft: selectedLeft,
                    pageIndex: pageIdx,
                    matchIndex: selectedMatchIdx
                  });
                }
              }

              if (prevEnd) {
                appendTextToDiv(prevEnd.divIdx, prevEnd.offset, infinity.offset);
              }
            }
          }, {
            key: "_updateMatches",
            value: function _updateMatches() {
              if (!this.enabled) {
                return;
              }

              var findController = this.findController,
                  matches = this.matches,
                  pageIdx = this.pageIdx;
              var textContentItemsStr = this.textContentItemsStr,
                  textDivs = this.textDivs;
              var clearedUntilDivIdx = -1;

              for (var i = 0, ii = matches.length; i < ii; i++) {
                var match = matches[i];
                var begin = Math.max(clearedUntilDivIdx, match.begin.divIdx);

                for (var n = begin, end = match.end.divIdx; n <= end; n++) {
                  var div = textDivs[n];
                  div.textContent = textContentItemsStr[n];
                  div.className = "";
                }

                clearedUntilDivIdx = match.end.divIdx + 1;
              }

              if (!(findController !== null && findController !== void 0 && findController.highlightMatches)) {
                return;
              }

              var pageMatches = findController.pageMatches[pageIdx] || null;
              var pageMatchesLength = findController.pageMatchesLength[pageIdx] || null;
              this.matches = this._convertMatches(pageMatches, pageMatchesLength);

              this._renderMatches(this.matches);
            }
          }]);

          return TextHighlighter;
        }();

        exports.TextHighlighter = TextHighlighter;
        /***/
      },
      /* 25 */

      /***/
      function (__unused_webpack_module, exports, __w_pdfjs_require__) {
        function _typeof(obj) {
          "@babel/helpers - typeof";

          if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
            _typeof = function _typeof(obj) {
              return typeof obj;
            };
          } else {
            _typeof = function _typeof(obj) {
              return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
            };
          }

          return _typeof(obj);
        }

        Object.defineProperty(exports, "__esModule", {
          value: true
        });
        exports.PDFViewer = void 0;

        var _ui_utils = __w_pdfjs_require__(7);

        var _base_viewer = __w_pdfjs_require__(23);

        var _pdfjsLib = __w_pdfjs_require__(4);

        function _createForOfIteratorHelper(o, allowArrayLike) {
          var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];

          if (!it) {
            if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
              if (it) o = it;
              var i = 0;

              var F = function F() {};

              return {
                s: F,
                n: function n() {
                  if (i >= o.length) return {
                    done: true
                  };
                  return {
                    done: false,
                    value: o[i++]
                  };
                },
                e: function e(_e) {
                  throw _e;
                },
                f: F
              };
            }

            throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
          }

          var normalCompletion = true,
              didErr = false,
              err;
          return {
            s: function s() {
              it = it.call(o);
            },
            n: function n() {
              var step = it.next();
              normalCompletion = step.done;
              return step;
            },
            e: function e(_e2) {
              didErr = true;
              err = _e2;
            },
            f: function f() {
              try {
                if (!normalCompletion && it["return"] != null) it["return"]();
              } finally {
                if (didErr) throw err;
              }
            }
          };
        }

        function _unsupportedIterableToArray(o, minLen) {
          if (!o) return;
          if (typeof o === "string") return _arrayLikeToArray(o, minLen);
          var n = Object.prototype.toString.call(o).slice(8, -1);
          if (n === "Object" && o.constructor) n = o.constructor.name;
          if (n === "Map" || n === "Set") return Array.from(o);
          if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
        }

        function _arrayLikeToArray(arr, len) {
          if (len == null || len > arr.length) len = arr.length;

          for (var i = 0, arr2 = new Array(len); i < len; i++) {
            arr2[i] = arr[i];
          }

          return arr2;
        }

        function _classCallCheck(instance, Constructor) {
          if (!(instance instanceof Constructor)) {
            throw new TypeError("Cannot call a class as a function");
          }
        }

        function _defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];
            descriptor.enumerable = descriptor.enumerable || false;
            descriptor.configurable = true;
            if ("value" in descriptor) descriptor.writable = true;
            Object.defineProperty(target, descriptor.key, descriptor);
          }
        }

        function _createClass(Constructor, protoProps, staticProps) {
          if (protoProps) _defineProperties(Constructor.prototype, protoProps);
          if (staticProps) _defineProperties(Constructor, staticProps);
          return Constructor;
        }

        function _get(target, property, receiver) {
          if (typeof Reflect !== "undefined" && Reflect.get) {
            _get = Reflect.get;
          } else {
            _get = function _get(target, property, receiver) {
              var base = _superPropBase(target, property);

              if (!base) return;
              var desc = Object.getOwnPropertyDescriptor(base, property);

              if (desc.get) {
                return desc.get.call(receiver);
              }

              return desc.value;
            };
          }

          return _get(target, property, receiver || target);
        }

        function _superPropBase(object, property) {
          while (!Object.prototype.hasOwnProperty.call(object, property)) {
            object = _getPrototypeOf(object);
            if (object === null) break;
          }

          return object;
        }

        function _inherits(subClass, superClass) {
          if (typeof superClass !== "function" && superClass !== null) {
            throw new TypeError("Super expression must either be null or a function");
          }

          subClass.prototype = Object.create(superClass && superClass.prototype, {
            constructor: {
              value: subClass,
              writable: true,
              configurable: true
            }
          });
          if (superClass) _setPrototypeOf(subClass, superClass);
        }

        function _setPrototypeOf(o, p) {
          _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
            o.__proto__ = p;
            return o;
          };

          return _setPrototypeOf(o, p);
        }

        function _createSuper(Derived) {
          var hasNativeReflectConstruct = _isNativeReflectConstruct();

          return function _createSuperInternal() {
            var Super = _getPrototypeOf(Derived),
                result;

            if (hasNativeReflectConstruct) {
              var NewTarget = _getPrototypeOf(this).constructor;

              result = Reflect.construct(Super, arguments, NewTarget);
            } else {
              result = Super.apply(this, arguments);
            }

            return _possibleConstructorReturn(this, result);
          };
        }

        function _possibleConstructorReturn(self, call) {
          if (call && (_typeof(call) === "object" || typeof call === "function")) {
            return call;
          } else if (call !== void 0) {
            throw new TypeError("Derived constructors may only return object or undefined");
          }

          return _assertThisInitialized(self);
        }

        function _assertThisInitialized(self) {
          if (self === void 0) {
            throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
          }

          return self;
        }

        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 (e) {
            return false;
          }
        }

        function _getPrototypeOf(o) {
          _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
            return o.__proto__ || Object.getPrototypeOf(o);
          };
          return _getPrototypeOf(o);
        }

        var PDFViewer = /*#__PURE__*/function (_BaseViewer) {
          _inherits(PDFViewer, _BaseViewer);

          var _super = _createSuper(PDFViewer);

          function PDFViewer() {
            _classCallCheck(this, PDFViewer);

            return _super.apply(this, arguments);
          }

          _createClass(PDFViewer, [{
            key: "_viewerElement",
            get: function get() {
              return (0, _pdfjsLib.shadow)(this, "_viewerElement", this.viewer);
            }
          }, {
            key: "_scrollIntoView",
            value: function _scrollIntoView(_ref) {
              var pageDiv = _ref.pageDiv,
                  _ref$pageSpot = _ref.pageSpot,
                  pageSpot = _ref$pageSpot === void 0 ? null : _ref$pageSpot,
                  _ref$pageNumber = _ref.pageNumber,
                  pageNumber = _ref$pageNumber === void 0 ? null : _ref$pageNumber;

              if (!pageSpot && !this.isInPresentationMode) {
                var left = pageDiv.offsetLeft + pageDiv.clientLeft;
                var right = left + pageDiv.clientWidth;
                var _this$container = this.container,
                    scrollLeft = _this$container.scrollLeft,
                    clientWidth = _this$container.clientWidth;

                if (this._isScrollModeHorizontal || left < scrollLeft || right > scrollLeft + clientWidth) {
                  pageSpot = {
                    left: 0,
                    top: 0
                  };
                }
              }

              _get(_getPrototypeOf(PDFViewer.prototype), "_scrollIntoView", this).call(this, {
                pageDiv: pageDiv,
                pageSpot: pageSpot,
                pageNumber: pageNumber
              });
            }
          }, {
            key: "_getVisiblePages",
            value: function _getVisiblePages() {
              if (this.isInPresentationMode) {
                return this._getCurrentVisiblePage();
              }

              return _get(_getPrototypeOf(PDFViewer.prototype), "_getVisiblePages", this).call(this);
            }
          }, {
            key: "_updateHelper",
            value: function _updateHelper(visiblePages) {
              if (this.isInPresentationMode) {
                return;
              }

              var currentId = this._currentPageNumber;
              var stillFullyVisible = false;

              var _iterator = _createForOfIteratorHelper(visiblePages),
                  _step;

              try {
                for (_iterator.s(); !(_step = _iterator.n()).done;) {
                  var page = _step.value;

                  if (page.percent < 100) {
                    break;
                  }

                  if (page.id === currentId && this._scrollMode === _ui_utils.ScrollMode.VERTICAL && this._spreadMode === _ui_utils.SpreadMode.NONE) {
                    stillFullyVisible = true;
                    break;
                  }
                }
              } catch (err) {
                _iterator.e(err);
              } finally {
                _iterator.f();
              }

              if (!stillFullyVisible) {
                currentId = visiblePages[0].id;
              }

              this._setCurrentPageNumber(currentId);
            }
          }]);

          return PDFViewer;
        }(_base_viewer.BaseViewer);

        exports.PDFViewer = PDFViewer;
        /***/
      }
      /******/
      ];
      /************************************************************************/

      /******/
      // The module cache

      /******/

      var __webpack_module_cache__ = {};
      /******/

      /******/
      // The require function

      /******/

      function __w_pdfjs_require__(moduleId) {
        /******/
        // Check if module is in cache

        /******/
        var cachedModule = __webpack_module_cache__[moduleId];
        /******/

        if (cachedModule !== undefined) {
          /******/
          return cachedModule.exports;
          /******/
        }
        /******/
        // Create a new module (and put it into the cache)

        /******/


        var module = __webpack_module_cache__[moduleId] = {
          /******/
          id: moduleId,

          /******/
          loaded: false,

          /******/
          exports: {}
          /******/

        };
        /******/

        /******/
        // Execute the module function

        /******/

        __webpack_modules__[moduleId](module, module.exports, __w_pdfjs_require__);
        /******/

        /******/
        // Flag the module as loaded

        /******/


        module.loaded = true;
        /******/

        /******/
        // Return the exports of the module

        /******/

        return module.exports;
        /******/
      }
      /******/

      /************************************************************************/

      /******/

      /* webpack/runtime/node module decorator */

      /******/


      (function () {
        /******/
        __w_pdfjs_require__.nmd = function (module) {
          /******/
          module.paths = [];
          /******/

          if (!module.children) module.children = [];
          /******/

          return module;
          /******/
        };
        /******/

      })();
      /******/

      /************************************************************************/


      var __webpack_exports__ = {}; // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.

      (function () {
        var exports = __webpack_exports__;
        Object.defineProperty(exports, "__esModule", {
          value: true
        });
        Object.defineProperty(exports, "AnnotationLayerBuilder", {
          enumerable: true,
          get: function get() {
            return _annotation_layer_builder.AnnotationLayerBuilder;
          }
        });
        Object.defineProperty(exports, "DefaultAnnotationLayerFactory", {
          enumerable: true,
          get: function get() {
            return _annotation_layer_builder.DefaultAnnotationLayerFactory;
          }
        });
        Object.defineProperty(exports, "DefaultStructTreeLayerFactory", {
          enumerable: true,
          get: function get() {
            return _struct_tree_layer_builder.DefaultStructTreeLayerFactory;
          }
        });
        Object.defineProperty(exports, "StructTreeLayerBuilder", {
          enumerable: true,
          get: function get() {
            return _struct_tree_layer_builder.StructTreeLayerBuilder;
          }
        });
        Object.defineProperty(exports, "DefaultTextLayerFactory", {
          enumerable: true,
          get: function get() {
            return _text_layer_builder.DefaultTextLayerFactory;
          }
        });
        Object.defineProperty(exports, "TextLayerBuilder", {
          enumerable: true,
          get: function get() {
            return _text_layer_builder.TextLayerBuilder;
          }
        });
        Object.defineProperty(exports, "DefaultXfaLayerFactory", {
          enumerable: true,
          get: function get() {
            return _xfa_layer_builder.DefaultXfaLayerFactory;
          }
        });
        Object.defineProperty(exports, "XfaLayerBuilder", {
          enumerable: true,
          get: function get() {
            return _xfa_layer_builder.XfaLayerBuilder;
          }
        });
        Object.defineProperty(exports, "EventBus", {
          enumerable: true,
          get: function get() {
            return _ui_utils.EventBus;
          }
        });
        Object.defineProperty(exports, "ProgressBar", {
          enumerable: true,
          get: function get() {
            return _ui_utils.ProgressBar;
          }
        });
        Object.defineProperty(exports, "PDFLinkService", {
          enumerable: true,
          get: function get() {
            return _pdf_link_service.PDFLinkService;
          }
        });
        Object.defineProperty(exports, "SimpleLinkService", {
          enumerable: true,
          get: function get() {
            return _pdf_link_service.SimpleLinkService;
          }
        });
        Object.defineProperty(exports, "DownloadManager", {
          enumerable: true,
          get: function get() {
            return _download_manager.DownloadManager;
          }
        });
        Object.defineProperty(exports, "GenericL10n", {
          enumerable: true,
          get: function get() {
            return _genericl10n.GenericL10n;
          }
        });
        Object.defineProperty(exports, "NullL10n", {
          enumerable: true,
          get: function get() {
            return _l10n_utils.NullL10n;
          }
        });
        Object.defineProperty(exports, "PDFFindController", {
          enumerable: true,
          get: function get() {
            return _pdf_find_controller.PDFFindController;
          }
        });
        Object.defineProperty(exports, "PDFHistory", {
          enumerable: true,
          get: function get() {
            return _pdf_history.PDFHistory;
          }
        });
        Object.defineProperty(exports, "PDFPageView", {
          enumerable: true,
          get: function get() {
            return _pdf_page_view.PDFPageView;
          }
        });
        Object.defineProperty(exports, "PDFScriptingManager", {
          enumerable: true,
          get: function get() {
            return _pdf_scripting_manager.PDFScriptingManager;
          }
        });
        Object.defineProperty(exports, "PDFSinglePageViewer", {
          enumerable: true,
          get: function get() {
            return _pdf_single_page_viewer.PDFSinglePageViewer;
          }
        });
        Object.defineProperty(exports, "PDFViewer", {
          enumerable: true,
          get: function get() {
            return _pdf_viewer.PDFViewer;
          }
        });

        var _annotation_layer_builder = __w_pdfjs_require__(1);

        var _struct_tree_layer_builder = __w_pdfjs_require__(8);

        var _text_layer_builder = __w_pdfjs_require__(9);

        var _xfa_layer_builder = __w_pdfjs_require__(10);

        var _ui_utils = __w_pdfjs_require__(7);

        var _pdf_link_service = __w_pdfjs_require__(6);

        var _download_manager = __w_pdfjs_require__(11);

        var _genericl10n = __w_pdfjs_require__(13);

        var _l10n_utils = __w_pdfjs_require__(5);

        var _pdf_find_controller = __w_pdfjs_require__(15);

        var _pdf_history = __w_pdfjs_require__(17);

        var _pdf_page_view = __w_pdfjs_require__(18);

        var _pdf_scripting_manager = __w_pdfjs_require__(20);

        var _pdf_single_page_viewer = __w_pdfjs_require__(22);

        var _pdf_viewer = __w_pdfjs_require__(25);

        var pdfjsVersion = '2.11.338';
        var pdfjsBuild = 'dedff3c98';
      })();
      /******/


      return __webpack_exports__;
      /******/
    }()
  );
});

/***/ }),

/***/ 888:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";
/**
 * Copyright (c) 2013-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */


var ReactPropTypesSecret = __webpack_require__(47);

function emptyFunction() {}

function emptyFunctionWithReset() {}

emptyFunctionWithReset.resetWarningCache = emptyFunction;

module.exports = function () {
  function shim(props, propName, componentName, location, propFullName, secret) {
    if (secret === ReactPropTypesSecret) {
      // It is still safe when called from React.
      return;
    }

    var err = new Error('Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use PropTypes.checkPropTypes() to call them. ' + 'Read more at http://fb.me/use-check-prop-types');
    err.name = 'Invariant Violation';
    throw err;
  }

  ;
  shim.isRequired = shim;

  function getShim() {
    return shim;
  }

  ; // Important!
  // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.

  var ReactPropTypes = {
    array: shim,
    bigint: shim,
    bool: shim,
    func: shim,
    number: shim,
    object: shim,
    string: shim,
    symbol: shim,
    any: shim,
    arrayOf: getShim,
    element: shim,
    elementType: shim,
    instanceOf: getShim,
    node: shim,
    objectOf: getShim,
    oneOf: getShim,
    oneOfType: getShim,
    shape: getShim,
    exact: getShim,
    checkPropTypes: emptyFunctionWithReset,
    resetWarningCache: emptyFunction
  };
  ReactPropTypes.PropTypes = ReactPropTypes;
  return ReactPropTypes;
};

/***/ }),

/***/ 7:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

/**
 * Copyright (c) 2013-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
if (false) { var throwOnDirectAccess, ReactIs; } else {
  // By explicitly using `prop-types` you are opting into new production behavior.
  // http://fb.me/prop-types-in-prod
  module.exports = __webpack_require__(888)();
}

/***/ }),

/***/ 47:
/***/ (function(module) {

"use strict";
/**
 * Copyright (c) 2013-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */


var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
module.exports = ReactPropTypesSecret;

/***/ }),

/***/ 463:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";
/** @license React v16.14.0
 * react-dom.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

/*
 Modernizr 3.0.0pre (Custom Build) | MIT
*/


var aa = __webpack_require__(791),
    n = __webpack_require__(725),
    r = __webpack_require__(296);

function u(a) {
  for (var b = "https://reactjs.org/docs/error-decoder.html?invariant=" + a, c = 1; c < arguments.length; c++) {
    b += "&args[]=" + encodeURIComponent(arguments[c]);
  }

  return "Minified React error #" + a + "; visit " + b + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";
}

if (!aa) throw Error(u(227));

function ba(a, b, c, d, e, f, g, h, k) {
  var l = Array.prototype.slice.call(arguments, 3);

  try {
    b.apply(c, l);
  } catch (m) {
    this.onError(m);
  }
}

var da = !1,
    ea = null,
    fa = !1,
    ha = null,
    ia = {
  onError: function onError(a) {
    da = !0;
    ea = a;
  }
};

function ja(a, b, c, d, e, f, g, h, k) {
  da = !1;
  ea = null;
  ba.apply(ia, arguments);
}

function ka(a, b, c, d, e, f, g, h, k) {
  ja.apply(this, arguments);

  if (da) {
    if (da) {
      var l = ea;
      da = !1;
      ea = null;
    } else throw Error(u(198));

    fa || (fa = !0, ha = l);
  }
}

var la = null,
    ma = null,
    na = null;

function oa(a, b, c) {
  var d = a.type || "unknown-event";
  a.currentTarget = na(c);
  ka(d, b, void 0, a);
  a.currentTarget = null;
}

var pa = null,
    qa = {};

function ra() {
  if (pa) for (var a in qa) {
    var b = qa[a],
        c = pa.indexOf(a);
    if (!(-1 < c)) throw Error(u(96, a));

    if (!sa[c]) {
      if (!b.extractEvents) throw Error(u(97, a));
      sa[c] = b;
      c = b.eventTypes;

      for (var d in c) {
        var e = void 0;
        var f = c[d],
            g = b,
            h = d;
        if (ta.hasOwnProperty(h)) throw Error(u(99, h));
        ta[h] = f;
        var k = f.phasedRegistrationNames;

        if (k) {
          for (e in k) {
            k.hasOwnProperty(e) && ua(k[e], g, h);
          }

          e = !0;
        } else f.registrationName ? (ua(f.registrationName, g, h), e = !0) : e = !1;

        if (!e) throw Error(u(98, d, a));
      }
    }
  }
}

function ua(a, b, c) {
  if (va[a]) throw Error(u(100, a));
  va[a] = b;
  wa[a] = b.eventTypes[c].dependencies;
}

var sa = [],
    ta = {},
    va = {},
    wa = {};

function xa(a) {
  var b = !1,
      c;

  for (c in a) {
    if (a.hasOwnProperty(c)) {
      var d = a[c];

      if (!qa.hasOwnProperty(c) || qa[c] !== d) {
        if (qa[c]) throw Error(u(102, c));
        qa[c] = d;
        b = !0;
      }
    }
  }

  b && ra();
}

var ya = !("undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement),
    za = null,
    Aa = null,
    Ba = null;

function Ca(a) {
  if (a = ma(a)) {
    if ("function" !== typeof za) throw Error(u(280));
    var b = a.stateNode;
    b && (b = la(b), za(a.stateNode, a.type, b));
  }
}

function Da(a) {
  Aa ? Ba ? Ba.push(a) : Ba = [a] : Aa = a;
}

function Ea() {
  if (Aa) {
    var a = Aa,
        b = Ba;
    Ba = Aa = null;
    Ca(a);
    if (b) for (a = 0; a < b.length; a++) {
      Ca(b[a]);
    }
  }
}

function Fa(a, b) {
  return a(b);
}

function Ga(a, b, c, d, e) {
  return a(b, c, d, e);
}

function Ha() {}

var Ia = Fa,
    Ja = !1,
    Ka = !1;

function La() {
  if (null !== Aa || null !== Ba) Ha(), Ea();
}

function Ma(a, b, c) {
  if (Ka) return a(b, c);
  Ka = !0;

  try {
    return Ia(a, b, c);
  } finally {
    Ka = !1, La();
  }
}

var Na = /^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,
    Oa = Object.prototype.hasOwnProperty,
    Pa = {},
    Qa = {};

function Ra(a) {
  if (Oa.call(Qa, a)) return !0;
  if (Oa.call(Pa, a)) return !1;
  if (Na.test(a)) return Qa[a] = !0;
  Pa[a] = !0;
  return !1;
}

function Sa(a, b, c, d) {
  if (null !== c && 0 === c.type) return !1;

  switch (typeof b) {
    case "function":
    case "symbol":
      return !0;

    case "boolean":
      if (d) return !1;
      if (null !== c) return !c.acceptsBooleans;
      a = a.toLowerCase().slice(0, 5);
      return "data-" !== a && "aria-" !== a;

    default:
      return !1;
  }
}

function Ta(a, b, c, d) {
  if (null === b || "undefined" === typeof b || Sa(a, b, c, d)) return !0;
  if (d) return !1;
  if (null !== c) switch (c.type) {
    case 3:
      return !b;

    case 4:
      return !1 === b;

    case 5:
      return isNaN(b);

    case 6:
      return isNaN(b) || 1 > b;
  }
  return !1;
}

function v(a, b, c, d, e, f) {
  this.acceptsBooleans = 2 === b || 3 === b || 4 === b;
  this.attributeName = d;
  this.attributeNamespace = e;
  this.mustUseProperty = c;
  this.propertyName = a;
  this.type = b;
  this.sanitizeURL = f;
}

var C = {};
"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function (a) {
  C[a] = new v(a, 0, !1, a, null, !1);
});
[["acceptCharset", "accept-charset"], ["className", "class"], ["htmlFor", "for"], ["httpEquiv", "http-equiv"]].forEach(function (a) {
  var b = a[0];
  C[b] = new v(b, 1, !1, a[1], null, !1);
});
["contentEditable", "draggable", "spellCheck", "value"].forEach(function (a) {
  C[a] = new v(a, 2, !1, a.toLowerCase(), null, !1);
});
["autoReverse", "externalResourcesRequired", "focusable", "preserveAlpha"].forEach(function (a) {
  C[a] = new v(a, 2, !1, a, null, !1);
});
"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function (a) {
  C[a] = new v(a, 3, !1, a.toLowerCase(), null, !1);
});
["checked", "multiple", "muted", "selected"].forEach(function (a) {
  C[a] = new v(a, 3, !0, a, null, !1);
});
["capture", "download"].forEach(function (a) {
  C[a] = new v(a, 4, !1, a, null, !1);
});
["cols", "rows", "size", "span"].forEach(function (a) {
  C[a] = new v(a, 6, !1, a, null, !1);
});
["rowSpan", "start"].forEach(function (a) {
  C[a] = new v(a, 5, !1, a.toLowerCase(), null, !1);
});
var Ua = /[\-:]([a-z])/g;

function Va(a) {
  return a[1].toUpperCase();
}

"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function (a) {
  var b = a.replace(Ua, Va);
  C[b] = new v(b, 1, !1, a, null, !1);
});
"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function (a) {
  var b = a.replace(Ua, Va);
  C[b] = new v(b, 1, !1, a, "http://www.w3.org/1999/xlink", !1);
});
["xml:base", "xml:lang", "xml:space"].forEach(function (a) {
  var b = a.replace(Ua, Va);
  C[b] = new v(b, 1, !1, a, "http://www.w3.org/XML/1998/namespace", !1);
});
["tabIndex", "crossOrigin"].forEach(function (a) {
  C[a] = new v(a, 1, !1, a.toLowerCase(), null, !1);
});
C.xlinkHref = new v("xlinkHref", 1, !1, "xlink:href", "http://www.w3.org/1999/xlink", !0);
["src", "href", "action", "formAction"].forEach(function (a) {
  C[a] = new v(a, 1, !1, a.toLowerCase(), null, !0);
});
var Wa = aa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
Wa.hasOwnProperty("ReactCurrentDispatcher") || (Wa.ReactCurrentDispatcher = {
  current: null
});
Wa.hasOwnProperty("ReactCurrentBatchConfig") || (Wa.ReactCurrentBatchConfig = {
  suspense: null
});

function Xa(a, b, c, d) {
  var e = C.hasOwnProperty(b) ? C[b] : null;
  var f = null !== e ? 0 === e.type : d ? !1 : !(2 < b.length) || "o" !== b[0] && "O" !== b[0] || "n" !== b[1] && "N" !== b[1] ? !1 : !0;
  f || (Ta(b, c, e, d) && (c = null), d || null === e ? Ra(b) && (null === c ? a.removeAttribute(b) : a.setAttribute(b, "" + c)) : e.mustUseProperty ? a[e.propertyName] = null === c ? 3 === e.type ? !1 : "" : c : (b = e.attributeName, d = e.attributeNamespace, null === c ? a.removeAttribute(b) : (e = e.type, c = 3 === e || 4 === e && !0 === c ? "" : "" + c, d ? a.setAttributeNS(d, b, c) : a.setAttribute(b, c))));
}

var Ya = /^(.*)[\\\/]/,
    E = "function" === typeof Symbol && Symbol.for,
    Za = E ? Symbol.for("react.element") : 60103,
    $a = E ? Symbol.for("react.portal") : 60106,
    ab = E ? Symbol.for("react.fragment") : 60107,
    bb = E ? Symbol.for("react.strict_mode") : 60108,
    cb = E ? Symbol.for("react.profiler") : 60114,
    db = E ? Symbol.for("react.provider") : 60109,
    eb = E ? Symbol.for("react.context") : 60110,
    fb = E ? Symbol.for("react.concurrent_mode") : 60111,
    gb = E ? Symbol.for("react.forward_ref") : 60112,
    hb = E ? Symbol.for("react.suspense") : 60113,
    ib = E ? Symbol.for("react.suspense_list") : 60120,
    jb = E ? Symbol.for("react.memo") : 60115,
    kb = E ? Symbol.for("react.lazy") : 60116,
    lb = E ? Symbol.for("react.block") : 60121,
    mb = "function" === typeof Symbol && Symbol.iterator;

function nb(a) {
  if (null === a || "object" !== typeof a) return null;
  a = mb && a[mb] || a["@@iterator"];
  return "function" === typeof a ? a : null;
}

function ob(a) {
  if (-1 === a._status) {
    a._status = 0;
    var b = a._ctor;
    b = b();
    a._result = b;
    b.then(function (b) {
      0 === a._status && (b = b.default, a._status = 1, a._result = b);
    }, function (b) {
      0 === a._status && (a._status = 2, a._result = b);
    });
  }
}

function pb(a) {
  if (null == a) return null;
  if ("function" === typeof a) return a.displayName || a.name || null;
  if ("string" === typeof a) return a;

  switch (a) {
    case ab:
      return "Fragment";

    case $a:
      return "Portal";

    case cb:
      return "Profiler";

    case bb:
      return "StrictMode";

    case hb:
      return "Suspense";

    case ib:
      return "SuspenseList";
  }

  if ("object" === typeof a) switch (a.$$typeof) {
    case eb:
      return "Context.Consumer";

    case db:
      return "Context.Provider";

    case gb:
      var b = a.render;
      b = b.displayName || b.name || "";
      return a.displayName || ("" !== b ? "ForwardRef(" + b + ")" : "ForwardRef");

    case jb:
      return pb(a.type);

    case lb:
      return pb(a.render);

    case kb:
      if (a = 1 === a._status ? a._result : null) return pb(a);
  }
  return null;
}

function qb(a) {
  var b = "";

  do {
    a: switch (a.tag) {
      case 3:
      case 4:
      case 6:
      case 7:
      case 10:
      case 9:
        var c = "";
        break a;

      default:
        var d = a._debugOwner,
            e = a._debugSource,
            f = pb(a.type);
        c = null;
        d && (c = pb(d.type));
        d = f;
        f = "";
        e ? f = " (at " + e.fileName.replace(Ya, "") + ":" + e.lineNumber + ")" : c && (f = " (created by " + c + ")");
        c = "\n    in " + (d || "Unknown") + f;
    }

    b += c;
    a = a.return;
  } while (a);

  return b;
}

function rb(a) {
  switch (typeof a) {
    case "boolean":
    case "number":
    case "object":
    case "string":
    case "undefined":
      return a;

    default:
      return "";
  }
}

function sb(a) {
  var b = a.type;
  return (a = a.nodeName) && "input" === a.toLowerCase() && ("checkbox" === b || "radio" === b);
}

function tb(a) {
  var b = sb(a) ? "checked" : "value",
      c = Object.getOwnPropertyDescriptor(a.constructor.prototype, b),
      d = "" + a[b];

  if (!a.hasOwnProperty(b) && "undefined" !== typeof c && "function" === typeof c.get && "function" === typeof c.set) {
    var e = c.get,
        f = c.set;
    Object.defineProperty(a, b, {
      configurable: !0,
      get: function get() {
        return e.call(this);
      },
      set: function set(a) {
        d = "" + a;
        f.call(this, a);
      }
    });
    Object.defineProperty(a, b, {
      enumerable: c.enumerable
    });
    return {
      getValue: function getValue() {
        return d;
      },
      setValue: function setValue(a) {
        d = "" + a;
      },
      stopTracking: function stopTracking() {
        a._valueTracker = null;
        delete a[b];
      }
    };
  }
}

function xb(a) {
  a._valueTracker || (a._valueTracker = tb(a));
}

function yb(a) {
  if (!a) return !1;
  var b = a._valueTracker;
  if (!b) return !0;
  var c = b.getValue();
  var d = "";
  a && (d = sb(a) ? a.checked ? "true" : "false" : a.value);
  a = d;
  return a !== c ? (b.setValue(a), !0) : !1;
}

function zb(a, b) {
  var c = b.checked;
  return n({}, b, {
    defaultChecked: void 0,
    defaultValue: void 0,
    value: void 0,
    checked: null != c ? c : a._wrapperState.initialChecked
  });
}

function Ab(a, b) {
  var c = null == b.defaultValue ? "" : b.defaultValue,
      d = null != b.checked ? b.checked : b.defaultChecked;
  c = rb(null != b.value ? b.value : c);
  a._wrapperState = {
    initialChecked: d,
    initialValue: c,
    controlled: "checkbox" === b.type || "radio" === b.type ? null != b.checked : null != b.value
  };
}

function Bb(a, b) {
  b = b.checked;
  null != b && Xa(a, "checked", b, !1);
}

function Cb(a, b) {
  Bb(a, b);
  var c = rb(b.value),
      d = b.type;
  if (null != c) {
    if ("number" === d) {
      if (0 === c && "" === a.value || a.value != c) a.value = "" + c;
    } else a.value !== "" + c && (a.value = "" + c);
  } else if ("submit" === d || "reset" === d) {
    a.removeAttribute("value");
    return;
  }
  b.hasOwnProperty("value") ? Db(a, b.type, c) : b.hasOwnProperty("defaultValue") && Db(a, b.type, rb(b.defaultValue));
  null == b.checked && null != b.defaultChecked && (a.defaultChecked = !!b.defaultChecked);
}

function Eb(a, b, c) {
  if (b.hasOwnProperty("value") || b.hasOwnProperty("defaultValue")) {
    var d = b.type;
    if (!("submit" !== d && "reset" !== d || void 0 !== b.value && null !== b.value)) return;
    b = "" + a._wrapperState.initialValue;
    c || b === a.value || (a.value = b);
    a.defaultValue = b;
  }

  c = a.name;
  "" !== c && (a.name = "");
  a.defaultChecked = !!a._wrapperState.initialChecked;
  "" !== c && (a.name = c);
}

function Db(a, b, c) {
  if ("number" !== b || a.ownerDocument.activeElement !== a) null == c ? a.defaultValue = "" + a._wrapperState.initialValue : a.defaultValue !== "" + c && (a.defaultValue = "" + c);
}

function Fb(a) {
  var b = "";
  aa.Children.forEach(a, function (a) {
    null != a && (b += a);
  });
  return b;
}

function Gb(a, b) {
  a = n({
    children: void 0
  }, b);
  if (b = Fb(b.children)) a.children = b;
  return a;
}

function Hb(a, b, c, d) {
  a = a.options;

  if (b) {
    b = {};

    for (var e = 0; e < c.length; e++) {
      b["$" + c[e]] = !0;
    }

    for (c = 0; c < a.length; c++) {
      e = b.hasOwnProperty("$" + a[c].value), a[c].selected !== e && (a[c].selected = e), e && d && (a[c].defaultSelected = !0);
    }
  } else {
    c = "" + rb(c);
    b = null;

    for (e = 0; e < a.length; e++) {
      if (a[e].value === c) {
        a[e].selected = !0;
        d && (a[e].defaultSelected = !0);
        return;
      }

      null !== b || a[e].disabled || (b = a[e]);
    }

    null !== b && (b.selected = !0);
  }
}

function Ib(a, b) {
  if (null != b.dangerouslySetInnerHTML) throw Error(u(91));
  return n({}, b, {
    value: void 0,
    defaultValue: void 0,
    children: "" + a._wrapperState.initialValue
  });
}

function Jb(a, b) {
  var c = b.value;

  if (null == c) {
    c = b.children;
    b = b.defaultValue;

    if (null != c) {
      if (null != b) throw Error(u(92));

      if (Array.isArray(c)) {
        if (!(1 >= c.length)) throw Error(u(93));
        c = c[0];
      }

      b = c;
    }

    null == b && (b = "");
    c = b;
  }

  a._wrapperState = {
    initialValue: rb(c)
  };
}

function Kb(a, b) {
  var c = rb(b.value),
      d = rb(b.defaultValue);
  null != c && (c = "" + c, c !== a.value && (a.value = c), null == b.defaultValue && a.defaultValue !== c && (a.defaultValue = c));
  null != d && (a.defaultValue = "" + d);
}

function Lb(a) {
  var b = a.textContent;
  b === a._wrapperState.initialValue && "" !== b && null !== b && (a.value = b);
}

var Mb = {
  html: "http://www.w3.org/1999/xhtml",
  mathml: "http://www.w3.org/1998/Math/MathML",
  svg: "http://www.w3.org/2000/svg"
};

function Nb(a) {
  switch (a) {
    case "svg":
      return "http://www.w3.org/2000/svg";

    case "math":
      return "http://www.w3.org/1998/Math/MathML";

    default:
      return "http://www.w3.org/1999/xhtml";
  }
}

function Ob(a, b) {
  return null == a || "http://www.w3.org/1999/xhtml" === a ? Nb(b) : "http://www.w3.org/2000/svg" === a && "foreignObject" === b ? "http://www.w3.org/1999/xhtml" : a;
}

var Pb,
    Qb = function (a) {
  return "undefined" !== typeof MSApp && MSApp.execUnsafeLocalFunction ? function (b, c, d, e) {
    MSApp.execUnsafeLocalFunction(function () {
      return a(b, c, d, e);
    });
  } : a;
}(function (a, b) {
  if (a.namespaceURI !== Mb.svg || "innerHTML" in a) a.innerHTML = b;else {
    Pb = Pb || document.createElement("div");
    Pb.innerHTML = "<svg>" + b.valueOf().toString() + "</svg>";

    for (b = Pb.firstChild; a.firstChild;) {
      a.removeChild(a.firstChild);
    }

    for (; b.firstChild;) {
      a.appendChild(b.firstChild);
    }
  }
});

function Rb(a, b) {
  if (b) {
    var c = a.firstChild;

    if (c && c === a.lastChild && 3 === c.nodeType) {
      c.nodeValue = b;
      return;
    }
  }

  a.textContent = b;
}

function Sb(a, b) {
  var c = {};
  c[a.toLowerCase()] = b.toLowerCase();
  c["Webkit" + a] = "webkit" + b;
  c["Moz" + a] = "moz" + b;
  return c;
}

var Tb = {
  animationend: Sb("Animation", "AnimationEnd"),
  animationiteration: Sb("Animation", "AnimationIteration"),
  animationstart: Sb("Animation", "AnimationStart"),
  transitionend: Sb("Transition", "TransitionEnd")
},
    Ub = {},
    Vb = {};
ya && (Vb = document.createElement("div").style, "AnimationEvent" in window || (delete Tb.animationend.animation, delete Tb.animationiteration.animation, delete Tb.animationstart.animation), "TransitionEvent" in window || delete Tb.transitionend.transition);

function Wb(a) {
  if (Ub[a]) return Ub[a];
  if (!Tb[a]) return a;
  var b = Tb[a],
      c;

  for (c in b) {
    if (b.hasOwnProperty(c) && c in Vb) return Ub[a] = b[c];
  }

  return a;
}

var Xb = Wb("animationend"),
    Yb = Wb("animationiteration"),
    Zb = Wb("animationstart"),
    $b = Wb("transitionend"),
    ac = "abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),
    bc = new ("function" === typeof WeakMap ? WeakMap : Map)();

function cc(a) {
  var b = bc.get(a);
  void 0 === b && (b = new Map(), bc.set(a, b));
  return b;
}

function dc(a) {
  var b = a,
      c = a;
  if (a.alternate) for (; b.return;) {
    b = b.return;
  } else {
    a = b;

    do {
      b = a, 0 !== (b.effectTag & 1026) && (c = b.return), a = b.return;
    } while (a);
  }
  return 3 === b.tag ? c : null;
}

function ec(a) {
  if (13 === a.tag) {
    var b = a.memoizedState;
    null === b && (a = a.alternate, null !== a && (b = a.memoizedState));
    if (null !== b) return b.dehydrated;
  }

  return null;
}

function fc(a) {
  if (dc(a) !== a) throw Error(u(188));
}

function gc(a) {
  var b = a.alternate;

  if (!b) {
    b = dc(a);
    if (null === b) throw Error(u(188));
    return b !== a ? null : a;
  }

  for (var c = a, d = b;;) {
    var e = c.return;
    if (null === e) break;
    var f = e.alternate;

    if (null === f) {
      d = e.return;

      if (null !== d) {
        c = d;
        continue;
      }

      break;
    }

    if (e.child === f.child) {
      for (f = e.child; f;) {
        if (f === c) return fc(e), a;
        if (f === d) return fc(e), b;
        f = f.sibling;
      }

      throw Error(u(188));
    }

    if (c.return !== d.return) c = e, d = f;else {
      for (var g = !1, h = e.child; h;) {
        if (h === c) {
          g = !0;
          c = e;
          d = f;
          break;
        }

        if (h === d) {
          g = !0;
          d = e;
          c = f;
          break;
        }

        h = h.sibling;
      }

      if (!g) {
        for (h = f.child; h;) {
          if (h === c) {
            g = !0;
            c = f;
            d = e;
            break;
          }

          if (h === d) {
            g = !0;
            d = f;
            c = e;
            break;
          }

          h = h.sibling;
        }

        if (!g) throw Error(u(189));
      }
    }
    if (c.alternate !== d) throw Error(u(190));
  }

  if (3 !== c.tag) throw Error(u(188));
  return c.stateNode.current === c ? a : b;
}

function hc(a) {
  a = gc(a);
  if (!a) return null;

  for (var b = a;;) {
    if (5 === b.tag || 6 === b.tag) return b;
    if (b.child) b.child.return = b, b = b.child;else {
      if (b === a) break;

      for (; !b.sibling;) {
        if (!b.return || b.return === a) return null;
        b = b.return;
      }

      b.sibling.return = b.return;
      b = b.sibling;
    }
  }

  return null;
}

function ic(a, b) {
  if (null == b) throw Error(u(30));
  if (null == a) return b;

  if (Array.isArray(a)) {
    if (Array.isArray(b)) return a.push.apply(a, b), a;
    a.push(b);
    return a;
  }

  return Array.isArray(b) ? [a].concat(b) : [a, b];
}

function jc(a, b, c) {
  Array.isArray(a) ? a.forEach(b, c) : a && b.call(c, a);
}

var kc = null;

function lc(a) {
  if (a) {
    var b = a._dispatchListeners,
        c = a._dispatchInstances;
    if (Array.isArray(b)) for (var d = 0; d < b.length && !a.isPropagationStopped(); d++) {
      oa(a, b[d], c[d]);
    } else b && oa(a, b, c);
    a._dispatchListeners = null;
    a._dispatchInstances = null;
    a.isPersistent() || a.constructor.release(a);
  }
}

function mc(a) {
  null !== a && (kc = ic(kc, a));
  a = kc;
  kc = null;

  if (a) {
    jc(a, lc);
    if (kc) throw Error(u(95));
    if (fa) throw a = ha, fa = !1, ha = null, a;
  }
}

function nc(a) {
  a = a.target || a.srcElement || window;
  a.correspondingUseElement && (a = a.correspondingUseElement);
  return 3 === a.nodeType ? a.parentNode : a;
}

function oc(a) {
  if (!ya) return !1;
  a = "on" + a;
  var b = (a in document);
  b || (b = document.createElement("div"), b.setAttribute(a, "return;"), b = "function" === typeof b[a]);
  return b;
}

var pc = [];

function qc(a) {
  a.topLevelType = null;
  a.nativeEvent = null;
  a.targetInst = null;
  a.ancestors.length = 0;
  10 > pc.length && pc.push(a);
}

function rc(a, b, c, d) {
  if (pc.length) {
    var e = pc.pop();
    e.topLevelType = a;
    e.eventSystemFlags = d;
    e.nativeEvent = b;
    e.targetInst = c;
    return e;
  }

  return {
    topLevelType: a,
    eventSystemFlags: d,
    nativeEvent: b,
    targetInst: c,
    ancestors: []
  };
}

function sc(a) {
  var b = a.targetInst,
      c = b;

  do {
    if (!c) {
      a.ancestors.push(c);
      break;
    }

    var d = c;
    if (3 === d.tag) d = d.stateNode.containerInfo;else {
      for (; d.return;) {
        d = d.return;
      }

      d = 3 !== d.tag ? null : d.stateNode.containerInfo;
    }
    if (!d) break;
    b = c.tag;
    5 !== b && 6 !== b || a.ancestors.push(c);
    c = tc(d);
  } while (c);

  for (c = 0; c < a.ancestors.length; c++) {
    b = a.ancestors[c];
    var e = nc(a.nativeEvent);
    d = a.topLevelType;
    var f = a.nativeEvent,
        g = a.eventSystemFlags;
    0 === c && (g |= 64);

    for (var h = null, k = 0; k < sa.length; k++) {
      var l = sa[k];
      l && (l = l.extractEvents(d, b, f, e, g)) && (h = ic(h, l));
    }

    mc(h);
  }
}

function uc(a, b, c) {
  if (!c.has(a)) {
    switch (a) {
      case "scroll":
        vc(b, "scroll", !0);
        break;

      case "focus":
      case "blur":
        vc(b, "focus", !0);
        vc(b, "blur", !0);
        c.set("blur", null);
        c.set("focus", null);
        break;

      case "cancel":
      case "close":
        oc(a) && vc(b, a, !0);
        break;

      case "invalid":
      case "submit":
      case "reset":
        break;

      default:
        -1 === ac.indexOf(a) && F(a, b);
    }

    c.set(a, null);
  }
}

var wc,
    xc,
    yc,
    zc = !1,
    Ac = [],
    Bc = null,
    Cc = null,
    Dc = null,
    Ec = new Map(),
    Fc = new Map(),
    Gc = [],
    Hc = "mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput close cancel copy cut paste click change contextmenu reset submit".split(" "),
    Ic = "focus blur dragenter dragleave mouseover mouseout pointerover pointerout gotpointercapture lostpointercapture".split(" ");

function Jc(a, b) {
  var c = cc(b);
  Hc.forEach(function (a) {
    uc(a, b, c);
  });
  Ic.forEach(function (a) {
    uc(a, b, c);
  });
}

function Kc(a, b, c, d, e) {
  return {
    blockedOn: a,
    topLevelType: b,
    eventSystemFlags: c | 32,
    nativeEvent: e,
    container: d
  };
}

function Lc(a, b) {
  switch (a) {
    case "focus":
    case "blur":
      Bc = null;
      break;

    case "dragenter":
    case "dragleave":
      Cc = null;
      break;

    case "mouseover":
    case "mouseout":
      Dc = null;
      break;

    case "pointerover":
    case "pointerout":
      Ec.delete(b.pointerId);
      break;

    case "gotpointercapture":
    case "lostpointercapture":
      Fc.delete(b.pointerId);
  }
}

function Mc(a, b, c, d, e, f) {
  if (null === a || a.nativeEvent !== f) return a = Kc(b, c, d, e, f), null !== b && (b = Nc(b), null !== b && xc(b)), a;
  a.eventSystemFlags |= d;
  return a;
}

function Oc(a, b, c, d, e) {
  switch (b) {
    case "focus":
      return Bc = Mc(Bc, a, b, c, d, e), !0;

    case "dragenter":
      return Cc = Mc(Cc, a, b, c, d, e), !0;

    case "mouseover":
      return Dc = Mc(Dc, a, b, c, d, e), !0;

    case "pointerover":
      var f = e.pointerId;
      Ec.set(f, Mc(Ec.get(f) || null, a, b, c, d, e));
      return !0;

    case "gotpointercapture":
      return f = e.pointerId, Fc.set(f, Mc(Fc.get(f) || null, a, b, c, d, e)), !0;
  }

  return !1;
}

function Pc(a) {
  var b = tc(a.target);

  if (null !== b) {
    var c = dc(b);
    if (null !== c) if (b = c.tag, 13 === b) {
      if (b = ec(c), null !== b) {
        a.blockedOn = b;
        r.unstable_runWithPriority(a.priority, function () {
          yc(c);
        });
        return;
      }
    } else if (3 === b && c.stateNode.hydrate) {
      a.blockedOn = 3 === c.tag ? c.stateNode.containerInfo : null;
      return;
    }
  }

  a.blockedOn = null;
}

function Qc(a) {
  if (null !== a.blockedOn) return !1;
  var b = Rc(a.topLevelType, a.eventSystemFlags, a.container, a.nativeEvent);

  if (null !== b) {
    var c = Nc(b);
    null !== c && xc(c);
    a.blockedOn = b;
    return !1;
  }

  return !0;
}

function Sc(a, b, c) {
  Qc(a) && c.delete(b);
}

function Tc() {
  for (zc = !1; 0 < Ac.length;) {
    var a = Ac[0];

    if (null !== a.blockedOn) {
      a = Nc(a.blockedOn);
      null !== a && wc(a);
      break;
    }

    var b = Rc(a.topLevelType, a.eventSystemFlags, a.container, a.nativeEvent);
    null !== b ? a.blockedOn = b : Ac.shift();
  }

  null !== Bc && Qc(Bc) && (Bc = null);
  null !== Cc && Qc(Cc) && (Cc = null);
  null !== Dc && Qc(Dc) && (Dc = null);
  Ec.forEach(Sc);
  Fc.forEach(Sc);
}

function Uc(a, b) {
  a.blockedOn === b && (a.blockedOn = null, zc || (zc = !0, r.unstable_scheduleCallback(r.unstable_NormalPriority, Tc)));
}

function Vc(a) {
  function b(b) {
    return Uc(b, a);
  }

  if (0 < Ac.length) {
    Uc(Ac[0], a);

    for (var c = 1; c < Ac.length; c++) {
      var d = Ac[c];
      d.blockedOn === a && (d.blockedOn = null);
    }
  }

  null !== Bc && Uc(Bc, a);
  null !== Cc && Uc(Cc, a);
  null !== Dc && Uc(Dc, a);
  Ec.forEach(b);
  Fc.forEach(b);

  for (c = 0; c < Gc.length; c++) {
    d = Gc[c], d.blockedOn === a && (d.blockedOn = null);
  }

  for (; 0 < Gc.length && (c = Gc[0], null === c.blockedOn);) {
    Pc(c), null === c.blockedOn && Gc.shift();
  }
}

var Wc = {},
    Yc = new Map(),
    Zc = new Map(),
    $c = ["abort", "abort", Xb, "animationEnd", Yb, "animationIteration", Zb, "animationStart", "canplay", "canPlay", "canplaythrough", "canPlayThrough", "durationchange", "durationChange", "emptied", "emptied", "encrypted", "encrypted", "ended", "ended", "error", "error", "gotpointercapture", "gotPointerCapture", "load", "load", "loadeddata", "loadedData", "loadedmetadata", "loadedMetadata", "loadstart", "loadStart", "lostpointercapture", "lostPointerCapture", "playing", "playing", "progress", "progress", "seeking", "seeking", "stalled", "stalled", "suspend", "suspend", "timeupdate", "timeUpdate", $b, "transitionEnd", "waiting", "waiting"];

function ad(a, b) {
  for (var c = 0; c < a.length; c += 2) {
    var d = a[c],
        e = a[c + 1],
        f = "on" + (e[0].toUpperCase() + e.slice(1));
    f = {
      phasedRegistrationNames: {
        bubbled: f,
        captured: f + "Capture"
      },
      dependencies: [d],
      eventPriority: b
    };
    Zc.set(d, b);
    Yc.set(d, f);
    Wc[e] = f;
  }
}

ad("blur blur cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focus focus input input invalid invalid keydown keyDown keypress keyPress keyup keyUp mousedown mouseDown mouseup mouseUp paste paste pause pause play play pointercancel pointerCancel pointerdown pointerDown pointerup pointerUp ratechange rateChange reset reset seeked seeked submit submit touchcancel touchCancel touchend touchEnd touchstart touchStart volumechange volumeChange".split(" "), 0);
ad("drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel".split(" "), 1);
ad($c, 2);

for (var bd = "change selectionchange textInput compositionstart compositionend compositionupdate".split(" "), cd = 0; cd < bd.length; cd++) {
  Zc.set(bd[cd], 0);
}

var dd = r.unstable_UserBlockingPriority,
    ed = r.unstable_runWithPriority,
    fd = !0;

function F(a, b) {
  vc(b, a, !1);
}

function vc(a, b, c) {
  var d = Zc.get(b);

  switch (void 0 === d ? 2 : d) {
    case 0:
      d = gd.bind(null, b, 1, a);
      break;

    case 1:
      d = hd.bind(null, b, 1, a);
      break;

    default:
      d = id.bind(null, b, 1, a);
  }

  c ? a.addEventListener(b, d, !0) : a.addEventListener(b, d, !1);
}

function gd(a, b, c, d) {
  Ja || Ha();
  var e = id,
      f = Ja;
  Ja = !0;

  try {
    Ga(e, a, b, c, d);
  } finally {
    (Ja = f) || La();
  }
}

function hd(a, b, c, d) {
  ed(dd, id.bind(null, a, b, c, d));
}

function id(a, b, c, d) {
  if (fd) if (0 < Ac.length && -1 < Hc.indexOf(a)) a = Kc(null, a, b, c, d), Ac.push(a);else {
    var e = Rc(a, b, c, d);
    if (null === e) Lc(a, d);else if (-1 < Hc.indexOf(a)) a = Kc(e, a, b, c, d), Ac.push(a);else if (!Oc(e, a, b, c, d)) {
      Lc(a, d);
      a = rc(a, d, null, b);

      try {
        Ma(sc, a);
      } finally {
        qc(a);
      }
    }
  }
}

function Rc(a, b, c, d) {
  c = nc(d);
  c = tc(c);

  if (null !== c) {
    var e = dc(c);
    if (null === e) c = null;else {
      var f = e.tag;

      if (13 === f) {
        c = ec(e);
        if (null !== c) return c;
        c = null;
      } else if (3 === f) {
        if (e.stateNode.hydrate) return 3 === e.tag ? e.stateNode.containerInfo : null;
        c = null;
      } else e !== c && (c = null);
    }
  }

  a = rc(a, d, c, b);

  try {
    Ma(sc, a);
  } finally {
    qc(a);
  }

  return null;
}

var jd = {
  animationIterationCount: !0,
  borderImageOutset: !0,
  borderImageSlice: !0,
  borderImageWidth: !0,
  boxFlex: !0,
  boxFlexGroup: !0,
  boxOrdinalGroup: !0,
  columnCount: !0,
  columns: !0,
  flex: !0,
  flexGrow: !0,
  flexPositive: !0,
  flexShrink: !0,
  flexNegative: !0,
  flexOrder: !0,
  gridArea: !0,
  gridRow: !0,
  gridRowEnd: !0,
  gridRowSpan: !0,
  gridRowStart: !0,
  gridColumn: !0,
  gridColumnEnd: !0,
  gridColumnSpan: !0,
  gridColumnStart: !0,
  fontWeight: !0,
  lineClamp: !0,
  lineHeight: !0,
  opacity: !0,
  order: !0,
  orphans: !0,
  tabSize: !0,
  widows: !0,
  zIndex: !0,
  zoom: !0,
  fillOpacity: !0,
  floodOpacity: !0,
  stopOpacity: !0,
  strokeDasharray: !0,
  strokeDashoffset: !0,
  strokeMiterlimit: !0,
  strokeOpacity: !0,
  strokeWidth: !0
},
    kd = ["Webkit", "ms", "Moz", "O"];
Object.keys(jd).forEach(function (a) {
  kd.forEach(function (b) {
    b = b + a.charAt(0).toUpperCase() + a.substring(1);
    jd[b] = jd[a];
  });
});

function ld(a, b, c) {
  return null == b || "boolean" === typeof b || "" === b ? "" : c || "number" !== typeof b || 0 === b || jd.hasOwnProperty(a) && jd[a] ? ("" + b).trim() : b + "px";
}

function md(a, b) {
  a = a.style;

  for (var c in b) {
    if (b.hasOwnProperty(c)) {
      var d = 0 === c.indexOf("--"),
          e = ld(c, b[c], d);
      "float" === c && (c = "cssFloat");
      d ? a.setProperty(c, e) : a[c] = e;
    }
  }
}

var nd = n({
  menuitem: !0
}, {
  area: !0,
  base: !0,
  br: !0,
  col: !0,
  embed: !0,
  hr: !0,
  img: !0,
  input: !0,
  keygen: !0,
  link: !0,
  meta: !0,
  param: !0,
  source: !0,
  track: !0,
  wbr: !0
});

function od(a, b) {
  if (b) {
    if (nd[a] && (null != b.children || null != b.dangerouslySetInnerHTML)) throw Error(u(137, a, ""));

    if (null != b.dangerouslySetInnerHTML) {
      if (null != b.children) throw Error(u(60));
      if (!("object" === typeof b.dangerouslySetInnerHTML && "__html" in b.dangerouslySetInnerHTML)) throw Error(u(61));
    }

    if (null != b.style && "object" !== typeof b.style) throw Error(u(62, ""));
  }
}

function pd(a, b) {
  if (-1 === a.indexOf("-")) return "string" === typeof b.is;

  switch (a) {
    case "annotation-xml":
    case "color-profile":
    case "font-face":
    case "font-face-src":
    case "font-face-uri":
    case "font-face-format":
    case "font-face-name":
    case "missing-glyph":
      return !1;

    default:
      return !0;
  }
}

var qd = Mb.html;

function rd(a, b) {
  a = 9 === a.nodeType || 11 === a.nodeType ? a : a.ownerDocument;
  var c = cc(a);
  b = wa[b];

  for (var d = 0; d < b.length; d++) {
    uc(b[d], a, c);
  }
}

function sd() {}

function td(a) {
  a = a || ("undefined" !== typeof document ? document : void 0);
  if ("undefined" === typeof a) return null;

  try {
    return a.activeElement || a.body;
  } catch (b) {
    return a.body;
  }
}

function ud(a) {
  for (; a && a.firstChild;) {
    a = a.firstChild;
  }

  return a;
}

function vd(a, b) {
  var c = ud(a);
  a = 0;

  for (var d; c;) {
    if (3 === c.nodeType) {
      d = a + c.textContent.length;
      if (a <= b && d >= b) return {
        node: c,
        offset: b - a
      };
      a = d;
    }

    a: {
      for (; c;) {
        if (c.nextSibling) {
          c = c.nextSibling;
          break a;
        }

        c = c.parentNode;
      }

      c = void 0;
    }

    c = ud(c);
  }
}

function wd(a, b) {
  return a && b ? a === b ? !0 : a && 3 === a.nodeType ? !1 : b && 3 === b.nodeType ? wd(a, b.parentNode) : "contains" in a ? a.contains(b) : a.compareDocumentPosition ? !!(a.compareDocumentPosition(b) & 16) : !1 : !1;
}

function xd() {
  for (var a = window, b = td(); b instanceof a.HTMLIFrameElement;) {
    try {
      var c = "string" === typeof b.contentWindow.location.href;
    } catch (d) {
      c = !1;
    }

    if (c) a = b.contentWindow;else break;
    b = td(a.document);
  }

  return b;
}

function yd(a) {
  var b = a && a.nodeName && a.nodeName.toLowerCase();
  return b && ("input" === b && ("text" === a.type || "search" === a.type || "tel" === a.type || "url" === a.type || "password" === a.type) || "textarea" === b || "true" === a.contentEditable);
}

var zd = "$",
    Ad = "/$",
    Bd = "$?",
    Cd = "$!",
    Dd = null,
    Ed = null;

function Fd(a, b) {
  switch (a) {
    case "button":
    case "input":
    case "select":
    case "textarea":
      return !!b.autoFocus;
  }

  return !1;
}

function Gd(a, b) {
  return "textarea" === a || "option" === a || "noscript" === a || "string" === typeof b.children || "number" === typeof b.children || "object" === typeof b.dangerouslySetInnerHTML && null !== b.dangerouslySetInnerHTML && null != b.dangerouslySetInnerHTML.__html;
}

var Hd = "function" === typeof setTimeout ? setTimeout : void 0,
    Id = "function" === typeof clearTimeout ? clearTimeout : void 0;

function Jd(a) {
  for (; null != a; a = a.nextSibling) {
    var b = a.nodeType;
    if (1 === b || 3 === b) break;
  }

  return a;
}

function Kd(a) {
  a = a.previousSibling;

  for (var b = 0; a;) {
    if (8 === a.nodeType) {
      var c = a.data;

      if (c === zd || c === Cd || c === Bd) {
        if (0 === b) return a;
        b--;
      } else c === Ad && b++;
    }

    a = a.previousSibling;
  }

  return null;
}

var Ld = Math.random().toString(36).slice(2),
    Md = "__reactInternalInstance$" + Ld,
    Nd = "__reactEventHandlers$" + Ld,
    Od = "__reactContainere$" + Ld;

function tc(a) {
  var b = a[Md];
  if (b) return b;

  for (var c = a.parentNode; c;) {
    if (b = c[Od] || c[Md]) {
      c = b.alternate;
      if (null !== b.child || null !== c && null !== c.child) for (a = Kd(a); null !== a;) {
        if (c = a[Md]) return c;
        a = Kd(a);
      }
      return b;
    }

    a = c;
    c = a.parentNode;
  }

  return null;
}

function Nc(a) {
  a = a[Md] || a[Od];
  return !a || 5 !== a.tag && 6 !== a.tag && 13 !== a.tag && 3 !== a.tag ? null : a;
}

function Pd(a) {
  if (5 === a.tag || 6 === a.tag) return a.stateNode;
  throw Error(u(33));
}

function Qd(a) {
  return a[Nd] || null;
}

function Rd(a) {
  do {
    a = a.return;
  } while (a && 5 !== a.tag);

  return a ? a : null;
}

function Sd(a, b) {
  var c = a.stateNode;
  if (!c) return null;
  var d = la(c);
  if (!d) return null;
  c = d[b];

  a: switch (b) {
    case "onClick":
    case "onClickCapture":
    case "onDoubleClick":
    case "onDoubleClickCapture":
    case "onMouseDown":
    case "onMouseDownCapture":
    case "onMouseMove":
    case "onMouseMoveCapture":
    case "onMouseUp":
    case "onMouseUpCapture":
    case "onMouseEnter":
      (d = !d.disabled) || (a = a.type, d = !("button" === a || "input" === a || "select" === a || "textarea" === a));
      a = !d;
      break a;

    default:
      a = !1;
  }

  if (a) return null;
  if (c && "function" !== typeof c) throw Error(u(231, b, typeof c));
  return c;
}

function Td(a, b, c) {
  if (b = Sd(a, c.dispatchConfig.phasedRegistrationNames[b])) c._dispatchListeners = ic(c._dispatchListeners, b), c._dispatchInstances = ic(c._dispatchInstances, a);
}

function Ud(a) {
  if (a && a.dispatchConfig.phasedRegistrationNames) {
    for (var b = a._targetInst, c = []; b;) {
      c.push(b), b = Rd(b);
    }

    for (b = c.length; 0 < b--;) {
      Td(c[b], "captured", a);
    }

    for (b = 0; b < c.length; b++) {
      Td(c[b], "bubbled", a);
    }
  }
}

function Vd(a, b, c) {
  a && c && c.dispatchConfig.registrationName && (b = Sd(a, c.dispatchConfig.registrationName)) && (c._dispatchListeners = ic(c._dispatchListeners, b), c._dispatchInstances = ic(c._dispatchInstances, a));
}

function Wd(a) {
  a && a.dispatchConfig.registrationName && Vd(a._targetInst, null, a);
}

function Xd(a) {
  jc(a, Ud);
}

var Yd = null,
    Zd = null,
    $d = null;

function ae() {
  if ($d) return $d;
  var a,
      b = Zd,
      c = b.length,
      d,
      e = "value" in Yd ? Yd.value : Yd.textContent,
      f = e.length;

  for (a = 0; a < c && b[a] === e[a]; a++) {
    ;
  }

  var g = c - a;

  for (d = 1; d <= g && b[c - d] === e[f - d]; d++) {
    ;
  }

  return $d = e.slice(a, 1 < d ? 1 - d : void 0);
}

function be() {
  return !0;
}

function ce() {
  return !1;
}

function G(a, b, c, d) {
  this.dispatchConfig = a;
  this._targetInst = b;
  this.nativeEvent = c;
  a = this.constructor.Interface;

  for (var e in a) {
    a.hasOwnProperty(e) && ((b = a[e]) ? this[e] = b(c) : "target" === e ? this.target = d : this[e] = c[e]);
  }

  this.isDefaultPrevented = (null != c.defaultPrevented ? c.defaultPrevented : !1 === c.returnValue) ? be : ce;
  this.isPropagationStopped = ce;
  return this;
}

n(G.prototype, {
  preventDefault: function preventDefault() {
    this.defaultPrevented = !0;
    var a = this.nativeEvent;
    a && (a.preventDefault ? a.preventDefault() : "unknown" !== typeof a.returnValue && (a.returnValue = !1), this.isDefaultPrevented = be);
  },
  stopPropagation: function stopPropagation() {
    var a = this.nativeEvent;
    a && (a.stopPropagation ? a.stopPropagation() : "unknown" !== typeof a.cancelBubble && (a.cancelBubble = !0), this.isPropagationStopped = be);
  },
  persist: function persist() {
    this.isPersistent = be;
  },
  isPersistent: ce,
  destructor: function destructor() {
    var a = this.constructor.Interface,
        b;

    for (b in a) {
      this[b] = null;
    }

    this.nativeEvent = this._targetInst = this.dispatchConfig = null;
    this.isPropagationStopped = this.isDefaultPrevented = ce;
    this._dispatchInstances = this._dispatchListeners = null;
  }
});
G.Interface = {
  type: null,
  target: null,
  currentTarget: function currentTarget() {
    return null;
  },
  eventPhase: null,
  bubbles: null,
  cancelable: null,
  timeStamp: function timeStamp(a) {
    return a.timeStamp || Date.now();
  },
  defaultPrevented: null,
  isTrusted: null
};

G.extend = function (a) {
  function b() {}

  function c() {
    return d.apply(this, arguments);
  }

  var d = this;
  b.prototype = d.prototype;
  var e = new b();
  n(e, c.prototype);
  c.prototype = e;
  c.prototype.constructor = c;
  c.Interface = n({}, d.Interface, a);
  c.extend = d.extend;
  de(c);
  return c;
};

de(G);

function ee(a, b, c, d) {
  if (this.eventPool.length) {
    var e = this.eventPool.pop();
    this.call(e, a, b, c, d);
    return e;
  }

  return new this(a, b, c, d);
}

function fe(a) {
  if (!(a instanceof this)) throw Error(u(279));
  a.destructor();
  10 > this.eventPool.length && this.eventPool.push(a);
}

function de(a) {
  a.eventPool = [];
  a.getPooled = ee;
  a.release = fe;
}

var ge = G.extend({
  data: null
}),
    he = G.extend({
  data: null
}),
    ie = [9, 13, 27, 32],
    je = ya && "CompositionEvent" in window,
    ke = null;
ya && "documentMode" in document && (ke = document.documentMode);
var le = ya && "TextEvent" in window && !ke,
    me = ya && (!je || ke && 8 < ke && 11 >= ke),
    ne = String.fromCharCode(32),
    oe = {
  beforeInput: {
    phasedRegistrationNames: {
      bubbled: "onBeforeInput",
      captured: "onBeforeInputCapture"
    },
    dependencies: ["compositionend", "keypress", "textInput", "paste"]
  },
  compositionEnd: {
    phasedRegistrationNames: {
      bubbled: "onCompositionEnd",
      captured: "onCompositionEndCapture"
    },
    dependencies: "blur compositionend keydown keypress keyup mousedown".split(" ")
  },
  compositionStart: {
    phasedRegistrationNames: {
      bubbled: "onCompositionStart",
      captured: "onCompositionStartCapture"
    },
    dependencies: "blur compositionstart keydown keypress keyup mousedown".split(" ")
  },
  compositionUpdate: {
    phasedRegistrationNames: {
      bubbled: "onCompositionUpdate",
      captured: "onCompositionUpdateCapture"
    },
    dependencies: "blur compositionupdate keydown keypress keyup mousedown".split(" ")
  }
},
    pe = !1;

function qe(a, b) {
  switch (a) {
    case "keyup":
      return -1 !== ie.indexOf(b.keyCode);

    case "keydown":
      return 229 !== b.keyCode;

    case "keypress":
    case "mousedown":
    case "blur":
      return !0;

    default:
      return !1;
  }
}

function re(a) {
  a = a.detail;
  return "object" === typeof a && "data" in a ? a.data : null;
}

var se = !1;

function te(a, b) {
  switch (a) {
    case "compositionend":
      return re(b);

    case "keypress":
      if (32 !== b.which) return null;
      pe = !0;
      return ne;

    case "textInput":
      return a = b.data, a === ne && pe ? null : a;

    default:
      return null;
  }
}

function ue(a, b) {
  if (se) return "compositionend" === a || !je && qe(a, b) ? (a = ae(), $d = Zd = Yd = null, se = !1, a) : null;

  switch (a) {
    case "paste":
      return null;

    case "keypress":
      if (!(b.ctrlKey || b.altKey || b.metaKey) || b.ctrlKey && b.altKey) {
        if (b.char && 1 < b.char.length) return b.char;
        if (b.which) return String.fromCharCode(b.which);
      }

      return null;

    case "compositionend":
      return me && "ko" !== b.locale ? null : b.data;

    default:
      return null;
  }
}

var ve = {
  eventTypes: oe,
  extractEvents: function extractEvents(a, b, c, d) {
    var e;
    if (je) b: {
      switch (a) {
        case "compositionstart":
          var f = oe.compositionStart;
          break b;

        case "compositionend":
          f = oe.compositionEnd;
          break b;

        case "compositionupdate":
          f = oe.compositionUpdate;
          break b;
      }

      f = void 0;
    } else se ? qe(a, c) && (f = oe.compositionEnd) : "keydown" === a && 229 === c.keyCode && (f = oe.compositionStart);
    f ? (me && "ko" !== c.locale && (se || f !== oe.compositionStart ? f === oe.compositionEnd && se && (e = ae()) : (Yd = d, Zd = "value" in Yd ? Yd.value : Yd.textContent, se = !0)), f = ge.getPooled(f, b, c, d), e ? f.data = e : (e = re(c), null !== e && (f.data = e)), Xd(f), e = f) : e = null;
    (a = le ? te(a, c) : ue(a, c)) ? (b = he.getPooled(oe.beforeInput, b, c, d), b.data = a, Xd(b)) : b = null;
    return null === e ? b : null === b ? e : [e, b];
  }
},
    we = {
  color: !0,
  date: !0,
  datetime: !0,
  "datetime-local": !0,
  email: !0,
  month: !0,
  number: !0,
  password: !0,
  range: !0,
  search: !0,
  tel: !0,
  text: !0,
  time: !0,
  url: !0,
  week: !0
};

function xe(a) {
  var b = a && a.nodeName && a.nodeName.toLowerCase();
  return "input" === b ? !!we[a.type] : "textarea" === b ? !0 : !1;
}

var ye = {
  change: {
    phasedRegistrationNames: {
      bubbled: "onChange",
      captured: "onChangeCapture"
    },
    dependencies: "blur change click focus input keydown keyup selectionchange".split(" ")
  }
};

function ze(a, b, c) {
  a = G.getPooled(ye.change, a, b, c);
  a.type = "change";
  Da(c);
  Xd(a);
  return a;
}

var Ae = null,
    Be = null;

function Ce(a) {
  mc(a);
}

function De(a) {
  var b = Pd(a);
  if (yb(b)) return a;
}

function Ee(a, b) {
  if ("change" === a) return b;
}

var Fe = !1;
ya && (Fe = oc("input") && (!document.documentMode || 9 < document.documentMode));

function Ge() {
  Ae && (Ae.detachEvent("onpropertychange", He), Be = Ae = null);
}

function He(a) {
  if ("value" === a.propertyName && De(Be)) if (a = ze(Be, a, nc(a)), Ja) mc(a);else {
    Ja = !0;

    try {
      Fa(Ce, a);
    } finally {
      Ja = !1, La();
    }
  }
}

function Ie(a, b, c) {
  "focus" === a ? (Ge(), Ae = b, Be = c, Ae.attachEvent("onpropertychange", He)) : "blur" === a && Ge();
}

function Je(a) {
  if ("selectionchange" === a || "keyup" === a || "keydown" === a) return De(Be);
}

function Ke(a, b) {
  if ("click" === a) return De(b);
}

function Le(a, b) {
  if ("input" === a || "change" === a) return De(b);
}

var Me = {
  eventTypes: ye,
  _isInputEventSupported: Fe,
  extractEvents: function extractEvents(a, b, c, d) {
    var e = b ? Pd(b) : window,
        f = e.nodeName && e.nodeName.toLowerCase();
    if ("select" === f || "input" === f && "file" === e.type) var g = Ee;else if (xe(e)) {
      if (Fe) g = Le;else {
        g = Je;
        var h = Ie;
      }
    } else (f = e.nodeName) && "input" === f.toLowerCase() && ("checkbox" === e.type || "radio" === e.type) && (g = Ke);
    if (g && (g = g(a, b))) return ze(g, c, d);
    h && h(a, e, b);
    "blur" === a && (a = e._wrapperState) && a.controlled && "number" === e.type && Db(e, "number", e.value);
  }
},
    Ne = G.extend({
  view: null,
  detail: null
}),
    Oe = {
  Alt: "altKey",
  Control: "ctrlKey",
  Meta: "metaKey",
  Shift: "shiftKey"
};

function Pe(a) {
  var b = this.nativeEvent;
  return b.getModifierState ? b.getModifierState(a) : (a = Oe[a]) ? !!b[a] : !1;
}

function Qe() {
  return Pe;
}

var Re = 0,
    Se = 0,
    Te = !1,
    Ue = !1,
    Ve = Ne.extend({
  screenX: null,
  screenY: null,
  clientX: null,
  clientY: null,
  pageX: null,
  pageY: null,
  ctrlKey: null,
  shiftKey: null,
  altKey: null,
  metaKey: null,
  getModifierState: Qe,
  button: null,
  buttons: null,
  relatedTarget: function relatedTarget(a) {
    return a.relatedTarget || (a.fromElement === a.srcElement ? a.toElement : a.fromElement);
  },
  movementX: function movementX(a) {
    if ("movementX" in a) return a.movementX;
    var b = Re;
    Re = a.screenX;
    return Te ? "mousemove" === a.type ? a.screenX - b : 0 : (Te = !0, 0);
  },
  movementY: function movementY(a) {
    if ("movementY" in a) return a.movementY;
    var b = Se;
    Se = a.screenY;
    return Ue ? "mousemove" === a.type ? a.screenY - b : 0 : (Ue = !0, 0);
  }
}),
    We = Ve.extend({
  pointerId: null,
  width: null,
  height: null,
  pressure: null,
  tangentialPressure: null,
  tiltX: null,
  tiltY: null,
  twist: null,
  pointerType: null,
  isPrimary: null
}),
    Xe = {
  mouseEnter: {
    registrationName: "onMouseEnter",
    dependencies: ["mouseout", "mouseover"]
  },
  mouseLeave: {
    registrationName: "onMouseLeave",
    dependencies: ["mouseout", "mouseover"]
  },
  pointerEnter: {
    registrationName: "onPointerEnter",
    dependencies: ["pointerout", "pointerover"]
  },
  pointerLeave: {
    registrationName: "onPointerLeave",
    dependencies: ["pointerout", "pointerover"]
  }
},
    Ye = {
  eventTypes: Xe,
  extractEvents: function extractEvents(a, b, c, d, e) {
    var f = "mouseover" === a || "pointerover" === a,
        g = "mouseout" === a || "pointerout" === a;
    if (f && 0 === (e & 32) && (c.relatedTarget || c.fromElement) || !g && !f) return null;
    f = d.window === d ? d : (f = d.ownerDocument) ? f.defaultView || f.parentWindow : window;

    if (g) {
      if (g = b, b = (b = c.relatedTarget || c.toElement) ? tc(b) : null, null !== b) {
        var h = dc(b);
        if (b !== h || 5 !== b.tag && 6 !== b.tag) b = null;
      }
    } else g = null;

    if (g === b) return null;

    if ("mouseout" === a || "mouseover" === a) {
      var k = Ve;
      var l = Xe.mouseLeave;
      var m = Xe.mouseEnter;
      var p = "mouse";
    } else if ("pointerout" === a || "pointerover" === a) k = We, l = Xe.pointerLeave, m = Xe.pointerEnter, p = "pointer";

    a = null == g ? f : Pd(g);
    f = null == b ? f : Pd(b);
    l = k.getPooled(l, g, c, d);
    l.type = p + "leave";
    l.target = a;
    l.relatedTarget = f;
    c = k.getPooled(m, b, c, d);
    c.type = p + "enter";
    c.target = f;
    c.relatedTarget = a;
    d = g;
    p = b;
    if (d && p) a: {
      k = d;
      m = p;
      g = 0;

      for (a = k; a; a = Rd(a)) {
        g++;
      }

      a = 0;

      for (b = m; b; b = Rd(b)) {
        a++;
      }

      for (; 0 < g - a;) {
        k = Rd(k), g--;
      }

      for (; 0 < a - g;) {
        m = Rd(m), a--;
      }

      for (; g--;) {
        if (k === m || k === m.alternate) break a;
        k = Rd(k);
        m = Rd(m);
      }

      k = null;
    } else k = null;
    m = k;

    for (k = []; d && d !== m;) {
      g = d.alternate;
      if (null !== g && g === m) break;
      k.push(d);
      d = Rd(d);
    }

    for (d = []; p && p !== m;) {
      g = p.alternate;
      if (null !== g && g === m) break;
      d.push(p);
      p = Rd(p);
    }

    for (p = 0; p < k.length; p++) {
      Vd(k[p], "bubbled", l);
    }

    for (p = d.length; 0 < p--;) {
      Vd(d[p], "captured", c);
    }

    return 0 === (e & 64) ? [l] : [l, c];
  }
};

function Ze(a, b) {
  return a === b && (0 !== a || 1 / a === 1 / b) || a !== a && b !== b;
}

var $e = "function" === typeof Object.is ? Object.is : Ze,
    af = Object.prototype.hasOwnProperty;

function bf(a, b) {
  if ($e(a, b)) return !0;
  if ("object" !== typeof a || null === a || "object" !== typeof b || null === b) return !1;
  var c = Object.keys(a),
      d = Object.keys(b);
  if (c.length !== d.length) return !1;

  for (d = 0; d < c.length; d++) {
    if (!af.call(b, c[d]) || !$e(a[c[d]], b[c[d]])) return !1;
  }

  return !0;
}

var cf = ya && "documentMode" in document && 11 >= document.documentMode,
    df = {
  select: {
    phasedRegistrationNames: {
      bubbled: "onSelect",
      captured: "onSelectCapture"
    },
    dependencies: "blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")
  }
},
    ef = null,
    ff = null,
    gf = null,
    hf = !1;

function jf(a, b) {
  var c = b.window === b ? b.document : 9 === b.nodeType ? b : b.ownerDocument;
  if (hf || null == ef || ef !== td(c)) return null;
  c = ef;
  "selectionStart" in c && yd(c) ? c = {
    start: c.selectionStart,
    end: c.selectionEnd
  } : (c = (c.ownerDocument && c.ownerDocument.defaultView || window).getSelection(), c = {
    anchorNode: c.anchorNode,
    anchorOffset: c.anchorOffset,
    focusNode: c.focusNode,
    focusOffset: c.focusOffset
  });
  return gf && bf(gf, c) ? null : (gf = c, a = G.getPooled(df.select, ff, a, b), a.type = "select", a.target = ef, Xd(a), a);
}

var kf = {
  eventTypes: df,
  extractEvents: function extractEvents(a, b, c, d, e, f) {
    e = f || (d.window === d ? d.document : 9 === d.nodeType ? d : d.ownerDocument);

    if (!(f = !e)) {
      a: {
        e = cc(e);
        f = wa.onSelect;

        for (var g = 0; g < f.length; g++) {
          if (!e.has(f[g])) {
            e = !1;
            break a;
          }
        }

        e = !0;
      }

      f = !e;
    }

    if (f) return null;
    e = b ? Pd(b) : window;

    switch (a) {
      case "focus":
        if (xe(e) || "true" === e.contentEditable) ef = e, ff = b, gf = null;
        break;

      case "blur":
        gf = ff = ef = null;
        break;

      case "mousedown":
        hf = !0;
        break;

      case "contextmenu":
      case "mouseup":
      case "dragend":
        return hf = !1, jf(c, d);

      case "selectionchange":
        if (cf) break;

      case "keydown":
      case "keyup":
        return jf(c, d);
    }

    return null;
  }
},
    lf = G.extend({
  animationName: null,
  elapsedTime: null,
  pseudoElement: null
}),
    mf = G.extend({
  clipboardData: function clipboardData(a) {
    return "clipboardData" in a ? a.clipboardData : window.clipboardData;
  }
}),
    nf = Ne.extend({
  relatedTarget: null
});

function of(a) {
  var b = a.keyCode;
  "charCode" in a ? (a = a.charCode, 0 === a && 13 === b && (a = 13)) : a = b;
  10 === a && (a = 13);
  return 32 <= a || 13 === a ? a : 0;
}

var pf = {
  Esc: "Escape",
  Spacebar: " ",
  Left: "ArrowLeft",
  Up: "ArrowUp",
  Right: "ArrowRight",
  Down: "ArrowDown",
  Del: "Delete",
  Win: "OS",
  Menu: "ContextMenu",
  Apps: "ContextMenu",
  Scroll: "ScrollLock",
  MozPrintableKey: "Unidentified"
},
    qf = {
  8: "Backspace",
  9: "Tab",
  12: "Clear",
  13: "Enter",
  16: "Shift",
  17: "Control",
  18: "Alt",
  19: "Pause",
  20: "CapsLock",
  27: "Escape",
  32: " ",
  33: "PageUp",
  34: "PageDown",
  35: "End",
  36: "Home",
  37: "ArrowLeft",
  38: "ArrowUp",
  39: "ArrowRight",
  40: "ArrowDown",
  45: "Insert",
  46: "Delete",
  112: "F1",
  113: "F2",
  114: "F3",
  115: "F4",
  116: "F5",
  117: "F6",
  118: "F7",
  119: "F8",
  120: "F9",
  121: "F10",
  122: "F11",
  123: "F12",
  144: "NumLock",
  145: "ScrollLock",
  224: "Meta"
},
    rf = Ne.extend({
  key: function key(a) {
    if (a.key) {
      var b = pf[a.key] || a.key;
      if ("Unidentified" !== b) return b;
    }

    return "keypress" === a.type ? (a = of(a), 13 === a ? "Enter" : String.fromCharCode(a)) : "keydown" === a.type || "keyup" === a.type ? qf[a.keyCode] || "Unidentified" : "";
  },
  location: null,
  ctrlKey: null,
  shiftKey: null,
  altKey: null,
  metaKey: null,
  repeat: null,
  locale: null,
  getModifierState: Qe,
  charCode: function charCode(a) {
    return "keypress" === a.type ? of(a) : 0;
  },
  keyCode: function keyCode(a) {
    return "keydown" === a.type || "keyup" === a.type ? a.keyCode : 0;
  },
  which: function which(a) {
    return "keypress" === a.type ? of(a) : "keydown" === a.type || "keyup" === a.type ? a.keyCode : 0;
  }
}),
    sf = Ve.extend({
  dataTransfer: null
}),
    tf = Ne.extend({
  touches: null,
  targetTouches: null,
  changedTouches: null,
  altKey: null,
  metaKey: null,
  ctrlKey: null,
  shiftKey: null,
  getModifierState: Qe
}),
    uf = G.extend({
  propertyName: null,
  elapsedTime: null,
  pseudoElement: null
}),
    vf = Ve.extend({
  deltaX: function deltaX(a) {
    return "deltaX" in a ? a.deltaX : "wheelDeltaX" in a ? -a.wheelDeltaX : 0;
  },
  deltaY: function deltaY(a) {
    return "deltaY" in a ? a.deltaY : "wheelDeltaY" in a ? -a.wheelDeltaY : "wheelDelta" in a ? -a.wheelDelta : 0;
  },
  deltaZ: null,
  deltaMode: null
}),
    wf = {
  eventTypes: Wc,
  extractEvents: function extractEvents(a, b, c, d) {
    var e = Yc.get(a);
    if (!e) return null;

    switch (a) {
      case "keypress":
        if (0 === of(c)) return null;

      case "keydown":
      case "keyup":
        a = rf;
        break;

      case "blur":
      case "focus":
        a = nf;
        break;

      case "click":
        if (2 === c.button) return null;

      case "auxclick":
      case "dblclick":
      case "mousedown":
      case "mousemove":
      case "mouseup":
      case "mouseout":
      case "mouseover":
      case "contextmenu":
        a = Ve;
        break;

      case "drag":
      case "dragend":
      case "dragenter":
      case "dragexit":
      case "dragleave":
      case "dragover":
      case "dragstart":
      case "drop":
        a = sf;
        break;

      case "touchcancel":
      case "touchend":
      case "touchmove":
      case "touchstart":
        a = tf;
        break;

      case Xb:
      case Yb:
      case Zb:
        a = lf;
        break;

      case $b:
        a = uf;
        break;

      case "scroll":
        a = Ne;
        break;

      case "wheel":
        a = vf;
        break;

      case "copy":
      case "cut":
      case "paste":
        a = mf;
        break;

      case "gotpointercapture":
      case "lostpointercapture":
      case "pointercancel":
      case "pointerdown":
      case "pointermove":
      case "pointerout":
      case "pointerover":
      case "pointerup":
        a = We;
        break;

      default:
        a = G;
    }

    b = a.getPooled(e, b, c, d);
    Xd(b);
    return b;
  }
};
if (pa) throw Error(u(101));
pa = Array.prototype.slice.call("ResponderEventPlugin SimpleEventPlugin EnterLeaveEventPlugin ChangeEventPlugin SelectEventPlugin BeforeInputEventPlugin".split(" "));
ra();
var xf = Nc;
la = Qd;
ma = xf;
na = Pd;
xa({
  SimpleEventPlugin: wf,
  EnterLeaveEventPlugin: Ye,
  ChangeEventPlugin: Me,
  SelectEventPlugin: kf,
  BeforeInputEventPlugin: ve
});
var yf = [],
    zf = -1;

function H(a) {
  0 > zf || (a.current = yf[zf], yf[zf] = null, zf--);
}

function I(a, b) {
  zf++;
  yf[zf] = a.current;
  a.current = b;
}

var Af = {},
    J = {
  current: Af
},
    K = {
  current: !1
},
    Bf = Af;

function Cf(a, b) {
  var c = a.type.contextTypes;
  if (!c) return Af;
  var d = a.stateNode;
  if (d && d.__reactInternalMemoizedUnmaskedChildContext === b) return d.__reactInternalMemoizedMaskedChildContext;
  var e = {},
      f;

  for (f in c) {
    e[f] = b[f];
  }

  d && (a = a.stateNode, a.__reactInternalMemoizedUnmaskedChildContext = b, a.__reactInternalMemoizedMaskedChildContext = e);
  return e;
}

function L(a) {
  a = a.childContextTypes;
  return null !== a && void 0 !== a;
}

function Df() {
  H(K);
  H(J);
}

function Ef(a, b, c) {
  if (J.current !== Af) throw Error(u(168));
  I(J, b);
  I(K, c);
}

function Ff(a, b, c) {
  var d = a.stateNode;
  a = b.childContextTypes;
  if ("function" !== typeof d.getChildContext) return c;
  d = d.getChildContext();

  for (var e in d) {
    if (!(e in a)) throw Error(u(108, pb(b) || "Unknown", e));
  }

  return n({}, c, {}, d);
}

function Gf(a) {
  a = (a = a.stateNode) && a.__reactInternalMemoizedMergedChildContext || Af;
  Bf = J.current;
  I(J, a);
  I(K, K.current);
  return !0;
}

function Hf(a, b, c) {
  var d = a.stateNode;
  if (!d) throw Error(u(169));
  c ? (a = Ff(a, b, Bf), d.__reactInternalMemoizedMergedChildContext = a, H(K), H(J), I(J, a)) : H(K);
  I(K, c);
}

var If = r.unstable_runWithPriority,
    Jf = r.unstable_scheduleCallback,
    Kf = r.unstable_cancelCallback,
    Lf = r.unstable_requestPaint,
    Mf = r.unstable_now,
    Nf = r.unstable_getCurrentPriorityLevel,
    Of = r.unstable_ImmediatePriority,
    Pf = r.unstable_UserBlockingPriority,
    Qf = r.unstable_NormalPriority,
    Rf = r.unstable_LowPriority,
    Sf = r.unstable_IdlePriority,
    Tf = {},
    Uf = r.unstable_shouldYield,
    Vf = void 0 !== Lf ? Lf : function () {},
    Wf = null,
    Xf = null,
    Yf = !1,
    Zf = Mf(),
    $f = 1E4 > Zf ? Mf : function () {
  return Mf() - Zf;
};

function ag() {
  switch (Nf()) {
    case Of:
      return 99;

    case Pf:
      return 98;

    case Qf:
      return 97;

    case Rf:
      return 96;

    case Sf:
      return 95;

    default:
      throw Error(u(332));
  }
}

function bg(a) {
  switch (a) {
    case 99:
      return Of;

    case 98:
      return Pf;

    case 97:
      return Qf;

    case 96:
      return Rf;

    case 95:
      return Sf;

    default:
      throw Error(u(332));
  }
}

function cg(a, b) {
  a = bg(a);
  return If(a, b);
}

function dg(a, b, c) {
  a = bg(a);
  return Jf(a, b, c);
}

function eg(a) {
  null === Wf ? (Wf = [a], Xf = Jf(Of, fg)) : Wf.push(a);
  return Tf;
}

function gg() {
  if (null !== Xf) {
    var a = Xf;
    Xf = null;
    Kf(a);
  }

  fg();
}

function fg() {
  if (!Yf && null !== Wf) {
    Yf = !0;
    var a = 0;

    try {
      var b = Wf;
      cg(99, function () {
        for (; a < b.length; a++) {
          var c = b[a];

          do {
            c = c(!0);
          } while (null !== c);
        }
      });
      Wf = null;
    } catch (c) {
      throw null !== Wf && (Wf = Wf.slice(a + 1)), Jf(Of, gg), c;
    } finally {
      Yf = !1;
    }
  }
}

function hg(a, b, c) {
  c /= 10;
  return 1073741821 - (((1073741821 - a + b / 10) / c | 0) + 1) * c;
}

function ig(a, b) {
  if (a && a.defaultProps) {
    b = n({}, b);
    a = a.defaultProps;

    for (var c in a) {
      void 0 === b[c] && (b[c] = a[c]);
    }
  }

  return b;
}

var jg = {
  current: null
},
    kg = null,
    lg = null,
    mg = null;

function ng() {
  mg = lg = kg = null;
}

function og(a) {
  var b = jg.current;
  H(jg);
  a.type._context._currentValue = b;
}

function pg(a, b) {
  for (; null !== a;) {
    var c = a.alternate;
    if (a.childExpirationTime < b) a.childExpirationTime = b, null !== c && c.childExpirationTime < b && (c.childExpirationTime = b);else if (null !== c && c.childExpirationTime < b) c.childExpirationTime = b;else break;
    a = a.return;
  }
}

function qg(a, b) {
  kg = a;
  mg = lg = null;
  a = a.dependencies;
  null !== a && null !== a.firstContext && (a.expirationTime >= b && (rg = !0), a.firstContext = null);
}

function sg(a, b) {
  if (mg !== a && !1 !== b && 0 !== b) {
    if ("number" !== typeof b || 1073741823 === b) mg = a, b = 1073741823;
    b = {
      context: a,
      observedBits: b,
      next: null
    };

    if (null === lg) {
      if (null === kg) throw Error(u(308));
      lg = b;
      kg.dependencies = {
        expirationTime: 0,
        firstContext: b,
        responders: null
      };
    } else lg = lg.next = b;
  }

  return a._currentValue;
}

var tg = !1;

function ug(a) {
  a.updateQueue = {
    baseState: a.memoizedState,
    baseQueue: null,
    shared: {
      pending: null
    },
    effects: null
  };
}

function vg(a, b) {
  a = a.updateQueue;
  b.updateQueue === a && (b.updateQueue = {
    baseState: a.baseState,
    baseQueue: a.baseQueue,
    shared: a.shared,
    effects: a.effects
  });
}

function wg(a, b) {
  a = {
    expirationTime: a,
    suspenseConfig: b,
    tag: 0,
    payload: null,
    callback: null,
    next: null
  };
  return a.next = a;
}

function xg(a, b) {
  a = a.updateQueue;

  if (null !== a) {
    a = a.shared;
    var c = a.pending;
    null === c ? b.next = b : (b.next = c.next, c.next = b);
    a.pending = b;
  }
}

function yg(a, b) {
  var c = a.alternate;
  null !== c && vg(c, a);
  a = a.updateQueue;
  c = a.baseQueue;
  null === c ? (a.baseQueue = b.next = b, b.next = b) : (b.next = c.next, c.next = b);
}

function zg(a, b, c, d) {
  var e = a.updateQueue;
  tg = !1;
  var f = e.baseQueue,
      g = e.shared.pending;

  if (null !== g) {
    if (null !== f) {
      var h = f.next;
      f.next = g.next;
      g.next = h;
    }

    f = g;
    e.shared.pending = null;
    h = a.alternate;
    null !== h && (h = h.updateQueue, null !== h && (h.baseQueue = g));
  }

  if (null !== f) {
    h = f.next;
    var k = e.baseState,
        l = 0,
        m = null,
        p = null,
        x = null;

    if (null !== h) {
      var z = h;

      do {
        g = z.expirationTime;

        if (g < d) {
          var ca = {
            expirationTime: z.expirationTime,
            suspenseConfig: z.suspenseConfig,
            tag: z.tag,
            payload: z.payload,
            callback: z.callback,
            next: null
          };
          null === x ? (p = x = ca, m = k) : x = x.next = ca;
          g > l && (l = g);
        } else {
          null !== x && (x = x.next = {
            expirationTime: 1073741823,
            suspenseConfig: z.suspenseConfig,
            tag: z.tag,
            payload: z.payload,
            callback: z.callback,
            next: null
          });
          Ag(g, z.suspenseConfig);

          a: {
            var D = a,
                t = z;
            g = b;
            ca = c;

            switch (t.tag) {
              case 1:
                D = t.payload;

                if ("function" === typeof D) {
                  k = D.call(ca, k, g);
                  break a;
                }

                k = D;
                break a;

              case 3:
                D.effectTag = D.effectTag & -4097 | 64;

              case 0:
                D = t.payload;
                g = "function" === typeof D ? D.call(ca, k, g) : D;
                if (null === g || void 0 === g) break a;
                k = n({}, k, g);
                break a;

              case 2:
                tg = !0;
            }
          }

          null !== z.callback && (a.effectTag |= 32, g = e.effects, null === g ? e.effects = [z] : g.push(z));
        }

        z = z.next;
        if (null === z || z === h) if (g = e.shared.pending, null === g) break;else z = f.next = g.next, g.next = h, e.baseQueue = f = g, e.shared.pending = null;
      } while (1);
    }

    null === x ? m = k : x.next = p;
    e.baseState = m;
    e.baseQueue = x;
    Bg(l);
    a.expirationTime = l;
    a.memoizedState = k;
  }
}

function Cg(a, b, c) {
  a = b.effects;
  b.effects = null;
  if (null !== a) for (b = 0; b < a.length; b++) {
    var d = a[b],
        e = d.callback;

    if (null !== e) {
      d.callback = null;
      d = e;
      e = c;
      if ("function" !== typeof d) throw Error(u(191, d));
      d.call(e);
    }
  }
}

var Dg = Wa.ReactCurrentBatchConfig,
    Eg = new aa.Component().refs;

function Fg(a, b, c, d) {
  b = a.memoizedState;
  c = c(d, b);
  c = null === c || void 0 === c ? b : n({}, b, c);
  a.memoizedState = c;
  0 === a.expirationTime && (a.updateQueue.baseState = c);
}

var Jg = {
  isMounted: function isMounted(a) {
    return (a = a._reactInternalFiber) ? dc(a) === a : !1;
  },
  enqueueSetState: function enqueueSetState(a, b, c) {
    a = a._reactInternalFiber;
    var d = Gg(),
        e = Dg.suspense;
    d = Hg(d, a, e);
    e = wg(d, e);
    e.payload = b;
    void 0 !== c && null !== c && (e.callback = c);
    xg(a, e);
    Ig(a, d);
  },
  enqueueReplaceState: function enqueueReplaceState(a, b, c) {
    a = a._reactInternalFiber;
    var d = Gg(),
        e = Dg.suspense;
    d = Hg(d, a, e);
    e = wg(d, e);
    e.tag = 1;
    e.payload = b;
    void 0 !== c && null !== c && (e.callback = c);
    xg(a, e);
    Ig(a, d);
  },
  enqueueForceUpdate: function enqueueForceUpdate(a, b) {
    a = a._reactInternalFiber;
    var c = Gg(),
        d = Dg.suspense;
    c = Hg(c, a, d);
    d = wg(c, d);
    d.tag = 2;
    void 0 !== b && null !== b && (d.callback = b);
    xg(a, d);
    Ig(a, c);
  }
};

function Kg(a, b, c, d, e, f, g) {
  a = a.stateNode;
  return "function" === typeof a.shouldComponentUpdate ? a.shouldComponentUpdate(d, f, g) : b.prototype && b.prototype.isPureReactComponent ? !bf(c, d) || !bf(e, f) : !0;
}

function Lg(a, b, c) {
  var d = !1,
      e = Af;
  var f = b.contextType;
  "object" === typeof f && null !== f ? f = sg(f) : (e = L(b) ? Bf : J.current, d = b.contextTypes, f = (d = null !== d && void 0 !== d) ? Cf(a, e) : Af);
  b = new b(c, f);
  a.memoizedState = null !== b.state && void 0 !== b.state ? b.state : null;
  b.updater = Jg;
  a.stateNode = b;
  b._reactInternalFiber = a;
  d && (a = a.stateNode, a.__reactInternalMemoizedUnmaskedChildContext = e, a.__reactInternalMemoizedMaskedChildContext = f);
  return b;
}

function Mg(a, b, c, d) {
  a = b.state;
  "function" === typeof b.componentWillReceiveProps && b.componentWillReceiveProps(c, d);
  "function" === typeof b.UNSAFE_componentWillReceiveProps && b.UNSAFE_componentWillReceiveProps(c, d);
  b.state !== a && Jg.enqueueReplaceState(b, b.state, null);
}

function Ng(a, b, c, d) {
  var e = a.stateNode;
  e.props = c;
  e.state = a.memoizedState;
  e.refs = Eg;
  ug(a);
  var f = b.contextType;
  "object" === typeof f && null !== f ? e.context = sg(f) : (f = L(b) ? Bf : J.current, e.context = Cf(a, f));
  zg(a, c, e, d);
  e.state = a.memoizedState;
  f = b.getDerivedStateFromProps;
  "function" === typeof f && (Fg(a, b, f, c), e.state = a.memoizedState);
  "function" === typeof b.getDerivedStateFromProps || "function" === typeof e.getSnapshotBeforeUpdate || "function" !== typeof e.UNSAFE_componentWillMount && "function" !== typeof e.componentWillMount || (b = e.state, "function" === typeof e.componentWillMount && e.componentWillMount(), "function" === typeof e.UNSAFE_componentWillMount && e.UNSAFE_componentWillMount(), b !== e.state && Jg.enqueueReplaceState(e, e.state, null), zg(a, c, e, d), e.state = a.memoizedState);
  "function" === typeof e.componentDidMount && (a.effectTag |= 4);
}

var Og = Array.isArray;

function Pg(a, b, c) {
  a = c.ref;

  if (null !== a && "function" !== typeof a && "object" !== typeof a) {
    if (c._owner) {
      c = c._owner;

      if (c) {
        if (1 !== c.tag) throw Error(u(309));
        var d = c.stateNode;
      }

      if (!d) throw Error(u(147, a));
      var e = "" + a;
      if (null !== b && null !== b.ref && "function" === typeof b.ref && b.ref._stringRef === e) return b.ref;

      b = function b(a) {
        var b = d.refs;
        b === Eg && (b = d.refs = {});
        null === a ? delete b[e] : b[e] = a;
      };

      b._stringRef = e;
      return b;
    }

    if ("string" !== typeof a) throw Error(u(284));
    if (!c._owner) throw Error(u(290, a));
  }

  return a;
}

function Qg(a, b) {
  if ("textarea" !== a.type) throw Error(u(31, "[object Object]" === Object.prototype.toString.call(b) ? "object with keys {" + Object.keys(b).join(", ") + "}" : b, ""));
}

function Rg(a) {
  function b(b, c) {
    if (a) {
      var d = b.lastEffect;
      null !== d ? (d.nextEffect = c, b.lastEffect = c) : b.firstEffect = b.lastEffect = c;
      c.nextEffect = null;
      c.effectTag = 8;
    }
  }

  function c(c, d) {
    if (!a) return null;

    for (; null !== d;) {
      b(c, d), d = d.sibling;
    }

    return null;
  }

  function d(a, b) {
    for (a = new Map(); null !== b;) {
      null !== b.key ? a.set(b.key, b) : a.set(b.index, b), b = b.sibling;
    }

    return a;
  }

  function e(a, b) {
    a = Sg(a, b);
    a.index = 0;
    a.sibling = null;
    return a;
  }

  function f(b, c, d) {
    b.index = d;
    if (!a) return c;
    d = b.alternate;
    if (null !== d) return d = d.index, d < c ? (b.effectTag = 2, c) : d;
    b.effectTag = 2;
    return c;
  }

  function g(b) {
    a && null === b.alternate && (b.effectTag = 2);
    return b;
  }

  function h(a, b, c, d) {
    if (null === b || 6 !== b.tag) return b = Tg(c, a.mode, d), b.return = a, b;
    b = e(b, c);
    b.return = a;
    return b;
  }

  function k(a, b, c, d) {
    if (null !== b && b.elementType === c.type) return d = e(b, c.props), d.ref = Pg(a, b, c), d.return = a, d;
    d = Ug(c.type, c.key, c.props, null, a.mode, d);
    d.ref = Pg(a, b, c);
    d.return = a;
    return d;
  }

  function l(a, b, c, d) {
    if (null === b || 4 !== b.tag || b.stateNode.containerInfo !== c.containerInfo || b.stateNode.implementation !== c.implementation) return b = Vg(c, a.mode, d), b.return = a, b;
    b = e(b, c.children || []);
    b.return = a;
    return b;
  }

  function m(a, b, c, d, f) {
    if (null === b || 7 !== b.tag) return b = Wg(c, a.mode, d, f), b.return = a, b;
    b = e(b, c);
    b.return = a;
    return b;
  }

  function p(a, b, c) {
    if ("string" === typeof b || "number" === typeof b) return b = Tg("" + b, a.mode, c), b.return = a, b;

    if ("object" === typeof b && null !== b) {
      switch (b.$$typeof) {
        case Za:
          return c = Ug(b.type, b.key, b.props, null, a.mode, c), c.ref = Pg(a, null, b), c.return = a, c;

        case $a:
          return b = Vg(b, a.mode, c), b.return = a, b;
      }

      if (Og(b) || nb(b)) return b = Wg(b, a.mode, c, null), b.return = a, b;
      Qg(a, b);
    }

    return null;
  }

  function x(a, b, c, d) {
    var e = null !== b ? b.key : null;
    if ("string" === typeof c || "number" === typeof c) return null !== e ? null : h(a, b, "" + c, d);

    if ("object" === typeof c && null !== c) {
      switch (c.$$typeof) {
        case Za:
          return c.key === e ? c.type === ab ? m(a, b, c.props.children, d, e) : k(a, b, c, d) : null;

        case $a:
          return c.key === e ? l(a, b, c, d) : null;
      }

      if (Og(c) || nb(c)) return null !== e ? null : m(a, b, c, d, null);
      Qg(a, c);
    }

    return null;
  }

  function z(a, b, c, d, e) {
    if ("string" === typeof d || "number" === typeof d) return a = a.get(c) || null, h(b, a, "" + d, e);

    if ("object" === typeof d && null !== d) {
      switch (d.$$typeof) {
        case Za:
          return a = a.get(null === d.key ? c : d.key) || null, d.type === ab ? m(b, a, d.props.children, e, d.key) : k(b, a, d, e);

        case $a:
          return a = a.get(null === d.key ? c : d.key) || null, l(b, a, d, e);
      }

      if (Og(d) || nb(d)) return a = a.get(c) || null, m(b, a, d, e, null);
      Qg(b, d);
    }

    return null;
  }

  function ca(e, g, h, k) {
    for (var l = null, t = null, m = g, y = g = 0, A = null; null !== m && y < h.length; y++) {
      m.index > y ? (A = m, m = null) : A = m.sibling;
      var q = x(e, m, h[y], k);

      if (null === q) {
        null === m && (m = A);
        break;
      }

      a && m && null === q.alternate && b(e, m);
      g = f(q, g, y);
      null === t ? l = q : t.sibling = q;
      t = q;
      m = A;
    }

    if (y === h.length) return c(e, m), l;

    if (null === m) {
      for (; y < h.length; y++) {
        m = p(e, h[y], k), null !== m && (g = f(m, g, y), null === t ? l = m : t.sibling = m, t = m);
      }

      return l;
    }

    for (m = d(e, m); y < h.length; y++) {
      A = z(m, e, y, h[y], k), null !== A && (a && null !== A.alternate && m.delete(null === A.key ? y : A.key), g = f(A, g, y), null === t ? l = A : t.sibling = A, t = A);
    }

    a && m.forEach(function (a) {
      return b(e, a);
    });
    return l;
  }

  function D(e, g, h, l) {
    var k = nb(h);
    if ("function" !== typeof k) throw Error(u(150));
    h = k.call(h);
    if (null == h) throw Error(u(151));

    for (var m = k = null, t = g, y = g = 0, A = null, q = h.next(); null !== t && !q.done; y++, q = h.next()) {
      t.index > y ? (A = t, t = null) : A = t.sibling;
      var D = x(e, t, q.value, l);

      if (null === D) {
        null === t && (t = A);
        break;
      }

      a && t && null === D.alternate && b(e, t);
      g = f(D, g, y);
      null === m ? k = D : m.sibling = D;
      m = D;
      t = A;
    }

    if (q.done) return c(e, t), k;

    if (null === t) {
      for (; !q.done; y++, q = h.next()) {
        q = p(e, q.value, l), null !== q && (g = f(q, g, y), null === m ? k = q : m.sibling = q, m = q);
      }

      return k;
    }

    for (t = d(e, t); !q.done; y++, q = h.next()) {
      q = z(t, e, y, q.value, l), null !== q && (a && null !== q.alternate && t.delete(null === q.key ? y : q.key), g = f(q, g, y), null === m ? k = q : m.sibling = q, m = q);
    }

    a && t.forEach(function (a) {
      return b(e, a);
    });
    return k;
  }

  return function (a, d, f, h) {
    var k = "object" === typeof f && null !== f && f.type === ab && null === f.key;
    k && (f = f.props.children);
    var l = "object" === typeof f && null !== f;
    if (l) switch (f.$$typeof) {
      case Za:
        a: {
          l = f.key;

          for (k = d; null !== k;) {
            if (k.key === l) {
              switch (k.tag) {
                case 7:
                  if (f.type === ab) {
                    c(a, k.sibling);
                    d = e(k, f.props.children);
                    d.return = a;
                    a = d;
                    break a;
                  }

                  break;

                default:
                  if (k.elementType === f.type) {
                    c(a, k.sibling);
                    d = e(k, f.props);
                    d.ref = Pg(a, k, f);
                    d.return = a;
                    a = d;
                    break a;
                  }

              }

              c(a, k);
              break;
            } else b(a, k);

            k = k.sibling;
          }

          f.type === ab ? (d = Wg(f.props.children, a.mode, h, f.key), d.return = a, a = d) : (h = Ug(f.type, f.key, f.props, null, a.mode, h), h.ref = Pg(a, d, f), h.return = a, a = h);
        }

        return g(a);

      case $a:
        a: {
          for (k = f.key; null !== d;) {
            if (d.key === k) {
              if (4 === d.tag && d.stateNode.containerInfo === f.containerInfo && d.stateNode.implementation === f.implementation) {
                c(a, d.sibling);
                d = e(d, f.children || []);
                d.return = a;
                a = d;
                break a;
              } else {
                c(a, d);
                break;
              }
            } else b(a, d);
            d = d.sibling;
          }

          d = Vg(f, a.mode, h);
          d.return = a;
          a = d;
        }

        return g(a);
    }
    if ("string" === typeof f || "number" === typeof f) return f = "" + f, null !== d && 6 === d.tag ? (c(a, d.sibling), d = e(d, f), d.return = a, a = d) : (c(a, d), d = Tg(f, a.mode, h), d.return = a, a = d), g(a);
    if (Og(f)) return ca(a, d, f, h);
    if (nb(f)) return D(a, d, f, h);
    l && Qg(a, f);
    if ("undefined" === typeof f && !k) switch (a.tag) {
      case 1:
      case 0:
        throw a = a.type, Error(u(152, a.displayName || a.name || "Component"));
    }
    return c(a, d);
  };
}

var Xg = Rg(!0),
    Yg = Rg(!1),
    Zg = {},
    $g = {
  current: Zg
},
    ah = {
  current: Zg
},
    bh = {
  current: Zg
};

function ch(a) {
  if (a === Zg) throw Error(u(174));
  return a;
}

function dh(a, b) {
  I(bh, b);
  I(ah, a);
  I($g, Zg);
  a = b.nodeType;

  switch (a) {
    case 9:
    case 11:
      b = (b = b.documentElement) ? b.namespaceURI : Ob(null, "");
      break;

    default:
      a = 8 === a ? b.parentNode : b, b = a.namespaceURI || null, a = a.tagName, b = Ob(b, a);
  }

  H($g);
  I($g, b);
}

function eh() {
  H($g);
  H(ah);
  H(bh);
}

function fh(a) {
  ch(bh.current);
  var b = ch($g.current);
  var c = Ob(b, a.type);
  b !== c && (I(ah, a), I($g, c));
}

function gh(a) {
  ah.current === a && (H($g), H(ah));
}

var M = {
  current: 0
};

function hh(a) {
  for (var b = a; null !== b;) {
    if (13 === b.tag) {
      var c = b.memoizedState;
      if (null !== c && (c = c.dehydrated, null === c || c.data === Bd || c.data === Cd)) return b;
    } else if (19 === b.tag && void 0 !== b.memoizedProps.revealOrder) {
      if (0 !== (b.effectTag & 64)) return b;
    } else if (null !== b.child) {
      b.child.return = b;
      b = b.child;
      continue;
    }

    if (b === a) break;

    for (; null === b.sibling;) {
      if (null === b.return || b.return === a) return null;
      b = b.return;
    }

    b.sibling.return = b.return;
    b = b.sibling;
  }

  return null;
}

function ih(a, b) {
  return {
    responder: a,
    props: b
  };
}

var jh = Wa.ReactCurrentDispatcher,
    kh = Wa.ReactCurrentBatchConfig,
    lh = 0,
    N = null,
    O = null,
    P = null,
    mh = !1;

function Q() {
  throw Error(u(321));
}

function nh(a, b) {
  if (null === b) return !1;

  for (var c = 0; c < b.length && c < a.length; c++) {
    if (!$e(a[c], b[c])) return !1;
  }

  return !0;
}

function oh(a, b, c, d, e, f) {
  lh = f;
  N = b;
  b.memoizedState = null;
  b.updateQueue = null;
  b.expirationTime = 0;
  jh.current = null === a || null === a.memoizedState ? ph : qh;
  a = c(d, e);

  if (b.expirationTime === lh) {
    f = 0;

    do {
      b.expirationTime = 0;
      if (!(25 > f)) throw Error(u(301));
      f += 1;
      P = O = null;
      b.updateQueue = null;
      jh.current = rh;
      a = c(d, e);
    } while (b.expirationTime === lh);
  }

  jh.current = sh;
  b = null !== O && null !== O.next;
  lh = 0;
  P = O = N = null;
  mh = !1;
  if (b) throw Error(u(300));
  return a;
}

function th() {
  var a = {
    memoizedState: null,
    baseState: null,
    baseQueue: null,
    queue: null,
    next: null
  };
  null === P ? N.memoizedState = P = a : P = P.next = a;
  return P;
}

function uh() {
  if (null === O) {
    var a = N.alternate;
    a = null !== a ? a.memoizedState : null;
  } else a = O.next;

  var b = null === P ? N.memoizedState : P.next;
  if (null !== b) P = b, O = a;else {
    if (null === a) throw Error(u(310));
    O = a;
    a = {
      memoizedState: O.memoizedState,
      baseState: O.baseState,
      baseQueue: O.baseQueue,
      queue: O.queue,
      next: null
    };
    null === P ? N.memoizedState = P = a : P = P.next = a;
  }
  return P;
}

function vh(a, b) {
  return "function" === typeof b ? b(a) : b;
}

function wh(a) {
  var b = uh(),
      c = b.queue;
  if (null === c) throw Error(u(311));
  c.lastRenderedReducer = a;
  var d = O,
      e = d.baseQueue,
      f = c.pending;

  if (null !== f) {
    if (null !== e) {
      var g = e.next;
      e.next = f.next;
      f.next = g;
    }

    d.baseQueue = e = f;
    c.pending = null;
  }

  if (null !== e) {
    e = e.next;
    d = d.baseState;
    var h = g = f = null,
        k = e;

    do {
      var l = k.expirationTime;

      if (l < lh) {
        var m = {
          expirationTime: k.expirationTime,
          suspenseConfig: k.suspenseConfig,
          action: k.action,
          eagerReducer: k.eagerReducer,
          eagerState: k.eagerState,
          next: null
        };
        null === h ? (g = h = m, f = d) : h = h.next = m;
        l > N.expirationTime && (N.expirationTime = l, Bg(l));
      } else null !== h && (h = h.next = {
        expirationTime: 1073741823,
        suspenseConfig: k.suspenseConfig,
        action: k.action,
        eagerReducer: k.eagerReducer,
        eagerState: k.eagerState,
        next: null
      }), Ag(l, k.suspenseConfig), d = k.eagerReducer === a ? k.eagerState : a(d, k.action);

      k = k.next;
    } while (null !== k && k !== e);

    null === h ? f = d : h.next = g;
    $e(d, b.memoizedState) || (rg = !0);
    b.memoizedState = d;
    b.baseState = f;
    b.baseQueue = h;
    c.lastRenderedState = d;
  }

  return [b.memoizedState, c.dispatch];
}

function xh(a) {
  var b = uh(),
      c = b.queue;
  if (null === c) throw Error(u(311));
  c.lastRenderedReducer = a;
  var d = c.dispatch,
      e = c.pending,
      f = b.memoizedState;

  if (null !== e) {
    c.pending = null;
    var g = e = e.next;

    do {
      f = a(f, g.action), g = g.next;
    } while (g !== e);

    $e(f, b.memoizedState) || (rg = !0);
    b.memoizedState = f;
    null === b.baseQueue && (b.baseState = f);
    c.lastRenderedState = f;
  }

  return [f, d];
}

function yh(a) {
  var b = th();
  "function" === typeof a && (a = a());
  b.memoizedState = b.baseState = a;
  a = b.queue = {
    pending: null,
    dispatch: null,
    lastRenderedReducer: vh,
    lastRenderedState: a
  };
  a = a.dispatch = zh.bind(null, N, a);
  return [b.memoizedState, a];
}

function Ah(a, b, c, d) {
  a = {
    tag: a,
    create: b,
    destroy: c,
    deps: d,
    next: null
  };
  b = N.updateQueue;
  null === b ? (b = {
    lastEffect: null
  }, N.updateQueue = b, b.lastEffect = a.next = a) : (c = b.lastEffect, null === c ? b.lastEffect = a.next = a : (d = c.next, c.next = a, a.next = d, b.lastEffect = a));
  return a;
}

function Bh() {
  return uh().memoizedState;
}

function Ch(a, b, c, d) {
  var e = th();
  N.effectTag |= a;
  e.memoizedState = Ah(1 | b, c, void 0, void 0 === d ? null : d);
}

function Dh(a, b, c, d) {
  var e = uh();
  d = void 0 === d ? null : d;
  var f = void 0;

  if (null !== O) {
    var g = O.memoizedState;
    f = g.destroy;

    if (null !== d && nh(d, g.deps)) {
      Ah(b, c, f, d);
      return;
    }
  }

  N.effectTag |= a;
  e.memoizedState = Ah(1 | b, c, f, d);
}

function Eh(a, b) {
  return Ch(516, 4, a, b);
}

function Fh(a, b) {
  return Dh(516, 4, a, b);
}

function Gh(a, b) {
  return Dh(4, 2, a, b);
}

function Hh(a, b) {
  if ("function" === typeof b) return a = a(), b(a), function () {
    b(null);
  };
  if (null !== b && void 0 !== b) return a = a(), b.current = a, function () {
    b.current = null;
  };
}

function Ih(a, b, c) {
  c = null !== c && void 0 !== c ? c.concat([a]) : null;
  return Dh(4, 2, Hh.bind(null, b, a), c);
}

function Jh() {}

function Kh(a, b) {
  th().memoizedState = [a, void 0 === b ? null : b];
  return a;
}

function Lh(a, b) {
  var c = uh();
  b = void 0 === b ? null : b;
  var d = c.memoizedState;
  if (null !== d && null !== b && nh(b, d[1])) return d[0];
  c.memoizedState = [a, b];
  return a;
}

function Mh(a, b) {
  var c = uh();
  b = void 0 === b ? null : b;
  var d = c.memoizedState;
  if (null !== d && null !== b && nh(b, d[1])) return d[0];
  a = a();
  c.memoizedState = [a, b];
  return a;
}

function Nh(a, b, c) {
  var d = ag();
  cg(98 > d ? 98 : d, function () {
    a(!0);
  });
  cg(97 < d ? 97 : d, function () {
    var d = kh.suspense;
    kh.suspense = void 0 === b ? null : b;

    try {
      a(!1), c();
    } finally {
      kh.suspense = d;
    }
  });
}

function zh(a, b, c) {
  var d = Gg(),
      e = Dg.suspense;
  d = Hg(d, a, e);
  e = {
    expirationTime: d,
    suspenseConfig: e,
    action: c,
    eagerReducer: null,
    eagerState: null,
    next: null
  };
  var f = b.pending;
  null === f ? e.next = e : (e.next = f.next, f.next = e);
  b.pending = e;
  f = a.alternate;
  if (a === N || null !== f && f === N) mh = !0, e.expirationTime = lh, N.expirationTime = lh;else {
    if (0 === a.expirationTime && (null === f || 0 === f.expirationTime) && (f = b.lastRenderedReducer, null !== f)) try {
      var g = b.lastRenderedState,
          h = f(g, c);
      e.eagerReducer = f;
      e.eagerState = h;
      if ($e(h, g)) return;
    } catch (k) {} finally {}
    Ig(a, d);
  }
}

var sh = {
  readContext: sg,
  useCallback: Q,
  useContext: Q,
  useEffect: Q,
  useImperativeHandle: Q,
  useLayoutEffect: Q,
  useMemo: Q,
  useReducer: Q,
  useRef: Q,
  useState: Q,
  useDebugValue: Q,
  useResponder: Q,
  useDeferredValue: Q,
  useTransition: Q
},
    ph = {
  readContext: sg,
  useCallback: Kh,
  useContext: sg,
  useEffect: Eh,
  useImperativeHandle: function useImperativeHandle(a, b, c) {
    c = null !== c && void 0 !== c ? c.concat([a]) : null;
    return Ch(4, 2, Hh.bind(null, b, a), c);
  },
  useLayoutEffect: function useLayoutEffect(a, b) {
    return Ch(4, 2, a, b);
  },
  useMemo: function useMemo(a, b) {
    var c = th();
    b = void 0 === b ? null : b;
    a = a();
    c.memoizedState = [a, b];
    return a;
  },
  useReducer: function useReducer(a, b, c) {
    var d = th();
    b = void 0 !== c ? c(b) : b;
    d.memoizedState = d.baseState = b;
    a = d.queue = {
      pending: null,
      dispatch: null,
      lastRenderedReducer: a,
      lastRenderedState: b
    };
    a = a.dispatch = zh.bind(null, N, a);
    return [d.memoizedState, a];
  },
  useRef: function useRef(a) {
    var b = th();
    a = {
      current: a
    };
    return b.memoizedState = a;
  },
  useState: yh,
  useDebugValue: Jh,
  useResponder: ih,
  useDeferredValue: function useDeferredValue(a, b) {
    var c = yh(a),
        d = c[0],
        e = c[1];
    Eh(function () {
      var c = kh.suspense;
      kh.suspense = void 0 === b ? null : b;

      try {
        e(a);
      } finally {
        kh.suspense = c;
      }
    }, [a, b]);
    return d;
  },
  useTransition: function useTransition(a) {
    var b = yh(!1),
        c = b[0];
    b = b[1];
    return [Kh(Nh.bind(null, b, a), [b, a]), c];
  }
},
    qh = {
  readContext: sg,
  useCallback: Lh,
  useContext: sg,
  useEffect: Fh,
  useImperativeHandle: Ih,
  useLayoutEffect: Gh,
  useMemo: Mh,
  useReducer: wh,
  useRef: Bh,
  useState: function useState() {
    return wh(vh);
  },
  useDebugValue: Jh,
  useResponder: ih,
  useDeferredValue: function useDeferredValue(a, b) {
    var c = wh(vh),
        d = c[0],
        e = c[1];
    Fh(function () {
      var c = kh.suspense;
      kh.suspense = void 0 === b ? null : b;

      try {
        e(a);
      } finally {
        kh.suspense = c;
      }
    }, [a, b]);
    return d;
  },
  useTransition: function useTransition(a) {
    var b = wh(vh),
        c = b[0];
    b = b[1];
    return [Lh(Nh.bind(null, b, a), [b, a]), c];
  }
},
    rh = {
  readContext: sg,
  useCallback: Lh,
  useContext: sg,
  useEffect: Fh,
  useImperativeHandle: Ih,
  useLayoutEffect: Gh,
  useMemo: Mh,
  useReducer: xh,
  useRef: Bh,
  useState: function useState() {
    return xh(vh);
  },
  useDebugValue: Jh,
  useResponder: ih,
  useDeferredValue: function useDeferredValue(a, b) {
    var c = xh(vh),
        d = c[0],
        e = c[1];
    Fh(function () {
      var c = kh.suspense;
      kh.suspense = void 0 === b ? null : b;

      try {
        e(a);
      } finally {
        kh.suspense = c;
      }
    }, [a, b]);
    return d;
  },
  useTransition: function useTransition(a) {
    var b = xh(vh),
        c = b[0];
    b = b[1];
    return [Lh(Nh.bind(null, b, a), [b, a]), c];
  }
},
    Oh = null,
    Ph = null,
    Qh = !1;

function Rh(a, b) {
  var c = Sh(5, null, null, 0);
  c.elementType = "DELETED";
  c.type = "DELETED";
  c.stateNode = b;
  c.return = a;
  c.effectTag = 8;
  null !== a.lastEffect ? (a.lastEffect.nextEffect = c, a.lastEffect = c) : a.firstEffect = a.lastEffect = c;
}

function Th(a, b) {
  switch (a.tag) {
    case 5:
      var c = a.type;
      b = 1 !== b.nodeType || c.toLowerCase() !== b.nodeName.toLowerCase() ? null : b;
      return null !== b ? (a.stateNode = b, !0) : !1;

    case 6:
      return b = "" === a.pendingProps || 3 !== b.nodeType ? null : b, null !== b ? (a.stateNode = b, !0) : !1;

    case 13:
      return !1;

    default:
      return !1;
  }
}

function Uh(a) {
  if (Qh) {
    var b = Ph;

    if (b) {
      var c = b;

      if (!Th(a, b)) {
        b = Jd(c.nextSibling);

        if (!b || !Th(a, b)) {
          a.effectTag = a.effectTag & -1025 | 2;
          Qh = !1;
          Oh = a;
          return;
        }

        Rh(Oh, c);
      }

      Oh = a;
      Ph = Jd(b.firstChild);
    } else a.effectTag = a.effectTag & -1025 | 2, Qh = !1, Oh = a;
  }
}

function Vh(a) {
  for (a = a.return; null !== a && 5 !== a.tag && 3 !== a.tag && 13 !== a.tag;) {
    a = a.return;
  }

  Oh = a;
}

function Wh(a) {
  if (a !== Oh) return !1;
  if (!Qh) return Vh(a), Qh = !0, !1;
  var b = a.type;
  if (5 !== a.tag || "head" !== b && "body" !== b && !Gd(b, a.memoizedProps)) for (b = Ph; b;) {
    Rh(a, b), b = Jd(b.nextSibling);
  }
  Vh(a);

  if (13 === a.tag) {
    a = a.memoizedState;
    a = null !== a ? a.dehydrated : null;
    if (!a) throw Error(u(317));

    a: {
      a = a.nextSibling;

      for (b = 0; a;) {
        if (8 === a.nodeType) {
          var c = a.data;

          if (c === Ad) {
            if (0 === b) {
              Ph = Jd(a.nextSibling);
              break a;
            }

            b--;
          } else c !== zd && c !== Cd && c !== Bd || b++;
        }

        a = a.nextSibling;
      }

      Ph = null;
    }
  } else Ph = Oh ? Jd(a.stateNode.nextSibling) : null;

  return !0;
}

function Xh() {
  Ph = Oh = null;
  Qh = !1;
}

var Yh = Wa.ReactCurrentOwner,
    rg = !1;

function R(a, b, c, d) {
  b.child = null === a ? Yg(b, null, c, d) : Xg(b, a.child, c, d);
}

function Zh(a, b, c, d, e) {
  c = c.render;
  var f = b.ref;
  qg(b, e);
  d = oh(a, b, c, d, f, e);
  if (null !== a && !rg) return b.updateQueue = a.updateQueue, b.effectTag &= -517, a.expirationTime <= e && (a.expirationTime = 0), $h(a, b, e);
  b.effectTag |= 1;
  R(a, b, d, e);
  return b.child;
}

function ai(a, b, c, d, e, f) {
  if (null === a) {
    var g = c.type;
    if ("function" === typeof g && !bi(g) && void 0 === g.defaultProps && null === c.compare && void 0 === c.defaultProps) return b.tag = 15, b.type = g, ci(a, b, g, d, e, f);
    a = Ug(c.type, null, d, null, b.mode, f);
    a.ref = b.ref;
    a.return = b;
    return b.child = a;
  }

  g = a.child;
  if (e < f && (e = g.memoizedProps, c = c.compare, c = null !== c ? c : bf, c(e, d) && a.ref === b.ref)) return $h(a, b, f);
  b.effectTag |= 1;
  a = Sg(g, d);
  a.ref = b.ref;
  a.return = b;
  return b.child = a;
}

function ci(a, b, c, d, e, f) {
  return null !== a && bf(a.memoizedProps, d) && a.ref === b.ref && (rg = !1, e < f) ? (b.expirationTime = a.expirationTime, $h(a, b, f)) : di(a, b, c, d, f);
}

function ei(a, b) {
  var c = b.ref;
  if (null === a && null !== c || null !== a && a.ref !== c) b.effectTag |= 128;
}

function di(a, b, c, d, e) {
  var f = L(c) ? Bf : J.current;
  f = Cf(b, f);
  qg(b, e);
  c = oh(a, b, c, d, f, e);
  if (null !== a && !rg) return b.updateQueue = a.updateQueue, b.effectTag &= -517, a.expirationTime <= e && (a.expirationTime = 0), $h(a, b, e);
  b.effectTag |= 1;
  R(a, b, c, e);
  return b.child;
}

function fi(a, b, c, d, e) {
  if (L(c)) {
    var f = !0;
    Gf(b);
  } else f = !1;

  qg(b, e);
  if (null === b.stateNode) null !== a && (a.alternate = null, b.alternate = null, b.effectTag |= 2), Lg(b, c, d), Ng(b, c, d, e), d = !0;else if (null === a) {
    var g = b.stateNode,
        h = b.memoizedProps;
    g.props = h;
    var k = g.context,
        l = c.contextType;
    "object" === typeof l && null !== l ? l = sg(l) : (l = L(c) ? Bf : J.current, l = Cf(b, l));
    var m = c.getDerivedStateFromProps,
        p = "function" === typeof m || "function" === typeof g.getSnapshotBeforeUpdate;
    p || "function" !== typeof g.UNSAFE_componentWillReceiveProps && "function" !== typeof g.componentWillReceiveProps || (h !== d || k !== l) && Mg(b, g, d, l);
    tg = !1;
    var x = b.memoizedState;
    g.state = x;
    zg(b, d, g, e);
    k = b.memoizedState;
    h !== d || x !== k || K.current || tg ? ("function" === typeof m && (Fg(b, c, m, d), k = b.memoizedState), (h = tg || Kg(b, c, h, d, x, k, l)) ? (p || "function" !== typeof g.UNSAFE_componentWillMount && "function" !== typeof g.componentWillMount || ("function" === typeof g.componentWillMount && g.componentWillMount(), "function" === typeof g.UNSAFE_componentWillMount && g.UNSAFE_componentWillMount()), "function" === typeof g.componentDidMount && (b.effectTag |= 4)) : ("function" === typeof g.componentDidMount && (b.effectTag |= 4), b.memoizedProps = d, b.memoizedState = k), g.props = d, g.state = k, g.context = l, d = h) : ("function" === typeof g.componentDidMount && (b.effectTag |= 4), d = !1);
  } else g = b.stateNode, vg(a, b), h = b.memoizedProps, g.props = b.type === b.elementType ? h : ig(b.type, h), k = g.context, l = c.contextType, "object" === typeof l && null !== l ? l = sg(l) : (l = L(c) ? Bf : J.current, l = Cf(b, l)), m = c.getDerivedStateFromProps, (p = "function" === typeof m || "function" === typeof g.getSnapshotBeforeUpdate) || "function" !== typeof g.UNSAFE_componentWillReceiveProps && "function" !== typeof g.componentWillReceiveProps || (h !== d || k !== l) && Mg(b, g, d, l), tg = !1, k = b.memoizedState, g.state = k, zg(b, d, g, e), x = b.memoizedState, h !== d || k !== x || K.current || tg ? ("function" === typeof m && (Fg(b, c, m, d), x = b.memoizedState), (m = tg || Kg(b, c, h, d, k, x, l)) ? (p || "function" !== typeof g.UNSAFE_componentWillUpdate && "function" !== typeof g.componentWillUpdate || ("function" === typeof g.componentWillUpdate && g.componentWillUpdate(d, x, l), "function" === typeof g.UNSAFE_componentWillUpdate && g.UNSAFE_componentWillUpdate(d, x, l)), "function" === typeof g.componentDidUpdate && (b.effectTag |= 4), "function" === typeof g.getSnapshotBeforeUpdate && (b.effectTag |= 256)) : ("function" !== typeof g.componentDidUpdate || h === a.memoizedProps && k === a.memoizedState || (b.effectTag |= 4), "function" !== typeof g.getSnapshotBeforeUpdate || h === a.memoizedProps && k === a.memoizedState || (b.effectTag |= 256), b.memoizedProps = d, b.memoizedState = x), g.props = d, g.state = x, g.context = l, d = m) : ("function" !== typeof g.componentDidUpdate || h === a.memoizedProps && k === a.memoizedState || (b.effectTag |= 4), "function" !== typeof g.getSnapshotBeforeUpdate || h === a.memoizedProps && k === a.memoizedState || (b.effectTag |= 256), d = !1);
  return gi(a, b, c, d, f, e);
}

function gi(a, b, c, d, e, f) {
  ei(a, b);
  var g = 0 !== (b.effectTag & 64);
  if (!d && !g) return e && Hf(b, c, !1), $h(a, b, f);
  d = b.stateNode;
  Yh.current = b;
  var h = g && "function" !== typeof c.getDerivedStateFromError ? null : d.render();
  b.effectTag |= 1;
  null !== a && g ? (b.child = Xg(b, a.child, null, f), b.child = Xg(b, null, h, f)) : R(a, b, h, f);
  b.memoizedState = d.state;
  e && Hf(b, c, !0);
  return b.child;
}

function hi(a) {
  var b = a.stateNode;
  b.pendingContext ? Ef(a, b.pendingContext, b.pendingContext !== b.context) : b.context && Ef(a, b.context, !1);
  dh(a, b.containerInfo);
}

var ii = {
  dehydrated: null,
  retryTime: 0
};

function ji(a, b, c) {
  var d = b.mode,
      e = b.pendingProps,
      f = M.current,
      g = !1,
      h;
  (h = 0 !== (b.effectTag & 64)) || (h = 0 !== (f & 2) && (null === a || null !== a.memoizedState));
  h ? (g = !0, b.effectTag &= -65) : null !== a && null === a.memoizedState || void 0 === e.fallback || !0 === e.unstable_avoidThisFallback || (f |= 1);
  I(M, f & 1);

  if (null === a) {
    void 0 !== e.fallback && Uh(b);

    if (g) {
      g = e.fallback;
      e = Wg(null, d, 0, null);
      e.return = b;
      if (0 === (b.mode & 2)) for (a = null !== b.memoizedState ? b.child.child : b.child, e.child = a; null !== a;) {
        a.return = e, a = a.sibling;
      }
      c = Wg(g, d, c, null);
      c.return = b;
      e.sibling = c;
      b.memoizedState = ii;
      b.child = e;
      return c;
    }

    d = e.children;
    b.memoizedState = null;
    return b.child = Yg(b, null, d, c);
  }

  if (null !== a.memoizedState) {
    a = a.child;
    d = a.sibling;

    if (g) {
      e = e.fallback;
      c = Sg(a, a.pendingProps);
      c.return = b;
      if (0 === (b.mode & 2) && (g = null !== b.memoizedState ? b.child.child : b.child, g !== a.child)) for (c.child = g; null !== g;) {
        g.return = c, g = g.sibling;
      }
      d = Sg(d, e);
      d.return = b;
      c.sibling = d;
      c.childExpirationTime = 0;
      b.memoizedState = ii;
      b.child = c;
      return d;
    }

    c = Xg(b, a.child, e.children, c);
    b.memoizedState = null;
    return b.child = c;
  }

  a = a.child;

  if (g) {
    g = e.fallback;
    e = Wg(null, d, 0, null);
    e.return = b;
    e.child = a;
    null !== a && (a.return = e);
    if (0 === (b.mode & 2)) for (a = null !== b.memoizedState ? b.child.child : b.child, e.child = a; null !== a;) {
      a.return = e, a = a.sibling;
    }
    c = Wg(g, d, c, null);
    c.return = b;
    e.sibling = c;
    c.effectTag |= 2;
    e.childExpirationTime = 0;
    b.memoizedState = ii;
    b.child = e;
    return c;
  }

  b.memoizedState = null;
  return b.child = Xg(b, a, e.children, c);
}

function ki(a, b) {
  a.expirationTime < b && (a.expirationTime = b);
  var c = a.alternate;
  null !== c && c.expirationTime < b && (c.expirationTime = b);
  pg(a.return, b);
}

function li(a, b, c, d, e, f) {
  var g = a.memoizedState;
  null === g ? a.memoizedState = {
    isBackwards: b,
    rendering: null,
    renderingStartTime: 0,
    last: d,
    tail: c,
    tailExpiration: 0,
    tailMode: e,
    lastEffect: f
  } : (g.isBackwards = b, g.rendering = null, g.renderingStartTime = 0, g.last = d, g.tail = c, g.tailExpiration = 0, g.tailMode = e, g.lastEffect = f);
}

function mi(a, b, c) {
  var d = b.pendingProps,
      e = d.revealOrder,
      f = d.tail;
  R(a, b, d.children, c);
  d = M.current;
  if (0 !== (d & 2)) d = d & 1 | 2, b.effectTag |= 64;else {
    if (null !== a && 0 !== (a.effectTag & 64)) a: for (a = b.child; null !== a;) {
      if (13 === a.tag) null !== a.memoizedState && ki(a, c);else if (19 === a.tag) ki(a, c);else if (null !== a.child) {
        a.child.return = a;
        a = a.child;
        continue;
      }
      if (a === b) break a;

      for (; null === a.sibling;) {
        if (null === a.return || a.return === b) break a;
        a = a.return;
      }

      a.sibling.return = a.return;
      a = a.sibling;
    }
    d &= 1;
  }
  I(M, d);
  if (0 === (b.mode & 2)) b.memoizedState = null;else switch (e) {
    case "forwards":
      c = b.child;

      for (e = null; null !== c;) {
        a = c.alternate, null !== a && null === hh(a) && (e = c), c = c.sibling;
      }

      c = e;
      null === c ? (e = b.child, b.child = null) : (e = c.sibling, c.sibling = null);
      li(b, !1, e, c, f, b.lastEffect);
      break;

    case "backwards":
      c = null;
      e = b.child;

      for (b.child = null; null !== e;) {
        a = e.alternate;

        if (null !== a && null === hh(a)) {
          b.child = e;
          break;
        }

        a = e.sibling;
        e.sibling = c;
        c = e;
        e = a;
      }

      li(b, !0, c, null, f, b.lastEffect);
      break;

    case "together":
      li(b, !1, null, null, void 0, b.lastEffect);
      break;

    default:
      b.memoizedState = null;
  }
  return b.child;
}

function $h(a, b, c) {
  null !== a && (b.dependencies = a.dependencies);
  var d = b.expirationTime;
  0 !== d && Bg(d);
  if (b.childExpirationTime < c) return null;
  if (null !== a && b.child !== a.child) throw Error(u(153));

  if (null !== b.child) {
    a = b.child;
    c = Sg(a, a.pendingProps);
    b.child = c;

    for (c.return = b; null !== a.sibling;) {
      a = a.sibling, c = c.sibling = Sg(a, a.pendingProps), c.return = b;
    }

    c.sibling = null;
  }

  return b.child;
}

var ni, oi, pi, qi;

ni = function ni(a, b) {
  for (var c = b.child; null !== c;) {
    if (5 === c.tag || 6 === c.tag) a.appendChild(c.stateNode);else if (4 !== c.tag && null !== c.child) {
      c.child.return = c;
      c = c.child;
      continue;
    }
    if (c === b) break;

    for (; null === c.sibling;) {
      if (null === c.return || c.return === b) return;
      c = c.return;
    }

    c.sibling.return = c.return;
    c = c.sibling;
  }
};

oi = function oi() {};

pi = function pi(a, b, c, d, e) {
  var f = a.memoizedProps;

  if (f !== d) {
    var g = b.stateNode;
    ch($g.current);
    a = null;

    switch (c) {
      case "input":
        f = zb(g, f);
        d = zb(g, d);
        a = [];
        break;

      case "option":
        f = Gb(g, f);
        d = Gb(g, d);
        a = [];
        break;

      case "select":
        f = n({}, f, {
          value: void 0
        });
        d = n({}, d, {
          value: void 0
        });
        a = [];
        break;

      case "textarea":
        f = Ib(g, f);
        d = Ib(g, d);
        a = [];
        break;

      default:
        "function" !== typeof f.onClick && "function" === typeof d.onClick && (g.onclick = sd);
    }

    od(c, d);
    var h, k;
    c = null;

    for (h in f) {
      if (!d.hasOwnProperty(h) && f.hasOwnProperty(h) && null != f[h]) if ("style" === h) for (k in g = f[h], g) {
        g.hasOwnProperty(k) && (c || (c = {}), c[k] = "");
      } else "dangerouslySetInnerHTML" !== h && "children" !== h && "suppressContentEditableWarning" !== h && "suppressHydrationWarning" !== h && "autoFocus" !== h && (va.hasOwnProperty(h) ? a || (a = []) : (a = a || []).push(h, null));
    }

    for (h in d) {
      var l = d[h];
      g = null != f ? f[h] : void 0;
      if (d.hasOwnProperty(h) && l !== g && (null != l || null != g)) if ("style" === h) {
        if (g) {
          for (k in g) {
            !g.hasOwnProperty(k) || l && l.hasOwnProperty(k) || (c || (c = {}), c[k] = "");
          }

          for (k in l) {
            l.hasOwnProperty(k) && g[k] !== l[k] && (c || (c = {}), c[k] = l[k]);
          }
        } else c || (a || (a = []), a.push(h, c)), c = l;
      } else "dangerouslySetInnerHTML" === h ? (l = l ? l.__html : void 0, g = g ? g.__html : void 0, null != l && g !== l && (a = a || []).push(h, l)) : "children" === h ? g === l || "string" !== typeof l && "number" !== typeof l || (a = a || []).push(h, "" + l) : "suppressContentEditableWarning" !== h && "suppressHydrationWarning" !== h && (va.hasOwnProperty(h) ? (null != l && rd(e, h), a || g === l || (a = [])) : (a = a || []).push(h, l));
    }

    c && (a = a || []).push("style", c);
    e = a;
    if (b.updateQueue = e) b.effectTag |= 4;
  }
};

qi = function qi(a, b, c, d) {
  c !== d && (b.effectTag |= 4);
};

function ri(a, b) {
  switch (a.tailMode) {
    case "hidden":
      b = a.tail;

      for (var c = null; null !== b;) {
        null !== b.alternate && (c = b), b = b.sibling;
      }

      null === c ? a.tail = null : c.sibling = null;
      break;

    case "collapsed":
      c = a.tail;

      for (var d = null; null !== c;) {
        null !== c.alternate && (d = c), c = c.sibling;
      }

      null === d ? b || null === a.tail ? a.tail = null : a.tail.sibling = null : d.sibling = null;
  }
}

function si(a, b, c) {
  var d = b.pendingProps;

  switch (b.tag) {
    case 2:
    case 16:
    case 15:
    case 0:
    case 11:
    case 7:
    case 8:
    case 12:
    case 9:
    case 14:
      return null;

    case 1:
      return L(b.type) && Df(), null;

    case 3:
      return eh(), H(K), H(J), c = b.stateNode, c.pendingContext && (c.context = c.pendingContext, c.pendingContext = null), null !== a && null !== a.child || !Wh(b) || (b.effectTag |= 4), oi(b), null;

    case 5:
      gh(b);
      c = ch(bh.current);
      var e = b.type;
      if (null !== a && null != b.stateNode) pi(a, b, e, d, c), a.ref !== b.ref && (b.effectTag |= 128);else {
        if (!d) {
          if (null === b.stateNode) throw Error(u(166));
          return null;
        }

        a = ch($g.current);

        if (Wh(b)) {
          d = b.stateNode;
          e = b.type;
          var f = b.memoizedProps;
          d[Md] = b;
          d[Nd] = f;

          switch (e) {
            case "iframe":
            case "object":
            case "embed":
              F("load", d);
              break;

            case "video":
            case "audio":
              for (a = 0; a < ac.length; a++) {
                F(ac[a], d);
              }

              break;

            case "source":
              F("error", d);
              break;

            case "img":
            case "image":
            case "link":
              F("error", d);
              F("load", d);
              break;

            case "form":
              F("reset", d);
              F("submit", d);
              break;

            case "details":
              F("toggle", d);
              break;

            case "input":
              Ab(d, f);
              F("invalid", d);
              rd(c, "onChange");
              break;

            case "select":
              d._wrapperState = {
                wasMultiple: !!f.multiple
              };
              F("invalid", d);
              rd(c, "onChange");
              break;

            case "textarea":
              Jb(d, f), F("invalid", d), rd(c, "onChange");
          }

          od(e, f);
          a = null;

          for (var g in f) {
            if (f.hasOwnProperty(g)) {
              var h = f[g];
              "children" === g ? "string" === typeof h ? d.textContent !== h && (a = ["children", h]) : "number" === typeof h && d.textContent !== "" + h && (a = ["children", "" + h]) : va.hasOwnProperty(g) && null != h && rd(c, g);
            }
          }

          switch (e) {
            case "input":
              xb(d);
              Eb(d, f, !0);
              break;

            case "textarea":
              xb(d);
              Lb(d);
              break;

            case "select":
            case "option":
              break;

            default:
              "function" === typeof f.onClick && (d.onclick = sd);
          }

          c = a;
          b.updateQueue = c;
          null !== c && (b.effectTag |= 4);
        } else {
          g = 9 === c.nodeType ? c : c.ownerDocument;
          a === qd && (a = Nb(e));
          a === qd ? "script" === e ? (a = g.createElement("div"), a.innerHTML = "<script>\x3c/script>", a = a.removeChild(a.firstChild)) : "string" === typeof d.is ? a = g.createElement(e, {
            is: d.is
          }) : (a = g.createElement(e), "select" === e && (g = a, d.multiple ? g.multiple = !0 : d.size && (g.size = d.size))) : a = g.createElementNS(a, e);
          a[Md] = b;
          a[Nd] = d;
          ni(a, b, !1, !1);
          b.stateNode = a;
          g = pd(e, d);

          switch (e) {
            case "iframe":
            case "object":
            case "embed":
              F("load", a);
              h = d;
              break;

            case "video":
            case "audio":
              for (h = 0; h < ac.length; h++) {
                F(ac[h], a);
              }

              h = d;
              break;

            case "source":
              F("error", a);
              h = d;
              break;

            case "img":
            case "image":
            case "link":
              F("error", a);
              F("load", a);
              h = d;
              break;

            case "form":
              F("reset", a);
              F("submit", a);
              h = d;
              break;

            case "details":
              F("toggle", a);
              h = d;
              break;

            case "input":
              Ab(a, d);
              h = zb(a, d);
              F("invalid", a);
              rd(c, "onChange");
              break;

            case "option":
              h = Gb(a, d);
              break;

            case "select":
              a._wrapperState = {
                wasMultiple: !!d.multiple
              };
              h = n({}, d, {
                value: void 0
              });
              F("invalid", a);
              rd(c, "onChange");
              break;

            case "textarea":
              Jb(a, d);
              h = Ib(a, d);
              F("invalid", a);
              rd(c, "onChange");
              break;

            default:
              h = d;
          }

          od(e, h);
          var k = h;

          for (f in k) {
            if (k.hasOwnProperty(f)) {
              var l = k[f];
              "style" === f ? md(a, l) : "dangerouslySetInnerHTML" === f ? (l = l ? l.__html : void 0, null != l && Qb(a, l)) : "children" === f ? "string" === typeof l ? ("textarea" !== e || "" !== l) && Rb(a, l) : "number" === typeof l && Rb(a, "" + l) : "suppressContentEditableWarning" !== f && "suppressHydrationWarning" !== f && "autoFocus" !== f && (va.hasOwnProperty(f) ? null != l && rd(c, f) : null != l && Xa(a, f, l, g));
            }
          }

          switch (e) {
            case "input":
              xb(a);
              Eb(a, d, !1);
              break;

            case "textarea":
              xb(a);
              Lb(a);
              break;

            case "option":
              null != d.value && a.setAttribute("value", "" + rb(d.value));
              break;

            case "select":
              a.multiple = !!d.multiple;
              c = d.value;
              null != c ? Hb(a, !!d.multiple, c, !1) : null != d.defaultValue && Hb(a, !!d.multiple, d.defaultValue, !0);
              break;

            default:
              "function" === typeof h.onClick && (a.onclick = sd);
          }

          Fd(e, d) && (b.effectTag |= 4);
        }

        null !== b.ref && (b.effectTag |= 128);
      }
      return null;

    case 6:
      if (a && null != b.stateNode) qi(a, b, a.memoizedProps, d);else {
        if ("string" !== typeof d && null === b.stateNode) throw Error(u(166));
        c = ch(bh.current);
        ch($g.current);
        Wh(b) ? (c = b.stateNode, d = b.memoizedProps, c[Md] = b, c.nodeValue !== d && (b.effectTag |= 4)) : (c = (9 === c.nodeType ? c : c.ownerDocument).createTextNode(d), c[Md] = b, b.stateNode = c);
      }
      return null;

    case 13:
      H(M);
      d = b.memoizedState;
      if (0 !== (b.effectTag & 64)) return b.expirationTime = c, b;
      c = null !== d;
      d = !1;
      null === a ? void 0 !== b.memoizedProps.fallback && Wh(b) : (e = a.memoizedState, d = null !== e, c || null === e || (e = a.child.sibling, null !== e && (f = b.firstEffect, null !== f ? (b.firstEffect = e, e.nextEffect = f) : (b.firstEffect = b.lastEffect = e, e.nextEffect = null), e.effectTag = 8)));
      if (c && !d && 0 !== (b.mode & 2)) if (null === a && !0 !== b.memoizedProps.unstable_avoidThisFallback || 0 !== (M.current & 1)) S === ti && (S = ui);else {
        if (S === ti || S === ui) S = vi;
        0 !== wi && null !== T && (xi(T, U), yi(T, wi));
      }
      if (c || d) b.effectTag |= 4;
      return null;

    case 4:
      return eh(), oi(b), null;

    case 10:
      return og(b), null;

    case 17:
      return L(b.type) && Df(), null;

    case 19:
      H(M);
      d = b.memoizedState;
      if (null === d) return null;
      e = 0 !== (b.effectTag & 64);
      f = d.rendering;
      if (null === f) {
        if (e) ri(d, !1);else {
          if (S !== ti || null !== a && 0 !== (a.effectTag & 64)) for (f = b.child; null !== f;) {
            a = hh(f);

            if (null !== a) {
              b.effectTag |= 64;
              ri(d, !1);
              e = a.updateQueue;
              null !== e && (b.updateQueue = e, b.effectTag |= 4);
              null === d.lastEffect && (b.firstEffect = null);
              b.lastEffect = d.lastEffect;

              for (d = b.child; null !== d;) {
                e = d, f = c, e.effectTag &= 2, e.nextEffect = null, e.firstEffect = null, e.lastEffect = null, a = e.alternate, null === a ? (e.childExpirationTime = 0, e.expirationTime = f, e.child = null, e.memoizedProps = null, e.memoizedState = null, e.updateQueue = null, e.dependencies = null) : (e.childExpirationTime = a.childExpirationTime, e.expirationTime = a.expirationTime, e.child = a.child, e.memoizedProps = a.memoizedProps, e.memoizedState = a.memoizedState, e.updateQueue = a.updateQueue, f = a.dependencies, e.dependencies = null === f ? null : {
                  expirationTime: f.expirationTime,
                  firstContext: f.firstContext,
                  responders: f.responders
                }), d = d.sibling;
              }

              I(M, M.current & 1 | 2);
              return b.child;
            }

            f = f.sibling;
          }
        }
      } else {
        if (!e) if (a = hh(f), null !== a) {
          if (b.effectTag |= 64, e = !0, c = a.updateQueue, null !== c && (b.updateQueue = c, b.effectTag |= 4), ri(d, !0), null === d.tail && "hidden" === d.tailMode && !f.alternate) return b = b.lastEffect = d.lastEffect, null !== b && (b.nextEffect = null), null;
        } else 2 * $f() - d.renderingStartTime > d.tailExpiration && 1 < c && (b.effectTag |= 64, e = !0, ri(d, !1), b.expirationTime = b.childExpirationTime = c - 1);
        d.isBackwards ? (f.sibling = b.child, b.child = f) : (c = d.last, null !== c ? c.sibling = f : b.child = f, d.last = f);
      }
      return null !== d.tail ? (0 === d.tailExpiration && (d.tailExpiration = $f() + 500), c = d.tail, d.rendering = c, d.tail = c.sibling, d.lastEffect = b.lastEffect, d.renderingStartTime = $f(), c.sibling = null, b = M.current, I(M, e ? b & 1 | 2 : b & 1), c) : null;
  }

  throw Error(u(156, b.tag));
}

function zi(a) {
  switch (a.tag) {
    case 1:
      L(a.type) && Df();
      var b = a.effectTag;
      return b & 4096 ? (a.effectTag = b & -4097 | 64, a) : null;

    case 3:
      eh();
      H(K);
      H(J);
      b = a.effectTag;
      if (0 !== (b & 64)) throw Error(u(285));
      a.effectTag = b & -4097 | 64;
      return a;

    case 5:
      return gh(a), null;

    case 13:
      return H(M), b = a.effectTag, b & 4096 ? (a.effectTag = b & -4097 | 64, a) : null;

    case 19:
      return H(M), null;

    case 4:
      return eh(), null;

    case 10:
      return og(a), null;

    default:
      return null;
  }
}

function Ai(a, b) {
  return {
    value: a,
    source: b,
    stack: qb(b)
  };
}

var Bi = "function" === typeof WeakSet ? WeakSet : Set;

function Ci(a, b) {
  var c = b.source,
      d = b.stack;
  null === d && null !== c && (d = qb(c));
  null !== c && pb(c.type);
  b = b.value;
  null !== a && 1 === a.tag && pb(a.type);

  try {
    console.error(b);
  } catch (e) {
    setTimeout(function () {
      throw e;
    });
  }
}

function Di(a, b) {
  try {
    b.props = a.memoizedProps, b.state = a.memoizedState, b.componentWillUnmount();
  } catch (c) {
    Ei(a, c);
  }
}

function Fi(a) {
  var b = a.ref;
  if (null !== b) if ("function" === typeof b) try {
    b(null);
  } catch (c) {
    Ei(a, c);
  } else b.current = null;
}

function Gi(a, b) {
  switch (b.tag) {
    case 0:
    case 11:
    case 15:
    case 22:
      return;

    case 1:
      if (b.effectTag & 256 && null !== a) {
        var c = a.memoizedProps,
            d = a.memoizedState;
        a = b.stateNode;
        b = a.getSnapshotBeforeUpdate(b.elementType === b.type ? c : ig(b.type, c), d);
        a.__reactInternalSnapshotBeforeUpdate = b;
      }

      return;

    case 3:
    case 5:
    case 6:
    case 4:
    case 17:
      return;
  }

  throw Error(u(163));
}

function Hi(a, b) {
  b = b.updateQueue;
  b = null !== b ? b.lastEffect : null;

  if (null !== b) {
    var c = b = b.next;

    do {
      if ((c.tag & a) === a) {
        var d = c.destroy;
        c.destroy = void 0;
        void 0 !== d && d();
      }

      c = c.next;
    } while (c !== b);
  }
}

function Ii(a, b) {
  b = b.updateQueue;
  b = null !== b ? b.lastEffect : null;

  if (null !== b) {
    var c = b = b.next;

    do {
      if ((c.tag & a) === a) {
        var d = c.create;
        c.destroy = d();
      }

      c = c.next;
    } while (c !== b);
  }
}

function Ji(a, b, c) {
  switch (c.tag) {
    case 0:
    case 11:
    case 15:
    case 22:
      Ii(3, c);
      return;

    case 1:
      a = c.stateNode;
      if (c.effectTag & 4) if (null === b) a.componentDidMount();else {
        var d = c.elementType === c.type ? b.memoizedProps : ig(c.type, b.memoizedProps);
        a.componentDidUpdate(d, b.memoizedState, a.__reactInternalSnapshotBeforeUpdate);
      }
      b = c.updateQueue;
      null !== b && Cg(c, b, a);
      return;

    case 3:
      b = c.updateQueue;

      if (null !== b) {
        a = null;
        if (null !== c.child) switch (c.child.tag) {
          case 5:
            a = c.child.stateNode;
            break;

          case 1:
            a = c.child.stateNode;
        }
        Cg(c, b, a);
      }

      return;

    case 5:
      a = c.stateNode;
      null === b && c.effectTag & 4 && Fd(c.type, c.memoizedProps) && a.focus();
      return;

    case 6:
      return;

    case 4:
      return;

    case 12:
      return;

    case 13:
      null === c.memoizedState && (c = c.alternate, null !== c && (c = c.memoizedState, null !== c && (c = c.dehydrated, null !== c && Vc(c))));
      return;

    case 19:
    case 17:
    case 20:
    case 21:
      return;
  }

  throw Error(u(163));
}

function Ki(a, b, c) {
  "function" === typeof Li && Li(b);

  switch (b.tag) {
    case 0:
    case 11:
    case 14:
    case 15:
    case 22:
      a = b.updateQueue;

      if (null !== a && (a = a.lastEffect, null !== a)) {
        var d = a.next;
        cg(97 < c ? 97 : c, function () {
          var a = d;

          do {
            var c = a.destroy;

            if (void 0 !== c) {
              var g = b;

              try {
                c();
              } catch (h) {
                Ei(g, h);
              }
            }

            a = a.next;
          } while (a !== d);
        });
      }

      break;

    case 1:
      Fi(b);
      c = b.stateNode;
      "function" === typeof c.componentWillUnmount && Di(b, c);
      break;

    case 5:
      Fi(b);
      break;

    case 4:
      Mi(a, b, c);
  }
}

function Ni(a) {
  var b = a.alternate;
  a.return = null;
  a.child = null;
  a.memoizedState = null;
  a.updateQueue = null;
  a.dependencies = null;
  a.alternate = null;
  a.firstEffect = null;
  a.lastEffect = null;
  a.pendingProps = null;
  a.memoizedProps = null;
  a.stateNode = null;
  null !== b && Ni(b);
}

function Oi(a) {
  return 5 === a.tag || 3 === a.tag || 4 === a.tag;
}

function Pi(a) {
  a: {
    for (var b = a.return; null !== b;) {
      if (Oi(b)) {
        var c = b;
        break a;
      }

      b = b.return;
    }

    throw Error(u(160));
  }

  b = c.stateNode;

  switch (c.tag) {
    case 5:
      var d = !1;
      break;

    case 3:
      b = b.containerInfo;
      d = !0;
      break;

    case 4:
      b = b.containerInfo;
      d = !0;
      break;

    default:
      throw Error(u(161));
  }

  c.effectTag & 16 && (Rb(b, ""), c.effectTag &= -17);

  a: b: for (c = a;;) {
    for (; null === c.sibling;) {
      if (null === c.return || Oi(c.return)) {
        c = null;
        break a;
      }

      c = c.return;
    }

    c.sibling.return = c.return;

    for (c = c.sibling; 5 !== c.tag && 6 !== c.tag && 18 !== c.tag;) {
      if (c.effectTag & 2) continue b;
      if (null === c.child || 4 === c.tag) continue b;else c.child.return = c, c = c.child;
    }

    if (!(c.effectTag & 2)) {
      c = c.stateNode;
      break a;
    }
  }

  d ? Qi(a, c, b) : Ri(a, c, b);
}

function Qi(a, b, c) {
  var d = a.tag,
      e = 5 === d || 6 === d;
  if (e) a = e ? a.stateNode : a.stateNode.instance, b ? 8 === c.nodeType ? c.parentNode.insertBefore(a, b) : c.insertBefore(a, b) : (8 === c.nodeType ? (b = c.parentNode, b.insertBefore(a, c)) : (b = c, b.appendChild(a)), c = c._reactRootContainer, null !== c && void 0 !== c || null !== b.onclick || (b.onclick = sd));else if (4 !== d && (a = a.child, null !== a)) for (Qi(a, b, c), a = a.sibling; null !== a;) {
    Qi(a, b, c), a = a.sibling;
  }
}

function Ri(a, b, c) {
  var d = a.tag,
      e = 5 === d || 6 === d;
  if (e) a = e ? a.stateNode : a.stateNode.instance, b ? c.insertBefore(a, b) : c.appendChild(a);else if (4 !== d && (a = a.child, null !== a)) for (Ri(a, b, c), a = a.sibling; null !== a;) {
    Ri(a, b, c), a = a.sibling;
  }
}

function Mi(a, b, c) {
  for (var d = b, e = !1, f, g;;) {
    if (!e) {
      e = d.return;

      a: for (;;) {
        if (null === e) throw Error(u(160));
        f = e.stateNode;

        switch (e.tag) {
          case 5:
            g = !1;
            break a;

          case 3:
            f = f.containerInfo;
            g = !0;
            break a;

          case 4:
            f = f.containerInfo;
            g = !0;
            break a;
        }

        e = e.return;
      }

      e = !0;
    }

    if (5 === d.tag || 6 === d.tag) {
      a: for (var h = a, k = d, l = c, m = k;;) {
        if (Ki(h, m, l), null !== m.child && 4 !== m.tag) m.child.return = m, m = m.child;else {
          if (m === k) break a;

          for (; null === m.sibling;) {
            if (null === m.return || m.return === k) break a;
            m = m.return;
          }

          m.sibling.return = m.return;
          m = m.sibling;
        }
      }

      g ? (h = f, k = d.stateNode, 8 === h.nodeType ? h.parentNode.removeChild(k) : h.removeChild(k)) : f.removeChild(d.stateNode);
    } else if (4 === d.tag) {
      if (null !== d.child) {
        f = d.stateNode.containerInfo;
        g = !0;
        d.child.return = d;
        d = d.child;
        continue;
      }
    } else if (Ki(a, d, c), null !== d.child) {
      d.child.return = d;
      d = d.child;
      continue;
    }

    if (d === b) break;

    for (; null === d.sibling;) {
      if (null === d.return || d.return === b) return;
      d = d.return;
      4 === d.tag && (e = !1);
    }

    d.sibling.return = d.return;
    d = d.sibling;
  }
}

function Si(a, b) {
  switch (b.tag) {
    case 0:
    case 11:
    case 14:
    case 15:
    case 22:
      Hi(3, b);
      return;

    case 1:
      return;

    case 5:
      var c = b.stateNode;

      if (null != c) {
        var d = b.memoizedProps,
            e = null !== a ? a.memoizedProps : d;
        a = b.type;
        var f = b.updateQueue;
        b.updateQueue = null;

        if (null !== f) {
          c[Nd] = d;
          "input" === a && "radio" === d.type && null != d.name && Bb(c, d);
          pd(a, e);
          b = pd(a, d);

          for (e = 0; e < f.length; e += 2) {
            var g = f[e],
                h = f[e + 1];
            "style" === g ? md(c, h) : "dangerouslySetInnerHTML" === g ? Qb(c, h) : "children" === g ? Rb(c, h) : Xa(c, g, h, b);
          }

          switch (a) {
            case "input":
              Cb(c, d);
              break;

            case "textarea":
              Kb(c, d);
              break;

            case "select":
              b = c._wrapperState.wasMultiple, c._wrapperState.wasMultiple = !!d.multiple, a = d.value, null != a ? Hb(c, !!d.multiple, a, !1) : b !== !!d.multiple && (null != d.defaultValue ? Hb(c, !!d.multiple, d.defaultValue, !0) : Hb(c, !!d.multiple, d.multiple ? [] : "", !1));
          }
        }
      }

      return;

    case 6:
      if (null === b.stateNode) throw Error(u(162));
      b.stateNode.nodeValue = b.memoizedProps;
      return;

    case 3:
      b = b.stateNode;
      b.hydrate && (b.hydrate = !1, Vc(b.containerInfo));
      return;

    case 12:
      return;

    case 13:
      c = b;
      null === b.memoizedState ? d = !1 : (d = !0, c = b.child, Ti = $f());
      if (null !== c) a: for (a = c;;) {
        if (5 === a.tag) f = a.stateNode, d ? (f = f.style, "function" === typeof f.setProperty ? f.setProperty("display", "none", "important") : f.display = "none") : (f = a.stateNode, e = a.memoizedProps.style, e = void 0 !== e && null !== e && e.hasOwnProperty("display") ? e.display : null, f.style.display = ld("display", e));else if (6 === a.tag) a.stateNode.nodeValue = d ? "" : a.memoizedProps;else if (13 === a.tag && null !== a.memoizedState && null === a.memoizedState.dehydrated) {
          f = a.child.sibling;
          f.return = a;
          a = f;
          continue;
        } else if (null !== a.child) {
          a.child.return = a;
          a = a.child;
          continue;
        }
        if (a === c) break;

        for (; null === a.sibling;) {
          if (null === a.return || a.return === c) break a;
          a = a.return;
        }

        a.sibling.return = a.return;
        a = a.sibling;
      }
      Ui(b);
      return;

    case 19:
      Ui(b);
      return;

    case 17:
      return;
  }

  throw Error(u(163));
}

function Ui(a) {
  var b = a.updateQueue;

  if (null !== b) {
    a.updateQueue = null;
    var c = a.stateNode;
    null === c && (c = a.stateNode = new Bi());
    b.forEach(function (b) {
      var d = Vi.bind(null, a, b);
      c.has(b) || (c.add(b), b.then(d, d));
    });
  }
}

var Wi = "function" === typeof WeakMap ? WeakMap : Map;

function Xi(a, b, c) {
  c = wg(c, null);
  c.tag = 3;
  c.payload = {
    element: null
  };
  var d = b.value;

  c.callback = function () {
    Yi || (Yi = !0, Zi = d);
    Ci(a, b);
  };

  return c;
}

function $i(a, b, c) {
  c = wg(c, null);
  c.tag = 3;
  var d = a.type.getDerivedStateFromError;

  if ("function" === typeof d) {
    var e = b.value;

    c.payload = function () {
      Ci(a, b);
      return d(e);
    };
  }

  var f = a.stateNode;
  null !== f && "function" === typeof f.componentDidCatch && (c.callback = function () {
    "function" !== typeof d && (null === aj ? aj = new Set([this]) : aj.add(this), Ci(a, b));
    var c = b.stack;
    this.componentDidCatch(b.value, {
      componentStack: null !== c ? c : ""
    });
  });
  return c;
}

var bj = Math.ceil,
    cj = Wa.ReactCurrentDispatcher,
    dj = Wa.ReactCurrentOwner,
    V = 0,
    ej = 8,
    fj = 16,
    gj = 32,
    ti = 0,
    hj = 1,
    ij = 2,
    ui = 3,
    vi = 4,
    jj = 5,
    W = V,
    T = null,
    X = null,
    U = 0,
    S = ti,
    kj = null,
    lj = 1073741823,
    mj = 1073741823,
    nj = null,
    wi = 0,
    oj = !1,
    Ti = 0,
    pj = 500,
    Y = null,
    Yi = !1,
    Zi = null,
    aj = null,
    qj = !1,
    rj = null,
    sj = 90,
    tj = null,
    uj = 0,
    vj = null,
    wj = 0;

function Gg() {
  return (W & (fj | gj)) !== V ? 1073741821 - ($f() / 10 | 0) : 0 !== wj ? wj : wj = 1073741821 - ($f() / 10 | 0);
}

function Hg(a, b, c) {
  b = b.mode;
  if (0 === (b & 2)) return 1073741823;
  var d = ag();
  if (0 === (b & 4)) return 99 === d ? 1073741823 : 1073741822;
  if ((W & fj) !== V) return U;
  if (null !== c) a = hg(a, c.timeoutMs | 0 || 5E3, 250);else switch (d) {
    case 99:
      a = 1073741823;
      break;

    case 98:
      a = hg(a, 150, 100);
      break;

    case 97:
    case 96:
      a = hg(a, 5E3, 250);
      break;

    case 95:
      a = 2;
      break;

    default:
      throw Error(u(326));
  }
  null !== T && a === U && --a;
  return a;
}

function Ig(a, b) {
  if (50 < uj) throw uj = 0, vj = null, Error(u(185));
  a = xj(a, b);

  if (null !== a) {
    var c = ag();
    1073741823 === b ? (W & ej) !== V && (W & (fj | gj)) === V ? yj(a) : (Z(a), W === V && gg()) : Z(a);
    (W & 4) === V || 98 !== c && 99 !== c || (null === tj ? tj = new Map([[a, b]]) : (c = tj.get(a), (void 0 === c || c > b) && tj.set(a, b)));
  }
}

function xj(a, b) {
  a.expirationTime < b && (a.expirationTime = b);
  var c = a.alternate;
  null !== c && c.expirationTime < b && (c.expirationTime = b);
  var d = a.return,
      e = null;
  if (null === d && 3 === a.tag) e = a.stateNode;else for (; null !== d;) {
    c = d.alternate;
    d.childExpirationTime < b && (d.childExpirationTime = b);
    null !== c && c.childExpirationTime < b && (c.childExpirationTime = b);

    if (null === d.return && 3 === d.tag) {
      e = d.stateNode;
      break;
    }

    d = d.return;
  }
  null !== e && (T === e && (Bg(b), S === vi && xi(e, U)), yi(e, b));
  return e;
}

function zj(a) {
  var b = a.lastExpiredTime;
  if (0 !== b) return b;
  b = a.firstPendingTime;
  if (!Aj(a, b)) return b;
  var c = a.lastPingedTime;
  a = a.nextKnownPendingLevel;
  a = c > a ? c : a;
  return 2 >= a && b !== a ? 0 : a;
}

function Z(a) {
  if (0 !== a.lastExpiredTime) a.callbackExpirationTime = 1073741823, a.callbackPriority = 99, a.callbackNode = eg(yj.bind(null, a));else {
    var b = zj(a),
        c = a.callbackNode;
    if (0 === b) null !== c && (a.callbackNode = null, a.callbackExpirationTime = 0, a.callbackPriority = 90);else {
      var d = Gg();
      1073741823 === b ? d = 99 : 1 === b || 2 === b ? d = 95 : (d = 10 * (1073741821 - b) - 10 * (1073741821 - d), d = 0 >= d ? 99 : 250 >= d ? 98 : 5250 >= d ? 97 : 95);

      if (null !== c) {
        var e = a.callbackPriority;
        if (a.callbackExpirationTime === b && e >= d) return;
        c !== Tf && Kf(c);
      }

      a.callbackExpirationTime = b;
      a.callbackPriority = d;
      b = 1073741823 === b ? eg(yj.bind(null, a)) : dg(d, Bj.bind(null, a), {
        timeout: 10 * (1073741821 - b) - $f()
      });
      a.callbackNode = b;
    }
  }
}

function Bj(a, b) {
  wj = 0;
  if (b) return b = Gg(), Cj(a, b), Z(a), null;
  var c = zj(a);

  if (0 !== c) {
    b = a.callbackNode;
    if ((W & (fj | gj)) !== V) throw Error(u(327));
    Dj();
    a === T && c === U || Ej(a, c);

    if (null !== X) {
      var d = W;
      W |= fj;
      var e = Fj();

      do {
        try {
          Gj();
          break;
        } catch (h) {
          Hj(a, h);
        }
      } while (1);

      ng();
      W = d;
      cj.current = e;
      if (S === hj) throw b = kj, Ej(a, c), xi(a, c), Z(a), b;
      if (null === X) switch (e = a.finishedWork = a.current.alternate, a.finishedExpirationTime = c, d = S, T = null, d) {
        case ti:
        case hj:
          throw Error(u(345));

        case ij:
          Cj(a, 2 < c ? 2 : c);
          break;

        case ui:
          xi(a, c);
          d = a.lastSuspendedTime;
          c === d && (a.nextKnownPendingLevel = Ij(e));

          if (1073741823 === lj && (e = Ti + pj - $f(), 10 < e)) {
            if (oj) {
              var f = a.lastPingedTime;

              if (0 === f || f >= c) {
                a.lastPingedTime = c;
                Ej(a, c);
                break;
              }
            }

            f = zj(a);
            if (0 !== f && f !== c) break;

            if (0 !== d && d !== c) {
              a.lastPingedTime = d;
              break;
            }

            a.timeoutHandle = Hd(Jj.bind(null, a), e);
            break;
          }

          Jj(a);
          break;

        case vi:
          xi(a, c);
          d = a.lastSuspendedTime;
          c === d && (a.nextKnownPendingLevel = Ij(e));

          if (oj && (e = a.lastPingedTime, 0 === e || e >= c)) {
            a.lastPingedTime = c;
            Ej(a, c);
            break;
          }

          e = zj(a);
          if (0 !== e && e !== c) break;

          if (0 !== d && d !== c) {
            a.lastPingedTime = d;
            break;
          }

          1073741823 !== mj ? d = 10 * (1073741821 - mj) - $f() : 1073741823 === lj ? d = 0 : (d = 10 * (1073741821 - lj) - 5E3, e = $f(), c = 10 * (1073741821 - c) - e, d = e - d, 0 > d && (d = 0), d = (120 > d ? 120 : 480 > d ? 480 : 1080 > d ? 1080 : 1920 > d ? 1920 : 3E3 > d ? 3E3 : 4320 > d ? 4320 : 1960 * bj(d / 1960)) - d, c < d && (d = c));

          if (10 < d) {
            a.timeoutHandle = Hd(Jj.bind(null, a), d);
            break;
          }

          Jj(a);
          break;

        case jj:
          if (1073741823 !== lj && null !== nj) {
            f = lj;
            var g = nj;
            d = g.busyMinDurationMs | 0;
            0 >= d ? d = 0 : (e = g.busyDelayMs | 0, f = $f() - (10 * (1073741821 - f) - (g.timeoutMs | 0 || 5E3)), d = f <= e ? 0 : e + d - f);

            if (10 < d) {
              xi(a, c);
              a.timeoutHandle = Hd(Jj.bind(null, a), d);
              break;
            }
          }

          Jj(a);
          break;

        default:
          throw Error(u(329));
      }
      Z(a);
      if (a.callbackNode === b) return Bj.bind(null, a);
    }
  }

  return null;
}

function yj(a) {
  var b = a.lastExpiredTime;
  b = 0 !== b ? b : 1073741823;
  if ((W & (fj | gj)) !== V) throw Error(u(327));
  Dj();
  a === T && b === U || Ej(a, b);

  if (null !== X) {
    var c = W;
    W |= fj;
    var d = Fj();

    do {
      try {
        Kj();
        break;
      } catch (e) {
        Hj(a, e);
      }
    } while (1);

    ng();
    W = c;
    cj.current = d;
    if (S === hj) throw c = kj, Ej(a, b), xi(a, b), Z(a), c;
    if (null !== X) throw Error(u(261));
    a.finishedWork = a.current.alternate;
    a.finishedExpirationTime = b;
    T = null;
    Jj(a);
    Z(a);
  }

  return null;
}

function Lj() {
  if (null !== tj) {
    var a = tj;
    tj = null;
    a.forEach(function (a, c) {
      Cj(c, a);
      Z(c);
    });
    gg();
  }
}

function Mj(a, b) {
  var c = W;
  W |= 1;

  try {
    return a(b);
  } finally {
    W = c, W === V && gg();
  }
}

function Nj(a, b) {
  var c = W;
  W &= -2;
  W |= ej;

  try {
    return a(b);
  } finally {
    W = c, W === V && gg();
  }
}

function Ej(a, b) {
  a.finishedWork = null;
  a.finishedExpirationTime = 0;
  var c = a.timeoutHandle;
  -1 !== c && (a.timeoutHandle = -1, Id(c));
  if (null !== X) for (c = X.return; null !== c;) {
    var d = c;

    switch (d.tag) {
      case 1:
        d = d.type.childContextTypes;
        null !== d && void 0 !== d && Df();
        break;

      case 3:
        eh();
        H(K);
        H(J);
        break;

      case 5:
        gh(d);
        break;

      case 4:
        eh();
        break;

      case 13:
        H(M);
        break;

      case 19:
        H(M);
        break;

      case 10:
        og(d);
    }

    c = c.return;
  }
  T = a;
  X = Sg(a.current, null);
  U = b;
  S = ti;
  kj = null;
  mj = lj = 1073741823;
  nj = null;
  wi = 0;
  oj = !1;
}

function Hj(a, b) {
  do {
    try {
      ng();
      jh.current = sh;
      if (mh) for (var c = N.memoizedState; null !== c;) {
        var d = c.queue;
        null !== d && (d.pending = null);
        c = c.next;
      }
      lh = 0;
      P = O = N = null;
      mh = !1;
      if (null === X || null === X.return) return S = hj, kj = b, X = null;

      a: {
        var e = a,
            f = X.return,
            g = X,
            h = b;
        b = U;
        g.effectTag |= 2048;
        g.firstEffect = g.lastEffect = null;

        if (null !== h && "object" === typeof h && "function" === typeof h.then) {
          var k = h;

          if (0 === (g.mode & 2)) {
            var l = g.alternate;
            l ? (g.updateQueue = l.updateQueue, g.memoizedState = l.memoizedState, g.expirationTime = l.expirationTime) : (g.updateQueue = null, g.memoizedState = null);
          }

          var m = 0 !== (M.current & 1),
              p = f;

          do {
            var x;

            if (x = 13 === p.tag) {
              var z = p.memoizedState;
              if (null !== z) x = null !== z.dehydrated ? !0 : !1;else {
                var ca = p.memoizedProps;
                x = void 0 === ca.fallback ? !1 : !0 !== ca.unstable_avoidThisFallback ? !0 : m ? !1 : !0;
              }
            }

            if (x) {
              var D = p.updateQueue;

              if (null === D) {
                var t = new Set();
                t.add(k);
                p.updateQueue = t;
              } else D.add(k);

              if (0 === (p.mode & 2)) {
                p.effectTag |= 64;
                g.effectTag &= -2981;
                if (1 === g.tag) if (null === g.alternate) g.tag = 17;else {
                  var y = wg(1073741823, null);
                  y.tag = 2;
                  xg(g, y);
                }
                g.expirationTime = 1073741823;
                break a;
              }

              h = void 0;
              g = b;
              var A = e.pingCache;
              null === A ? (A = e.pingCache = new Wi(), h = new Set(), A.set(k, h)) : (h = A.get(k), void 0 === h && (h = new Set(), A.set(k, h)));

              if (!h.has(g)) {
                h.add(g);
                var q = Oj.bind(null, e, k, g);
                k.then(q, q);
              }

              p.effectTag |= 4096;
              p.expirationTime = b;
              break a;
            }

            p = p.return;
          } while (null !== p);

          h = Error((pb(g.type) || "A React component") + " suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display." + qb(g));
        }

        S !== jj && (S = ij);
        h = Ai(h, g);
        p = f;

        do {
          switch (p.tag) {
            case 3:
              k = h;
              p.effectTag |= 4096;
              p.expirationTime = b;
              var B = Xi(p, k, b);
              yg(p, B);
              break a;

            case 1:
              k = h;
              var w = p.type,
                  ub = p.stateNode;

              if (0 === (p.effectTag & 64) && ("function" === typeof w.getDerivedStateFromError || null !== ub && "function" === typeof ub.componentDidCatch && (null === aj || !aj.has(ub)))) {
                p.effectTag |= 4096;
                p.expirationTime = b;
                var vb = $i(p, k, b);
                yg(p, vb);
                break a;
              }

          }

          p = p.return;
        } while (null !== p);
      }

      X = Pj(X);
    } catch (Xc) {
      b = Xc;
      continue;
    }

    break;
  } while (1);
}

function Fj() {
  var a = cj.current;
  cj.current = sh;
  return null === a ? sh : a;
}

function Ag(a, b) {
  a < lj && 2 < a && (lj = a);
  null !== b && a < mj && 2 < a && (mj = a, nj = b);
}

function Bg(a) {
  a > wi && (wi = a);
}

function Kj() {
  for (; null !== X;) {
    X = Qj(X);
  }
}

function Gj() {
  for (; null !== X && !Uf();) {
    X = Qj(X);
  }
}

function Qj(a) {
  var b = Rj(a.alternate, a, U);
  a.memoizedProps = a.pendingProps;
  null === b && (b = Pj(a));
  dj.current = null;
  return b;
}

function Pj(a) {
  X = a;

  do {
    var b = X.alternate;
    a = X.return;

    if (0 === (X.effectTag & 2048)) {
      b = si(b, X, U);

      if (1 === U || 1 !== X.childExpirationTime) {
        for (var c = 0, d = X.child; null !== d;) {
          var e = d.expirationTime,
              f = d.childExpirationTime;
          e > c && (c = e);
          f > c && (c = f);
          d = d.sibling;
        }

        X.childExpirationTime = c;
      }

      if (null !== b) return b;
      null !== a && 0 === (a.effectTag & 2048) && (null === a.firstEffect && (a.firstEffect = X.firstEffect), null !== X.lastEffect && (null !== a.lastEffect && (a.lastEffect.nextEffect = X.firstEffect), a.lastEffect = X.lastEffect), 1 < X.effectTag && (null !== a.lastEffect ? a.lastEffect.nextEffect = X : a.firstEffect = X, a.lastEffect = X));
    } else {
      b = zi(X);
      if (null !== b) return b.effectTag &= 2047, b;
      null !== a && (a.firstEffect = a.lastEffect = null, a.effectTag |= 2048);
    }

    b = X.sibling;
    if (null !== b) return b;
    X = a;
  } while (null !== X);

  S === ti && (S = jj);
  return null;
}

function Ij(a) {
  var b = a.expirationTime;
  a = a.childExpirationTime;
  return b > a ? b : a;
}

function Jj(a) {
  var b = ag();
  cg(99, Sj.bind(null, a, b));
  return null;
}

function Sj(a, b) {
  do {
    Dj();
  } while (null !== rj);

  if ((W & (fj | gj)) !== V) throw Error(u(327));
  var c = a.finishedWork,
      d = a.finishedExpirationTime;
  if (null === c) return null;
  a.finishedWork = null;
  a.finishedExpirationTime = 0;
  if (c === a.current) throw Error(u(177));
  a.callbackNode = null;
  a.callbackExpirationTime = 0;
  a.callbackPriority = 90;
  a.nextKnownPendingLevel = 0;
  var e = Ij(c);
  a.firstPendingTime = e;
  d <= a.lastSuspendedTime ? a.firstSuspendedTime = a.lastSuspendedTime = a.nextKnownPendingLevel = 0 : d <= a.firstSuspendedTime && (a.firstSuspendedTime = d - 1);
  d <= a.lastPingedTime && (a.lastPingedTime = 0);
  d <= a.lastExpiredTime && (a.lastExpiredTime = 0);
  a === T && (X = T = null, U = 0);
  1 < c.effectTag ? null !== c.lastEffect ? (c.lastEffect.nextEffect = c, e = c.firstEffect) : e = c : e = c.firstEffect;

  if (null !== e) {
    var f = W;
    W |= gj;
    dj.current = null;
    Dd = fd;
    var g = xd();

    if (yd(g)) {
      if ("selectionStart" in g) var h = {
        start: g.selectionStart,
        end: g.selectionEnd
      };else a: {
        h = (h = g.ownerDocument) && h.defaultView || window;
        var k = h.getSelection && h.getSelection();

        if (k && 0 !== k.rangeCount) {
          h = k.anchorNode;
          var l = k.anchorOffset,
              m = k.focusNode;
          k = k.focusOffset;

          try {
            h.nodeType, m.nodeType;
          } catch (wb) {
            h = null;
            break a;
          }

          var p = 0,
              x = -1,
              z = -1,
              ca = 0,
              D = 0,
              t = g,
              y = null;

          b: for (;;) {
            for (var A;;) {
              t !== h || 0 !== l && 3 !== t.nodeType || (x = p + l);
              t !== m || 0 !== k && 3 !== t.nodeType || (z = p + k);
              3 === t.nodeType && (p += t.nodeValue.length);
              if (null === (A = t.firstChild)) break;
              y = t;
              t = A;
            }

            for (;;) {
              if (t === g) break b;
              y === h && ++ca === l && (x = p);
              y === m && ++D === k && (z = p);
              if (null !== (A = t.nextSibling)) break;
              t = y;
              y = t.parentNode;
            }

            t = A;
          }

          h = -1 === x || -1 === z ? null : {
            start: x,
            end: z
          };
        } else h = null;
      }
      h = h || {
        start: 0,
        end: 0
      };
    } else h = null;

    Ed = {
      activeElementDetached: null,
      focusedElem: g,
      selectionRange: h
    };
    fd = !1;
    Y = e;

    do {
      try {
        Tj();
      } catch (wb) {
        if (null === Y) throw Error(u(330));
        Ei(Y, wb);
        Y = Y.nextEffect;
      }
    } while (null !== Y);

    Y = e;

    do {
      try {
        for (g = a, h = b; null !== Y;) {
          var q = Y.effectTag;
          q & 16 && Rb(Y.stateNode, "");

          if (q & 128) {
            var B = Y.alternate;

            if (null !== B) {
              var w = B.ref;
              null !== w && ("function" === typeof w ? w(null) : w.current = null);
            }
          }

          switch (q & 1038) {
            case 2:
              Pi(Y);
              Y.effectTag &= -3;
              break;

            case 6:
              Pi(Y);
              Y.effectTag &= -3;
              Si(Y.alternate, Y);
              break;

            case 1024:
              Y.effectTag &= -1025;
              break;

            case 1028:
              Y.effectTag &= -1025;
              Si(Y.alternate, Y);
              break;

            case 4:
              Si(Y.alternate, Y);
              break;

            case 8:
              l = Y, Mi(g, l, h), Ni(l);
          }

          Y = Y.nextEffect;
        }
      } catch (wb) {
        if (null === Y) throw Error(u(330));
        Ei(Y, wb);
        Y = Y.nextEffect;
      }
    } while (null !== Y);

    w = Ed;
    B = xd();
    q = w.focusedElem;
    h = w.selectionRange;

    if (B !== q && q && q.ownerDocument && wd(q.ownerDocument.documentElement, q)) {
      null !== h && yd(q) && (B = h.start, w = h.end, void 0 === w && (w = B), "selectionStart" in q ? (q.selectionStart = B, q.selectionEnd = Math.min(w, q.value.length)) : (w = (B = q.ownerDocument || document) && B.defaultView || window, w.getSelection && (w = w.getSelection(), l = q.textContent.length, g = Math.min(h.start, l), h = void 0 === h.end ? g : Math.min(h.end, l), !w.extend && g > h && (l = h, h = g, g = l), l = vd(q, g), m = vd(q, h), l && m && (1 !== w.rangeCount || w.anchorNode !== l.node || w.anchorOffset !== l.offset || w.focusNode !== m.node || w.focusOffset !== m.offset) && (B = B.createRange(), B.setStart(l.node, l.offset), w.removeAllRanges(), g > h ? (w.addRange(B), w.extend(m.node, m.offset)) : (B.setEnd(m.node, m.offset), w.addRange(B))))));
      B = [];

      for (w = q; w = w.parentNode;) {
        1 === w.nodeType && B.push({
          element: w,
          left: w.scrollLeft,
          top: w.scrollTop
        });
      }

      "function" === typeof q.focus && q.focus();

      for (q = 0; q < B.length; q++) {
        w = B[q], w.element.scrollLeft = w.left, w.element.scrollTop = w.top;
      }
    }

    fd = !!Dd;
    Ed = Dd = null;
    a.current = c;
    Y = e;

    do {
      try {
        for (q = a; null !== Y;) {
          var ub = Y.effectTag;
          ub & 36 && Ji(q, Y.alternate, Y);

          if (ub & 128) {
            B = void 0;
            var vb = Y.ref;

            if (null !== vb) {
              var Xc = Y.stateNode;

              switch (Y.tag) {
                case 5:
                  B = Xc;
                  break;

                default:
                  B = Xc;
              }

              "function" === typeof vb ? vb(B) : vb.current = B;
            }
          }

          Y = Y.nextEffect;
        }
      } catch (wb) {
        if (null === Y) throw Error(u(330));
        Ei(Y, wb);
        Y = Y.nextEffect;
      }
    } while (null !== Y);

    Y = null;
    Vf();
    W = f;
  } else a.current = c;

  if (qj) qj = !1, rj = a, sj = b;else for (Y = e; null !== Y;) {
    b = Y.nextEffect, Y.nextEffect = null, Y = b;
  }
  b = a.firstPendingTime;
  0 === b && (aj = null);
  1073741823 === b ? a === vj ? uj++ : (uj = 0, vj = a) : uj = 0;
  "function" === typeof Uj && Uj(c.stateNode, d);
  Z(a);
  if (Yi) throw Yi = !1, a = Zi, Zi = null, a;
  if ((W & ej) !== V) return null;
  gg();
  return null;
}

function Tj() {
  for (; null !== Y;) {
    var a = Y.effectTag;
    0 !== (a & 256) && Gi(Y.alternate, Y);
    0 === (a & 512) || qj || (qj = !0, dg(97, function () {
      Dj();
      return null;
    }));
    Y = Y.nextEffect;
  }
}

function Dj() {
  if (90 !== sj) {
    var a = 97 < sj ? 97 : sj;
    sj = 90;
    return cg(a, Vj);
  }
}

function Vj() {
  if (null === rj) return !1;
  var a = rj;
  rj = null;
  if ((W & (fj | gj)) !== V) throw Error(u(331));
  var b = W;
  W |= gj;

  for (a = a.current.firstEffect; null !== a;) {
    try {
      var c = a;
      if (0 !== (c.effectTag & 512)) switch (c.tag) {
        case 0:
        case 11:
        case 15:
        case 22:
          Hi(5, c), Ii(5, c);
      }
    } catch (d) {
      if (null === a) throw Error(u(330));
      Ei(a, d);
    }

    c = a.nextEffect;
    a.nextEffect = null;
    a = c;
  }

  W = b;
  gg();
  return !0;
}

function Wj(a, b, c) {
  b = Ai(c, b);
  b = Xi(a, b, 1073741823);
  xg(a, b);
  a = xj(a, 1073741823);
  null !== a && Z(a);
}

function Ei(a, b) {
  if (3 === a.tag) Wj(a, a, b);else for (var c = a.return; null !== c;) {
    if (3 === c.tag) {
      Wj(c, a, b);
      break;
    } else if (1 === c.tag) {
      var d = c.stateNode;

      if ("function" === typeof c.type.getDerivedStateFromError || "function" === typeof d.componentDidCatch && (null === aj || !aj.has(d))) {
        a = Ai(b, a);
        a = $i(c, a, 1073741823);
        xg(c, a);
        c = xj(c, 1073741823);
        null !== c && Z(c);
        break;
      }
    }

    c = c.return;
  }
}

function Oj(a, b, c) {
  var d = a.pingCache;
  null !== d && d.delete(b);
  T === a && U === c ? S === vi || S === ui && 1073741823 === lj && $f() - Ti < pj ? Ej(a, U) : oj = !0 : Aj(a, c) && (b = a.lastPingedTime, 0 !== b && b < c || (a.lastPingedTime = c, Z(a)));
}

function Vi(a, b) {
  var c = a.stateNode;
  null !== c && c.delete(b);
  b = 0;
  0 === b && (b = Gg(), b = Hg(b, a, null));
  a = xj(a, b);
  null !== a && Z(a);
}

var Rj;

Rj = function Rj(a, b, c) {
  var d = b.expirationTime;

  if (null !== a) {
    var e = b.pendingProps;
    if (a.memoizedProps !== e || K.current) rg = !0;else {
      if (d < c) {
        rg = !1;

        switch (b.tag) {
          case 3:
            hi(b);
            Xh();
            break;

          case 5:
            fh(b);
            if (b.mode & 4 && 1 !== c && e.hidden) return b.expirationTime = b.childExpirationTime = 1, null;
            break;

          case 1:
            L(b.type) && Gf(b);
            break;

          case 4:
            dh(b, b.stateNode.containerInfo);
            break;

          case 10:
            d = b.memoizedProps.value;
            e = b.type._context;
            I(jg, e._currentValue);
            e._currentValue = d;
            break;

          case 13:
            if (null !== b.memoizedState) {
              d = b.child.childExpirationTime;
              if (0 !== d && d >= c) return ji(a, b, c);
              I(M, M.current & 1);
              b = $h(a, b, c);
              return null !== b ? b.sibling : null;
            }

            I(M, M.current & 1);
            break;

          case 19:
            d = b.childExpirationTime >= c;

            if (0 !== (a.effectTag & 64)) {
              if (d) return mi(a, b, c);
              b.effectTag |= 64;
            }

            e = b.memoizedState;
            null !== e && (e.rendering = null, e.tail = null);
            I(M, M.current);
            if (!d) return null;
        }

        return $h(a, b, c);
      }

      rg = !1;
    }
  } else rg = !1;

  b.expirationTime = 0;

  switch (b.tag) {
    case 2:
      d = b.type;
      null !== a && (a.alternate = null, b.alternate = null, b.effectTag |= 2);
      a = b.pendingProps;
      e = Cf(b, J.current);
      qg(b, c);
      e = oh(null, b, d, a, e, c);
      b.effectTag |= 1;

      if ("object" === typeof e && null !== e && "function" === typeof e.render && void 0 === e.$$typeof) {
        b.tag = 1;
        b.memoizedState = null;
        b.updateQueue = null;

        if (L(d)) {
          var f = !0;
          Gf(b);
        } else f = !1;

        b.memoizedState = null !== e.state && void 0 !== e.state ? e.state : null;
        ug(b);
        var g = d.getDerivedStateFromProps;
        "function" === typeof g && Fg(b, d, g, a);
        e.updater = Jg;
        b.stateNode = e;
        e._reactInternalFiber = b;
        Ng(b, d, a, c);
        b = gi(null, b, d, !0, f, c);
      } else b.tag = 0, R(null, b, e, c), b = b.child;

      return b;

    case 16:
      a: {
        e = b.elementType;
        null !== a && (a.alternate = null, b.alternate = null, b.effectTag |= 2);
        a = b.pendingProps;
        ob(e);
        if (1 !== e._status) throw e._result;
        e = e._result;
        b.type = e;
        f = b.tag = Xj(e);
        a = ig(e, a);

        switch (f) {
          case 0:
            b = di(null, b, e, a, c);
            break a;

          case 1:
            b = fi(null, b, e, a, c);
            break a;

          case 11:
            b = Zh(null, b, e, a, c);
            break a;

          case 14:
            b = ai(null, b, e, ig(e.type, a), d, c);
            break a;
        }

        throw Error(u(306, e, ""));
      }

      return b;

    case 0:
      return d = b.type, e = b.pendingProps, e = b.elementType === d ? e : ig(d, e), di(a, b, d, e, c);

    case 1:
      return d = b.type, e = b.pendingProps, e = b.elementType === d ? e : ig(d, e), fi(a, b, d, e, c);

    case 3:
      hi(b);
      d = b.updateQueue;
      if (null === a || null === d) throw Error(u(282));
      d = b.pendingProps;
      e = b.memoizedState;
      e = null !== e ? e.element : null;
      vg(a, b);
      zg(b, d, null, c);
      d = b.memoizedState.element;
      if (d === e) Xh(), b = $h(a, b, c);else {
        if (e = b.stateNode.hydrate) Ph = Jd(b.stateNode.containerInfo.firstChild), Oh = b, e = Qh = !0;
        if (e) for (c = Yg(b, null, d, c), b.child = c; c;) {
          c.effectTag = c.effectTag & -3 | 1024, c = c.sibling;
        } else R(a, b, d, c), Xh();
        b = b.child;
      }
      return b;

    case 5:
      return fh(b), null === a && Uh(b), d = b.type, e = b.pendingProps, f = null !== a ? a.memoizedProps : null, g = e.children, Gd(d, e) ? g = null : null !== f && Gd(d, f) && (b.effectTag |= 16), ei(a, b), b.mode & 4 && 1 !== c && e.hidden ? (b.expirationTime = b.childExpirationTime = 1, b = null) : (R(a, b, g, c), b = b.child), b;

    case 6:
      return null === a && Uh(b), null;

    case 13:
      return ji(a, b, c);

    case 4:
      return dh(b, b.stateNode.containerInfo), d = b.pendingProps, null === a ? b.child = Xg(b, null, d, c) : R(a, b, d, c), b.child;

    case 11:
      return d = b.type, e = b.pendingProps, e = b.elementType === d ? e : ig(d, e), Zh(a, b, d, e, c);

    case 7:
      return R(a, b, b.pendingProps, c), b.child;

    case 8:
      return R(a, b, b.pendingProps.children, c), b.child;

    case 12:
      return R(a, b, b.pendingProps.children, c), b.child;

    case 10:
      a: {
        d = b.type._context;
        e = b.pendingProps;
        g = b.memoizedProps;
        f = e.value;
        var h = b.type._context;
        I(jg, h._currentValue);
        h._currentValue = f;
        if (null !== g) if (h = g.value, f = $e(h, f) ? 0 : ("function" === typeof d._calculateChangedBits ? d._calculateChangedBits(h, f) : 1073741823) | 0, 0 === f) {
          if (g.children === e.children && !K.current) {
            b = $h(a, b, c);
            break a;
          }
        } else for (h = b.child, null !== h && (h.return = b); null !== h;) {
          var k = h.dependencies;

          if (null !== k) {
            g = h.child;

            for (var l = k.firstContext; null !== l;) {
              if (l.context === d && 0 !== (l.observedBits & f)) {
                1 === h.tag && (l = wg(c, null), l.tag = 2, xg(h, l));
                h.expirationTime < c && (h.expirationTime = c);
                l = h.alternate;
                null !== l && l.expirationTime < c && (l.expirationTime = c);
                pg(h.return, c);
                k.expirationTime < c && (k.expirationTime = c);
                break;
              }

              l = l.next;
            }
          } else g = 10 === h.tag ? h.type === b.type ? null : h.child : h.child;

          if (null !== g) g.return = h;else for (g = h; null !== g;) {
            if (g === b) {
              g = null;
              break;
            }

            h = g.sibling;

            if (null !== h) {
              h.return = g.return;
              g = h;
              break;
            }

            g = g.return;
          }
          h = g;
        }
        R(a, b, e.children, c);
        b = b.child;
      }

      return b;

    case 9:
      return e = b.type, f = b.pendingProps, d = f.children, qg(b, c), e = sg(e, f.unstable_observedBits), d = d(e), b.effectTag |= 1, R(a, b, d, c), b.child;

    case 14:
      return e = b.type, f = ig(e, b.pendingProps), f = ig(e.type, f), ai(a, b, e, f, d, c);

    case 15:
      return ci(a, b, b.type, b.pendingProps, d, c);

    case 17:
      return d = b.type, e = b.pendingProps, e = b.elementType === d ? e : ig(d, e), null !== a && (a.alternate = null, b.alternate = null, b.effectTag |= 2), b.tag = 1, L(d) ? (a = !0, Gf(b)) : a = !1, qg(b, c), Lg(b, d, e), Ng(b, d, e, c), gi(null, b, d, !0, a, c);

    case 19:
      return mi(a, b, c);
  }

  throw Error(u(156, b.tag));
};

var Uj = null,
    Li = null;

function Yj(a) {
  if ("undefined" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) return !1;
  var b = __REACT_DEVTOOLS_GLOBAL_HOOK__;
  if (b.isDisabled || !b.supportsFiber) return !0;

  try {
    var c = b.inject(a);

    Uj = function Uj(a) {
      try {
        b.onCommitFiberRoot(c, a, void 0, 64 === (a.current.effectTag & 64));
      } catch (e) {}
    };

    Li = function Li(a) {
      try {
        b.onCommitFiberUnmount(c, a);
      } catch (e) {}
    };
  } catch (d) {}

  return !0;
}

function Zj(a, b, c, d) {
  this.tag = a;
  this.key = c;
  this.sibling = this.child = this.return = this.stateNode = this.type = this.elementType = null;
  this.index = 0;
  this.ref = null;
  this.pendingProps = b;
  this.dependencies = this.memoizedState = this.updateQueue = this.memoizedProps = null;
  this.mode = d;
  this.effectTag = 0;
  this.lastEffect = this.firstEffect = this.nextEffect = null;
  this.childExpirationTime = this.expirationTime = 0;
  this.alternate = null;
}

function Sh(a, b, c, d) {
  return new Zj(a, b, c, d);
}

function bi(a) {
  a = a.prototype;
  return !(!a || !a.isReactComponent);
}

function Xj(a) {
  if ("function" === typeof a) return bi(a) ? 1 : 0;

  if (void 0 !== a && null !== a) {
    a = a.$$typeof;
    if (a === gb) return 11;
    if (a === jb) return 14;
  }

  return 2;
}

function Sg(a, b) {
  var c = a.alternate;
  null === c ? (c = Sh(a.tag, b, a.key, a.mode), c.elementType = a.elementType, c.type = a.type, c.stateNode = a.stateNode, c.alternate = a, a.alternate = c) : (c.pendingProps = b, c.effectTag = 0, c.nextEffect = null, c.firstEffect = null, c.lastEffect = null);
  c.childExpirationTime = a.childExpirationTime;
  c.expirationTime = a.expirationTime;
  c.child = a.child;
  c.memoizedProps = a.memoizedProps;
  c.memoizedState = a.memoizedState;
  c.updateQueue = a.updateQueue;
  b = a.dependencies;
  c.dependencies = null === b ? null : {
    expirationTime: b.expirationTime,
    firstContext: b.firstContext,
    responders: b.responders
  };
  c.sibling = a.sibling;
  c.index = a.index;
  c.ref = a.ref;
  return c;
}

function Ug(a, b, c, d, e, f) {
  var g = 2;
  d = a;
  if ("function" === typeof a) bi(a) && (g = 1);else if ("string" === typeof a) g = 5;else a: switch (a) {
    case ab:
      return Wg(c.children, e, f, b);

    case fb:
      g = 8;
      e |= 7;
      break;

    case bb:
      g = 8;
      e |= 1;
      break;

    case cb:
      return a = Sh(12, c, b, e | 8), a.elementType = cb, a.type = cb, a.expirationTime = f, a;

    case hb:
      return a = Sh(13, c, b, e), a.type = hb, a.elementType = hb, a.expirationTime = f, a;

    case ib:
      return a = Sh(19, c, b, e), a.elementType = ib, a.expirationTime = f, a;

    default:
      if ("object" === typeof a && null !== a) switch (a.$$typeof) {
        case db:
          g = 10;
          break a;

        case eb:
          g = 9;
          break a;

        case gb:
          g = 11;
          break a;

        case jb:
          g = 14;
          break a;

        case kb:
          g = 16;
          d = null;
          break a;

        case lb:
          g = 22;
          break a;
      }
      throw Error(u(130, null == a ? a : typeof a, ""));
  }
  b = Sh(g, c, b, e);
  b.elementType = a;
  b.type = d;
  b.expirationTime = f;
  return b;
}

function Wg(a, b, c, d) {
  a = Sh(7, a, d, b);
  a.expirationTime = c;
  return a;
}

function Tg(a, b, c) {
  a = Sh(6, a, null, b);
  a.expirationTime = c;
  return a;
}

function Vg(a, b, c) {
  b = Sh(4, null !== a.children ? a.children : [], a.key, b);
  b.expirationTime = c;
  b.stateNode = {
    containerInfo: a.containerInfo,
    pendingChildren: null,
    implementation: a.implementation
  };
  return b;
}

function ak(a, b, c) {
  this.tag = b;
  this.current = null;
  this.containerInfo = a;
  this.pingCache = this.pendingChildren = null;
  this.finishedExpirationTime = 0;
  this.finishedWork = null;
  this.timeoutHandle = -1;
  this.pendingContext = this.context = null;
  this.hydrate = c;
  this.callbackNode = null;
  this.callbackPriority = 90;
  this.lastExpiredTime = this.lastPingedTime = this.nextKnownPendingLevel = this.lastSuspendedTime = this.firstSuspendedTime = this.firstPendingTime = 0;
}

function Aj(a, b) {
  var c = a.firstSuspendedTime;
  a = a.lastSuspendedTime;
  return 0 !== c && c >= b && a <= b;
}

function xi(a, b) {
  var c = a.firstSuspendedTime,
      d = a.lastSuspendedTime;
  c < b && (a.firstSuspendedTime = b);
  if (d > b || 0 === c) a.lastSuspendedTime = b;
  b <= a.lastPingedTime && (a.lastPingedTime = 0);
  b <= a.lastExpiredTime && (a.lastExpiredTime = 0);
}

function yi(a, b) {
  b > a.firstPendingTime && (a.firstPendingTime = b);
  var c = a.firstSuspendedTime;
  0 !== c && (b >= c ? a.firstSuspendedTime = a.lastSuspendedTime = a.nextKnownPendingLevel = 0 : b >= a.lastSuspendedTime && (a.lastSuspendedTime = b + 1), b > a.nextKnownPendingLevel && (a.nextKnownPendingLevel = b));
}

function Cj(a, b) {
  var c = a.lastExpiredTime;
  if (0 === c || c > b) a.lastExpiredTime = b;
}

function bk(a, b, c, d) {
  var e = b.current,
      f = Gg(),
      g = Dg.suspense;
  f = Hg(f, e, g);

  a: if (c) {
    c = c._reactInternalFiber;

    b: {
      if (dc(c) !== c || 1 !== c.tag) throw Error(u(170));
      var h = c;

      do {
        switch (h.tag) {
          case 3:
            h = h.stateNode.context;
            break b;

          case 1:
            if (L(h.type)) {
              h = h.stateNode.__reactInternalMemoizedMergedChildContext;
              break b;
            }

        }

        h = h.return;
      } while (null !== h);

      throw Error(u(171));
    }

    if (1 === c.tag) {
      var k = c.type;

      if (L(k)) {
        c = Ff(c, k, h);
        break a;
      }
    }

    c = h;
  } else c = Af;

  null === b.context ? b.context = c : b.pendingContext = c;
  b = wg(f, g);
  b.payload = {
    element: a
  };
  d = void 0 === d ? null : d;
  null !== d && (b.callback = d);
  xg(e, b);
  Ig(e, f);
  return f;
}

function ck(a) {
  a = a.current;
  if (!a.child) return null;

  switch (a.child.tag) {
    case 5:
      return a.child.stateNode;

    default:
      return a.child.stateNode;
  }
}

function dk(a, b) {
  a = a.memoizedState;
  null !== a && null !== a.dehydrated && a.retryTime < b && (a.retryTime = b);
}

function ek(a, b) {
  dk(a, b);
  (a = a.alternate) && dk(a, b);
}

function fk(a, b, c) {
  c = null != c && !0 === c.hydrate;
  var d = new ak(a, b, c),
      e = Sh(3, null, null, 2 === b ? 7 : 1 === b ? 3 : 0);
  d.current = e;
  e.stateNode = d;
  ug(e);
  a[Od] = d.current;
  c && 0 !== b && Jc(a, 9 === a.nodeType ? a : a.ownerDocument);
  this._internalRoot = d;
}

fk.prototype.render = function (a) {
  bk(a, this._internalRoot, null, null);
};

fk.prototype.unmount = function () {
  var a = this._internalRoot,
      b = a.containerInfo;
  bk(null, a, null, function () {
    b[Od] = null;
  });
};

function gk(a) {
  return !(!a || 1 !== a.nodeType && 9 !== a.nodeType && 11 !== a.nodeType && (8 !== a.nodeType || " react-mount-point-unstable " !== a.nodeValue));
}

function hk(a, b) {
  b || (b = a ? 9 === a.nodeType ? a.documentElement : a.firstChild : null, b = !(!b || 1 !== b.nodeType || !b.hasAttribute("data-reactroot")));
  if (!b) for (var c; c = a.lastChild;) {
    a.removeChild(c);
  }
  return new fk(a, 0, b ? {
    hydrate: !0
  } : void 0);
}

function ik(a, b, c, d, e) {
  var f = c._reactRootContainer;

  if (f) {
    var g = f._internalRoot;

    if ("function" === typeof e) {
      var h = e;

      e = function e() {
        var a = ck(g);
        h.call(a);
      };
    }

    bk(b, g, a, e);
  } else {
    f = c._reactRootContainer = hk(c, d);
    g = f._internalRoot;

    if ("function" === typeof e) {
      var k = e;

      e = function e() {
        var a = ck(g);
        k.call(a);
      };
    }

    Nj(function () {
      bk(b, g, a, e);
    });
  }

  return ck(g);
}

function jk(a, b, c) {
  var d = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;
  return {
    $$typeof: $a,
    key: null == d ? null : "" + d,
    children: a,
    containerInfo: b,
    implementation: c
  };
}

wc = function wc(a) {
  if (13 === a.tag) {
    var b = hg(Gg(), 150, 100);
    Ig(a, b);
    ek(a, b);
  }
};

xc = function xc(a) {
  13 === a.tag && (Ig(a, 3), ek(a, 3));
};

yc = function yc(a) {
  if (13 === a.tag) {
    var b = Gg();
    b = Hg(b, a, null);
    Ig(a, b);
    ek(a, b);
  }
};

za = function za(a, b, c) {
  switch (b) {
    case "input":
      Cb(a, c);
      b = c.name;

      if ("radio" === c.type && null != b) {
        for (c = a; c.parentNode;) {
          c = c.parentNode;
        }

        c = c.querySelectorAll("input[name=" + JSON.stringify("" + b) + '][type="radio"]');

        for (b = 0; b < c.length; b++) {
          var d = c[b];

          if (d !== a && d.form === a.form) {
            var e = Qd(d);
            if (!e) throw Error(u(90));
            yb(d);
            Cb(d, e);
          }
        }
      }

      break;

    case "textarea":
      Kb(a, c);
      break;

    case "select":
      b = c.value, null != b && Hb(a, !!c.multiple, b, !1);
  }
};

Fa = Mj;

Ga = function Ga(a, b, c, d, e) {
  var f = W;
  W |= 4;

  try {
    return cg(98, a.bind(null, b, c, d, e));
  } finally {
    W = f, W === V && gg();
  }
};

Ha = function Ha() {
  (W & (1 | fj | gj)) === V && (Lj(), Dj());
};

Ia = function Ia(a, b) {
  var c = W;
  W |= 2;

  try {
    return a(b);
  } finally {
    W = c, W === V && gg();
  }
};

function kk(a, b) {
  var c = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;
  if (!gk(b)) throw Error(u(200));
  return jk(a, b, null, c);
}

var lk = {
  Events: [Nc, Pd, Qd, xa, ta, Xd, function (a) {
    jc(a, Wd);
  }, Da, Ea, id, mc, Dj, {
    current: !1
  }]
};

(function (a) {
  var b = a.findFiberByHostInstance;
  return Yj(n({}, a, {
    overrideHookState: null,
    overrideProps: null,
    setSuspenseHandler: null,
    scheduleUpdate: null,
    currentDispatcherRef: Wa.ReactCurrentDispatcher,
    findHostInstanceByFiber: function findHostInstanceByFiber(a) {
      a = hc(a);
      return null === a ? null : a.stateNode;
    },
    findFiberByHostInstance: function findFiberByHostInstance(a) {
      return b ? b(a) : null;
    },
    findHostInstancesForRefresh: null,
    scheduleRefresh: null,
    scheduleRoot: null,
    setRefreshHandler: null,
    getCurrentFiber: null
  }));
})({
  findFiberByHostInstance: tc,
  bundleType: 0,
  version: "16.14.0",
  rendererPackageName: "react-dom"
});

exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = lk;
exports.createPortal = kk;

exports.findDOMNode = function (a) {
  if (null == a) return null;
  if (1 === a.nodeType) return a;
  var b = a._reactInternalFiber;

  if (void 0 === b) {
    if ("function" === typeof a.render) throw Error(u(188));
    throw Error(u(268, Object.keys(a)));
  }

  a = hc(b);
  a = null === a ? null : a.stateNode;
  return a;
};

exports.flushSync = function (a, b) {
  if ((W & (fj | gj)) !== V) throw Error(u(187));
  var c = W;
  W |= 1;

  try {
    return cg(99, a.bind(null, b));
  } finally {
    W = c, gg();
  }
};

exports.hydrate = function (a, b, c) {
  if (!gk(b)) throw Error(u(200));
  return ik(null, a, b, !0, c);
};

exports.render = function (a, b, c) {
  if (!gk(b)) throw Error(u(200));
  return ik(null, a, b, !1, c);
};

exports.unmountComponentAtNode = function (a) {
  if (!gk(a)) throw Error(u(40));
  return a._reactRootContainer ? (Nj(function () {
    ik(null, null, a, !1, function () {
      a._reactRootContainer = null;
      a[Od] = null;
    });
  }), !0) : !1;
};

exports.unstable_batchedUpdates = Mj;

exports.unstable_createPortal = function (a, b) {
  return kk(a, b, 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null);
};

exports.unstable_renderSubtreeIntoContainer = function (a, b, c, d) {
  if (!gk(c)) throw Error(u(200));
  if (null == a || void 0 === a._reactInternalFiber) throw Error(u(38));
  return ik(a, b, c, !1, d);
};

exports.version = "16.14.0";

/***/ }),

/***/ 164:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


function checkDCE() {
  /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
  if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' || typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function') {
    return;
  }

  if (false) {}

  try {
    // Verify that the code above has been dead code eliminated (DCE'd).
    __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);
  } catch (err) {
    // DevTools shouldn't crash React, no matter what.
    // We should still report in case we break this code.
    console.error(err);
  }
}

if (true) {
  // DCE check should happen before ReactDOM bundle executes so that
  // DevTools can report bad minification during injection.
  checkDCE();
  module.exports = __webpack_require__(463);
} else {}

/***/ }),

/***/ 37:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";


function _typeof(obj) {
  "@babel/helpers - typeof";

  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof = function _typeof(obj) {
      return typeof obj;
    };
  } else {
    _typeof = function _typeof(obj) {
      return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
    };
  }

  return _typeof(obj);
}

Object.defineProperty(exports, "__esModule", ({
  value: true
}));
Object.defineProperty(exports, "DraggableCore", ({
  enumerable: true,
  get: function get() {
    return _DraggableCore.default;
  }
}));
exports["default"] = void 0;

var React = _interopRequireWildcard(__webpack_require__(791));

var _propTypes = _interopRequireDefault(__webpack_require__(7));

var _reactDom = _interopRequireDefault(__webpack_require__(164));

var _clsx2 = _interopRequireDefault(__webpack_require__(182));

var _domFns = __webpack_require__(280);

var _positionFns = __webpack_require__(580);

var _shims = __webpack_require__(693);

var _DraggableCore = _interopRequireDefault(__webpack_require__(91));

var _log = _interopRequireDefault(__webpack_require__(655));

var _excluded = ["axis", "bounds", "children", "defaultPosition", "defaultClassName", "defaultClassNameDragging", "defaultClassNameDragged", "position", "positionOffset", "scale"];

function _interopRequireDefault(obj) {
  return obj && obj.__esModule ? obj : {
    default: obj
  };
}

function _getRequireWildcardCache(nodeInterop) {
  if (typeof WeakMap !== "function") return null;
  var cacheBabelInterop = new WeakMap();
  var cacheNodeInterop = new WeakMap();
  return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) {
    return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
  })(nodeInterop);
}

function _interopRequireWildcard(obj, nodeInterop) {
  if (!nodeInterop && obj && obj.__esModule) {
    return obj;
  }

  if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") {
    return {
      default: obj
    };
  }

  var cache = _getRequireWildcardCache(nodeInterop);

  if (cache && cache.has(obj)) {
    return cache.get(obj);
  }

  var newObj = {};
  var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;

  for (var key in obj) {
    if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
      var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;

      if (desc && (desc.get || desc.set)) {
        Object.defineProperty(newObj, key, desc);
      } else {
        newObj[key] = obj[key];
      }
    }
  }

  newObj.default = obj;

  if (cache) {
    cache.set(obj, newObj);
  }

  return newObj;
}

function _extends() {
  _extends = Object.assign || function (target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = arguments[i];

      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }

    return target;
  };

  return _extends.apply(this, arguments);
}

function _objectWithoutProperties(source, excluded) {
  if (source == null) return {};

  var target = _objectWithoutPropertiesLoose(source, excluded);

  var key, i;

  if (Object.getOwnPropertySymbols) {
    var sourceSymbolKeys = Object.getOwnPropertySymbols(source);

    for (i = 0; i < sourceSymbolKeys.length; i++) {
      key = sourceSymbolKeys[i];
      if (excluded.indexOf(key) >= 0) continue;
      if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
      target[key] = source[key];
    }
  }

  return target;
}

function _objectWithoutPropertiesLoose(source, excluded) {
  if (source == null) return {};
  var target = {};
  var sourceKeys = Object.keys(source);
  var key, i;

  for (i = 0; i < sourceKeys.length; i++) {
    key = sourceKeys[i];
    if (excluded.indexOf(key) >= 0) continue;
    target[key] = source[key];
  }

  return target;
}

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 i = 1; i < arguments.length; i++) {
    var source = arguments[i] != null ? arguments[i] : {};

    if (i % 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;
}

function _slicedToArray(arr, i) {
  return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
}

function _nonIterableRest() {
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}

function _unsupportedIterableToArray(o, minLen) {
  if (!o) return;
  if (typeof o === "string") return _arrayLikeToArray(o, minLen);
  var n = Object.prototype.toString.call(o).slice(8, -1);
  if (n === "Object" && o.constructor) n = o.constructor.name;
  if (n === "Map" || n === "Set") return Array.from(o);
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
}

function _arrayLikeToArray(arr, len) {
  if (len == null || len > arr.length) len = arr.length;

  for (var i = 0, arr2 = new Array(len); i < len; i++) {
    arr2[i] = arr[i];
  }

  return arr2;
}

function _iterableToArrayLimit(arr, i) {
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];

  if (_i == null) return;
  var _arr = [];
  var _n = true;
  var _d = false;

  var _s, _e;

  try {
    for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
      _arr.push(_s.value);

      if (i && _arr.length === i) break;
    }
  } catch (err) {
    _d = true;
    _e = err;
  } finally {
    try {
      if (!_n && _i["return"] != null) _i["return"]();
    } finally {
      if (_d) throw _e;
    }
  }

  return _arr;
}

function _arrayWithHoles(arr) {
  if (Array.isArray(arr)) return arr;
}

function _classCallCheck(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}

function _defineProperties(target, props) {
  for (var i = 0; i < props.length; i++) {
    var descriptor = props[i];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor) descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}

function _createClass(Constructor, protoProps, staticProps) {
  if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  if (staticProps) _defineProperties(Constructor, staticProps);
  return Constructor;
}

function _inherits(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }

  subClass.prototype = Object.create(superClass && superClass.prototype, {
    constructor: {
      value: subClass,
      writable: true,
      configurable: true
    }
  });
  if (superClass) _setPrototypeOf(subClass, superClass);
}

function _setPrototypeOf(o, p) {
  _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
    o.__proto__ = p;
    return o;
  };

  return _setPrototypeOf(o, p);
}

function _createSuper(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct();

  return function _createSuperInternal() {
    var Super = _getPrototypeOf(Derived),
        result;

    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf(this).constructor;

      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }

    return _possibleConstructorReturn(this, result);
  };
}

function _possibleConstructorReturn(self, call) {
  if (call && (_typeof(call) === "object" || typeof call === "function")) {
    return call;
  } else if (call !== void 0) {
    throw new TypeError("Derived constructors may only return object or undefined");
  }

  return _assertThisInitialized(self);
}

function _assertThisInitialized(self) {
  if (self === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }

  return self;
}

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 (e) {
    return false;
  }
}

function _getPrototypeOf(o) {
  _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
    return o.__proto__ || Object.getPrototypeOf(o);
  };
  return _getPrototypeOf(o);
}

function _defineProperty(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, {
      value: value,
      enumerable: true,
      configurable: true,
      writable: true
    });
  } else {
    obj[key] = value;
  }

  return obj;
} //
// Define <Draggable>
//


var Draggable = /*#__PURE__*/function (_React$Component) {
  _inherits(Draggable, _React$Component);

  var _super = _createSuper(Draggable);

  function Draggable(props
  /*: DraggableProps*/
  ) {
    var _this;

    _classCallCheck(this, Draggable);

    _this = _super.call(this, props);

    _defineProperty(_assertThisInitialized(_this), "onDragStart", function (e, coreData) {
      (0, _log.default)('Draggable: onDragStart: %j', coreData); // Short-circuit if user's callback killed it.

      var shouldStart = _this.props.onStart(e, (0, _positionFns.createDraggableData)(_assertThisInitialized(_this), coreData)); // Kills start event on core as well, so move handlers are never bound.


      if (shouldStart === false) return false;

      _this.setState({
        dragging: true,
        dragged: true
      });
    });

    _defineProperty(_assertThisInitialized(_this), "onDrag", function (e, coreData) {
      if (!_this.state.dragging) return false;
      (0, _log.default)('Draggable: onDrag: %j', coreData);
      var uiData = (0, _positionFns.createDraggableData)(_assertThisInitialized(_this), coreData);
      var newState
      /*: $Shape<DraggableState>*/
      = {
        x: uiData.x,
        y: uiData.y
      }; // Keep within bounds.

      if (_this.props.bounds) {
        // Save original x and y.
        var x = newState.x,
            y = newState.y; // Add slack to the values used to calculate bound position. This will ensure that if
        // we start removing slack, the element won't react to it right away until it's been
        // completely removed.

        newState.x += _this.state.slackX;
        newState.y += _this.state.slackY; // Get bound position. This will ceil/floor the x and y within the boundaries.

        var _getBoundPosition = (0, _positionFns.getBoundPosition)(_assertThisInitialized(_this), newState.x, newState.y),
            _getBoundPosition2 = _slicedToArray(_getBoundPosition, 2),
            newStateX = _getBoundPosition2[0],
            newStateY = _getBoundPosition2[1];

        newState.x = newStateX;
        newState.y = newStateY; // Recalculate slack by noting how much was shaved by the boundPosition handler.

        newState.slackX = _this.state.slackX + (x - newState.x);
        newState.slackY = _this.state.slackY + (y - newState.y); // Update the event we fire to reflect what really happened after bounds took effect.

        uiData.x = newState.x;
        uiData.y = newState.y;
        uiData.deltaX = newState.x - _this.state.x;
        uiData.deltaY = newState.y - _this.state.y;
      } // Short-circuit if user's callback killed it.


      var shouldUpdate = _this.props.onDrag(e, uiData);

      if (shouldUpdate === false) return false;

      _this.setState(newState);
    });

    _defineProperty(_assertThisInitialized(_this), "onDragStop", function (e, coreData) {
      if (!_this.state.dragging) return false; // Short-circuit if user's callback killed it.

      var shouldContinue = _this.props.onStop(e, (0, _positionFns.createDraggableData)(_assertThisInitialized(_this), coreData));

      if (shouldContinue === false) return false;
      (0, _log.default)('Draggable: onDragStop: %j', coreData);
      var newState
      /*: $Shape<DraggableState>*/
      = {
        dragging: false,
        slackX: 0,
        slackY: 0
      }; // If this is a controlled component, the result of this operation will be to
      // revert back to the old position. We expect a handler on `onDragStop`, at the least.

      var controlled = Boolean(_this.props.position);

      if (controlled) {
        var _this$props$position = _this.props.position,
            x = _this$props$position.x,
            y = _this$props$position.y;
        newState.x = x;
        newState.y = y;
      }

      _this.setState(newState);
    });

    _this.state = {
      // Whether or not we are currently dragging.
      dragging: false,
      // Whether or not we have been dragged before.
      dragged: false,
      // Current transform x and y.
      x: props.position ? props.position.x : props.defaultPosition.x,
      y: props.position ? props.position.y : props.defaultPosition.y,
      prevPropsPosition: _objectSpread({}, props.position),
      // Used for compensating for out-of-bounds drags
      slackX: 0,
      slackY: 0,
      // Can only determine if SVG after mounting
      isElementSVG: false
    };

    if (props.position && !(props.onDrag || props.onStop)) {
      // eslint-disable-next-line no-console
      console.warn('A `position` was applied to this <Draggable>, without drag handlers. This will make this ' + 'component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the ' + '`position` of this element.');
    }

    return _this;
  }

  _createClass(Draggable, [{
    key: "componentDidMount",
    value: function componentDidMount() {
      // Check to see if the element passed is an instanceof SVGElement
      if (typeof window.SVGElement !== 'undefined' && this.findDOMNode() instanceof window.SVGElement) {
        this.setState({
          isElementSVG: true
        });
      }
    }
  }, {
    key: "componentWillUnmount",
    value: function componentWillUnmount() {
      this.setState({
        dragging: false
      }); // prevents invariant if unmounted while dragging
    } // React Strict Mode compatibility: if `nodeRef` is passed, we will use it instead of trying to find
    // the underlying DOM node ourselves. See the README for more information.

  }, {
    key: "findDOMNode",
    value: function findDOMNode()
    /*: ?HTMLElement*/
    {
      var _this$props$nodeRef$c, _this$props, _this$props$nodeRef;

      return (_this$props$nodeRef$c = (_this$props = this.props) === null || _this$props === void 0 ? void 0 : (_this$props$nodeRef = _this$props.nodeRef) === null || _this$props$nodeRef === void 0 ? void 0 : _this$props$nodeRef.current) !== null && _this$props$nodeRef$c !== void 0 ? _this$props$nodeRef$c : _reactDom.default.findDOMNode(this);
    }
  }, {
    key: "render",
    value: function render()
    /*: ReactElement<any>*/
    {
      var _clsx;

      var _this$props2 = this.props,
          axis = _this$props2.axis,
          bounds = _this$props2.bounds,
          children = _this$props2.children,
          defaultPosition = _this$props2.defaultPosition,
          defaultClassName = _this$props2.defaultClassName,
          defaultClassNameDragging = _this$props2.defaultClassNameDragging,
          defaultClassNameDragged = _this$props2.defaultClassNameDragged,
          position = _this$props2.position,
          positionOffset = _this$props2.positionOffset,
          scale = _this$props2.scale,
          draggableCoreProps = _objectWithoutProperties(_this$props2, _excluded);

      var style = {};
      var svgTransform = null; // If this is controlled, we don't want to move it - unless it's dragging.

      var controlled = Boolean(position);
      var draggable = !controlled || this.state.dragging;
      var validPosition = position || defaultPosition;
      var transformOpts = {
        // Set left if horizontal drag is enabled
        x: (0, _positionFns.canDragX)(this) && draggable ? this.state.x : validPosition.x,
        // Set top if vertical drag is enabled
        y: (0, _positionFns.canDragY)(this) && draggable ? this.state.y : validPosition.y
      }; // If this element was SVG, we use the `transform` attribute.

      if (this.state.isElementSVG) {
        svgTransform = (0, _domFns.createSVGTransform)(transformOpts, positionOffset);
      } else {
        // Add a CSS transform to move the element around. This allows us to move the element around
        // without worrying about whether or not it is relatively or absolutely positioned.
        // If the item you are dragging already has a transform set, wrap it in a <span> so <Draggable>
        // has a clean slate.
        style = (0, _domFns.createCSSTransform)(transformOpts, positionOffset);
      } // Mark with class while dragging


      var className = (0, _clsx2.default)(children.props.className || '', defaultClassName, (_clsx = {}, _defineProperty(_clsx, defaultClassNameDragging, this.state.dragging), _defineProperty(_clsx, defaultClassNameDragged, this.state.dragged), _clsx)); // Reuse the child provided
      // This makes it flexible to use whatever element is wanted (div, ul, etc)

      return /*#__PURE__*/React.createElement(_DraggableCore.default, _extends({}, draggableCoreProps, {
        onStart: this.onDragStart,
        onDrag: this.onDrag,
        onStop: this.onDragStop
      }), /*#__PURE__*/React.cloneElement(React.Children.only(children), {
        className: className,
        style: _objectSpread(_objectSpread({}, children.props.style), style),
        transform: svgTransform
      }));
    }
  }], [{
    key: "getDerivedStateFromProps",
    value: // React 16.3+
    // Arity (props, state)
    function getDerivedStateFromProps(_ref, _ref2)
    /*: ?$Shape<DraggableState>*/
    {
      var position = _ref.position;
      var prevPropsPosition = _ref2.prevPropsPosition; // Set x/y if a new position is provided in props that is different than the previous.

      if (position && (!prevPropsPosition || position.x !== prevPropsPosition.x || position.y !== prevPropsPosition.y)) {
        (0, _log.default)('Draggable: getDerivedStateFromProps %j', {
          position: position,
          prevPropsPosition: prevPropsPosition
        });
        return {
          x: position.x,
          y: position.y,
          prevPropsPosition: _objectSpread({}, position)
        };
      }

      return null;
    }
  }]);

  return Draggable;
}(React.Component);

exports["default"] = Draggable;

_defineProperty(Draggable, "displayName", 'Draggable');

_defineProperty(Draggable, "propTypes", _objectSpread(_objectSpread({}, _DraggableCore.default.propTypes), {}, {
  /**
   * `axis` determines which axis the draggable can move.
   *
   *  Note that all callbacks will still return data as normal. This only
   *  controls flushing to the DOM.
   *
   * 'both' allows movement horizontally and vertically.
   * 'x' limits movement to horizontal axis.
   * 'y' limits movement to vertical axis.
   * 'none' limits all movement.
   *
   * Defaults to 'both'.
   */
  axis: _propTypes.default.oneOf(['both', 'x', 'y', 'none']),

  /**
   * `bounds` determines the range of movement available to the element.
   * Available values are:
   *
   * 'parent' restricts movement within the Draggable's parent node.
   *
   * Alternatively, pass an object with the following properties, all of which are optional:
   *
   * {left: LEFT_BOUND, right: RIGHT_BOUND, bottom: BOTTOM_BOUND, top: TOP_BOUND}
   *
   * All values are in px.
   *
   * Example:
   *
   * ```jsx
   *   let App = React.createClass({
   *       render: function () {
   *         return (
   *            <Draggable bounds={{right: 300, bottom: 300}}>
   *              <div>Content</div>
   *           </Draggable>
   *         );
   *       }
   *   });
   * ```
   */
  bounds: _propTypes.default.oneOfType([_propTypes.default.shape({
    left: _propTypes.default.number,
    right: _propTypes.default.number,
    top: _propTypes.default.number,
    bottom: _propTypes.default.number
  }), _propTypes.default.string, _propTypes.default.oneOf([false])]),
  defaultClassName: _propTypes.default.string,
  defaultClassNameDragging: _propTypes.default.string,
  defaultClassNameDragged: _propTypes.default.string,

  /**
   * `defaultPosition` specifies the x and y that the dragged item should start at
   *
   * Example:
   *
   * ```jsx
   *      let App = React.createClass({
   *          render: function () {
   *              return (
   *                  <Draggable defaultPosition={{x: 25, y: 25}}>
   *                      <div>I start with transformX: 25px and transformY: 25px;</div>
   *                  </Draggable>
   *              );
   *          }
   *      });
   * ```
   */
  defaultPosition: _propTypes.default.shape({
    x: _propTypes.default.number,
    y: _propTypes.default.number
  }),
  positionOffset: _propTypes.default.shape({
    x: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
    y: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])
  }),

  /**
   * `position`, if present, defines the current position of the element.
   *
   *  This is similar to how form elements in React work - if no `position` is supplied, the component
   *  is uncontrolled.
   *
   * Example:
   *
   * ```jsx
   *      let App = React.createClass({
   *          render: function () {
   *              return (
   *                  <Draggable position={{x: 25, y: 25}}>
   *                      <div>I start with transformX: 25px and transformY: 25px;</div>
   *                  </Draggable>
   *              );
   *          }
   *      });
   * ```
   */
  position: _propTypes.default.shape({
    x: _propTypes.default.number,
    y: _propTypes.default.number
  }),

  /**
   * These properties should be defined on the child, not here.
   */
  className: _shims.dontSetMe,
  style: _shims.dontSetMe,
  transform: _shims.dontSetMe
}));

_defineProperty(Draggable, "defaultProps", _objectSpread(_objectSpread({}, _DraggableCore.default.defaultProps), {}, {
  axis: 'both',
  bounds: false,
  defaultClassName: 'react-draggable',
  defaultClassNameDragging: 'react-draggable-dragging',
  defaultClassNameDragged: 'react-draggable-dragged',
  defaultPosition: {
    x: 0,
    y: 0
  },
  scale: 1
}));

/***/ }),

/***/ 91:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";


function _typeof(obj) {
  "@babel/helpers - typeof";

  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof = function _typeof(obj) {
      return typeof obj;
    };
  } else {
    _typeof = function _typeof(obj) {
      return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
    };
  }

  return _typeof(obj);
}

Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports["default"] = void 0;

var React = _interopRequireWildcard(__webpack_require__(791));

var _propTypes = _interopRequireDefault(__webpack_require__(7));

var _reactDom = _interopRequireDefault(__webpack_require__(164));

var _domFns = __webpack_require__(280);

var _positionFns = __webpack_require__(580);

var _shims = __webpack_require__(693);

var _log = _interopRequireDefault(__webpack_require__(655));

function _interopRequireDefault(obj) {
  return obj && obj.__esModule ? obj : {
    default: obj
  };
}

function _getRequireWildcardCache(nodeInterop) {
  if (typeof WeakMap !== "function") return null;
  var cacheBabelInterop = new WeakMap();
  var cacheNodeInterop = new WeakMap();
  return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) {
    return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
  })(nodeInterop);
}

function _interopRequireWildcard(obj, nodeInterop) {
  if (!nodeInterop && obj && obj.__esModule) {
    return obj;
  }

  if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") {
    return {
      default: obj
    };
  }

  var cache = _getRequireWildcardCache(nodeInterop);

  if (cache && cache.has(obj)) {
    return cache.get(obj);
  }

  var newObj = {};
  var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;

  for (var key in obj) {
    if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
      var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;

      if (desc && (desc.get || desc.set)) {
        Object.defineProperty(newObj, key, desc);
      } else {
        newObj[key] = obj[key];
      }
    }
  }

  newObj.default = obj;

  if (cache) {
    cache.set(obj, newObj);
  }

  return newObj;
}

function _slicedToArray(arr, i) {
  return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
}

function _nonIterableRest() {
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}

function _unsupportedIterableToArray(o, minLen) {
  if (!o) return;
  if (typeof o === "string") return _arrayLikeToArray(o, minLen);
  var n = Object.prototype.toString.call(o).slice(8, -1);
  if (n === "Object" && o.constructor) n = o.constructor.name;
  if (n === "Map" || n === "Set") return Array.from(o);
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
}

function _arrayLikeToArray(arr, len) {
  if (len == null || len > arr.length) len = arr.length;

  for (var i = 0, arr2 = new Array(len); i < len; i++) {
    arr2[i] = arr[i];
  }

  return arr2;
}

function _iterableToArrayLimit(arr, i) {
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];

  if (_i == null) return;
  var _arr = [];
  var _n = true;
  var _d = false;

  var _s, _e;

  try {
    for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
      _arr.push(_s.value);

      if (i && _arr.length === i) break;
    }
  } catch (err) {
    _d = true;
    _e = err;
  } finally {
    try {
      if (!_n && _i["return"] != null) _i["return"]();
    } finally {
      if (_d) throw _e;
    }
  }

  return _arr;
}

function _arrayWithHoles(arr) {
  if (Array.isArray(arr)) return arr;
}

function _classCallCheck(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}

function _defineProperties(target, props) {
  for (var i = 0; i < props.length; i++) {
    var descriptor = props[i];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor) descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}

function _createClass(Constructor, protoProps, staticProps) {
  if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  if (staticProps) _defineProperties(Constructor, staticProps);
  return Constructor;
}

function _inherits(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }

  subClass.prototype = Object.create(superClass && superClass.prototype, {
    constructor: {
      value: subClass,
      writable: true,
      configurable: true
    }
  });
  if (superClass) _setPrototypeOf(subClass, superClass);
}

function _setPrototypeOf(o, p) {
  _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
    o.__proto__ = p;
    return o;
  };

  return _setPrototypeOf(o, p);
}

function _createSuper(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct();

  return function _createSuperInternal() {
    var Super = _getPrototypeOf(Derived),
        result;

    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf(this).constructor;

      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }

    return _possibleConstructorReturn(this, result);
  };
}

function _possibleConstructorReturn(self, call) {
  if (call && (_typeof(call) === "object" || typeof call === "function")) {
    return call;
  } else if (call !== void 0) {
    throw new TypeError("Derived constructors may only return object or undefined");
  }

  return _assertThisInitialized(self);
}

function _assertThisInitialized(self) {
  if (self === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }

  return self;
}

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 (e) {
    return false;
  }
}

function _getPrototypeOf(o) {
  _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
    return o.__proto__ || Object.getPrototypeOf(o);
  };
  return _getPrototypeOf(o);
}

function _defineProperty(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, {
      value: value,
      enumerable: true,
      configurable: true,
      writable: true
    });
  } else {
    obj[key] = value;
  }

  return obj;
} // Simple abstraction for dragging events names.


var eventsFor = {
  touch: {
    start: 'touchstart',
    move: 'touchmove',
    stop: 'touchend'
  },
  mouse: {
    start: 'mousedown',
    move: 'mousemove',
    stop: 'mouseup'
  }
}; // Default to mouse events.

var dragEventFor = eventsFor.mouse;
/*:: type DraggableCoreState = {
  dragging: boolean,
  lastX: number,
  lastY: number,
  touchIdentifier: ?number
};*/

/*:: export type DraggableData = {
  node: HTMLElement,
  x: number, y: number,
  deltaX: number, deltaY: number,
  lastX: number, lastY: number,
};*/

/*:: export type DraggableEventHandler = (e: MouseEvent, data: DraggableData) => void | false;*/

/*:: export type ControlPosition = {x: number, y: number};*/

/*:: export type PositionOffsetControlPosition = {x: number|string, y: number|string};*/

/*:: export type DraggableCoreDefaultProps = {
  allowAnyClick: boolean,
  disabled: boolean,
  enableUserSelectHack: boolean,
  onStart: DraggableEventHandler,
  onDrag: DraggableEventHandler,
  onStop: DraggableEventHandler,
  onMouseDown: (e: MouseEvent) => void,
  scale: number,
};*/

/*:: export type DraggableCoreProps = {
  ...DraggableCoreDefaultProps,
  cancel: string,
  children: ReactElement<any>,
  offsetParent: HTMLElement,
  grid: [number, number],
  handle: string,
  nodeRef?: ?React.ElementRef<any>,
};*/
//
// Define <DraggableCore>.
//
// <DraggableCore> is for advanced usage of <Draggable>. It maintains minimal internal state so it can
// work well with libraries that require more control over the element.
//

var DraggableCore = /*#__PURE__*/function (_React$Component) {
  _inherits(DraggableCore, _React$Component);

  var _super = _createSuper(DraggableCore);

  function DraggableCore() {
    var _this;

    _classCallCheck(this, DraggableCore);

    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    _this = _super.call.apply(_super, [this].concat(args));

    _defineProperty(_assertThisInitialized(_this), "state", {
      dragging: false,
      // Used while dragging to determine deltas.
      lastX: NaN,
      lastY: NaN,
      touchIdentifier: null
    });

    _defineProperty(_assertThisInitialized(_this), "mounted", false);

    _defineProperty(_assertThisInitialized(_this), "handleDragStart", function (e) {
      // Make it possible to attach event handlers on top of this one.
      _this.props.onMouseDown(e); // Only accept left-clicks.


      if (!_this.props.allowAnyClick && typeof e.button === 'number' && e.button !== 0) return false; // Get nodes. Be sure to grab relative document (could be iframed)

      var thisNode = _this.findDOMNode();

      if (!thisNode || !thisNode.ownerDocument || !thisNode.ownerDocument.body) {
        throw new Error('<DraggableCore> not mounted on DragStart!');
      }

      var ownerDocument = thisNode.ownerDocument; // Short circuit if handle or cancel prop was provided and selector doesn't match.

      if (_this.props.disabled || !(e.target instanceof ownerDocument.defaultView.Node) || _this.props.handle && !(0, _domFns.matchesSelectorAndParentsTo)(e.target, _this.props.handle, thisNode) || _this.props.cancel && (0, _domFns.matchesSelectorAndParentsTo)(e.target, _this.props.cancel, thisNode)) {
        return;
      } // Prevent scrolling on mobile devices, like ipad/iphone.
      // Important that this is after handle/cancel.


      if (e.type === 'touchstart') e.preventDefault(); // Set touch identifier in component state if this is a touch event. This allows us to
      // distinguish between individual touches on multitouch screens by identifying which
      // touchpoint was set to this element.

      var touchIdentifier = (0, _domFns.getTouchIdentifier)(e);

      _this.setState({
        touchIdentifier: touchIdentifier
      }); // Get the current drag point from the event. This is used as the offset.


      var position = (0, _positionFns.getControlPosition)(e, touchIdentifier, _assertThisInitialized(_this));
      if (position == null) return; // not possible but satisfies flow

      var x = position.x,
          y = position.y; // Create an event object with all the data parents need to make a decision here.

      var coreEvent = (0, _positionFns.createCoreData)(_assertThisInitialized(_this), x, y);
      (0, _log.default)('DraggableCore: handleDragStart: %j', coreEvent); // Call event handler. If it returns explicit false, cancel.

      (0, _log.default)('calling', _this.props.onStart);

      var shouldUpdate = _this.props.onStart(e, coreEvent);

      if (shouldUpdate === false || _this.mounted === false) return; // Add a style to the body to disable user-select. This prevents text from
      // being selected all over the page.

      if (_this.props.enableUserSelectHack) (0, _domFns.addUserSelectStyles)(ownerDocument); // Initiate dragging. Set the current x and y as offsets
      // so we know how much we've moved during the drag. This allows us
      // to drag elements around even if they have been moved, without issue.

      _this.setState({
        dragging: true,
        lastX: x,
        lastY: y
      }); // Add events to the document directly so we catch when the user's mouse/touch moves outside of
      // this element. We use different events depending on whether or not we have detected that this
      // is a touch-capable device.


      (0, _domFns.addEvent)(ownerDocument, dragEventFor.move, _this.handleDrag);
      (0, _domFns.addEvent)(ownerDocument, dragEventFor.stop, _this.handleDragStop);
    });

    _defineProperty(_assertThisInitialized(_this), "handleDrag", function (e) {
      // Get the current drag point from the event. This is used as the offset.
      var position = (0, _positionFns.getControlPosition)(e, _this.state.touchIdentifier, _assertThisInitialized(_this));
      if (position == null) return;
      var x = position.x,
          y = position.y; // Snap to grid if prop has been provided

      if (Array.isArray(_this.props.grid)) {
        var deltaX = x - _this.state.lastX,
            deltaY = y - _this.state.lastY;

        var _snapToGrid = (0, _positionFns.snapToGrid)(_this.props.grid, deltaX, deltaY);

        var _snapToGrid2 = _slicedToArray(_snapToGrid, 2);

        deltaX = _snapToGrid2[0];
        deltaY = _snapToGrid2[1];
        if (!deltaX && !deltaY) return; // skip useless drag

        x = _this.state.lastX + deltaX, y = _this.state.lastY + deltaY;
      }

      var coreEvent = (0, _positionFns.createCoreData)(_assertThisInitialized(_this), x, y);
      (0, _log.default)('DraggableCore: handleDrag: %j', coreEvent); // Call event handler. If it returns explicit false, trigger end.

      var shouldUpdate = _this.props.onDrag(e, coreEvent);

      if (shouldUpdate === false || _this.mounted === false) {
        try {
          // $FlowIgnore
          _this.handleDragStop(new MouseEvent('mouseup'));
        } catch (err) {
          // Old browsers
          var event = document.createEvent('MouseEvents')
          /*: any*/

          /*: MouseTouchEvent*/
          ; // I see why this insanity was deprecated
          // $FlowIgnore

          event.initMouseEvent('mouseup', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);

          _this.handleDragStop(event);
        }

        return;
      }

      _this.setState({
        lastX: x,
        lastY: y
      });
    });

    _defineProperty(_assertThisInitialized(_this), "handleDragStop", function (e) {
      if (!_this.state.dragging) return;
      var position = (0, _positionFns.getControlPosition)(e, _this.state.touchIdentifier, _assertThisInitialized(_this));
      if (position == null) return;
      var x = position.x,
          y = position.y;
      var coreEvent = (0, _positionFns.createCoreData)(_assertThisInitialized(_this), x, y); // Call event handler

      var shouldContinue = _this.props.onStop(e, coreEvent);

      if (shouldContinue === false || _this.mounted === false) return false;

      var thisNode = _this.findDOMNode();

      if (thisNode) {
        // Remove user-select hack
        if (_this.props.enableUserSelectHack) (0, _domFns.removeUserSelectStyles)(thisNode.ownerDocument);
      }

      (0, _log.default)('DraggableCore: handleDragStop: %j', coreEvent); // Reset the el.

      _this.setState({
        dragging: false,
        lastX: NaN,
        lastY: NaN
      });

      if (thisNode) {
        // Remove event handlers
        (0, _log.default)('DraggableCore: Removing handlers');
        (0, _domFns.removeEvent)(thisNode.ownerDocument, dragEventFor.move, _this.handleDrag);
        (0, _domFns.removeEvent)(thisNode.ownerDocument, dragEventFor.stop, _this.handleDragStop);
      }
    });

    _defineProperty(_assertThisInitialized(_this), "onMouseDown", function (e) {
      dragEventFor = eventsFor.mouse; // on touchscreen laptops we could switch back to mouse

      return _this.handleDragStart(e);
    });

    _defineProperty(_assertThisInitialized(_this), "onMouseUp", function (e) {
      dragEventFor = eventsFor.mouse;
      return _this.handleDragStop(e);
    });

    _defineProperty(_assertThisInitialized(_this), "onTouchStart", function (e) {
      // We're on a touch device now, so change the event handlers
      dragEventFor = eventsFor.touch;
      return _this.handleDragStart(e);
    });

    _defineProperty(_assertThisInitialized(_this), "onTouchEnd", function (e) {
      // We're on a touch device now, so change the event handlers
      dragEventFor = eventsFor.touch;
      return _this.handleDragStop(e);
    });

    return _this;
  }

  _createClass(DraggableCore, [{
    key: "componentDidMount",
    value: function componentDidMount() {
      this.mounted = true; // Touch handlers must be added with {passive: false} to be cancelable.
      // https://developers.google.com/web/updates/2017/01/scrolling-intervention

      var thisNode = this.findDOMNode();

      if (thisNode) {
        (0, _domFns.addEvent)(thisNode, eventsFor.touch.start, this.onTouchStart, {
          passive: false
        });
      }
    }
  }, {
    key: "componentWillUnmount",
    value: function componentWillUnmount() {
      this.mounted = false; // Remove any leftover event handlers. Remove both touch and mouse handlers in case
      // some browser quirk caused a touch event to fire during a mouse move, or vice versa.

      var thisNode = this.findDOMNode();

      if (thisNode) {
        var ownerDocument = thisNode.ownerDocument;
        (0, _domFns.removeEvent)(ownerDocument, eventsFor.mouse.move, this.handleDrag);
        (0, _domFns.removeEvent)(ownerDocument, eventsFor.touch.move, this.handleDrag);
        (0, _domFns.removeEvent)(ownerDocument, eventsFor.mouse.stop, this.handleDragStop);
        (0, _domFns.removeEvent)(ownerDocument, eventsFor.touch.stop, this.handleDragStop);
        (0, _domFns.removeEvent)(thisNode, eventsFor.touch.start, this.onTouchStart, {
          passive: false
        });
        if (this.props.enableUserSelectHack) (0, _domFns.removeUserSelectStyles)(ownerDocument);
      }
    } // React Strict Mode compatibility: if `nodeRef` is passed, we will use it instead of trying to find
    // the underlying DOM node ourselves. See the README for more information.

  }, {
    key: "findDOMNode",
    value: function findDOMNode()
    /*: ?HTMLElement*/
    {
      var _this$props$nodeRef$c, _this$props, _this$props$nodeRef;

      return (_this$props$nodeRef$c = (_this$props = this.props) === null || _this$props === void 0 ? void 0 : (_this$props$nodeRef = _this$props.nodeRef) === null || _this$props$nodeRef === void 0 ? void 0 : _this$props$nodeRef.current) !== null && _this$props$nodeRef$c !== void 0 ? _this$props$nodeRef$c : _reactDom.default.findDOMNode(this);
    }
  }, {
    key: "render",
    value: function render()
    /*: React.Element<any>*/
    {
      // Reuse the child provided
      // This makes it flexible to use whatever element is wanted (div, ul, etc)
      return /*#__PURE__*/React.cloneElement(React.Children.only(this.props.children), {
        // Note: mouseMove handler is attached to document so it will still function
        // when the user drags quickly and leaves the bounds of the element.
        onMouseDown: this.onMouseDown,
        onMouseUp: this.onMouseUp,
        // onTouchStart is added on `componentDidMount` so they can be added with
        // {passive: false}, which allows it to cancel. See
        // https://developers.google.com/web/updates/2017/01/scrolling-intervention
        onTouchEnd: this.onTouchEnd
      });
    }
  }]);

  return DraggableCore;
}(React.Component);

exports["default"] = DraggableCore;

_defineProperty(DraggableCore, "displayName", 'DraggableCore');

_defineProperty(DraggableCore, "propTypes", {
  /**
   * `allowAnyClick` allows dragging using any mouse button.
   * By default, we only accept the left button.
   *
   * Defaults to `false`.
   */
  allowAnyClick: _propTypes.default.bool,

  /**
   * `disabled`, if true, stops the <Draggable> from dragging. All handlers,
   * with the exception of `onMouseDown`, will not fire.
   */
  disabled: _propTypes.default.bool,

  /**
   * By default, we add 'user-select:none' attributes to the document body
   * to prevent ugly text selection during drag. If this is causing problems
   * for your app, set this to `false`.
   */
  enableUserSelectHack: _propTypes.default.bool,

  /**
   * `offsetParent`, if set, uses the passed DOM node to compute drag offsets
   * instead of using the parent node.
   */
  offsetParent: function offsetParent(props
  /*: DraggableCoreProps*/
  , propName
  /*: $Keys<DraggableCoreProps>*/
  ) {
    if (props[propName] && props[propName].nodeType !== 1) {
      throw new Error('Draggable\'s offsetParent must be a DOM Node.');
    }
  },

  /**
   * `grid` specifies the x and y that dragging should snap to.
   */
  grid: _propTypes.default.arrayOf(_propTypes.default.number),

  /**
   * `handle` specifies a selector to be used as the handle that initiates drag.
   *
   * Example:
   *
   * ```jsx
   *   let App = React.createClass({
   *       render: function () {
   *         return (
   *            <Draggable handle=".handle">
   *              <div>
   *                  <div className="handle">Click me to drag</div>
   *                  <div>This is some other content</div>
   *              </div>
   *           </Draggable>
   *         );
   *       }
   *   });
   * ```
   */
  handle: _propTypes.default.string,

  /**
   * `cancel` specifies a selector to be used to prevent drag initialization.
   *
   * Example:
   *
   * ```jsx
   *   let App = React.createClass({
   *       render: function () {
   *           return(
   *               <Draggable cancel=".cancel">
   *                   <div>
   *                     <div className="cancel">You can't drag from here</div>
   *                     <div>Dragging here works fine</div>
   *                   </div>
   *               </Draggable>
   *           );
   *       }
   *   });
   * ```
   */
  cancel: _propTypes.default.string,

  /* If running in React Strict mode, ReactDOM.findDOMNode() is deprecated.
   * Unfortunately, in order for <Draggable> to work properly, we need raw access
   * to the underlying DOM node. If you want to avoid the warning, pass a `nodeRef`
   * as in this example:
   *
   * function MyComponent() {
   *   const nodeRef = React.useRef(null);
   *   return (
   *     <Draggable nodeRef={nodeRef}>
   *       <div ref={nodeRef}>Example Target</div>
   *     </Draggable>
   *   );
   * }
   *
   * This can be used for arbitrarily nested components, so long as the ref ends up
   * pointing to the actual child DOM node and not a custom component.
   */
  nodeRef: _propTypes.default.object,

  /**
   * Called when dragging starts.
   * If this function returns the boolean false, dragging will be canceled.
   */
  onStart: _propTypes.default.func,

  /**
   * Called while dragging.
   * If this function returns the boolean false, dragging will be canceled.
   */
  onDrag: _propTypes.default.func,

  /**
   * Called when dragging stops.
   * If this function returns the boolean false, the drag will remain active.
   */
  onStop: _propTypes.default.func,

  /**
   * A workaround option which can be passed if onMouseDown needs to be accessed,
   * since it'll always be blocked (as there is internal use of onMouseDown)
   */
  onMouseDown: _propTypes.default.func,

  /**
   * `scale`, if set, applies scaling while dragging an element
   */
  scale: _propTypes.default.number,

  /**
   * These properties should be defined on the child, not here.
   */
  className: _shims.dontSetMe,
  style: _shims.dontSetMe,
  transform: _shims.dontSetMe
});

_defineProperty(DraggableCore, "defaultProps", {
  allowAnyClick: false,
  // by default only accept left click
  disabled: false,
  enableUserSelectHack: true,
  onStart: function onStart() {},
  onDrag: function onDrag() {},
  onStop: function onStop() {},
  onMouseDown: function onMouseDown() {},
  scale: 1
});

/***/ }),

/***/ 962:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var _require = __webpack_require__(37),
    Draggable = _require.default,
    DraggableCore = _require.DraggableCore; // Previous versions of this lib exported <Draggable> as the root export. As to no-// them, or TypeScript, we export *both* as the root and as 'default'.
// See https://github.com/mzabriskie/react-draggable/pull/254
// and https://github.com/mzabriskie/react-draggable/issues/266


module.exports = Draggable;
module.exports["default"] = Draggable;
module.exports.DraggableCore = DraggableCore;

/***/ }),

/***/ 280:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";


function _typeof(obj) {
  "@babel/helpers - typeof";

  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof = function _typeof(obj) {
      return typeof obj;
    };
  } else {
    _typeof = function _typeof(obj) {
      return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
    };
  }

  return _typeof(obj);
}

Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports.matchesSelector = matchesSelector;
exports.matchesSelectorAndParentsTo = matchesSelectorAndParentsTo;
exports.addEvent = addEvent;
exports.removeEvent = removeEvent;
exports.outerHeight = outerHeight;
exports.outerWidth = outerWidth;
exports.innerHeight = innerHeight;
exports.innerWidth = innerWidth;
exports.offsetXYFromParent = offsetXYFromParent;
exports.createCSSTransform = createCSSTransform;
exports.createSVGTransform = createSVGTransform;
exports.getTranslation = getTranslation;
exports.getTouch = getTouch;
exports.getTouchIdentifier = getTouchIdentifier;
exports.addUserSelectStyles = addUserSelectStyles;
exports.removeUserSelectStyles = removeUserSelectStyles;
exports.addClassName = addClassName;
exports.removeClassName = removeClassName;

var _shims = __webpack_require__(693);

var _getPrefix = _interopRequireWildcard(__webpack_require__(21));

function _getRequireWildcardCache(nodeInterop) {
  if (typeof WeakMap !== "function") return null;
  var cacheBabelInterop = new WeakMap();
  var cacheNodeInterop = new WeakMap();
  return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) {
    return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
  })(nodeInterop);
}

function _interopRequireWildcard(obj, nodeInterop) {
  if (!nodeInterop && obj && obj.__esModule) {
    return obj;
  }

  if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") {
    return {
      default: obj
    };
  }

  var cache = _getRequireWildcardCache(nodeInterop);

  if (cache && cache.has(obj)) {
    return cache.get(obj);
  }

  var newObj = {};
  var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;

  for (var key in obj) {
    if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
      var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;

      if (desc && (desc.get || desc.set)) {
        Object.defineProperty(newObj, key, desc);
      } else {
        newObj[key] = obj[key];
      }
    }
  }

  newObj.default = obj;

  if (cache) {
    cache.set(obj, newObj);
  }

  return newObj;
}

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 i = 1; i < arguments.length; i++) {
    var source = arguments[i] != null ? arguments[i] : {};

    if (i % 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;
}

function _defineProperty(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, {
      value: value,
      enumerable: true,
      configurable: true,
      writable: true
    });
  } else {
    obj[key] = value;
  }

  return obj;
}

var matchesSelectorFunc = '';

function matchesSelector(el
/*: Node*/
, selector
/*: string*/
)
/*: boolean*/
{
  if (!matchesSelectorFunc) {
    matchesSelectorFunc = (0, _shims.findInArray)(['matches', 'webkitMatchesSelector', 'mozMatchesSelector', 'msMatchesSelector', 'oMatchesSelector'], function (method) {
      // $FlowIgnore: Doesn't think elements are indexable
      return (0, _shims.isFunction)(el[method]);
    });
  } // Might not be found entirely (not an Element?) - in that case, bail
  // $FlowIgnore: Doesn't think elements are indexable


  if (!(0, _shims.isFunction)(el[matchesSelectorFunc])) return false; // $FlowIgnore: Doesn't think elements are indexable

  return el[matchesSelectorFunc](selector);
} // Works up the tree to the draggable itself attempting to match selector.


function matchesSelectorAndParentsTo(el
/*: Node*/
, selector
/*: string*/
, baseNode
/*: Node*/
)
/*: boolean*/
{
  var node = el;

  do {
    if (matchesSelector(node, selector)) return true;
    if (node === baseNode) return false;
    node = node.parentNode;
  } while (node);

  return false;
}

function addEvent(el
/*: ?Node*/
, event
/*: string*/
, handler
/*: Function*/
, inputOptions
/*: Object*/
)
/*: void*/
{
  if (!el) return;

  var options = _objectSpread({
    capture: true
  }, inputOptions); // $FlowIgnore[method-unbinding]


  if (el.addEventListener) {
    el.addEventListener(event, handler, options);
  } else if (el.attachEvent) {
    el.attachEvent('on' + event, handler);
  } else {
    // $FlowIgnore: Doesn't think elements are indexable
    el['on' + event] = handler;
  }
}

function removeEvent(el
/*: ?Node*/
, event
/*: string*/
, handler
/*: Function*/
, inputOptions
/*: Object*/
)
/*: void*/
{
  if (!el) return;

  var options = _objectSpread({
    capture: true
  }, inputOptions); // $FlowIgnore[method-unbinding]


  if (el.removeEventListener) {
    el.removeEventListener(event, handler, options);
  } else if (el.detachEvent) {
    el.detachEvent('on' + event, handler);
  } else {
    // $FlowIgnore: Doesn't think elements are indexable
    el['on' + event] = null;
  }
}

function outerHeight(node
/*: HTMLElement*/
)
/*: number*/
{
  // This is deliberately excluding margin for our calculations, since we are using
  // offsetTop which is including margin. See getBoundPosition
  var height = node.clientHeight;
  var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);
  height += (0, _shims.int)(computedStyle.borderTopWidth);
  height += (0, _shims.int)(computedStyle.borderBottomWidth);
  return height;
}

function outerWidth(node
/*: HTMLElement*/
)
/*: number*/
{
  // This is deliberately excluding margin for our calculations, since we are using
  // offsetLeft which is including margin. See getBoundPosition
  var width = node.clientWidth;
  var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);
  width += (0, _shims.int)(computedStyle.borderLeftWidth);
  width += (0, _shims.int)(computedStyle.borderRightWidth);
  return width;
}

function innerHeight(node
/*: HTMLElement*/
)
/*: number*/
{
  var height = node.clientHeight;
  var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);
  height -= (0, _shims.int)(computedStyle.paddingTop);
  height -= (0, _shims.int)(computedStyle.paddingBottom);
  return height;
}

function innerWidth(node
/*: HTMLElement*/
)
/*: number*/
{
  var width = node.clientWidth;
  var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);
  width -= (0, _shims.int)(computedStyle.paddingLeft);
  width -= (0, _shims.int)(computedStyle.paddingRight);
  return width;
}
/*:: interface EventWithOffset {
  clientX: number, clientY: number
}*/
// Get from offsetParent


function offsetXYFromParent(evt
/*: EventWithOffset*/
, offsetParent
/*: HTMLElement*/
, scale
/*: number*/
)
/*: ControlPosition*/
{
  var isBody = offsetParent === offsetParent.ownerDocument.body;
  var offsetParentRect = isBody ? {
    left: 0,
    top: 0
  } : offsetParent.getBoundingClientRect();
  var x = (evt.clientX + offsetParent.scrollLeft - offsetParentRect.left) / scale;
  var y = (evt.clientY + offsetParent.scrollTop - offsetParentRect.top) / scale;
  return {
    x: x,
    y: y
  };
}

function createCSSTransform(controlPos
/*: ControlPosition*/
, positionOffset
/*: PositionOffsetControlPosition*/
)
/*: Object*/
{
  var translation = getTranslation(controlPos, positionOffset, 'px');
  return _defineProperty({}, (0, _getPrefix.browserPrefixToKey)('transform', _getPrefix.default), translation);
}

function createSVGTransform(controlPos
/*: ControlPosition*/
, positionOffset
/*: PositionOffsetControlPosition*/
)
/*: string*/
{
  var translation = getTranslation(controlPos, positionOffset, '');
  return translation;
}

function getTranslation(_ref2, positionOffset
/*: PositionOffsetControlPosition*/
, unitSuffix
/*: string*/
)
/*: string*/
{
  var x = _ref2.x,
      y = _ref2.y;
  var translation = "translate(".concat(x).concat(unitSuffix, ",").concat(y).concat(unitSuffix, ")");

  if (positionOffset) {
    var defaultX = "".concat(typeof positionOffset.x === 'string' ? positionOffset.x : positionOffset.x + unitSuffix);
    var defaultY = "".concat(typeof positionOffset.y === 'string' ? positionOffset.y : positionOffset.y + unitSuffix);
    translation = "translate(".concat(defaultX, ", ").concat(defaultY, ")") + translation;
  }

  return translation;
}

function getTouch(e
/*: MouseTouchEvent*/
, identifier
/*: number*/
)
/*: ?{clientX: number, clientY: number}*/
{
  return e.targetTouches && (0, _shims.findInArray)(e.targetTouches, function (t) {
    return identifier === t.identifier;
  }) || e.changedTouches && (0, _shims.findInArray)(e.changedTouches, function (t) {
    return identifier === t.identifier;
  });
}

function getTouchIdentifier(e
/*: MouseTouchEvent*/
)
/*: ?number*/
{
  if (e.targetTouches && e.targetTouches[0]) return e.targetTouches[0].identifier;
  if (e.changedTouches && e.changedTouches[0]) return e.changedTouches[0].identifier;
} // User-select Hacks:
//
// Useful for preventing blue highlights all over everything when dragging.
// Note we're passing `document` b/c we could be iframed


function addUserSelectStyles(doc
/*: ?Document*/
) {
  if (!doc) return;
  var styleEl = doc.getElementById('react-draggable-style-el');

  if (!styleEl) {
    styleEl = doc.createElement('style');
    styleEl.type = 'text/css';
    styleEl.id = 'react-draggable-style-el';
    styleEl.innerHTML = '.react-draggable-transparent-selection *::-moz-selection {all: inherit;}\n';
    styleEl.innerHTML += '.react-draggable-transparent-selection *::selection {all: inherit;}\n';
    doc.getElementsByTagName('head')[0].appendChild(styleEl);
  }

  if (doc.body) addClassName(doc.body, 'react-draggable-transparent-selection');
}

function removeUserSelectStyles(doc
/*: ?Document*/
) {
  if (!doc) return;

  try {
    if (doc.body) removeClassName(doc.body, 'react-draggable-transparent-selection'); // $FlowIgnore: IE

    if (doc.selection) {
      // $FlowIgnore: IE
      doc.selection.empty();
    } else {
      // Remove selection caused by scroll, unless it's a focused input
      // (we use doc.defaultView in case we're in an iframe)
      var selection = (doc.defaultView || window).getSelection();

      if (selection && selection.type !== 'Caret') {
        selection.removeAllRanges();
      }
    }
  } catch (e) {// probably IE
  }
}

function addClassName(el
/*: HTMLElement*/
, className
/*: string*/
) {
  if (el.classList) {
    el.classList.add(className);
  } else {
    if (!el.className.match(new RegExp("(?:^|\\s)".concat(className, "(?!\\S)")))) {
      el.className += " ".concat(className);
    }
  }
}

function removeClassName(el
/*: HTMLElement*/
, className
/*: string*/
) {
  if (el.classList) {
    el.classList.remove(className);
  } else {
    el.className = el.className.replace(new RegExp("(?:^|\\s)".concat(className, "(?!\\S)"), 'g'), '');
  }
}

/***/ }),

/***/ 21:
/***/ (function(__unused_webpack_module, exports) {

"use strict";


Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports.getPrefix = getPrefix;
exports.browserPrefixToKey = browserPrefixToKey;
exports.browserPrefixToStyle = browserPrefixToStyle;
exports["default"] = void 0;
var prefixes = ['Moz', 'Webkit', 'O', 'ms'];

function getPrefix()
/*: string*/
{
  var _window$document, _window$document$docu;

  var prop
  /*: string*/
  = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'transform'; // Ensure we're running in an environment where there is actually a global
  // `window` obj

  if (typeof window === 'undefined') return ''; // If we're in a pseudo-browser server-side environment, this access
  // path may not exist, so bail out if it doesn't.

  var style = (_window$document = window.document) === null || _window$document === void 0 ? void 0 : (_window$document$docu = _window$document.documentElement) === null || _window$document$docu === void 0 ? void 0 : _window$document$docu.style;
  if (!style) return '';
  if (prop in style) return '';

  for (var i = 0; i < prefixes.length; i++) {
    if (browserPrefixToKey(prop, prefixes[i]) in style) return prefixes[i];
  }

  return '';
}

function browserPrefixToKey(prop
/*: string*/
, prefix
/*: string*/
)
/*: string*/
{
  return prefix ? "".concat(prefix).concat(kebabToTitleCase(prop)) : prop;
}

function browserPrefixToStyle(prop
/*: string*/
, prefix
/*: string*/
)
/*: string*/
{
  return prefix ? "-".concat(prefix.toLowerCase(), "-").concat(prop) : prop;
}

function kebabToTitleCase(str
/*: string*/
)
/*: string*/
{
  var out = '';
  var shouldCapitalize = true;

  for (var i = 0; i < str.length; i++) {
    if (shouldCapitalize) {
      out += str[i].toUpperCase();
      shouldCapitalize = false;
    } else if (str[i] === '-') {
      shouldCapitalize = true;
    } else {
      out += str[i];
    }
  }

  return out;
} // Default export is the prefix itself, like 'Moz', 'Webkit', etc
// Note that you may have to re-test for certain things; for instance, Chrome 50
// can handle unprefixed `transform`, but not unprefixed `user-select`


var _default = getPrefix()
/*: string*/
;

exports["default"] = _default;

/***/ }),

/***/ 655:
/***/ (function(__unused_webpack_module, exports) {

"use strict";


Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports["default"] = log;
/*eslint no-console:0*/

function log() {
  var _console;

  if (false) {}
}

/***/ }),

/***/ 580:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports.getBoundPosition = getBoundPosition;
exports.snapToGrid = snapToGrid;
exports.canDragX = canDragX;
exports.canDragY = canDragY;
exports.getControlPosition = getControlPosition;
exports.createCoreData = createCoreData;
exports.createDraggableData = createDraggableData;

var _shims = __webpack_require__(693);

var _domFns = __webpack_require__(280);

function getBoundPosition(draggable
/*: Draggable*/
, x
/*: number*/
, y
/*: number*/
)
/*: [number, number]*/
{
  // If no bounds, short-circuit and move on
  if (!draggable.props.bounds) return [x, y]; // Clone new bounds

  var bounds = draggable.props.bounds;
  bounds = typeof bounds === 'string' ? bounds : cloneBounds(bounds);
  var node = findDOMNode(draggable);

  if (typeof bounds === 'string') {
    var ownerDocument = node.ownerDocument;
    var ownerWindow = ownerDocument.defaultView;
    var boundNode;

    if (bounds === 'parent') {
      boundNode = node.parentNode;
    } else {
      boundNode = ownerDocument.querySelector(bounds);
    }

    if (!(boundNode instanceof ownerWindow.HTMLElement)) {
      throw new Error('Bounds selector "' + bounds + '" could not find an element.');
    }

    var boundNodeEl
    /*: HTMLElement*/
    = boundNode; // for Flow, can't seem to refine correctly

    var nodeStyle = ownerWindow.getComputedStyle(node);
    var boundNodeStyle = ownerWindow.getComputedStyle(boundNodeEl); // Compute bounds. This is a pain with padding and offsets but this gets it exactly right.

    bounds = {
      left: -node.offsetLeft + (0, _shims.int)(boundNodeStyle.paddingLeft) + (0, _shims.int)(nodeStyle.marginLeft),
      top: -node.offsetTop + (0, _shims.int)(boundNodeStyle.paddingTop) + (0, _shims.int)(nodeStyle.marginTop),
      right: (0, _domFns.innerWidth)(boundNodeEl) - (0, _domFns.outerWidth)(node) - node.offsetLeft + (0, _shims.int)(boundNodeStyle.paddingRight) - (0, _shims.int)(nodeStyle.marginRight),
      bottom: (0, _domFns.innerHeight)(boundNodeEl) - (0, _domFns.outerHeight)(node) - node.offsetTop + (0, _shims.int)(boundNodeStyle.paddingBottom) - (0, _shims.int)(nodeStyle.marginBottom)
    };
  } // Keep x and y below right and bottom limits...


  if ((0, _shims.isNum)(bounds.right)) x = Math.min(x, bounds.right);
  if ((0, _shims.isNum)(bounds.bottom)) y = Math.min(y, bounds.bottom); // But above left and top limits.

  if ((0, _shims.isNum)(bounds.left)) x = Math.max(x, bounds.left);
  if ((0, _shims.isNum)(bounds.top)) y = Math.max(y, bounds.top);
  return [x, y];
}

function snapToGrid(grid
/*: [number, number]*/
, pendingX
/*: number*/
, pendingY
/*: number*/
)
/*: [number, number]*/
{
  var x = Math.round(pendingX / grid[0]) * grid[0];
  var y = Math.round(pendingY / grid[1]) * grid[1];
  return [x, y];
}

function canDragX(draggable
/*: Draggable*/
)
/*: boolean*/
{
  return draggable.props.axis === 'both' || draggable.props.axis === 'x';
}

function canDragY(draggable
/*: Draggable*/
)
/*: boolean*/
{
  return draggable.props.axis === 'both' || draggable.props.axis === 'y';
} // Get {x, y} positions from event.


function getControlPosition(e
/*: MouseTouchEvent*/
, touchIdentifier
/*: ?number*/
, draggableCore
/*: DraggableCore*/
)
/*: ?ControlPosition*/
{
  var touchObj = typeof touchIdentifier === 'number' ? (0, _domFns.getTouch)(e, touchIdentifier) : null;
  if (typeof touchIdentifier === 'number' && !touchObj) return null; // not the right touch

  var node = findDOMNode(draggableCore); // User can provide an offsetParent if desired.

  var offsetParent = draggableCore.props.offsetParent || node.offsetParent || node.ownerDocument.body;
  return (0, _domFns.offsetXYFromParent)(touchObj || e, offsetParent, draggableCore.props.scale);
} // Create an data object exposed by <DraggableCore>'s events


function createCoreData(draggable
/*: DraggableCore*/
, x
/*: number*/
, y
/*: number*/
)
/*: DraggableData*/
{
  var state = draggable.state;
  var isStart = !(0, _shims.isNum)(state.lastX);
  var node = findDOMNode(draggable);

  if (isStart) {
    // If this is our first move, use the x and y as last coords.
    return {
      node: node,
      deltaX: 0,
      deltaY: 0,
      lastX: x,
      lastY: y,
      x: x,
      y: y
    };
  } else {
    // Otherwise calculate proper values.
    return {
      node: node,
      deltaX: x - state.lastX,
      deltaY: y - state.lastY,
      lastX: state.lastX,
      lastY: state.lastY,
      x: x,
      y: y
    };
  }
} // Create an data exposed by <Draggable>'s events


function createDraggableData(draggable
/*: Draggable*/
, coreData
/*: DraggableData*/
)
/*: DraggableData*/
{
  var scale = draggable.props.scale;
  return {
    node: coreData.node,
    x: draggable.state.x + coreData.deltaX / scale,
    y: draggable.state.y + coreData.deltaY / scale,
    deltaX: coreData.deltaX / scale,
    deltaY: coreData.deltaY / scale,
    lastX: draggable.state.x,
    lastY: draggable.state.y
  };
} // A lot faster than stringify/parse


function cloneBounds(bounds
/*: Bounds*/
)
/*: Bounds*/
{
  return {
    left: bounds.left,
    top: bounds.top,
    right: bounds.right,
    bottom: bounds.bottom
  };
}

function findDOMNode(draggable
/*: Draggable | DraggableCore*/
)
/*: HTMLElement*/
{
  var node = draggable.findDOMNode();

  if (!node) {
    throw new Error('<DraggableCore>: Unmounted during event!');
  } // $FlowIgnore we can't assert on HTMLElement due to tests... FIXME


  return node;
}

/***/ }),

/***/ 693:
/***/ (function(__unused_webpack_module, exports) {

"use strict";


Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports.findInArray = findInArray;
exports.isFunction = isFunction;
exports.isNum = isNum;
exports.int = int;
exports.dontSetMe = dontSetMe; // @credits https://gist.github.com/rogozhnikoff/a43cfed27c41e4e68cdc

function findInArray(array
/*: Array<any> | TouchList*/
, callback
/*: Function*/
)
/*: any*/
{
  for (var i = 0, length = array.length; i < length; i++) {
    if (callback.apply(callback, [array[i], i, array])) return array[i];
  }
}

function isFunction(func
/*: any*/
)
/*: boolean %checks*/
{
  // $FlowIgnore[method-unbinding]
  return typeof func === 'function' || Object.prototype.toString.call(func) === '[object Function]';
}

function isNum(num
/*: any*/
)
/*: boolean %checks*/
{
  return typeof num === 'number' && !isNaN(num);
}

function int(a
/*: string*/
)
/*: number*/
{
  return parseInt(a, 10);
}

function dontSetMe(props
/*: Object*/
, propName
/*: string*/
, componentName
/*: string*/
)
/*: ?Error*/
{
  if (props[propName]) {
    return new Error("Invalid prop ".concat(propName, " passed to ").concat(componentName, " - do not set this, set it on the child."));
  }
}

/***/ }),

/***/ 374:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";
/** @license React v16.14.0
 * react-jsx-runtime.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */


var f = __webpack_require__(791),
    g = 60103;

exports.Fragment = 60107;

if ("function" === typeof Symbol && Symbol.for) {
  var h = Symbol.for;
  g = h("react.element");
  exports.Fragment = h("react.fragment");
}

var m = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,
    n = Object.prototype.hasOwnProperty,
    p = {
  key: !0,
  ref: !0,
  __self: !0,
  __source: !0
};

function q(c, a, k) {
  var b,
      d = {},
      e = null,
      l = null;
  void 0 !== k && (e = "" + k);
  void 0 !== a.key && (e = "" + a.key);
  void 0 !== a.ref && (l = a.ref);

  for (b in a) {
    n.call(a, b) && !p.hasOwnProperty(b) && (d[b] = a[b]);
  }

  if (c && c.defaultProps) for (b in a = c.defaultProps, a) {
    void 0 === d[b] && (d[b] = a[b]);
  }
  return {
    $$typeof: g,
    type: c,
    key: e,
    ref: l,
    props: d,
    _owner: m.current
  };
}

exports.jsx = q;
exports.jsxs = q;

/***/ }),

/***/ 117:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";
/** @license React v16.14.0
 * react.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */


var l = __webpack_require__(725),
    n = "function" === typeof Symbol && Symbol.for,
    p = n ? Symbol.for("react.element") : 60103,
    q = n ? Symbol.for("react.portal") : 60106,
    r = n ? Symbol.for("react.fragment") : 60107,
    t = n ? Symbol.for("react.strict_mode") : 60108,
    u = n ? Symbol.for("react.profiler") : 60114,
    v = n ? Symbol.for("react.provider") : 60109,
    w = n ? Symbol.for("react.context") : 60110,
    x = n ? Symbol.for("react.forward_ref") : 60112,
    y = n ? Symbol.for("react.suspense") : 60113,
    z = n ? Symbol.for("react.memo") : 60115,
    A = n ? Symbol.for("react.lazy") : 60116,
    B = "function" === typeof Symbol && Symbol.iterator;

function C(a) {
  for (var b = "https://reactjs.org/docs/error-decoder.html?invariant=" + a, c = 1; c < arguments.length; c++) {
    b += "&args[]=" + encodeURIComponent(arguments[c]);
  }

  return "Minified React error #" + a + "; visit " + b + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";
}

var D = {
  isMounted: function isMounted() {
    return !1;
  },
  enqueueForceUpdate: function enqueueForceUpdate() {},
  enqueueReplaceState: function enqueueReplaceState() {},
  enqueueSetState: function enqueueSetState() {}
},
    E = {};

function F(a, b, c) {
  this.props = a;
  this.context = b;
  this.refs = E;
  this.updater = c || D;
}

F.prototype.isReactComponent = {};

F.prototype.setState = function (a, b) {
  if ("object" !== typeof a && "function" !== typeof a && null != a) throw Error(C(85));
  this.updater.enqueueSetState(this, a, b, "setState");
};

F.prototype.forceUpdate = function (a) {
  this.updater.enqueueForceUpdate(this, a, "forceUpdate");
};

function G() {}

G.prototype = F.prototype;

function H(a, b, c) {
  this.props = a;
  this.context = b;
  this.refs = E;
  this.updater = c || D;
}

var I = H.prototype = new G();
I.constructor = H;
l(I, F.prototype);
I.isPureReactComponent = !0;
var J = {
  current: null
},
    K = Object.prototype.hasOwnProperty,
    L = {
  key: !0,
  ref: !0,
  __self: !0,
  __source: !0
};

function M(a, b, c) {
  var e,
      d = {},
      g = null,
      k = null;
  if (null != b) for (e in void 0 !== b.ref && (k = b.ref), void 0 !== b.key && (g = "" + b.key), b) {
    K.call(b, e) && !L.hasOwnProperty(e) && (d[e] = b[e]);
  }
  var f = arguments.length - 2;
  if (1 === f) d.children = c;else if (1 < f) {
    for (var h = Array(f), m = 0; m < f; m++) {
      h[m] = arguments[m + 2];
    }

    d.children = h;
  }
  if (a && a.defaultProps) for (e in f = a.defaultProps, f) {
    void 0 === d[e] && (d[e] = f[e]);
  }
  return {
    $$typeof: p,
    type: a,
    key: g,
    ref: k,
    props: d,
    _owner: J.current
  };
}

function N(a, b) {
  return {
    $$typeof: p,
    type: a.type,
    key: b,
    ref: a.ref,
    props: a.props,
    _owner: a._owner
  };
}

function O(a) {
  return "object" === typeof a && null !== a && a.$$typeof === p;
}

function escape(a) {
  var b = {
    "=": "=0",
    ":": "=2"
  };
  return "$" + ("" + a).replace(/[=:]/g, function (a) {
    return b[a];
  });
}

var P = /\/+/g,
    Q = [];

function R(a, b, c, e) {
  if (Q.length) {
    var d = Q.pop();
    d.result = a;
    d.keyPrefix = b;
    d.func = c;
    d.context = e;
    d.count = 0;
    return d;
  }

  return {
    result: a,
    keyPrefix: b,
    func: c,
    context: e,
    count: 0
  };
}

function S(a) {
  a.result = null;
  a.keyPrefix = null;
  a.func = null;
  a.context = null;
  a.count = 0;
  10 > Q.length && Q.push(a);
}

function T(a, b, c, e) {
  var d = typeof a;
  if ("undefined" === d || "boolean" === d) a = null;
  var g = !1;
  if (null === a) g = !0;else switch (d) {
    case "string":
    case "number":
      g = !0;
      break;

    case "object":
      switch (a.$$typeof) {
        case p:
        case q:
          g = !0;
      }

  }
  if (g) return c(e, a, "" === b ? "." + U(a, 0) : b), 1;
  g = 0;
  b = "" === b ? "." : b + ":";
  if (Array.isArray(a)) for (var k = 0; k < a.length; k++) {
    d = a[k];
    var f = b + U(d, k);
    g += T(d, f, c, e);
  } else if (null === a || "object" !== typeof a ? f = null : (f = B && a[B] || a["@@iterator"], f = "function" === typeof f ? f : null), "function" === typeof f) for (a = f.call(a), k = 0; !(d = a.next()).done;) {
    d = d.value, f = b + U(d, k++), g += T(d, f, c, e);
  } else if ("object" === d) throw c = "" + a, Error(C(31, "[object Object]" === c ? "object with keys {" + Object.keys(a).join(", ") + "}" : c, ""));
  return g;
}

function V(a, b, c) {
  return null == a ? 0 : T(a, "", b, c);
}

function U(a, b) {
  return "object" === typeof a && null !== a && null != a.key ? escape(a.key) : b.toString(36);
}

function W(a, b) {
  a.func.call(a.context, b, a.count++);
}

function aa(a, b, c) {
  var e = a.result,
      d = a.keyPrefix;
  a = a.func.call(a.context, b, a.count++);
  Array.isArray(a) ? X(a, e, c, function (a) {
    return a;
  }) : null != a && (O(a) && (a = N(a, d + (!a.key || b && b.key === a.key ? "" : ("" + a.key).replace(P, "$&/") + "/") + c)), e.push(a));
}

function X(a, b, c, e, d) {
  var g = "";
  null != c && (g = ("" + c).replace(P, "$&/") + "/");
  b = R(b, g, e, d);
  V(a, aa, b);
  S(b);
}

var Y = {
  current: null
};

function Z() {
  var a = Y.current;
  if (null === a) throw Error(C(321));
  return a;
}

var ba = {
  ReactCurrentDispatcher: Y,
  ReactCurrentBatchConfig: {
    suspense: null
  },
  ReactCurrentOwner: J,
  IsSomeRendererActing: {
    current: !1
  },
  assign: l
};
exports.Children = {
  map: function map(a, b, c) {
    if (null == a) return a;
    var e = [];
    X(a, e, null, b, c);
    return e;
  },
  forEach: function forEach(a, b, c) {
    if (null == a) return a;
    b = R(null, null, b, c);
    V(a, W, b);
    S(b);
  },
  count: function count(a) {
    return V(a, function () {
      return null;
    }, null);
  },
  toArray: function toArray(a) {
    var b = [];
    X(a, b, null, function (a) {
      return a;
    });
    return b;
  },
  only: function only(a) {
    if (!O(a)) throw Error(C(143));
    return a;
  }
};
exports.Component = F;
exports.Fragment = r;
exports.Profiler = u;
exports.PureComponent = H;
exports.StrictMode = t;
exports.Suspense = y;
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ba;

exports.cloneElement = function (a, b, c) {
  if (null === a || void 0 === a) throw Error(C(267, a));
  var e = l({}, a.props),
      d = a.key,
      g = a.ref,
      k = a._owner;

  if (null != b) {
    void 0 !== b.ref && (g = b.ref, k = J.current);
    void 0 !== b.key && (d = "" + b.key);
    if (a.type && a.type.defaultProps) var f = a.type.defaultProps;

    for (h in b) {
      K.call(b, h) && !L.hasOwnProperty(h) && (e[h] = void 0 === b[h] && void 0 !== f ? f[h] : b[h]);
    }
  }

  var h = arguments.length - 2;
  if (1 === h) e.children = c;else if (1 < h) {
    f = Array(h);

    for (var m = 0; m < h; m++) {
      f[m] = arguments[m + 2];
    }

    e.children = f;
  }
  return {
    $$typeof: p,
    type: a.type,
    key: d,
    ref: g,
    props: e,
    _owner: k
  };
};

exports.createContext = function (a, b) {
  void 0 === b && (b = null);
  a = {
    $$typeof: w,
    _calculateChangedBits: b,
    _currentValue: a,
    _currentValue2: a,
    _threadCount: 0,
    Provider: null,
    Consumer: null
  };
  a.Provider = {
    $$typeof: v,
    _context: a
  };
  return a.Consumer = a;
};

exports.createElement = M;

exports.createFactory = function (a) {
  var b = M.bind(null, a);
  b.type = a;
  return b;
};

exports.createRef = function () {
  return {
    current: null
  };
};

exports.forwardRef = function (a) {
  return {
    $$typeof: x,
    render: a
  };
};

exports.isValidElement = O;

exports.lazy = function (a) {
  return {
    $$typeof: A,
    _ctor: a,
    _status: -1,
    _result: null
  };
};

exports.memo = function (a, b) {
  return {
    $$typeof: z,
    type: a,
    compare: void 0 === b ? null : b
  };
};

exports.useCallback = function (a, b) {
  return Z().useCallback(a, b);
};

exports.useContext = function (a, b) {
  return Z().useContext(a, b);
};

exports.useDebugValue = function () {};

exports.useEffect = function (a, b) {
  return Z().useEffect(a, b);
};

exports.useImperativeHandle = function (a, b, c) {
  return Z().useImperativeHandle(a, b, c);
};

exports.useLayoutEffect = function (a, b) {
  return Z().useLayoutEffect(a, b);
};

exports.useMemo = function (a, b) {
  return Z().useMemo(a, b);
};

exports.useReducer = function (a, b, c) {
  return Z().useReducer(a, b, c);
};

exports.useRef = function (a) {
  return Z().useRef(a);
};

exports.useState = function (a) {
  return Z().useState(a);
};

exports.version = "16.14.0";

/***/ }),

/***/ 791:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


if (true) {
  module.exports = __webpack_require__(117);
} else {}

/***/ }),

/***/ 184:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


if (true) {
  module.exports = __webpack_require__(374);
} else {}

/***/ }),

/***/ 813:
/***/ (function(__unused_webpack_module, exports) {

"use strict";
/** @license React v0.19.1
 * scheduler.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */


var _f, g, h, k, l;

if ("undefined" === typeof window || "function" !== typeof MessageChannel) {
  var p = null,
      q = null,
      t = function t() {
    if (null !== p) try {
      var a = exports.unstable_now();
      p(!0, a);
      p = null;
    } catch (b) {
      throw setTimeout(t, 0), b;
    }
  },
      u = Date.now();

  exports.unstable_now = function () {
    return Date.now() - u;
  };

  _f = function f(a) {
    null !== p ? setTimeout(_f, 0, a) : (p = a, setTimeout(t, 0));
  };

  g = function g(a, b) {
    q = setTimeout(a, b);
  };

  h = function h() {
    clearTimeout(q);
  };

  k = function k() {
    return !1;
  };

  l = exports.unstable_forceFrameRate = function () {};
} else {
  var w = window.performance,
      x = window.Date,
      y = window.setTimeout,
      z = window.clearTimeout;

  if ("undefined" !== typeof console) {
    var A = window.cancelAnimationFrame;
    "function" !== typeof window.requestAnimationFrame && console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills");
    "function" !== typeof A && console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills");
  }

  if ("object" === typeof w && "function" === typeof w.now) exports.unstable_now = function () {
    return w.now();
  };else {
    var B = x.now();

    exports.unstable_now = function () {
      return x.now() - B;
    };
  }
  var C = !1,
      D = null,
      E = -1,
      F = 5,
      G = 0;

  k = function k() {
    return exports.unstable_now() >= G;
  };

  l = function l() {};

  exports.unstable_forceFrameRate = function (a) {
    0 > a || 125 < a ? console.error("forceFrameRate takes a positive int between 0 and 125, forcing framerates higher than 125 fps is not unsupported") : F = 0 < a ? Math.floor(1E3 / a) : 5;
  };

  var H = new MessageChannel(),
      I = H.port2;

  H.port1.onmessage = function () {
    if (null !== D) {
      var a = exports.unstable_now();
      G = a + F;

      try {
        D(!0, a) ? I.postMessage(null) : (C = !1, D = null);
      } catch (b) {
        throw I.postMessage(null), b;
      }
    } else C = !1;
  };

  _f = function _f(a) {
    D = a;
    C || (C = !0, I.postMessage(null));
  };

  g = function g(a, b) {
    E = y(function () {
      a(exports.unstable_now());
    }, b);
  };

  h = function h() {
    z(E);
    E = -1;
  };
}

function J(a, b) {
  var c = a.length;
  a.push(b);

  a: for (;;) {
    var d = c - 1 >>> 1,
        e = a[d];
    if (void 0 !== e && 0 < K(e, b)) a[d] = b, a[c] = e, c = d;else break a;
  }
}

function L(a) {
  a = a[0];
  return void 0 === a ? null : a;
}

function M(a) {
  var b = a[0];

  if (void 0 !== b) {
    var c = a.pop();

    if (c !== b) {
      a[0] = c;

      a: for (var d = 0, e = a.length; d < e;) {
        var m = 2 * (d + 1) - 1,
            n = a[m],
            v = m + 1,
            r = a[v];
        if (void 0 !== n && 0 > K(n, c)) void 0 !== r && 0 > K(r, n) ? (a[d] = r, a[v] = c, d = v) : (a[d] = n, a[m] = c, d = m);else if (void 0 !== r && 0 > K(r, c)) a[d] = r, a[v] = c, d = v;else break a;
      }
    }

    return b;
  }

  return null;
}

function K(a, b) {
  var c = a.sortIndex - b.sortIndex;
  return 0 !== c ? c : a.id - b.id;
}

var N = [],
    O = [],
    P = 1,
    Q = null,
    R = 3,
    S = !1,
    T = !1,
    U = !1;

function V(a) {
  for (var b = L(O); null !== b;) {
    if (null === b.callback) M(O);else if (b.startTime <= a) M(O), b.sortIndex = b.expirationTime, J(N, b);else break;
    b = L(O);
  }
}

function W(a) {
  U = !1;
  V(a);
  if (!T) if (null !== L(N)) T = !0, _f(X);else {
    var b = L(O);
    null !== b && g(W, b.startTime - a);
  }
}

function X(a, b) {
  T = !1;
  U && (U = !1, h());
  S = !0;
  var c = R;

  try {
    V(b);

    for (Q = L(N); null !== Q && (!(Q.expirationTime > b) || a && !k());) {
      var d = Q.callback;

      if (null !== d) {
        Q.callback = null;
        R = Q.priorityLevel;
        var e = d(Q.expirationTime <= b);
        b = exports.unstable_now();
        "function" === typeof e ? Q.callback = e : Q === L(N) && M(N);
        V(b);
      } else M(N);

      Q = L(N);
    }

    if (null !== Q) var m = !0;else {
      var n = L(O);
      null !== n && g(W, n.startTime - b);
      m = !1;
    }
    return m;
  } finally {
    Q = null, R = c, S = !1;
  }
}

function Y(a) {
  switch (a) {
    case 1:
      return -1;

    case 2:
      return 250;

    case 5:
      return 1073741823;

    case 4:
      return 1E4;

    default:
      return 5E3;
  }
}

var Z = l;
exports.unstable_IdlePriority = 5;
exports.unstable_ImmediatePriority = 1;
exports.unstable_LowPriority = 4;
exports.unstable_NormalPriority = 3;
exports.unstable_Profiling = null;
exports.unstable_UserBlockingPriority = 2;

exports.unstable_cancelCallback = function (a) {
  a.callback = null;
};

exports.unstable_continueExecution = function () {
  T || S || (T = !0, _f(X));
};

exports.unstable_getCurrentPriorityLevel = function () {
  return R;
};

exports.unstable_getFirstCallbackNode = function () {
  return L(N);
};

exports.unstable_next = function (a) {
  switch (R) {
    case 1:
    case 2:
    case 3:
      var b = 3;
      break;

    default:
      b = R;
  }

  var c = R;
  R = b;

  try {
    return a();
  } finally {
    R = c;
  }
};

exports.unstable_pauseExecution = function () {};

exports.unstable_requestPaint = Z;

exports.unstable_runWithPriority = function (a, b) {
  switch (a) {
    case 1:
    case 2:
    case 3:
    case 4:
    case 5:
      break;

    default:
      a = 3;
  }

  var c = R;
  R = a;

  try {
    return b();
  } finally {
    R = c;
  }
};

exports.unstable_scheduleCallback = function (a, b, c) {
  var d = exports.unstable_now();

  if ("object" === typeof c && null !== c) {
    var e = c.delay;
    e = "number" === typeof e && 0 < e ? d + e : d;
    c = "number" === typeof c.timeout ? c.timeout : Y(a);
  } else c = Y(a), e = d;

  c = e + c;
  a = {
    id: P++,
    callback: b,
    priorityLevel: a,
    startTime: e,
    expirationTime: c,
    sortIndex: -1
  };
  e > d ? (a.sortIndex = e, J(O, a), null === L(N) && a === L(O) && (U ? h() : U = !0, g(W, e - d))) : (a.sortIndex = c, J(N, a), T || S || (T = !0, _f(X)));
  return a;
};

exports.unstable_shouldYield = function () {
  var a = exports.unstable_now();
  V(a);
  var b = L(N);
  return b !== Q && null !== Q && null !== b && null !== b.callback && b.startTime <= a && b.expirationTime < Q.expirationTime || k();
};

exports.unstable_wrapCallback = function (a) {
  var b = R;
  return function () {
    var c = R;
    R = b;

    try {
      return a.apply(this, arguments);
    } finally {
      R = c;
    }
  };
};

/***/ }),

/***/ 296:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


if (true) {
  module.exports = __webpack_require__(813);
} else {}

/***/ }),

/***/ 601:
/***/ (function() {

/* (ignored) */

/***/ }),

/***/ 767:
/***/ (function() {

/* (ignored) */

/***/ }),

/***/ 251:
/***/ (function() {

/* (ignored) */

/***/ }),

/***/ 677:
/***/ (function() {

/* (ignored) */

/***/ }),

/***/ 543:
/***/ (function() {

/* (ignored) */

/***/ }),

/***/ 324:
/***/ (function() {

/* (ignored) */

/***/ })

/******/ 	});
/************************************************************************/
/******/ 	// The module cache
/******/ 	var __webpack_module_cache__ = {};
/******/ 	
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/ 		// Check if module is in cache
/******/ 		var cachedModule = __webpack_module_cache__[moduleId];
/******/ 		if (cachedModule !== undefined) {
/******/ 			return cachedModule.exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = __webpack_module_cache__[moduleId] = {
/******/ 			// no module.id needed
/******/ 			// no module.loaded needed
/******/ 			exports: {}
/******/ 		};
/******/ 	
/******/ 		// Execute the module function
/******/ 		__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ 	
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/compat get default export */
/******/ 	!function() {
/******/ 		// getDefaultExport function for compatibility with non-harmony modules
/******/ 		__webpack_require__.n = function(module) {
/******/ 			var getter = module && module.__esModule ?
/******/ 				function() { return module['default']; } :
/******/ 				function() { return module; };
/******/ 			__webpack_require__.d(getter, { a: getter });
/******/ 			return getter;
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/define property getters */
/******/ 	!function() {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = function(exports, definition) {
/******/ 			for(var key in definition) {
/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/global */
/******/ 	!function() {
/******/ 		__webpack_require__.g = (function() {
/******/ 			if (typeof globalThis === 'object') return globalThis;
/******/ 			try {
/******/ 				return this || new Function('return this')();
/******/ 			} catch (e) {
/******/ 				if (typeof window === 'object') return window;
/******/ 			}
/******/ 		})();
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
/******/ 	!function() {
/******/ 		__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/make namespace object */
/******/ 	!function() {
/******/ 		// define __esModule on exports
/******/ 		__webpack_require__.r = function(exports) {
/******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 			}
/******/ 			Object.defineProperty(exports, '__esModule', { value: true });
/******/ 		};
/******/ 	}();
/******/ 	
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be in strict mode.
!function() {
"use strict";

;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
function _objectWithoutPropertiesLoose(source, excluded) {
  if (source == null) return {};
  var target = {};
  var sourceKeys = Object.keys(source);
  var key, i;

  for (i = 0; i < sourceKeys.length; i++) {
    key = sourceKeys[i];
    if (excluded.indexOf(key) >= 0) continue;
    target[key] = source[key];
  }

  return target;
}
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js

function _objectWithoutProperties(source, excluded) {
  if (source == null) return {};
  var target = _objectWithoutPropertiesLoose(source, excluded);
  var key, i;

  if (Object.getOwnPropertySymbols) {
    var sourceSymbolKeys = Object.getOwnPropertySymbols(source);

    for (i = 0; i < sourceSymbolKeys.length; i++) {
      key = sourceSymbolKeys[i];
      if (excluded.indexOf(key) >= 0) continue;
      if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
      target[key] = source[key];
    }
  }

  return target;
}
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
function _defineProperty(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, {
      value: value,
      enumerable: true,
      configurable: true,
      writable: true
    });
  } else {
    obj[key] = value;
  }

  return obj;
}
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js


function ownKeys(object, enumerableOnly) {
  var keys = Object.keys(object);

  if (Object.getOwnPropertySymbols) {
    var symbols = Object.getOwnPropertySymbols(object);
    enumerableOnly && (symbols = symbols.filter(function (sym) {
      return Object.getOwnPropertyDescriptor(object, sym).enumerable;
    })), keys.push.apply(keys, symbols);
  }

  return keys;
}

function _objectSpread2(target) {
  for (var i = 1; i < arguments.length; i++) {
    var source = null != arguments[i] ? arguments[i] : {};
    i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
      _defineProperty(target, key, source[key]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
      Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
    });
  }

  return target;
}
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
function _arrayLikeToArray(arr, len) {
  if (len == null || len > arr.length) len = arr.length;

  for (var i = 0, arr2 = new Array(len); i < len; i++) {
    arr2[i] = arr[i];
  }

  return arr2;
}
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js

function _arrayWithoutHoles(arr) {
  if (Array.isArray(arr)) return _arrayLikeToArray(arr);
}
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
function _iterableToArray(iter) {
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
}
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js

function _unsupportedIterableToArray(o, minLen) {
  if (!o) return;
  if (typeof o === "string") return _arrayLikeToArray(o, minLen);
  var n = Object.prototype.toString.call(o).slice(8, -1);
  if (n === "Object" && o.constructor) n = o.constructor.name;
  if (n === "Map" || n === "Set") return Array.from(o);
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
}
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
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.");
}
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js




function _toConsumableArray(arr) {
  return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
}
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
function _classCallCheck(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
function _defineProperties(target, props) {
  for (var i = 0; i < props.length; i++) {
    var descriptor = props[i];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor) descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}

function _createClass(Constructor, protoProps, staticProps) {
  if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  if (staticProps) _defineProperties(Constructor, staticProps);
  Object.defineProperty(Constructor, "prototype", {
    writable: false
  });
  return Constructor;
}
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
function _setPrototypeOf(o, p) {
  _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
    o.__proto__ = p;
    return o;
  };
  return _setPrototypeOf(o, p);
}
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js

function _inherits(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }

  subClass.prototype = Object.create(superClass && superClass.prototype, {
    constructor: {
      value: subClass,
      writable: true,
      configurable: true
    }
  });
  Object.defineProperty(subClass, "prototype", {
    writable: false
  });
  if (superClass) _setPrototypeOf(subClass, superClass);
}
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
function _getPrototypeOf(o) {
  _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
    return o.__proto__ || Object.getPrototypeOf(o);
  };
  return _getPrototypeOf(o);
}
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js
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 (e) {
    return false;
  }
}
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js
function _typeof(obj) {
  "@babel/helpers - typeof";

  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
    return typeof obj;
  } : function (obj) {
    return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  }, _typeof(obj);
}
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
function _assertThisInitialized(self) {
  if (self === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }

  return self;
}
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js


function _possibleConstructorReturn(self, call) {
  if (call && (_typeof(call) === "object" || typeof call === "function")) {
    return call;
  } else if (call !== void 0) {
    throw new TypeError("Derived constructors may only return object or undefined");
  }

  return _assertThisInitialized(self);
}
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/createSuper.js



function _createSuper(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf(Derived),
        result;

    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }

    return _possibleConstructorReturn(this, result);
  };
}
// EXTERNAL MODULE: ./node_modules/react/index.js
var react = __webpack_require__(791);
// EXTERNAL MODULE: ./node_modules/react-draggable/build/cjs/cjs.js
var cjs = __webpack_require__(962);
var cjs_default = /*#__PURE__*/__webpack_require__.n(cjs);
;// CONCATENATED MODULE: ./node_modules/re-resizable/lib/resizer.js
var __extends = undefined && undefined.__extends || function () {
  var _extendStatics = function extendStatics(d, b) {
    _extendStatics = Object.setPrototypeOf || {
      __proto__: []
    } instanceof Array && function (d, b) {
      d.__proto__ = b;
    } || function (d, b) {
      for (var p in b) {
        if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
      }
    };

    return _extendStatics(d, b);
  };

  return function (d, b) {
    _extendStatics(d, b);

    function __() {
      this.constructor = d;
    }

    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();

var __assign = undefined && undefined.__assign || function () {
  __assign = Object.assign || function (t) {
    for (var s, i = 1, n = arguments.length; i < n; i++) {
      s = arguments[i];

      for (var p in s) {
        if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
      }
    }

    return t;
  };

  return __assign.apply(this, arguments);
};


var styles = {
  top: {
    width: '100%',
    height: '10px',
    top: '-5px',
    left: '0px',
    cursor: 'row-resize'
  },
  right: {
    width: '10px',
    height: '100%',
    top: '0px',
    right: '-5px',
    cursor: 'col-resize'
  },
  bottom: {
    width: '100%',
    height: '10px',
    bottom: '-5px',
    left: '0px',
    cursor: 'row-resize'
  },
  left: {
    width: '10px',
    height: '100%',
    top: '0px',
    left: '-5px',
    cursor: 'col-resize'
  },
  topRight: {
    width: '20px',
    height: '20px',
    position: 'absolute',
    right: '-10px',
    top: '-10px',
    cursor: 'ne-resize'
  },
  bottomRight: {
    width: '20px',
    height: '20px',
    position: 'absolute',
    right: '-10px',
    bottom: '-10px',
    cursor: 'se-resize'
  },
  bottomLeft: {
    width: '20px',
    height: '20px',
    position: 'absolute',
    left: '-10px',
    bottom: '-10px',
    cursor: 'sw-resize'
  },
  topLeft: {
    width: '20px',
    height: '20px',
    position: 'absolute',
    left: '-10px',
    top: '-10px',
    cursor: 'nw-resize'
  }
};

var Resizer =
/** @class */
function (_super) {
  __extends(Resizer, _super);

  function Resizer() {
    var _this = _super !== null && _super.apply(this, arguments) || this;

    _this.onMouseDown = function (e) {
      _this.props.onResizeStart(e, _this.props.direction);
    };

    _this.onTouchStart = function (e) {
      _this.props.onResizeStart(e, _this.props.direction);
    };

    return _this;
  }

  Resizer.prototype.render = function () {
    return react.createElement("div", {
      className: this.props.className || '',
      style: __assign(__assign({
        position: 'absolute',
        userSelect: 'none'
      }, styles[this.props.direction]), this.props.replaceStyles || {}),
      onMouseDown: this.onMouseDown,
      onTouchStart: this.onTouchStart
    }, this.props.children);
  };

  return Resizer;
}(react.PureComponent);


// EXTERNAL MODULE: ./node_modules/fast-memoize/src/index.js
var src = __webpack_require__(959);
var src_default = /*#__PURE__*/__webpack_require__.n(src);
;// CONCATENATED MODULE: ./node_modules/re-resizable/lib/index.js
var lib_extends = undefined && undefined.__extends || function () {
  var _extendStatics = function extendStatics(d, b) {
    _extendStatics = Object.setPrototypeOf || {
      __proto__: []
    } instanceof Array && function (d, b) {
      d.__proto__ = b;
    } || function (d, b) {
      for (var p in b) {
        if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
      }
    };

    return _extendStatics(d, b);
  };

  return function (d, b) {
    _extendStatics(d, b);

    function __() {
      this.constructor = d;
    }

    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();

var lib_assign = undefined && undefined.__assign || function () {
  lib_assign = Object.assign || function (t) {
    for (var s, i = 1, n = arguments.length; i < n; i++) {
      s = arguments[i];

      for (var p in s) {
        if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
      }
    }

    return t;
  };

  return lib_assign.apply(this, arguments);
};




var DEFAULT_SIZE = {
  width: 'auto',
  height: 'auto'
};
var clamp = src_default()(function (n, min, max) {
  return Math.max(Math.min(n, max), min);
});
var snap = src_default()(function (n, size) {
  return Math.round(n / size) * size;
});
var hasDirection = src_default()(function (dir, target) {
  return new RegExp(dir, 'i').test(target);
}); // INFO: In case of window is a Proxy and does not porxy Events correctly, use isTouchEvent & isMouseEvent to distinguish event type instead of `instanceof`.

var isTouchEvent = function isTouchEvent(event) {
  return Boolean(event.touches && event.touches.length);
};

var isMouseEvent = function isMouseEvent(event) {
  return Boolean((event.clientX || event.clientX === 0) && (event.clientY || event.clientY === 0));
};

var findClosestSnap = src_default()(function (n, snapArray, snapGap) {
  if (snapGap === void 0) {
    snapGap = 0;
  }

  var closestGapIndex = snapArray.reduce(function (prev, curr, index) {
    return Math.abs(curr - n) < Math.abs(snapArray[prev] - n) ? index : prev;
  }, 0);
  var gap = Math.abs(snapArray[closestGapIndex] - n);
  return snapGap === 0 || gap < snapGap ? snapArray[closestGapIndex] : n;
});
var endsWith = src_default()(function (str, searchStr) {
  return str.substr(str.length - searchStr.length, searchStr.length) === searchStr;
});
var getStringSize = src_default()(function (n) {
  n = n.toString();

  if (n === 'auto') {
    return n;
  }

  if (endsWith(n, 'px')) {
    return n;
  }

  if (endsWith(n, '%')) {
    return n;
  }

  if (endsWith(n, 'vh')) {
    return n;
  }

  if (endsWith(n, 'vw')) {
    return n;
  }

  if (endsWith(n, 'vmax')) {
    return n;
  }

  if (endsWith(n, 'vmin')) {
    return n;
  }

  return n + "px";
});

var getPixelSize = function getPixelSize(size, parentSize, innerWidth, innerHeight) {
  if (size && typeof size === 'string') {
    if (endsWith(size, 'px')) {
      return Number(size.replace('px', ''));
    }

    if (endsWith(size, '%')) {
      var ratio = Number(size.replace('%', '')) / 100;
      return parentSize * ratio;
    }

    if (endsWith(size, 'vw')) {
      var ratio = Number(size.replace('vw', '')) / 100;
      return innerWidth * ratio;
    }

    if (endsWith(size, 'vh')) {
      var ratio = Number(size.replace('vh', '')) / 100;
      return innerHeight * ratio;
    }
  }

  return size;
};

var calculateNewMax = src_default()(function (parentSize, innerWidth, innerHeight, maxWidth, maxHeight, minWidth, minHeight) {
  maxWidth = getPixelSize(maxWidth, parentSize.width, innerWidth, innerHeight);
  maxHeight = getPixelSize(maxHeight, parentSize.height, innerWidth, innerHeight);
  minWidth = getPixelSize(minWidth, parentSize.width, innerWidth, innerHeight);
  minHeight = getPixelSize(minHeight, parentSize.height, innerWidth, innerHeight);
  return {
    maxWidth: typeof maxWidth === 'undefined' ? undefined : Number(maxWidth),
    maxHeight: typeof maxHeight === 'undefined' ? undefined : Number(maxHeight),
    minWidth: typeof minWidth === 'undefined' ? undefined : Number(minWidth),
    minHeight: typeof minHeight === 'undefined' ? undefined : Number(minHeight)
  };
});
var definedProps = ['as', 'style', 'className', 'grid', 'snap', 'bounds', 'boundsByDirection', 'size', 'defaultSize', 'minWidth', 'minHeight', 'maxWidth', 'maxHeight', 'lockAspectRatio', 'lockAspectRatioExtraWidth', 'lockAspectRatioExtraHeight', 'enable', 'handleStyles', 'handleClasses', 'handleWrapperStyle', 'handleWrapperClass', 'children', 'onResizeStart', 'onResize', 'onResizeStop', 'handleComponent', 'scale', 'resizeRatio', 'snapGap']; // HACK: This class is used to calculate % size.

var baseClassName = '__resizable_base__';

var Resizable =
/** @class */
function (_super) {
  lib_extends(Resizable, _super);

  function Resizable(props) {
    var _this = _super.call(this, props) || this;

    _this.ratio = 1;
    _this.resizable = null; // For parent boundary

    _this.parentLeft = 0;
    _this.parentTop = 0; // For boundary

    _this.resizableLeft = 0;
    _this.resizableRight = 0;
    _this.resizableTop = 0;
    _this.resizableBottom = 0; // For target boundary

    _this.targetLeft = 0;
    _this.targetTop = 0;

    _this.appendBase = function () {
      if (!_this.resizable || !_this.window) {
        return null;
      }

      var parent = _this.parentNode;

      if (!parent) {
        return null;
      }

      var element = _this.window.document.createElement('div');

      element.style.width = '100%';
      element.style.height = '100%';
      element.style.position = 'absolute';
      element.style.transform = 'scale(0, 0)';
      element.style.left = '0';
      element.style.flex = '0 0 100%';

      if (element.classList) {
        element.classList.add(baseClassName);
      } else {
        element.className += baseClassName;
      }

      parent.appendChild(element);
      return element;
    };

    _this.removeBase = function (base) {
      var parent = _this.parentNode;

      if (!parent) {
        return;
      }

      parent.removeChild(base);
    };

    _this.ref = function (c) {
      if (c) {
        _this.resizable = c;
      }
    };

    _this.state = {
      isResizing: false,
      width: typeof (_this.propsSize && _this.propsSize.width) === 'undefined' ? 'auto' : _this.propsSize && _this.propsSize.width,
      height: typeof (_this.propsSize && _this.propsSize.height) === 'undefined' ? 'auto' : _this.propsSize && _this.propsSize.height,
      direction: 'right',
      original: {
        x: 0,
        y: 0,
        width: 0,
        height: 0
      },
      backgroundStyle: {
        height: '100%',
        width: '100%',
        backgroundColor: 'rgba(0,0,0,0)',
        cursor: 'auto',
        opacity: 0,
        position: 'fixed',
        zIndex: 9999,
        top: '0',
        left: '0',
        bottom: '0',
        right: '0'
      },
      flexBasis: undefined
    };
    _this.onResizeStart = _this.onResizeStart.bind(_this);
    _this.onMouseMove = _this.onMouseMove.bind(_this);
    _this.onMouseUp = _this.onMouseUp.bind(_this);
    return _this;
  }

  Object.defineProperty(Resizable.prototype, "parentNode", {
    get: function get() {
      if (!this.resizable) {
        return null;
      }

      return this.resizable.parentNode;
    },
    enumerable: false,
    configurable: true
  });
  Object.defineProperty(Resizable.prototype, "window", {
    get: function get() {
      if (!this.resizable) {
        return null;
      }

      if (!this.resizable.ownerDocument) {
        return null;
      }

      return this.resizable.ownerDocument.defaultView;
    },
    enumerable: false,
    configurable: true
  });
  Object.defineProperty(Resizable.prototype, "propsSize", {
    get: function get() {
      return this.props.size || this.props.defaultSize || DEFAULT_SIZE;
    },
    enumerable: false,
    configurable: true
  });
  Object.defineProperty(Resizable.prototype, "size", {
    get: function get() {
      var width = 0;
      var height = 0;

      if (this.resizable && this.window) {
        var orgWidth = this.resizable.offsetWidth;
        var orgHeight = this.resizable.offsetHeight; // HACK: Set position `relative` to get parent size.
        //       This is because when re-resizable set `absolute`, I can not get base width correctly.

        var orgPosition = this.resizable.style.position;

        if (orgPosition !== 'relative') {
          this.resizable.style.position = 'relative';
        } // INFO: Use original width or height if set auto.


        width = this.resizable.style.width !== 'auto' ? this.resizable.offsetWidth : orgWidth;
        height = this.resizable.style.height !== 'auto' ? this.resizable.offsetHeight : orgHeight; // Restore original position

        this.resizable.style.position = orgPosition;
      }

      return {
        width: width,
        height: height
      };
    },
    enumerable: false,
    configurable: true
  });
  Object.defineProperty(Resizable.prototype, "sizeStyle", {
    get: function get() {
      var _this = this;

      var size = this.props.size;

      var getSize = function getSize(key) {
        if (typeof _this.state[key] === 'undefined' || _this.state[key] === 'auto') {
          return 'auto';
        }

        if (_this.propsSize && _this.propsSize[key] && endsWith(_this.propsSize[key].toString(), '%')) {
          if (endsWith(_this.state[key].toString(), '%')) {
            return _this.state[key].toString();
          }

          var parentSize = _this.getParentSize();

          var value = Number(_this.state[key].toString().replace('px', ''));
          var percent = value / parentSize[key] * 100;
          return percent + "%";
        }

        return getStringSize(_this.state[key]);
      };

      var width = size && typeof size.width !== 'undefined' && !this.state.isResizing ? getStringSize(size.width) : getSize('width');
      var height = size && typeof size.height !== 'undefined' && !this.state.isResizing ? getStringSize(size.height) : getSize('height');
      return {
        width: width,
        height: height
      };
    },
    enumerable: false,
    configurable: true
  });

  Resizable.prototype.getParentSize = function () {
    if (!this.parentNode) {
      if (!this.window) {
        return {
          width: 0,
          height: 0
        };
      }

      return {
        width: this.window.innerWidth,
        height: this.window.innerHeight
      };
    }

    var base = this.appendBase();

    if (!base) {
      return {
        width: 0,
        height: 0
      };
    } // INFO: To calculate parent width with flex layout


    var wrapChanged = false;
    var wrap = this.parentNode.style.flexWrap;

    if (wrap !== 'wrap') {
      wrapChanged = true;
      this.parentNode.style.flexWrap = 'wrap'; // HACK: Use relative to get parent padding size
    }

    base.style.position = 'relative';
    base.style.minWidth = '100%';
    base.style.minHeight = '100%';
    var size = {
      width: base.offsetWidth,
      height: base.offsetHeight
    };

    if (wrapChanged) {
      this.parentNode.style.flexWrap = wrap;
    }

    this.removeBase(base);
    return size;
  };

  Resizable.prototype.bindEvents = function () {
    if (this.window) {
      this.window.addEventListener('mouseup', this.onMouseUp);
      this.window.addEventListener('mousemove', this.onMouseMove);
      this.window.addEventListener('mouseleave', this.onMouseUp);
      this.window.addEventListener('touchmove', this.onMouseMove, {
        capture: true,
        passive: false
      });
      this.window.addEventListener('touchend', this.onMouseUp);
    }
  };

  Resizable.prototype.unbindEvents = function () {
    if (this.window) {
      this.window.removeEventListener('mouseup', this.onMouseUp);
      this.window.removeEventListener('mousemove', this.onMouseMove);
      this.window.removeEventListener('mouseleave', this.onMouseUp);
      this.window.removeEventListener('touchmove', this.onMouseMove, true);
      this.window.removeEventListener('touchend', this.onMouseUp);
    }
  };

  Resizable.prototype.componentDidMount = function () {
    if (!this.resizable || !this.window) {
      return;
    }

    var computedStyle = this.window.getComputedStyle(this.resizable);
    this.setState({
      width: this.state.width || this.size.width,
      height: this.state.height || this.size.height,
      flexBasis: computedStyle.flexBasis !== 'auto' ? computedStyle.flexBasis : undefined
    });
  };

  Resizable.prototype.componentWillUnmount = function () {
    if (this.window) {
      this.unbindEvents();
    }
  };

  Resizable.prototype.createSizeForCssProperty = function (newSize, kind) {
    var propsSize = this.propsSize && this.propsSize[kind];
    return this.state[kind] === 'auto' && this.state.original[kind] === newSize && (typeof propsSize === 'undefined' || propsSize === 'auto') ? 'auto' : newSize;
  };

  Resizable.prototype.calculateNewMaxFromBoundary = function (maxWidth, maxHeight) {
    var boundsByDirection = this.props.boundsByDirection;
    var direction = this.state.direction;
    var widthByDirection = boundsByDirection && hasDirection('left', direction);
    var heightByDirection = boundsByDirection && hasDirection('top', direction);
    var boundWidth;
    var boundHeight;

    if (this.props.bounds === 'parent') {
      var parent_1 = this.parentNode;

      if (parent_1) {
        boundWidth = widthByDirection ? this.resizableRight - this.parentLeft : parent_1.offsetWidth + (this.parentLeft - this.resizableLeft);
        boundHeight = heightByDirection ? this.resizableBottom - this.parentTop : parent_1.offsetHeight + (this.parentTop - this.resizableTop);
      }
    } else if (this.props.bounds === 'window') {
      if (this.window) {
        boundWidth = widthByDirection ? this.resizableRight : this.window.innerWidth - this.resizableLeft;
        boundHeight = heightByDirection ? this.resizableBottom : this.window.innerHeight - this.resizableTop;
      }
    } else if (this.props.bounds) {
      boundWidth = widthByDirection ? this.resizableRight - this.targetLeft : this.props.bounds.offsetWidth + (this.targetLeft - this.resizableLeft);
      boundHeight = heightByDirection ? this.resizableBottom - this.targetTop : this.props.bounds.offsetHeight + (this.targetTop - this.resizableTop);
    }

    if (boundWidth && Number.isFinite(boundWidth)) {
      maxWidth = maxWidth && maxWidth < boundWidth ? maxWidth : boundWidth;
    }

    if (boundHeight && Number.isFinite(boundHeight)) {
      maxHeight = maxHeight && maxHeight < boundHeight ? maxHeight : boundHeight;
    }

    return {
      maxWidth: maxWidth,
      maxHeight: maxHeight
    };
  };

  Resizable.prototype.calculateNewSizeFromDirection = function (clientX, clientY) {
    var scale = this.props.scale || 1;
    var resizeRatio = this.props.resizeRatio || 1;
    var _a = this.state,
        direction = _a.direction,
        original = _a.original;
    var _b = this.props,
        lockAspectRatio = _b.lockAspectRatio,
        lockAspectRatioExtraHeight = _b.lockAspectRatioExtraHeight,
        lockAspectRatioExtraWidth = _b.lockAspectRatioExtraWidth;
    var newWidth = original.width;
    var newHeight = original.height;
    var extraHeight = lockAspectRatioExtraHeight || 0;
    var extraWidth = lockAspectRatioExtraWidth || 0;

    if (hasDirection('right', direction)) {
      newWidth = original.width + (clientX - original.x) * resizeRatio / scale;

      if (lockAspectRatio) {
        newHeight = (newWidth - extraWidth) / this.ratio + extraHeight;
      }
    }

    if (hasDirection('left', direction)) {
      newWidth = original.width - (clientX - original.x) * resizeRatio / scale;

      if (lockAspectRatio) {
        newHeight = (newWidth - extraWidth) / this.ratio + extraHeight;
      }
    }

    if (hasDirection('bottom', direction)) {
      newHeight = original.height + (clientY - original.y) * resizeRatio / scale;

      if (lockAspectRatio) {
        newWidth = (newHeight - extraHeight) * this.ratio + extraWidth;
      }
    }

    if (hasDirection('top', direction)) {
      newHeight = original.height - (clientY - original.y) * resizeRatio / scale;

      if (lockAspectRatio) {
        newWidth = (newHeight - extraHeight) * this.ratio + extraWidth;
      }
    }

    return {
      newWidth: newWidth,
      newHeight: newHeight
    };
  };

  Resizable.prototype.calculateNewSizeFromAspectRatio = function (newWidth, newHeight, max, min) {
    var _a = this.props,
        lockAspectRatio = _a.lockAspectRatio,
        lockAspectRatioExtraHeight = _a.lockAspectRatioExtraHeight,
        lockAspectRatioExtraWidth = _a.lockAspectRatioExtraWidth;
    var computedMinWidth = typeof min.width === 'undefined' ? 10 : min.width;
    var computedMaxWidth = typeof max.width === 'undefined' || max.width < 0 ? newWidth : max.width;
    var computedMinHeight = typeof min.height === 'undefined' ? 10 : min.height;
    var computedMaxHeight = typeof max.height === 'undefined' || max.height < 0 ? newHeight : max.height;
    var extraHeight = lockAspectRatioExtraHeight || 0;
    var extraWidth = lockAspectRatioExtraWidth || 0;

    if (lockAspectRatio) {
      var extraMinWidth = (computedMinHeight - extraHeight) * this.ratio + extraWidth;
      var extraMaxWidth = (computedMaxHeight - extraHeight) * this.ratio + extraWidth;
      var extraMinHeight = (computedMinWidth - extraWidth) / this.ratio + extraHeight;
      var extraMaxHeight = (computedMaxWidth - extraWidth) / this.ratio + extraHeight;
      var lockedMinWidth = Math.max(computedMinWidth, extraMinWidth);
      var lockedMaxWidth = Math.min(computedMaxWidth, extraMaxWidth);
      var lockedMinHeight = Math.max(computedMinHeight, extraMinHeight);
      var lockedMaxHeight = Math.min(computedMaxHeight, extraMaxHeight);
      newWidth = clamp(newWidth, lockedMinWidth, lockedMaxWidth);
      newHeight = clamp(newHeight, lockedMinHeight, lockedMaxHeight);
    } else {
      newWidth = clamp(newWidth, computedMinWidth, computedMaxWidth);
      newHeight = clamp(newHeight, computedMinHeight, computedMaxHeight);
    }

    return {
      newWidth: newWidth,
      newHeight: newHeight
    };
  };

  Resizable.prototype.setBoundingClientRect = function () {
    // For parent boundary
    if (this.props.bounds === 'parent') {
      var parent_2 = this.parentNode;

      if (parent_2) {
        var parentRect = parent_2.getBoundingClientRect();
        this.parentLeft = parentRect.left;
        this.parentTop = parentRect.top;
      }
    } // For target(html element) boundary


    if (this.props.bounds && typeof this.props.bounds !== 'string') {
      var targetRect = this.props.bounds.getBoundingClientRect();
      this.targetLeft = targetRect.left;
      this.targetTop = targetRect.top;
    } // For boundary


    if (this.resizable) {
      var _a = this.resizable.getBoundingClientRect(),
          left = _a.left,
          top_1 = _a.top,
          right = _a.right,
          bottom = _a.bottom;

      this.resizableLeft = left;
      this.resizableRight = right;
      this.resizableTop = top_1;
      this.resizableBottom = bottom;
    }
  };

  Resizable.prototype.onResizeStart = function (event, direction) {
    if (!this.resizable || !this.window) {
      return;
    }

    var clientX = 0;
    var clientY = 0;

    if (event.nativeEvent && isMouseEvent(event.nativeEvent)) {
      clientX = event.nativeEvent.clientX;
      clientY = event.nativeEvent.clientY;
    } else if (event.nativeEvent && isTouchEvent(event.nativeEvent)) {
      clientX = event.nativeEvent.touches[0].clientX;
      clientY = event.nativeEvent.touches[0].clientY;
    }

    if (this.props.onResizeStart) {
      if (this.resizable) {
        var startResize = this.props.onResizeStart(event, direction, this.resizable);

        if (startResize === false) {
          return;
        }
      }
    } // Fix #168


    if (this.props.size) {
      if (typeof this.props.size.height !== 'undefined' && this.props.size.height !== this.state.height) {
        this.setState({
          height: this.props.size.height
        });
      }

      if (typeof this.props.size.width !== 'undefined' && this.props.size.width !== this.state.width) {
        this.setState({
          width: this.props.size.width
        });
      }
    } // For lockAspectRatio case


    this.ratio = typeof this.props.lockAspectRatio === 'number' ? this.props.lockAspectRatio : this.size.width / this.size.height;
    var flexBasis;
    var computedStyle = this.window.getComputedStyle(this.resizable);

    if (computedStyle.flexBasis !== 'auto') {
      var parent_3 = this.parentNode;

      if (parent_3) {
        var dir = this.window.getComputedStyle(parent_3).flexDirection;
        this.flexDir = dir.startsWith('row') ? 'row' : 'column';
        flexBasis = computedStyle.flexBasis;
      }
    } // For boundary


    this.setBoundingClientRect();
    this.bindEvents();
    var state = {
      original: {
        x: clientX,
        y: clientY,
        width: this.size.width,
        height: this.size.height
      },
      isResizing: true,
      backgroundStyle: lib_assign(lib_assign({}, this.state.backgroundStyle), {
        cursor: this.window.getComputedStyle(event.target).cursor || 'auto'
      }),
      direction: direction,
      flexBasis: flexBasis
    };
    this.setState(state);
  };

  Resizable.prototype.onMouseMove = function (event) {
    if (!this.state.isResizing || !this.resizable || !this.window) {
      return;
    }

    if (this.window.TouchEvent && isTouchEvent(event)) {
      try {
        event.preventDefault();
        event.stopPropagation();
      } catch (e) {// Ignore on fail
      }
    }

    var _a = this.props,
        maxWidth = _a.maxWidth,
        maxHeight = _a.maxHeight,
        minWidth = _a.minWidth,
        minHeight = _a.minHeight;
    var clientX = isTouchEvent(event) ? event.touches[0].clientX : event.clientX;
    var clientY = isTouchEvent(event) ? event.touches[0].clientY : event.clientY;
    var _b = this.state,
        direction = _b.direction,
        original = _b.original,
        width = _b.width,
        height = _b.height;
    var parentSize = this.getParentSize();
    var max = calculateNewMax(parentSize, this.window.innerWidth, this.window.innerHeight, maxWidth, maxHeight, minWidth, minHeight);
    maxWidth = max.maxWidth;
    maxHeight = max.maxHeight;
    minWidth = max.minWidth;
    minHeight = max.minHeight; // Calculate new size

    var _c = this.calculateNewSizeFromDirection(clientX, clientY),
        newHeight = _c.newHeight,
        newWidth = _c.newWidth; // Calculate max size from boundary settings


    var boundaryMax = this.calculateNewMaxFromBoundary(maxWidth, maxHeight);

    if (this.props.snap && this.props.snap.x) {
      newWidth = findClosestSnap(newWidth, this.props.snap.x, this.props.snapGap);
    }

    if (this.props.snap && this.props.snap.y) {
      newHeight = findClosestSnap(newHeight, this.props.snap.y, this.props.snapGap);
    } // Calculate new size from aspect ratio


    var newSize = this.calculateNewSizeFromAspectRatio(newWidth, newHeight, {
      width: boundaryMax.maxWidth,
      height: boundaryMax.maxHeight
    }, {
      width: minWidth,
      height: minHeight
    });
    newWidth = newSize.newWidth;
    newHeight = newSize.newHeight;

    if (this.props.grid) {
      var newGridWidth = snap(newWidth, this.props.grid[0]);
      var newGridHeight = snap(newHeight, this.props.grid[1]);
      var gap = this.props.snapGap || 0;
      newWidth = gap === 0 || Math.abs(newGridWidth - newWidth) <= gap ? newGridWidth : newWidth;
      newHeight = gap === 0 || Math.abs(newGridHeight - newHeight) <= gap ? newGridHeight : newHeight;
    }

    var delta = {
      width: newWidth - original.width,
      height: newHeight - original.height
    };

    if (width && typeof width === 'string') {
      if (endsWith(width, '%')) {
        var percent = newWidth / parentSize.width * 100;
        newWidth = percent + "%";
      } else if (endsWith(width, 'vw')) {
        var vw = newWidth / this.window.innerWidth * 100;
        newWidth = vw + "vw";
      } else if (endsWith(width, 'vh')) {
        var vh = newWidth / this.window.innerHeight * 100;
        newWidth = vh + "vh";
      }
    }

    if (height && typeof height === 'string') {
      if (endsWith(height, '%')) {
        var percent = newHeight / parentSize.height * 100;
        newHeight = percent + "%";
      } else if (endsWith(height, 'vw')) {
        var vw = newHeight / this.window.innerWidth * 100;
        newHeight = vw + "vw";
      } else if (endsWith(height, 'vh')) {
        var vh = newHeight / this.window.innerHeight * 100;
        newHeight = vh + "vh";
      }
    }

    var newState = {
      width: this.createSizeForCssProperty(newWidth, 'width'),
      height: this.createSizeForCssProperty(newHeight, 'height')
    };

    if (this.flexDir === 'row') {
      newState.flexBasis = newState.width;
    } else if (this.flexDir === 'column') {
      newState.flexBasis = newState.height;
    }

    this.setState(newState);

    if (this.props.onResize) {
      this.props.onResize(event, direction, this.resizable, delta);
    }
  };

  Resizable.prototype.onMouseUp = function (event) {
    var _a = this.state,
        isResizing = _a.isResizing,
        direction = _a.direction,
        original = _a.original;

    if (!isResizing || !this.resizable) {
      return;
    }

    var delta = {
      width: this.size.width - original.width,
      height: this.size.height - original.height
    };

    if (this.props.onResizeStop) {
      this.props.onResizeStop(event, direction, this.resizable, delta);
    }

    if (this.props.size) {
      this.setState(this.props.size);
    }

    this.unbindEvents();
    this.setState({
      isResizing: false,
      backgroundStyle: lib_assign(lib_assign({}, this.state.backgroundStyle), {
        cursor: 'auto'
      })
    });
  };

  Resizable.prototype.updateSize = function (size) {
    this.setState({
      width: size.width,
      height: size.height
    });
  };

  Resizable.prototype.renderResizer = function () {
    var _this = this;

    var _a = this.props,
        enable = _a.enable,
        handleStyles = _a.handleStyles,
        handleClasses = _a.handleClasses,
        handleWrapperStyle = _a.handleWrapperStyle,
        handleWrapperClass = _a.handleWrapperClass,
        handleComponent = _a.handleComponent;

    if (!enable) {
      return null;
    }

    var resizers = Object.keys(enable).map(function (dir) {
      if (enable[dir] !== false) {
        return react.createElement(Resizer, {
          key: dir,
          direction: dir,
          onResizeStart: _this.onResizeStart,
          replaceStyles: handleStyles && handleStyles[dir],
          className: handleClasses && handleClasses[dir]
        }, handleComponent && handleComponent[dir] ? handleComponent[dir] : null);
      }

      return null;
    }); // #93 Wrap the resize box in span (will not break 100% width/height)

    return react.createElement("div", {
      className: handleWrapperClass,
      style: handleWrapperStyle
    }, resizers);
  };

  Resizable.prototype.render = function () {
    var _this = this;

    var extendsProps = Object.keys(this.props).reduce(function (acc, key) {
      if (definedProps.indexOf(key) !== -1) {
        return acc;
      }

      acc[key] = _this.props[key];
      return acc;
    }, {});

    var style = lib_assign(lib_assign(lib_assign({
      position: 'relative',
      userSelect: this.state.isResizing ? 'none' : 'auto'
    }, this.props.style), this.sizeStyle), {
      maxWidth: this.props.maxWidth,
      maxHeight: this.props.maxHeight,
      minWidth: this.props.minWidth,
      minHeight: this.props.minHeight,
      boxSizing: 'border-box',
      flexShrink: 0
    });

    if (this.state.flexBasis) {
      style.flexBasis = this.state.flexBasis;
    }

    var Wrapper = this.props.as || 'div';
    return react.createElement(Wrapper, lib_assign({
      ref: this.ref,
      style: style,
      className: this.props.className
    }, extendsProps), this.state.isResizing && react.createElement("div", {
      style: this.state.backgroundStyle
    }), this.props.children, this.renderResizer());
  };

  Resizable.defaultProps = {
    as: 'div',
    onResizeStart: function onResizeStart() {},
    onResize: function onResize() {},
    onResizeStop: function onResizeStop() {},
    enable: {
      top: true,
      right: true,
      bottom: true,
      left: true,
      topRight: true,
      bottomRight: true,
      bottomLeft: true,
      topLeft: true
    },
    style: {},
    grid: [1, 1],
    lockAspectRatio: false,
    lockAspectRatioExtraWidth: 0,
    lockAspectRatioExtraHeight: 0,
    scale: 1,
    resizeRatio: 1,
    snapGap: 0
  };
  return Resizable;
}(react.PureComponent);


;// CONCATENATED MODULE: ./node_modules/react-rnd/lib/index.js



/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0

THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.

See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */

/* global Reflect, Promise */

var _extendStatics = function extendStatics(d, b) {
  _extendStatics = Object.setPrototypeOf || {
    __proto__: []
  } instanceof Array && function (d, b) {
    d.__proto__ = b;
  } || function (d, b) {
    for (var p in b) {
      if (b.hasOwnProperty(p)) d[p] = b[p];
    }
  };

  return _extendStatics(d, b);
};

function react_rnd_lib_extends(d, b) {
  _extendStatics(d, b);

  function __() {
    this.constructor = d;
  }

  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}

var _assign = function __assign() {
  _assign = Object.assign || function __assign(t) {
    for (var s, i = 1, n = arguments.length; i < n; i++) {
      s = arguments[i];

      for (var p in s) {
        if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
      }
    }

    return t;
  };

  return _assign.apply(this, arguments);
};

function __rest(s, e) {
  var t = {};

  for (var p in s) {
    if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
  }

  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
    if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
  }
  return t;
}

var Draggable = (cjs_default());
var resizableStyle = {
  width: "auto",
  height: "auto",
  display: "inline-block",
  position: "absolute",
  top: 0,
  left: 0
};

var getEnableResizingByFlag = function getEnableResizingByFlag(flag) {
  return {
    bottom: flag,
    bottomLeft: flag,
    bottomRight: flag,
    left: flag,
    right: flag,
    top: flag,
    topLeft: flag,
    topRight: flag
  };
};

var Rnd =
/** @class */
function (_super) {
  react_rnd_lib_extends(Rnd, _super);

  function Rnd(props) {
    var _this = _super.call(this, props) || this;

    _this.resizingPosition = {
      x: 0,
      y: 0
    };
    _this.offsetFromParent = {
      left: 0,
      top: 0
    };
    _this.resizableElement = {
      current: null
    };
    _this.originalPosition = {
      x: 0,
      y: 0
    };

    _this.refDraggable = function (c) {
      if (!c) return;
      _this.draggable = c;
    };

    _this.refResizable = function (c) {
      if (!c) return;
      _this.resizable = c;
      _this.resizableElement.current = c.resizable;
    };

    _this.state = {
      resizing: false,
      bounds: {
        top: 0,
        right: 0,
        bottom: 0,
        left: 0
      },
      maxWidth: props.maxWidth,
      maxHeight: props.maxHeight
    };
    _this.onResizeStart = _this.onResizeStart.bind(_this);
    _this.onResize = _this.onResize.bind(_this);
    _this.onResizeStop = _this.onResizeStop.bind(_this);
    _this.onDragStart = _this.onDragStart.bind(_this);
    _this.onDrag = _this.onDrag.bind(_this);
    _this.onDragStop = _this.onDragStop.bind(_this);
    _this.getMaxSizesFromProps = _this.getMaxSizesFromProps.bind(_this);
    return _this;
  }

  Rnd.prototype.componentDidMount = function () {
    this.updateOffsetFromParent();
    var _a = this.offsetFromParent,
        left = _a.left,
        top = _a.top;

    var _b = this.getDraggablePosition(),
        x = _b.x,
        y = _b.y;

    this.draggable.setState({
      x: x - left,
      y: y - top
    }); // HACK: Apply position adjustment

    this.forceUpdate();
  }; // HACK: To get `react-draggable` state x and y.


  Rnd.prototype.getDraggablePosition = function () {
    var _a = this.draggable.state,
        x = _a.x,
        y = _a.y;
    return {
      x: x,
      y: y
    };
  };

  Rnd.prototype.getParent = function () {
    return this.resizable && this.resizable.parentNode;
  };

  Rnd.prototype.getParentSize = function () {
    return this.resizable.getParentSize();
  };

  Rnd.prototype.getMaxSizesFromProps = function () {
    var maxWidth = typeof this.props.maxWidth === "undefined" ? Number.MAX_SAFE_INTEGER : this.props.maxWidth;
    var maxHeight = typeof this.props.maxHeight === "undefined" ? Number.MAX_SAFE_INTEGER : this.props.maxHeight;
    return {
      maxWidth: maxWidth,
      maxHeight: maxHeight
    };
  };

  Rnd.prototype.getSelfElement = function () {
    return this.resizable && this.resizable.resizable;
  };

  Rnd.prototype.getOffsetHeight = function (boundary) {
    var scale = this.props.scale;

    switch (this.props.bounds) {
      case "window":
        return window.innerHeight / scale;

      case "body":
        return document.body.offsetHeight / scale;

      default:
        return boundary.offsetHeight;
    }
  };

  Rnd.prototype.getOffsetWidth = function (boundary) {
    var scale = this.props.scale;

    switch (this.props.bounds) {
      case "window":
        return window.innerWidth / scale;

      case "body":
        return document.body.offsetWidth / scale;

      default:
        return boundary.offsetWidth;
    }
  };

  Rnd.prototype.onDragStart = function (e, data) {
    if (this.props.onDragStart) {
      this.props.onDragStart(e, data);
    }

    var pos = this.getDraggablePosition();
    this.originalPosition = pos;
    if (!this.props.bounds) return;
    var parent = this.getParent();
    var scale = this.props.scale;
    var boundary;

    if (this.props.bounds === "parent") {
      boundary = parent;
    } else if (this.props.bounds === "body") {
      var parentRect_1 = parent.getBoundingClientRect();
      var parentLeft_1 = parentRect_1.left;
      var parentTop_1 = parentRect_1.top;
      var bodyRect = document.body.getBoundingClientRect();
      var left_1 = -(parentLeft_1 - parent.offsetLeft * scale - bodyRect.left) / scale;
      var top_1 = -(parentTop_1 - parent.offsetTop * scale - bodyRect.top) / scale;
      var right = (document.body.offsetWidth - this.resizable.size.width * scale) / scale + left_1;
      var bottom = (document.body.offsetHeight - this.resizable.size.height * scale) / scale + top_1;
      return this.setState({
        bounds: {
          top: top_1,
          right: right,
          bottom: bottom,
          left: left_1
        }
      });
    } else if (this.props.bounds === "window") {
      if (!this.resizable) return;
      var parentRect_2 = parent.getBoundingClientRect();
      var parentLeft_2 = parentRect_2.left;
      var parentTop_2 = parentRect_2.top;
      var left_2 = -(parentLeft_2 - parent.offsetLeft * scale) / scale;
      var top_2 = -(parentTop_2 - parent.offsetTop * scale) / scale;
      var right = (window.innerWidth - this.resizable.size.width * scale) / scale + left_2;
      var bottom = (window.innerHeight - this.resizable.size.height * scale) / scale + top_2;
      return this.setState({
        bounds: {
          top: top_2,
          right: right,
          bottom: bottom,
          left: left_2
        }
      });
    } else {
      boundary = document.querySelector(this.props.bounds);
    }

    if (!(boundary instanceof HTMLElement) || !(parent instanceof HTMLElement)) {
      return;
    }

    var boundaryRect = boundary.getBoundingClientRect();
    var boundaryLeft = boundaryRect.left;
    var boundaryTop = boundaryRect.top;
    var parentRect = parent.getBoundingClientRect();
    var parentLeft = parentRect.left;
    var parentTop = parentRect.top;
    var left = (boundaryLeft - parentLeft) / scale;
    var top = boundaryTop - parentTop;
    if (!this.resizable) return;
    this.updateOffsetFromParent();
    var offset = this.offsetFromParent;
    this.setState({
      bounds: {
        top: top - offset.top,
        right: left + (boundary.offsetWidth - this.resizable.size.width) - offset.left / scale,
        bottom: top + (boundary.offsetHeight - this.resizable.size.height) - offset.top,
        left: left - offset.left / scale
      }
    });
  };

  Rnd.prototype.onDrag = function (e, data) {
    if (!this.props.onDrag) return;
    var _a = this.offsetFromParent,
        left = _a.left,
        top = _a.top;

    if (!this.props.dragAxis || this.props.dragAxis === "both") {
      return this.props.onDrag(e, _assign(_assign({}, data), {
        x: data.x - left,
        y: data.y - top
      }));
    } else if (this.props.dragAxis === "x") {
      return this.props.onDrag(e, _assign(_assign({}, data), {
        x: data.x + left,
        y: this.originalPosition.y + top,
        deltaY: 0
      }));
    } else if (this.props.dragAxis === "y") {
      return this.props.onDrag(e, _assign(_assign({}, data), {
        x: this.originalPosition.x + left,
        y: data.y + top,
        deltaX: 0
      }));
    }
  };

  Rnd.prototype.onDragStop = function (e, data) {
    if (!this.props.onDragStop) return;
    var _a = this.offsetFromParent,
        left = _a.left,
        top = _a.top;

    if (!this.props.dragAxis || this.props.dragAxis === "both") {
      return this.props.onDragStop(e, _assign(_assign({}, data), {
        x: data.x + left,
        y: data.y + top
      }));
    } else if (this.props.dragAxis === "x") {
      return this.props.onDragStop(e, _assign(_assign({}, data), {
        x: data.x + left,
        y: this.originalPosition.y + top,
        deltaY: 0
      }));
    } else if (this.props.dragAxis === "y") {
      return this.props.onDragStop(e, _assign(_assign({}, data), {
        x: this.originalPosition.x + left,
        y: data.y + top,
        deltaX: 0
      }));
    }
  };

  Rnd.prototype.onResizeStart = function (e, dir, elementRef) {
    e.stopPropagation();
    this.setState({
      resizing: true
    });
    var scale = this.props.scale;
    var offset = this.offsetFromParent;
    var pos = this.getDraggablePosition();
    this.resizingPosition = {
      x: pos.x + offset.left,
      y: pos.y + offset.top
    };
    this.originalPosition = pos;

    if (this.props.bounds) {
      var parent_1 = this.getParent();
      var boundary = void 0;

      if (this.props.bounds === "parent") {
        boundary = parent_1;
      } else if (this.props.bounds === "body") {
        boundary = document.body;
      } else if (this.props.bounds === "window") {
        boundary = window;
      } else {
        boundary = document.querySelector(this.props.bounds);
      }

      var self_1 = this.getSelfElement();

      if (self_1 instanceof Element && (boundary instanceof HTMLElement || boundary === window) && parent_1 instanceof HTMLElement) {
        var _a = this.getMaxSizesFromProps(),
            maxWidth = _a.maxWidth,
            maxHeight = _a.maxHeight;

        var parentSize = this.getParentSize();

        if (maxWidth && typeof maxWidth === "string") {
          if (maxWidth.endsWith("%")) {
            var ratio = Number(maxWidth.replace("%", "")) / 100;
            maxWidth = parentSize.width * ratio;
          } else if (maxWidth.endsWith("px")) {
            maxWidth = Number(maxWidth.replace("px", ""));
          }
        }

        if (maxHeight && typeof maxHeight === "string") {
          if (maxHeight.endsWith("%")) {
            var ratio = Number(maxHeight.replace("%", "")) / 100;
            maxHeight = parentSize.width * ratio;
          } else if (maxHeight.endsWith("px")) {
            maxHeight = Number(maxHeight.replace("px", ""));
          }
        }

        var selfRect = self_1.getBoundingClientRect();
        var selfLeft = selfRect.left;
        var selfTop = selfRect.top;
        var boundaryRect = this.props.bounds === "window" ? {
          left: 0,
          top: 0
        } : boundary.getBoundingClientRect();
        var boundaryLeft = boundaryRect.left;
        var boundaryTop = boundaryRect.top;
        var offsetWidth = this.getOffsetWidth(boundary);
        var offsetHeight = this.getOffsetHeight(boundary);
        var hasLeft = dir.toLowerCase().endsWith("left");
        var hasRight = dir.toLowerCase().endsWith("right");
        var hasTop = dir.startsWith("top");
        var hasBottom = dir.startsWith("bottom");

        if ((hasLeft || hasTop) && this.resizable) {
          var max = (selfLeft - boundaryLeft) / scale + this.resizable.size.width;
          this.setState({
            maxWidth: max > Number(maxWidth) ? maxWidth : max
          });
        } // INFO: To set bounds in `lock aspect ratio with bounds` case. See also that story.


        if (hasRight || this.props.lockAspectRatio && !hasLeft && !hasTop) {
          var max = offsetWidth + (boundaryLeft - selfLeft) / scale;
          this.setState({
            maxWidth: max > Number(maxWidth) ? maxWidth : max
          });
        }

        if ((hasTop || hasLeft) && this.resizable) {
          var max = (selfTop - boundaryTop) / scale + this.resizable.size.height;
          this.setState({
            maxHeight: max > Number(maxHeight) ? maxHeight : max
          });
        } // INFO: To set bounds in `lock aspect ratio with bounds` case. See also that story.


        if (hasBottom || this.props.lockAspectRatio && !hasTop && !hasLeft) {
          var max = offsetHeight + (boundaryTop - selfTop) / scale;
          this.setState({
            maxHeight: max > Number(maxHeight) ? maxHeight : max
          });
        }
      }
    } else {
      this.setState({
        maxWidth: this.props.maxWidth,
        maxHeight: this.props.maxHeight
      });
    }

    if (this.props.onResizeStart) {
      this.props.onResizeStart(e, dir, elementRef);
    }
  };

  Rnd.prototype.onResize = function (e, direction, elementRef, delta) {
    // INFO: Apply x and y position adjustments caused by resizing to draggable
    var newPos = {
      x: this.originalPosition.x,
      y: this.originalPosition.y
    };
    var left = -delta.width;
    var top = -delta.height;
    var directions = ["top", "left", "topLeft", "bottomLeft", "topRight"];

    if (directions.indexOf(direction) !== -1) {
      if (direction === "bottomLeft") {
        newPos.x += left;
      } else if (direction === "topRight") {
        newPos.y += top;
      } else {
        newPos.x += left;
        newPos.y += top;
      }
    }

    if (newPos.x !== this.draggable.state.x || newPos.y !== this.draggable.state.y) {
      this.draggable.setState(newPos);
    }

    this.updateOffsetFromParent();
    var offset = this.offsetFromParent;
    var x = this.getDraggablePosition().x + offset.left;
    var y = this.getDraggablePosition().y + offset.top;
    this.resizingPosition = {
      x: x,
      y: y
    };
    if (!this.props.onResize) return;
    this.props.onResize(e, direction, elementRef, delta, {
      x: x,
      y: y
    });
  };

  Rnd.prototype.onResizeStop = function (e, direction, elementRef, delta) {
    this.setState({
      resizing: false
    });

    var _a = this.getMaxSizesFromProps(),
        maxWidth = _a.maxWidth,
        maxHeight = _a.maxHeight;

    this.setState({
      maxWidth: maxWidth,
      maxHeight: maxHeight
    });

    if (this.props.onResizeStop) {
      this.props.onResizeStop(e, direction, elementRef, delta, this.resizingPosition);
    }
  };

  Rnd.prototype.updateSize = function (size) {
    if (!this.resizable) return;
    this.resizable.updateSize({
      width: size.width,
      height: size.height
    });
  };

  Rnd.prototype.updatePosition = function (position) {
    this.draggable.setState(position);
  };

  Rnd.prototype.updateOffsetFromParent = function () {
    var scale = this.props.scale;
    var parent = this.getParent();
    var self = this.getSelfElement();

    if (!parent || self === null) {
      return {
        top: 0,
        left: 0
      };
    }

    var parentRect = parent.getBoundingClientRect();
    var parentLeft = parentRect.left;
    var parentTop = parentRect.top;
    var selfRect = self.getBoundingClientRect();
    var position = this.getDraggablePosition();
    var scrollLeft = parent.scrollLeft;
    var scrollTop = parent.scrollTop;
    this.offsetFromParent = {
      left: selfRect.left - parentLeft + scrollLeft - position.x * scale,
      top: selfRect.top - parentTop + scrollTop - position.y * scale
    };
  };

  Rnd.prototype.render = function () {
    var _a = this.props,
        disableDragging = _a.disableDragging,
        style = _a.style,
        dragHandleClassName = _a.dragHandleClassName,
        position = _a.position,
        onMouseDown = _a.onMouseDown,
        onMouseUp = _a.onMouseUp,
        dragAxis = _a.dragAxis,
        dragGrid = _a.dragGrid,
        bounds = _a.bounds,
        enableUserSelectHack = _a.enableUserSelectHack,
        cancel = _a.cancel,
        children = _a.children,
        onResizeStart = _a.onResizeStart,
        onResize = _a.onResize,
        onResizeStop = _a.onResizeStop,
        onDragStart = _a.onDragStart,
        onDrag = _a.onDrag,
        onDragStop = _a.onDragStop,
        resizeHandleStyles = _a.resizeHandleStyles,
        resizeHandleClasses = _a.resizeHandleClasses,
        resizeHandleComponent = _a.resizeHandleComponent,
        enableResizing = _a.enableResizing,
        resizeGrid = _a.resizeGrid,
        resizeHandleWrapperClass = _a.resizeHandleWrapperClass,
        resizeHandleWrapperStyle = _a.resizeHandleWrapperStyle,
        scale = _a.scale,
        allowAnyClick = _a.allowAnyClick,
        resizableProps = __rest(_a, ["disableDragging", "style", "dragHandleClassName", "position", "onMouseDown", "onMouseUp", "dragAxis", "dragGrid", "bounds", "enableUserSelectHack", "cancel", "children", "onResizeStart", "onResize", "onResizeStop", "onDragStart", "onDrag", "onDragStop", "resizeHandleStyles", "resizeHandleClasses", "resizeHandleComponent", "enableResizing", "resizeGrid", "resizeHandleWrapperClass", "resizeHandleWrapperStyle", "scale", "allowAnyClick"]);

    var defaultValue = this.props.default ? _assign({}, this.props.default) : undefined; // Remove unknown props, see also https://reactjs.org/warnings/unknown-prop.html

    delete resizableProps.default;
    var cursorStyle = disableDragging || dragHandleClassName ? {
      cursor: "auto"
    } : {
      cursor: "move"
    };

    var innerStyle = _assign(_assign(_assign({}, resizableStyle), cursorStyle), style);

    var _b = this.offsetFromParent,
        left = _b.left,
        top = _b.top;
    var draggablePosition;

    if (position) {
      draggablePosition = {
        x: position.x - left,
        y: position.y - top
      };
    } // INFO: Make uncontorolled component when resizing to control position by setPostion.


    var pos = this.state.resizing ? undefined : draggablePosition;
    var dragAxisOrUndefined = this.state.resizing ? "both" : dragAxis;
    return (0,react.createElement)(Draggable, {
      ref: this.refDraggable,
      handle: dragHandleClassName ? ".".concat(dragHandleClassName) : undefined,
      defaultPosition: defaultValue,
      onMouseDown: onMouseDown,
      onMouseUp: onMouseUp,
      onStart: this.onDragStart,
      onDrag: this.onDrag,
      onStop: this.onDragStop,
      axis: dragAxisOrUndefined,
      disabled: disableDragging,
      grid: dragGrid,
      bounds: bounds ? this.state.bounds : undefined,
      position: pos,
      enableUserSelectHack: enableUserSelectHack,
      cancel: cancel,
      scale: scale,
      allowAnyClick: allowAnyClick,
      nodeRef: this.resizableElement
    }, (0,react.createElement)(Resizable, _assign({}, resizableProps, {
      ref: this.refResizable,
      defaultSize: defaultValue,
      size: this.props.size,
      enable: typeof enableResizing === "boolean" ? getEnableResizingByFlag(enableResizing) : enableResizing,
      onResizeStart: this.onResizeStart,
      onResize: this.onResize,
      onResizeStop: this.onResizeStop,
      style: innerStyle,
      minWidth: this.props.minWidth,
      minHeight: this.props.minHeight,
      maxWidth: this.state.resizing ? this.state.maxWidth : this.props.maxWidth,
      maxHeight: this.state.resizing ? this.state.maxHeight : this.props.maxHeight,
      grid: resizeGrid,
      handleWrapperClass: resizeHandleWrapperClass,
      handleWrapperStyle: resizeHandleWrapperStyle,
      lockAspectRatio: this.props.lockAspectRatio,
      lockAspectRatioExtraWidth: this.props.lockAspectRatioExtraWidth,
      lockAspectRatioExtraHeight: this.props.lockAspectRatioExtraHeight,
      handleStyles: resizeHandleStyles,
      handleClasses: resizeHandleClasses,
      handleComponent: resizeHandleComponent,
      scale: this.props.scale
    }), children));
  };

  Rnd.defaultProps = {
    maxWidth: Number.MAX_SAFE_INTEGER,
    maxHeight: Number.MAX_SAFE_INTEGER,
    scale: 1,
    onResizeStart: function onResizeStart() {},
    onResize: function onResize() {},
    onResizeStop: function onResizeStop() {},
    onDragStart: function onDragStart() {},
    onDrag: function onDrag() {},
    onDragStop: function onDragStop() {}
  };
  return Rnd;
}(react.PureComponent);


;// CONCATENATED MODULE: ./src/lib/pdfjs-dom.ts
var getDocument=function getDocument(elm){return(elm||{}).ownerDocument||document;};var getWindow=function getWindow(elm){return(getDocument(elm)||{}).defaultView||window;};var isHTMLElement=function isHTMLElement(elm){return elm instanceof HTMLElement||elm instanceof getWindow(elm).HTMLElement;};var isHTMLCanvasElement=function isHTMLCanvasElement(elm){return elm instanceof HTMLCanvasElement||elm instanceof getWindow(elm).HTMLCanvasElement;};var asElement=function asElement(x){return x;};var getPageFromElement=function getPageFromElement(target){var node=asElement(target.closest(".page"));if(!node||!isHTMLElement(node)){return null;}var number=Number(asElement(node).dataset.pageNumber);return{node:node,number:number};};var getPagesFromRange=function getPagesFromRange(range){var startParentElement=range.startContainer.parentElement;var endParentElement=range.endContainer.parentElement;if(!isHTMLElement(startParentElement)||!isHTMLElement(endParentElement)){return[];}var startPage=getPageFromElement(asElement(startParentElement));var endPage=getPageFromElement(asElement(endParentElement));if(!(startPage!==null&&startPage!==void 0&&startPage.number)||!(endPage!==null&&endPage!==void 0&&endPage.number)){return[];}if(startPage.number===endPage.number){return[startPage];}if(startPage.number===endPage.number-1){return[startPage,endPage];}var pages=[];var currentPageNumber=startPage.number;var document=startPage.node.ownerDocument;while(currentPageNumber<=endPage.number){var currentPage=getPageFromElement(document.querySelector("[data-page-number='".concat(currentPageNumber,"'")));if(currentPage){pages.push(currentPage);}}return pages;};var findOrCreateContainerLayer=function findOrCreateContainerLayer(pageViewDiv,className){var doc=getDocument(pageViewDiv);var layer=pageViewDiv.querySelector(".".concat(className));if(!layer){layer=doc.createElement("div");layer.className=className;pageViewDiv.appendChild(layer);}// const canvasWrapper: HTMLElement | null = pageViewDiv.querySelector('.canvasWrapper')
// const canvasWrapperBoundingClientRect = canvasWrapper?.getBoundingClientRect()
// layer.style.top = canvasWrapperBoundingClientRect?.top + 'px' || ''
// layer.style.left = canvasWrapperBoundingClientRect?.left +'px' || ''
layer.style.width=pageViewDiv.style.width;layer.style.height=pageViewDiv.style.height;return layer;};
;// CONCATENATED MODULE: ./src/style/AreaHighlight.css
// extracted by mini-css-extract-plugin
/* harmony default export */ var AreaHighlight = ({});
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
var jsx_runtime = __webpack_require__(184);
;// CONCATENATED MODULE: ./src/components/AreaHighlight.tsx
var _excluded=["highlight","onChange","locked"];var AreaHighlight_AreaHighlight=/*#__PURE__*/function(_Component){_inherits(AreaHighlight,_Component);var _super=_createSuper(AreaHighlight);function AreaHighlight(){_classCallCheck(this,AreaHighlight);return _super.apply(this,arguments);}_createClass(AreaHighlight,[{key:"render",value:function render(){var _this$props=this.props,highlight=_this$props.highlight,onChange=_this$props.onChange,locked=_this$props.locked,otherProps=_objectWithoutProperties(_this$props,_excluded);return/*#__PURE__*/(0,jsx_runtime.jsx)("div",{className:"AreaHighlight ".concat(locked?"AreaHighlight--locked":""),children:/*#__PURE__*/(0,jsx_runtime.jsx)(Rnd,_objectSpread2({className:"AreaHighlight__part",onDragStop:function onDragStop(_,data){var boundingRect=_objectSpread2(_objectSpread2({},highlight.position.boundingRect),{},{top:data.y,left:data.x});onChange(boundingRect);},onResizeStop:function onResizeStop(_mouseEvent,_direction,ref,_delta,position){var _getPageFromElement;var boundingRect={top:position.y,left:position.x,width:ref.offsetWidth,height:ref.offsetHeight,pageNumber:((_getPageFromElement=getPageFromElement(ref))===null||_getPageFromElement===void 0?void 0:_getPageFromElement.number)||-1};onChange(boundingRect);},position:{x:highlight.position.boundingRect.left,y:highlight.position.boundingRect.top},size:{width:highlight.position.boundingRect.width,height:highlight.position.boundingRect.height},onClick:function onClick(event){event.stopPropagation();event.preventDefault();}},otherProps))});}}]);return AreaHighlight;}(react.Component);/* harmony default export */ var components_AreaHighlight = ((/* unused pure expression or super */ null && (AreaHighlight_AreaHighlight)));
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js

function _createForOfIteratorHelper(o, allowArrayLike) {
  var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];

  if (!it) {
    if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
      if (it) o = it;
      var i = 0;

      var F = function F() {};

      return {
        s: F,
        n: function n() {
          if (i >= o.length) return {
            done: true
          };
          return {
            done: false,
            value: o[i++]
          };
        },
        e: function e(_e) {
          throw _e;
        },
        f: F
      };
    }

    throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }

  var normalCompletion = true,
      didErr = false,
      err;
  return {
    s: function s() {
      it = it.call(o);
    },
    n: function n() {
      var step = it.next();
      normalCompletion = step.done;
      return step;
    },
    e: function e(_e2) {
      didErr = true;
      err = _e2;
    },
    f: function f() {
      try {
        if (!normalCompletion && it["return"] != null) it["return"]();
      } finally {
        if (didErr) throw err;
      }
    }
  };
}
// EXTERNAL MODULE: ./node_modules/lodash.debounce/index.js
var lodash_debounce = __webpack_require__(95);
var lodash_debounce_default = /*#__PURE__*/__webpack_require__.n(lodash_debounce);
// EXTERNAL MODULE: ./node_modules/react-dom/index.js
var react_dom = __webpack_require__(164);
// EXTERNAL MODULE: ./node_modules/pdfjs-dist/legacy/web/pdf_viewer.js
var pdf_viewer = __webpack_require__(615);
;// CONCATENATED MODULE: ./node_modules/pdfjs-dist/web/pdf_viewer.css
// extracted by mini-css-extract-plugin
/* harmony default export */ var web_pdf_viewer = ({});
;// CONCATENATED MODULE: ./src/style/pdf_viewer.css
// extracted by mini-css-extract-plugin
/* harmony default export */ var style_pdf_viewer = ({});
;// CONCATENATED MODULE: ./src/style/PdfHighlighter.css
// extracted by mini-css-extract-plugin
/* harmony default export */ var PdfHighlighter = ({});
;// CONCATENATED MODULE: ./src/lib/get-area-as-png.ts
var getAreaAsPNG=function getAreaAsPNG(canvas,position){var left=position.left,top=position.top,width=position.width,height=position.height;var doc=canvas?canvas.ownerDocument:null;// @TODO: cache this?
var newCanvas=doc&&doc.createElement("canvas");if(!newCanvas||!isHTMLCanvasElement(newCanvas)){return"";}newCanvas.width=width;newCanvas.height=height;var newCanvasContext=newCanvas.getContext("2d");if(!newCanvasContext||!canvas){return"";}var dpr=window.devicePixelRatio;newCanvasContext.drawImage(canvas,left*dpr,top*dpr,width*dpr,height*dpr,0,0,width,height);return newCanvas.toDataURL("image/png");};/* harmony default export */ var get_area_as_png = (getAreaAsPNG);
;// CONCATENATED MODULE: ./src/lib/get-bounding-rect.ts
var getBoundingRect=function getBoundingRect(clientRects){var rects=Array.from(clientRects).map(function(rect){var left=rect.left,top=rect.top,width=rect.width,height=rect.height,pageNumber=rect.pageNumber;var X0=left;var X1=left+width;var Y0=top;var Y1=top+height;return{X0:X0,X1:X1,Y0:Y0,Y1:Y1,pageNumber:pageNumber};});var firstPageNumber=Number.MAX_SAFE_INTEGER;rects.forEach(function(rect){var _rect$pageNumber;firstPageNumber=Math.min(firstPageNumber,(_rect$pageNumber=rect.pageNumber)!==null&&_rect$pageNumber!==void 0?_rect$pageNumber:firstPageNumber);});var rectsWithSizeOnFirstPage=rects.filter(function(rect){return(rect.X0>0||rect.X1>0||rect.Y0>0||rect.Y1>0)&&rect.pageNumber===firstPageNumber;});var optimal=rectsWithSizeOnFirstPage.reduce(function(res,rect){return{X0:Math.min(res.X0,rect.X0),X1:Math.max(res.X1,rect.X1),Y0:Math.min(res.Y0,rect.Y0),Y1:Math.max(res.Y1,rect.Y1),pageNumber:firstPageNumber};},rectsWithSizeOnFirstPage[0]);var X0=optimal.X0,X1=optimal.X1,Y0=optimal.Y0,Y1=optimal.Y1,pageNumber=optimal.pageNumber;return{left:X0,top:Y0,width:X1-X0,height:Y1-Y0,pageNumber:pageNumber};};/* harmony default export */ var get_bounding_rect = (getBoundingRect);
;// CONCATENATED MODULE: ./src/lib/optimize-client-rects.ts
var sort=function sort(rects){return rects.sort(function(A,B){var top=(A.pageNumber||0)*A.top-(B.pageNumber||0)*B.top;if(top===0){return A.left-B.left;}return top;});};var overlaps=function overlaps(A,B){return A.pageNumber===B.pageNumber&&A.left<=B.left&&B.left<=A.left+A.width;};var sameLine=function sameLine(A,B){var yMargin=arguments.length>2&&arguments[2]!==undefined?arguments[2]:5;return A.pageNumber===B.pageNumber&&Math.abs(A.top-B.top)<yMargin&&Math.abs(A.height-B.height)<yMargin;};var inside=function inside(A,B){return A.pageNumber===B.pageNumber&&A.top>B.top&&A.left>B.left&&A.top+A.height<B.top+B.height&&A.left+A.width<B.left+B.width;};var nextTo=function nextTo(A,B){var xMargin=arguments.length>2&&arguments[2]!==undefined?arguments[2]:10;var Aright=A.left+A.width;var Bright=B.left+B.width;return A.pageNumber===B.pageNumber&&A.left<=B.left&&Aright<=Bright&&B.left-Aright<=xMargin;};var extendWidth=function extendWidth(A,B){// extend width of A to cover B
A.width=Math.max(B.width-A.left+B.left,A.width);};var optimizeClientRects=function optimizeClientRects(clientRects){var rects=sort(clientRects);var toRemove=new Set();var firstPass=rects.filter(function(rect){return rects.every(function(otherRect){return!inside(rect,otherRect);});});var passCount=0;while(passCount<=2){firstPass.forEach(function(A){firstPass.forEach(function(B){if(A===B||toRemove.has(A)||toRemove.has(B)){return;}if(!sameLine(A,B)){return;}if(overlaps(A,B)){extendWidth(A,B);A.height=Math.max(A.height,B.height);toRemove.add(B);}if(nextTo(A,B)){extendWidth(A,B);toRemove.add(B);}});});passCount+=1;}return firstPass.filter(function(rect){return!toRemove.has(rect);});};/* harmony default export */ var optimize_client_rects = (optimizeClientRects);
;// CONCATENATED MODULE: ./src/lib/get-client-rects.ts
var isClientRectInsidePageRect=function isClientRectInsidePageRect(clientRect,pageRect){if(clientRect.top<pageRect.top){return false;}if(clientRect.bottom>pageRect.bottom){return false;}if(clientRect.right>pageRect.right){return false;}if(clientRect.left<pageRect.left){return false;}return true;};var getClientRects=function getClientRects(range,pages){var shouldOptimize=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;var clientRects=Array.from(range.getClientRects());var rects=[];for(var _i=0,_clientRects=clientRects;_i<_clientRects.length;_i++){var clientRect=_clientRects[_i];var _iterator=_createForOfIteratorHelper(pages),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var page=_step.value;var pageRect=page.node.getBoundingClientRect();if(isClientRectInsidePageRect(clientRect,pageRect)&&clientRect.top>=0&&clientRect.bottom>=0&&clientRect.width>0&&clientRect.height>0&&clientRect.width<pageRect.width&&clientRect.height<pageRect.height){var highlightedRect={top:clientRect.top+page.node.scrollTop-pageRect.top,left:clientRect.left+page.node.scrollLeft-pageRect.left,width:clientRect.width,height:clientRect.height,pageNumber:page.number};rects.push(highlightedRect);}}}catch(err){_iterator.e(err);}finally{_iterator.f();}}return shouldOptimize?optimize_client_rects(rects):rects;};/* harmony default export */ var get_client_rects = (getClientRects);
;// CONCATENATED MODULE: ./src/style/MouseSelection.css
// extracted by mini-css-extract-plugin
/* harmony default export */ var MouseSelection = ({});
;// CONCATENATED MODULE: ./src/components/MouseSelection.tsx
var MouseSelection_MouseSelection=/*#__PURE__*/function(_Component){_inherits(MouseSelection,_Component);var _super=_createSuper(MouseSelection);function MouseSelection(){var _this;_classCallCheck(this,MouseSelection);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}_this=_super.call.apply(_super,[this].concat(args));_this.state={locked:false,start:null,end:null};_this.root=void 0;_this.reset=function(){var onDragEnd=_this.props.onDragEnd;onDragEnd();_this.setState({start:null,end:null,locked:false});};return _this;}_createClass(MouseSelection,[{key:"getBoundingRect",value:function getBoundingRect(start,end){return{left:Math.min(end.x,start.x),top:Math.min(end.y,start.y),width:Math.abs(end.x-start.x),height:Math.abs(end.y-start.y)};}},{key:"componentDidUpdate",value:function componentDidUpdate(){var onChange=this.props.onChange;var _this$state=this.state,start=_this$state.start,end=_this$state.end;var isVisible=Boolean(start&&end);onChange(isVisible);// const stickyParent = this.root?.parentElement ? this.stickyParent(this.root?.parentElement): null
// const initialStickyParentTop = stickyParent ? stickyParent.getBoundingClientRect().top : 0
// console.debug(`Component MouseSelection did update ${initialStickyParentTop}`)
}},{key:"componentDidMount",value:function componentDidMount(){var _this2=this;if(!this.root){return;}var that=this;var _this$props=this.props,onSelection=_this$props.onSelection,onDragStart=_this$props.onDragStart,onDragEnd=_this$props.onDragEnd,shouldStart=_this$props.shouldStart;var container=asElement(this.root.parentElement);var stickyParent=this.stickyParent(this.root.parentElement);var initialStickyParentTop=0;// stickyParent ? stickyParent.getBoundingClientRect().top : 0
if(!isHTMLElement(container)){return;}var containerBoundingRect=null;var containerCoords=function containerCoords(pageX,pageY){if(!containerBoundingRect){containerBoundingRect=container.getBoundingClientRect();}if(window.scrollY===0){initialStickyParentTop=stickyParent?stickyParent.getBoundingClientRect().top:0;// console.debug(`Component MouseSelection on window.scrollY === 0 ${initialStickyParentTop}`)
}return{x:pageX-containerBoundingRect.left+container.scrollLeft,y:pageY-containerBoundingRect.top+container.scrollTop+(!stickyParent?0:initialStickyParentTop-stickyParent.getBoundingClientRect().top)-window.scrollY};};container.addEventListener("mousemove",function(event){var _this2$state=_this2.state,start=_this2$state.start,locked=_this2$state.locked;if(!start||locked){return;}that.setState(_objectSpread2(_objectSpread2({},_this2.state),{},{end:containerCoords(event.pageX,event.pageY)}));});container.addEventListener("mousedown",function(event){if(!shouldStart(event)){_this2.reset();return;}var startTarget=asElement(event.target);if(!isHTMLElement(startTarget)){return;}onDragStart();_this2.setState({start:containerCoords(event.pageX,event.pageY),end:null,locked:false});var onMouseUp=function onMouseUp(event){var _event$currentTarget;// emulate listen once
(_event$currentTarget=event.currentTarget)===null||_event$currentTarget===void 0?void 0:_event$currentTarget.removeEventListener("mouseup",onMouseUp);var start=_this2.state.start;if(!start){return;}var end=containerCoords(event.pageX,event.pageY);var boundingRect=that.getBoundingRect(start,end);if(!isHTMLElement(event.target)||!container.contains(asElement(event.target))||!that.shouldRender(boundingRect)){that.reset();return;}that.setState({end:end,locked:true},function(){// Callback
var _that$state=that.state,start=_that$state.start,end=_that$state.end;if(!start||!end){return;}if(isHTMLElement(event.target)){onSelection(startTarget,boundingRect,that.reset);onDragEnd();}});};var doc=container.ownerDocument;if(doc.body){doc.body.addEventListener("mouseup",onMouseUp);}});// console.debug(`Component MouseSelection did mount ${initialStickyParentTop}`)
}// _trace() {
//   console.debug(`MouseSelection state: ${JSON.stringify(this.state)}`)
// }
},{key:"stickyParent",value:function stickyParent(parentElement){if(!parentElement){return null;}// FIXME: Hardcore class name (try to use css class definition and position)
if(parentElement.style.position==='sticky'||parentElement.className==='publicationCreateForm'){return parentElement;}return this.stickyParent(parentElement.parentElement);}},{key:"shouldRender",value:function shouldRender(boundingRect){return boundingRect.width>=1&&boundingRect.height>=1;}},{key:"render",value:function render(){var _this3=this;var _this$state2=this.state,start=_this$state2.start,end=_this$state2.end;return/*#__PURE__*/(0,jsx_runtime.jsx)("div",{className:"MouseSelection-container",ref:function ref(node){if(!node){return;}_this3.root=node;},children:start&&end?/*#__PURE__*/(0,jsx_runtime.jsx)("div",{className:"MouseSelection",style:this.getBoundingRect(start,end)}):null});}}]);return MouseSelection;}(react.Component);/* harmony default export */ var components_MouseSelection = (MouseSelection_MouseSelection);
;// CONCATENATED MODULE: ./src/components/TipContainer.tsx
var TipContainer_clamp=function clamp(value,left,right){return Math.min(Math.max(value,left),right);};var TipContainer=/*#__PURE__*/function(_Component){_inherits(TipContainer,_Component);var _super=_createSuper(TipContainer);function TipContainer(){var _this;_classCallCheck(this,TipContainer);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}_this=_super.call.apply(_super,[this].concat(args));_this.state={height:0,width:0};_this.node=null;_this.updatePosition=function(){if(!_this.node){return;}var _this$node=_this.node,offsetHeight=_this$node.offsetHeight,offsetWidth=_this$node.offsetWidth;_this.setState({height:offsetHeight,width:offsetWidth});};return _this;}_createClass(TipContainer,[{key:"componentDidUpdate",value:function componentDidUpdate(nextProps){if(this.props.children!==nextProps.children){this.updatePosition();}}},{key:"componentDidMount",value:function componentDidMount(){setTimeout(this.updatePosition,0);}},{key:"render",value:function render(){var _this2=this;var _this$props=this.props,children=_this$props.children,style=_this$props.style,scrollTop=_this$props.scrollTop,pageBoundingRect=_this$props.pageBoundingRect;var _this$state=this.state,height=_this$state.height,width=_this$state.width;var isStyleCalculationInProgress=width===0&&height===0;var shouldMove=style.top-height-5<scrollTop;var top=shouldMove?style.bottom+5:style.top-height-5;var left=TipContainer_clamp(style.left-width/2,0,pageBoundingRect.width-width);var childrenWithProps=react.Children.map(children,function(child){return/*#__PURE__*/ (// @ts-ignore
react.cloneElement(child,{onUpdate:function onUpdate(){_this2.setState({width:0,height:0},function(){setTimeout(_this2.updatePosition,0);});},popup:{position:shouldMove?"below":"above"}}));});return/*#__PURE__*/(0,jsx_runtime.jsx)("div",{className:"PdfHighlighter__tip-container",style:{visibility:isStyleCalculationInProgress?"hidden":"visible",top:top,left:left},ref:function ref(node){_this2.node=node;},children:childrenWithProps});}}]);return TipContainer;}(react.Component);/* harmony default export */ var components_TipContainer = (TipContainer);
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
function _arrayWithHoles(arr) {
  if (Array.isArray(arr)) return arr;
}
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
function _iterableToArrayLimit(arr, i) {
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];

  if (_i == null) return;
  var _arr = [];
  var _n = true;
  var _d = false;

  var _s, _e;

  try {
    for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
      _arr.push(_s.value);

      if (i && _arr.length === i) break;
    }
  } catch (err) {
    _d = true;
    _e = err;
  } finally {
    try {
      if (!_n && _i["return"] != null) _i["return"]();
    } finally {
      if (_d) throw _e;
    }
  }

  return _arr;
}
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
function _nonIterableRest() {
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js




function _slicedToArray(arr, i) {
  return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
}
;// CONCATENATED MODULE: ./src/lib/coordinates.ts
// "viewport" rectangle is { top, left, width, height }
// "scaled" means that data structure stores (0, 1) coordinates.
// for clarity reasons I decided not to store actual (0, 1) coordinates, but
// provide width and height, so user can compute ratio himself if needed
var viewportToScaled=function viewportToScaled(rect,_ref){var width=_ref.width,height=_ref.height;return{x1:rect.left,y1:rect.top,x2:rect.left+rect.width,y2:rect.top+rect.height,width:width,height:height,pageNumber:rect.pageNumber};};var pdfToViewport=function pdfToViewport(pdf,viewport){var _viewport$convertToVi=viewport.convertToViewportRectangle([pdf.x1,pdf.y1,pdf.x2,pdf.y2]),_viewport$convertToVi2=_slicedToArray(_viewport$convertToVi,4),x1=_viewport$convertToVi2[0],y1=_viewport$convertToVi2[1],x2=_viewport$convertToVi2[2],y2=_viewport$convertToVi2[3];return{left:x1,top:y1,width:x2-x1,height:y1-y2,pageNumber:pdf.pageNumber};};var scaledToViewport=function scaledToViewport(scaled,viewport){var usePdfCoordinates=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var width=viewport.width,height=viewport.height;if(usePdfCoordinates){return pdfToViewport(scaled,viewport);}if(scaled.x1===undefined){throw new Error("You are using old position format, please update");}var x1=width*scaled.x1/scaled.width;var y1=height*scaled.y1/scaled.height;var x2=width*scaled.x2/scaled.width;var y2=height*scaled.y2/scaled.height;return{left:x1,top:y1,width:x2-x1,height:y2-y1,pageNumber:scaled.pageNumber};};var intersectRect=function intersectRect(r1,r2){return!(r2.left>r1.right||r2.right<r1.left||r2.top>r1.bottom||r2.bottom<r1.top);};
;// CONCATENATED MODULE: ./src/components/PdfHighlighter.tsx
var PdfHighlighter_excluded=["position","id"];var EMPTY_ID="empty-id";var PdfHighlighter_PdfHighlighter=/*#__PURE__*/function(_PureComponent){_inherits(PdfHighlighter,_PureComponent);var _super=_createSuper(PdfHighlighter);function PdfHighlighter(props){var _this;_classCallCheck(this,PdfHighlighter);_this=_super.call(this,props);_this.state={ghostHighlight:null,isCollapsed:true,range:null,scrolledToHighlightId:EMPTY_ID,isAreaSelectionInProgress:false,tip:null,tipPosition:null,tipChildren:null};_this.eventBus=new pdf_viewer.EventBus();_this.linkService=new pdf_viewer.PDFLinkService({eventBus:_this.eventBus,externalLinkTarget:2});_this.viewer=void 0;_this.resizeObserver=null;_this.containerNode=null;_this.unsubscribe=function(){};_this.attachRef=function(ref){var _assertThisInitialize=_assertThisInitialized(_this),eventBus=_assertThisInitialize.eventBus,observer=_assertThisInitialize.resizeObserver;_this.containerNode=ref;_this.unsubscribe();if(ref){var _doc$defaultView;var doc=ref.ownerDocument;eventBus.on("textlayerrendered",_this.onTextLayerRendered);eventBus.on("pagesinit",_this.onDocumentReady);doc.addEventListener("selectionchange",_this.onSelectionChange);doc.addEventListener("keydown",_this.handleKeyDown);(_doc$defaultView=doc.defaultView)===null||_doc$defaultView===void 0?void 0:_doc$defaultView.addEventListener("resize",_this.debouncedScaleValue);if(observer)observer.observe(ref);_this.unsubscribe=function(){var _doc$defaultView2;eventBus.off("pagesinit",_this.onDocumentReady);eventBus.off("textlayerrendered",_this.onTextLayerRendered);doc.removeEventListener("selectionchange",_this.onSelectionChange);doc.removeEventListener("keydown",_this.handleKeyDown);(_doc$defaultView2=doc.defaultView)===null||_doc$defaultView2===void 0?void 0:_doc$defaultView2.removeEventListener("resize",_this.debouncedScaleValue);if(observer)observer.disconnect();};}};_this.hideTipAndSelection=function(){_this.setState({tipPosition:null,tipChildren:null});_this.setState({ghostHighlight:null,tip:null},function(){return _this.renderHighlights();});};_this.renderTip=function(){var _this$state=_this.state,tipPosition=_this$state.tipPosition,tipChildren=_this$state.tipChildren;if(!tipPosition)return null;var boundingRect=tipPosition.boundingRect,pageNumber=tipPosition.pageNumber;var page={node:_this.viewer.getPageView((boundingRect.pageNumber||pageNumber)-1).div,pageNumber:boundingRect.pageNumber||pageNumber};var pageBoundingClientRect=page.node.getBoundingClientRect();var pageBoundingRect={bottom:pageBoundingClientRect.bottom,height:pageBoundingClientRect.height,left:pageBoundingClientRect.left,right:pageBoundingClientRect.right,top:pageBoundingClientRect.top,width:pageBoundingClientRect.width,x:pageBoundingClientRect.x,y:pageBoundingClientRect.y,pageNumber:page.pageNumber};return/*#__PURE__*/(0,jsx_runtime.jsx)(components_TipContainer,{scrollTop:_this.viewer.container.scrollTop,pageBoundingRect:pageBoundingRect,style:{left:page.node.offsetLeft+boundingRect.left+boundingRect.width/2,top:boundingRect.top+page.node.offsetTop,bottom:boundingRect.top+page.node.offsetTop+boundingRect.height},children:tipChildren});};_this.onTextLayerRendered=function(){_this.renderHighlights();};_this.scrollTo=function(highlight){var boundingRect=highlight.position.boundingRect;var pageNumber=highlight.position.pageNumber||boundingRect.pageNumber||1;var usePdfCoordinates=highlight.position.usePdfCoordinates;_this.viewer.container.removeEventListener("scroll",_this.onScroll);var pageViewport=_this.viewer.getPageView(pageNumber-1).viewport;var scrollMargin=10;_this.viewer.scrollPageIntoView({pageNumber:pageNumber,destArray:[null,{name:"XYZ"}].concat(_toConsumableArray(pageViewport.convertToPdfPoint(0,scaledToViewport(boundingRect,pageViewport,usePdfCoordinates).top-scrollMargin)),[0])});_this.setState({scrolledToHighlightId:highlight.id},function(){return _this.renderHighlights();});// wait for scrolling to finish
setTimeout(function(){_this.viewer.container.addEventListener("scroll",_this.onScroll);},100);};_this.onDocumentReady=function(){var scrollRef=_this.props.scrollRef;_this.handleScaleValue();scrollRef(_this.scrollTo);};_this.onSelectionChange=function(){var container=_this.containerNode;var selection=getWindow(container).getSelection();if(!selection){return;}var range=selection.rangeCount>0?selection.getRangeAt(0):null;if(selection.isCollapsed){_this.setState({isCollapsed:true});return;}if(!range||!container||!container.contains(range.commonAncestorContainer)){return;}_this.setState({isCollapsed:false,range:range});// this.debouncedAfterSelection();
};_this.onScroll=function(){var onScrollChange=_this.props.onScrollChange;onScrollChange();_this.setState({scrolledToHighlightId:EMPTY_ID},function(){return _this.renderHighlights();});_this.viewer.container.removeEventListener("scroll",_this.onScroll);};_this.onMouseDown=function(event){if(!isHTMLElement(event.target)){return;}if(asElement(event.target).closest(".PdfHighlighter__tip-container")){return;}_this.hideTipAndSelection();};_this.handleKeyDown=function(event){if(event.code==="Escape"){_this.hideTipAndSelection();}};_this.afterSelection=function(){var onSelectionFinished=_this.props.onSelectionFinished;var _this$state2=_this.state,isCollapsed=_this$state2.isCollapsed,range=_this$state2.range;if(!range||isCollapsed){return;}var pages=getPagesFromRange(range);if(!pages||pages.length===0){return;}var rects=get_client_rects(range,pages);if(rects.length===0){return;}var boundingRect=get_bounding_rect(rects);var viewportPosition={boundingRect:boundingRect,rects:rects,pageNumber:pages[0].number};var content={text:range.toString()};var scaledPosition=_this.viewportPositionToScaled(viewportPosition);_this.setTip(viewportPosition,onSelectionFinished(scaledPosition,content,function(){return _this.hideTipAndSelection();},function(){return _this.setState({ghostHighlight:{position:scaledPosition}},function(){return _this.renderHighlights();});}));};_this.debouncedAfterSelection=lodash_debounce_default()(_this.afterSelection,500);_this.handleScaleValue=function(){if(_this.viewer){_this.viewer.currentScaleValue=_this.props.pdfScaleValue;//"page-width";
}};_this.debouncedScaleValue=lodash_debounce_default()(_this.handleScaleValue,500);if(typeof ResizeObserver!=="undefined"){_this.resizeObserver=new ResizeObserver(_this.debouncedScaleValue);}return _this;}_createClass(PdfHighlighter,[{key:"componentDidMount",value:function componentDidMount(){this.init();}},{key:"componentDidUpdate",value:function componentDidUpdate(prevProps){if(prevProps.pdfDocument!==this.props.pdfDocument){this.init();return;}if(prevProps.highlights!==this.props.highlights){this.renderHighlights(this.props);}}},{key:"init",value:function init(){var pdfDocument=this.props.pdfDocument;this.viewer=this.viewer||new pdf_viewer.PDFViewer({container:this.containerNode,eventBus:this.eventBus,// enhanceTextSelection: true, // deprecated. https://github.com/mozilla/pdf.js/issues/9943#issuecomment-409369485
textLayerMode:1,// Only simple layer, @notice z-index: -1 on the styles
removePageBorders:true,linkService:this.linkService,renderer:"canvas",l10n:null});this.linkService.setDocument(pdfDocument);this.linkService.setViewer(this.viewer);this.viewer.setDocument(pdfDocument);// debug
window.PdfViewer=this;}},{key:"componentWillUnmount",value:function componentWillUnmount(){this.unsubscribe();}},{key:"findOrCreateHighlightLayer",value:function findOrCreateHighlightLayer(page){var pageView=this.viewer.getPageView(page-1)||{};if(!pageView||!pageView.div){return null;}return findOrCreateContainerLayer(pageView.div,"PdfHighlighter__highlight-layer");}},{key:"groupHighlightsByPage",value:function groupHighlightsByPage(highlights){var ghostHighlight=this.state.ghostHighlight;var allHighlights=[].concat(_toConsumableArray(highlights),[ghostHighlight]).filter(Boolean);var pageNumbers=new Set();var _iterator=_createForOfIteratorHelper(allHighlights),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var _position$boundingRec3;var _highlight2=_step.value;if(_highlight2.position.pageNumber){pageNumbers.add(_highlight2.position.pageNumber);}if((_position$boundingRec3=_highlight2.position.boundingRect)!==null&&_position$boundingRec3!==void 0&&_position$boundingRec3.pageNumber){pageNumbers.add(_highlight2.position.boundingRect.pageNumber);}if(_highlight2.position.rects){var _iterator4=_createForOfIteratorHelper(_highlight2.position.rects),_step4;try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var _rect2=_step4.value;if(_rect2.pageNumber){pageNumbers.add(_rect2.pageNumber);}}}catch(err){_iterator4.e(err);}finally{_iterator4.f();}}}}catch(err){_iterator.e(err);}finally{_iterator.f();}var groupedHighlights={};for(var _i=0,_Array$from=Array.from(pageNumbers);_i<_Array$from.length;_i++){var _pageNumber=_Array$from[_i];groupedHighlights[_pageNumber]=groupedHighlights[_pageNumber]||[];var _iterator2=_createForOfIteratorHelper(allHighlights),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var _position$boundingRec;var _highlight=_step2.value;var pageSpecificHighlight=_objectSpread2(_objectSpread2({},_highlight),{},{position:{pageNumber:_pageNumber,boundingRect:_highlight.position.boundingRect,rects:[],usePdfCoordinates:_highlight.position.usePdfCoordinates}});var anyRectsOnPage=false;if(_highlight.position.rects){var _iterator3=_createForOfIteratorHelper(_highlight.position.rects),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var _rect=_step3.value;if(_pageNumber===(_rect.pageNumber||_highlight.position.pageNumber)){pageSpecificHighlight.position.rects.push(_rect);anyRectsOnPage=true;}}}catch(err){_iterator3.e(err);}finally{_iterator3.f();}}if(_highlight.position.pageNumber){if(anyRectsOnPage||_pageNumber===_highlight.position.pageNumber){groupedHighlights[_pageNumber].push(pageSpecificHighlight);}}if((_position$boundingRec=_highlight.position.boundingRect)!==null&&_position$boundingRec!==void 0&&_position$boundingRec.pageNumber){var _position$boundingRec2;if(anyRectsOnPage||_pageNumber===((_position$boundingRec2=_highlight.position.boundingRect)===null||_position$boundingRec2===void 0?void 0:_position$boundingRec2.pageNumber)){groupedHighlights[_pageNumber].push(pageSpecificHighlight);}}}}catch(err){_iterator2.e(err);}finally{_iterator2.f();}}return groupedHighlights;}},{key:"showTip",value:function showTip(highlight,content){var _this$state3=this.state,isCollapsed=_this$state3.isCollapsed,ghostHighlight=_this$state3.ghostHighlight,isAreaSelectionInProgress=_this$state3.isAreaSelectionInProgress;var highlightInProgress=!isCollapsed||ghostHighlight;if(highlightInProgress||isAreaSelectionInProgress){return;}this.setTip(highlight.position,content);}},{key:"scaledPositionToViewport",value:function scaledPositionToViewport(_ref){var pageNumber=_ref.pageNumber,boundingRect=_ref.boundingRect,rects=_ref.rects,usePdfCoordinates=_ref.usePdfCoordinates;var viewport=this.viewer.getPageView(pageNumber-1).viewport;return{boundingRect:scaledToViewport(boundingRect,viewport,usePdfCoordinates),rects:(rects||[]).map(function(rect){return scaledToViewport(rect,viewport,usePdfCoordinates);}),pageNumber:pageNumber};}},{key:"viewportPositionToScaled",value:function viewportPositionToScaled(_ref2){var pageNumber=_ref2.pageNumber,boundingRect=_ref2.boundingRect,rects=_ref2.rects;var viewport=this.viewer.getPageView(pageNumber-1).viewport;return{boundingRect:viewportToScaled(boundingRect,viewport),rects:(rects||[]).map(function(rect){return viewportToScaled(rect,viewport);}),pageNumber:pageNumber};}},{key:"screenshot",value:function screenshot(position,pageNumber){var canvas=this.viewer.getPageView(pageNumber-1).canvas;return get_area_as_png(canvas,position);}},{key:"renderHighlights",value:function renderHighlights(nextProps){var _this2=this;var _ref3=nextProps||this.props,highlightTransform=_ref3.highlightTransform,highlights=_ref3.highlights;var pdfDocument=this.props.pdfDocument;var _this$state4=this.state,tip=_this$state4.tip,scrolledToHighlightId=_this$state4.scrolledToHighlightId;var highlightsByPage=this.groupHighlightsByPage(highlights);var _loop=function _loop(_pageNumber2){var highlightLayer=_this2.findOrCreateHighlightLayer(_pageNumber2);if(highlightLayer){react_dom.render(/*#__PURE__*/(0,jsx_runtime.jsx)("div",{children:(highlightsByPage[String(_pageNumber2)]||[]).map(function(_ref4,index){var position=_ref4.position,id=_ref4.id,highlight=_objectWithoutProperties(_ref4,PdfHighlighter_excluded);// @ts-ignore
var viewportHighlight=_objectSpread2({id:id,position:_this2.scaledPositionToViewport(position)},highlight);if(tip&&tip.highlight.id===String(id)){_this2.showTip(tip.highlight,tip.callback(viewportHighlight));}var isScrolledTo=Boolean(scrolledToHighlightId===id);return highlightTransform(viewportHighlight,index,function(highlight,callback){_this2.setState({tip:{highlight:highlight,callback:callback}});_this2.showTip(highlight,callback(highlight));},_this2.hideTipAndSelection,function(rect){var viewport=_this2.viewer.getPageView((rect.pageNumber||_pageNumber2)-1).viewport;return viewportToScaled(rect,viewport);},function(boundingRect){return _this2.screenshot(boundingRect,_pageNumber2);},isScrolledTo);})}),highlightLayer);}};for(var _pageNumber2=1;_pageNumber2<=pdfDocument.numPages;_pageNumber2++){_loop(_pageNumber2);}}},{key:"setTip",value:function setTip(position,inner){this.setState({tipPosition:position,tipChildren:inner});}},{key:"toggleTextSelection",value:function toggleTextSelection(flag){this.viewer.viewer.classList.toggle("PdfHighlighter--disable-selection",flag);}},{key:"render",value:function render(){var _this3=this;var _this$props=this.props,onSelectionFinished=_this$props.onSelectionFinished,enableAreaSelection=_this$props.enableAreaSelection;var self=this;return/*#__PURE__*/(0,jsx_runtime.jsx)("div",{onPointerDown:this.onMouseDown,children:/*#__PURE__*/(0,jsx_runtime.jsxs)("div",{ref:this.attachRef,className:"PdfHighlighter",onContextMenu:function onContextMenu(e){return e.preventDefault();},children:[/*#__PURE__*/(0,jsx_runtime.jsx)("div",{className:"pdfViewer"}),this.renderTip(),typeof enableAreaSelection==="function"?/*#__PURE__*/(0,jsx_runtime.jsx)(components_MouseSelection,{onDragStart:function onDragStart(){return _this3.toggleTextSelection(false);},onDragEnd:function onDragEnd(){return _this3.toggleTextSelection(false);},onChange:function onChange(isVisible){return _this3.setState({isAreaSelectionInProgress:isVisible});},shouldStart:function shouldStart(event){return enableAreaSelection(event)&&isHTMLElement(event.target)&&Boolean(asElement(event.target).closest(".page"));},onSelection:function onSelection(startTarget,boundingRect,resetSelection){var _self$state;var page=getPageFromElement(startTarget);if(!page){return;}var pageBoundingRect=_objectSpread2(_objectSpread2({},boundingRect),{},{top:boundingRect.top-page.node.offsetTop,left:boundingRect.left-page.node.offsetLeft,pageNumber:page.number});var viewportPosition={boundingRect:pageBoundingRect,rects:[],pageNumber:page.number};var scaledPosition=_this3.viewportPositionToScaled(viewportPosition);var image=_this3.screenshot(pageBoundingRect,pageBoundingRect.pageNumber);var range=(_self$state=self.state)===null||_self$state===void 0?void 0:_self$state.range;// selection && selection.rangeCount > 0 ? selection.getRangeAt(0) : null
var text=range?range.toString():'-';var pageView=self.viewer.getPageView(page.number-1)||{};if(pageView.textLayer){var _pageView$textLayer,_pageView$textLayer$t;// FIXME: for include intersectRect filter
// const containerRect = pageView.div.parentElement.getBoundingClientRect()
// const selectionRect = {
//   left: boundingRect.left,
//   top: boundingRect.top,
//   right: boundingRect.left + boundingRect.width,
//   bottom: boundingRect.top + boundingRect.height,
// }
// console.debug(`Try to select text on the text layer ${JSON.stringify(selectionRect)}`)
(_pageView$textLayer=pageView.textLayer)===null||_pageView$textLayer===void 0?void 0:(_pageView$textLayer$t=_pageView$textLayer.textLayerDiv)===null||_pageView$textLayer$t===void 0?void 0:_pageView$textLayer$t.childNodes.forEach(function check(child){var _child$parentElement;var textRect=child.nodeType===Node.TEXT_NODE&&typeof((_child$parentElement=child.parentElement)===null||_child$parentElement===void 0?void 0:_child$parentElement.getBoundingClientRect)==='function'?child.parentElement.getBoundingClientRect():null;if(textRect){console.debug("Text: ".concat(child.textContent," ").concat(JSON.stringify(textRect)));}if(textRect){//} && intersectRect(textRect, selectionRect)) {
text+=child.nodeValue.trim()+' ';}child.childNodes.forEach(check);});//console.log(`Text is ${text}`)
}_this3.setTip(viewportPosition,onSelectionFinished(scaledPosition,{text:text,image:image},function(){return _this3.hideTipAndSelection();},function(){return _this3.setState({ghostHighlight:{position:scaledPosition,content:{text:text,image:image}}},function(){resetSelection();_this3.renderHighlights();});}));}}):null]})});}}]);return PdfHighlighter;}(react.PureComponent);PdfHighlighter_PdfHighlighter.defaultProps={pdfScaleValue:"auto"};
// EXTERNAL MODULE: ./node_modules/pdfjs-dist/legacy/build/pdf.js
var pdf = __webpack_require__(560);
;// CONCATENATED MODULE: ./src/components/PdfLoader.tsx
var PdfLoader=/*#__PURE__*/function(_Component){_inherits(PdfLoader,_Component);var _super=_createSuper(PdfLoader);function PdfLoader(){var _this;_classCallCheck(this,PdfLoader);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}_this=_super.call.apply(_super,[this].concat(args));_this.state={pdfDocument:null,error:null};_this.documentRef=/*#__PURE__*/react.createRef();return _this;}_createClass(PdfLoader,[{key:"componentDidMount",value:function componentDidMount(){this.load();}},{key:"componentWillUnmount",value:function componentWillUnmount(){var discardedDocument=this.state.pdfDocument;if(discardedDocument){discardedDocument.destroy();}}},{key:"componentDidUpdate",value:function componentDidUpdate(_ref){var url=_ref.url;if(this.props.url!==url){this.load();}}},{key:"componentDidCatch",value:function componentDidCatch(error,info){var onError=this.props.onError;if(onError){onError(error);}this.setState({pdfDocument:null,error:error});}},{key:"load",value:function load(){var _this2=this;var _ref2=this.documentRef.current||{},_ref2$ownerDocument=_ref2.ownerDocument,ownerDocument=_ref2$ownerDocument===void 0?document:_ref2$ownerDocument;var _this$props=this.props,url=_this$props.url,cMapUrl=_this$props.cMapUrl,cMapPacked=_this$props.cMapPacked,workerSrc=_this$props.workerSrc;var discardedDocument=this.state.pdfDocument;this.setState({pdfDocument:null,error:null});if(typeof workerSrc==="string"){pdf.GlobalWorkerOptions.workerSrc=workerSrc;}Promise.resolve().then(function(){return discardedDocument&&discardedDocument.destroy();}).then(function(){if(!url){return;}return (0,pdf.getDocument)(_objectSpread2(_objectSpread2({},_this2.props),{},{ownerDocument:ownerDocument,cMapUrl:cMapUrl,cMapPacked:cMapPacked})).promise.then(function(pdfDocument){_this2.setState({pdfDocument:pdfDocument});console.debug("Pdf document ".concat(pdfDocument," loaded"));window.dispatchEvent(new CustomEvent('pdf-viewer:documentLoaded'));});}).catch(function(e){return _this2.componentDidCatch(e);});}},{key:"render",value:function render(){var _this$props2=this.props,children=_this$props2.children,beforeLoad=_this$props2.beforeLoad;var _this$state=this.state,pdfDocument=_this$state.pdfDocument,error=_this$state.error;return/*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)("span",{ref:this.documentRef}),error?this.renderError():!pdfDocument||!children?beforeLoad:children(pdfDocument)]});}},{key:"renderError",value:function renderError(){var errorMessage=this.props.errorMessage;if(errorMessage){return/*#__PURE__*/react.cloneElement(errorMessage,{error:this.state.error});}return null;}}]);return PdfLoader;}(react.Component);PdfLoader.defaultProps={// workerSrc: "https://unpkg.com/pdfjs-dist@2.11.338/build/pdf.worker.min.js",
workerSrc:'/static/djeu/js/pdf.worker.min.js'};/* harmony default export */ var components_PdfLoader = ((/* unused pure expression or super */ null && (PdfLoader)));
;// CONCATENATED MODULE: ./src/components/MouseMonitor.tsx
var MouseMonitor_excluded=["onMoveAway","paddingX","paddingY","children"];var MouseMonitor=/*#__PURE__*/function(_Component){_inherits(MouseMonitor,_Component);var _super=_createSuper(MouseMonitor);function MouseMonitor(){var _this;_classCallCheck(this,MouseMonitor);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}_this=_super.call.apply(_super,[this].concat(args));_this.container=null;_this.unsubscribe=function(){};_this.onMouseMove=function(event){if(!_this.container){return;}var _this$props=_this.props,onMoveAway=_this$props.onMoveAway,paddingX=_this$props.paddingX,paddingY=_this$props.paddingY;var clientX=event.clientX,clientY=event.clientY;// TODO: see if possible to optimize
var _this$container$getBo=_this.container.getBoundingClientRect(),left=_this$container$getBo.left,top=_this$container$getBo.top,width=_this$container$getBo.width,height=_this$container$getBo.height;var inBoundsX=clientX>left-paddingX&&clientX<left+width+paddingX;var inBoundsY=clientY>top-paddingY&&clientY<top+height+paddingY;var isNear=inBoundsX&&inBoundsY;if(!isNear){onMoveAway();}};_this.attachRef=function(ref){_this.container=ref;_this.unsubscribe();if(ref){var doc=ref.ownerDocument;doc.addEventListener("mousemove",_this.onMouseMove);_this.unsubscribe=function(){doc.removeEventListener("mousemove",_this.onMouseMove);};}};return _this;}_createClass(MouseMonitor,[{key:"render",value:function render(){// eslint-disable-next-line
var _this$props2=this.props,onMoveAway=_this$props2.onMoveAway,paddingX=_this$props2.paddingX,paddingY=_this$props2.paddingY,children=_this$props2.children,restProps=_objectWithoutProperties(_this$props2,MouseMonitor_excluded);return/*#__PURE__*/(0,jsx_runtime.jsx)("div",{ref:this.attachRef,children:/*#__PURE__*/react.cloneElement(children,restProps)});}}]);return MouseMonitor;}(react.Component);/* harmony default export */ var components_MouseMonitor = (MouseMonitor);
;// CONCATENATED MODULE: ./src/components/Popup.tsx
var Popup=/*#__PURE__*/function(_Component){_inherits(Popup,_Component);var _super=_createSuper(Popup);function Popup(){var _this;_classCallCheck(this,Popup);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}_this=_super.call.apply(_super,[this].concat(args));_this.state={mouseIn:false};return _this;}_createClass(Popup,[{key:"render",value:function render(){var _this2=this;var _this$props=this.props,_onMouseOver=_this$props.onMouseOver,popupContent=_this$props.popupContent,onMouseOut=_this$props.onMouseOut;return/*#__PURE__*/(0,jsx_runtime.jsx)("div",{onMouseOver:function onMouseOver(){_this2.setState({mouseIn:true});_onMouseOver(/*#__PURE__*/(0,jsx_runtime.jsx)(components_MouseMonitor,{onMoveAway:function onMoveAway(){if(_this2.state.mouseIn){return;}onMouseOut();},paddingX:60,paddingY:30,children:popupContent}));},onMouseOut:function onMouseOut(){_this2.setState({mouseIn:false});},children:this.props.children});}}]);return Popup;}(react.Component);/* harmony default export */ var components_Popup = ((/* unused pure expression or super */ null && (Popup)));
;// CONCATENATED MODULE: ./src/components/Spinner.tsx
function Spinner(){return/*#__PURE__*/(0,jsx_runtime.jsx)("div",{style:{display:"flex",alignItems:"center",height:"100vh"},children:/*#__PURE__*/(0,jsx_runtime.jsxs)("div",{className:"sk-fading-circle",children:[/*#__PURE__*/(0,jsx_runtime.jsx)("div",{className:"sk-circle1 sk-circle"}),/*#__PURE__*/(0,jsx_runtime.jsx)("div",{className:"sk-circle2 sk-circle"}),/*#__PURE__*/(0,jsx_runtime.jsx)("div",{className:"sk-circle3 sk-circle"}),/*#__PURE__*/(0,jsx_runtime.jsx)("div",{className:"sk-circle4 sk-circle"}),/*#__PURE__*/(0,jsx_runtime.jsx)("div",{className:"sk-circle5 sk-circle"}),/*#__PURE__*/(0,jsx_runtime.jsx)("div",{className:"sk-circle6 sk-circle"}),/*#__PURE__*/(0,jsx_runtime.jsx)("div",{className:"sk-circle7 sk-circle"}),/*#__PURE__*/(0,jsx_runtime.jsx)("div",{className:"sk-circle8 sk-circle"}),/*#__PURE__*/(0,jsx_runtime.jsx)("div",{className:"sk-circle9 sk-circle"}),/*#__PURE__*/(0,jsx_runtime.jsx)("div",{className:"sk-circle10 sk-circle"}),/*#__PURE__*/(0,jsx_runtime.jsx)("div",{className:"sk-circle11 sk-circle"}),/*#__PURE__*/(0,jsx_runtime.jsx)("div",{className:"sk-circle12 sk-circle"})]})});}
;// CONCATENATED MODULE: ./src/style/Tip.css
// extracted by mini-css-extract-plugin
/* harmony default export */ var Tip = ({});
;// CONCATENATED MODULE: ./src/components/Tip.tsx
var ChangeMode;(function(ChangeMode){ChangeMode[ChangeMode["AddNew"]=1]="AddNew";ChangeMode[ChangeMode["ChangeExist"]=2]="ChangeExist";})(ChangeMode||(ChangeMode={}));;var Tip_Tip=/*#__PURE__*/function(_Component){_inherits(Tip,_Component);var _super=_createSuper(Tip);function Tip(){var _this;_classCallCheck(this,Tip);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}_this=_super.call.apply(_super,[this].concat(args));_this.state={};return _this;}_createClass(Tip,[{key:"componentDidUpdate",value:// for TipContainer
function componentDidUpdate(nextProps,nextState){// const { onUpdate } = this.props;
// if (onUpdate) {
//   onUpdate();
// }
}},{key:"render",value:function render(){var _this$props=this.props,changeMode=_this$props.changeMode,textAvailable=_this$props.textAvailable,onAction=_this$props.onAction;return/*#__PURE__*/(0,jsx_runtime.jsxs)("div",{className:"Tip",children:[/*#__PURE__*/(0,jsx_runtime.jsx)("div",{className:"Tip__compact",onClick:function onClick(event){event.preventDefault();onAction(false);// this.setState({ compact: false });
// onConfirm({ text, emoji });
},children:changeMode===ChangeMode.AddNew?'Добавить цитату':'Обновить цитату'}),textAvailable?/*#__PURE__*/(0,jsx_runtime.jsx)("div",{className:"Tip__compact_without_top_bound",onClick:function onClick(event){event.preventDefault();onAction(true);// this.setState({ compact: false });
// onConfirm({ text, emoji });
},children:changeMode===ChangeMode.AddNew?'Добавить цитату и текст':'Обновить цитату и текст'}):'']});}}]);return Tip;}(react.Component);/* harmony default export */ var components_Tip = ((/* unused pure expression or super */ null && (Tip_Tip)));
;// CONCATENATED MODULE: ./src/components/PDFwrapper.tsx
var PDFwrapper_excluded=["id","position","content"];// import { testHighlights as _testHighlights } from "./test-highlights";
// const highlightsStore: Record<string, Array<IHighlight>> = _testHighlights;
var getNextId=function getNextId(){return String(Math.random()).slice(2);};var parseIdFromHash=function parseIdFromHash(){return document.location.hash.slice("#highlight-".length);};var resetHash=function resetHash(){document.location.hash="";};var HighlightPopup=function HighlightPopup(_ref){var comment=_ref.comment;return comment!==null&&comment!==void 0&&comment.text?/*#__PURE__*/(0,jsx_runtime.jsxs)("div",{className:"Highlight__popup",children:[comment.emoji," ",comment.text]}):null;};// const PRIMARY_PDF_URL = "files/vedomosti_spb_1727.pdf";
// const SECONDARY_PDF_URL = "https://arxiv.org/pdf/1604.02480.pdf";
// const initialUrl = SECONDARY_PDF_URL;
// console.log(initialUrl);
var PDFwrapper=/*#__PURE__*/function(_Component){_inherits(PDFwrapper,_Component);var _super=_createSuper(PDFwrapper);// FIXME: Add listeners not for window level but element level only
function PDFwrapper(props){var _this;_classCallCheck(this,PDFwrapper);_this=_super.call(this,props);_this.setUrlListener=void 0;_this.setHighlightsListener=void 0;_this.cancelLatestHighlightListener=void 0;_this.selectHighlightListener=void 0;_this.editHighlightListener=void 0;_this.removeHighlightListener=void 0;_this.afterPersistHighlightListener=void 0;_this.cancelEditHighlightListener=void 0;_this.resetHighlights=function(){_this.setState({highlights:[],changeMode:ChangeMode.AddNew});};_this.toggleDocument=function(newUrl){_this.setState({url:newUrl,highlights:[],changeMode:ChangeMode.AddNew});};_this.scrollViewerTo=function(highlight){};_this.scrollToHighlightFromHash=function(){var highlight=_this.getHighlightById(parseIdFromHash());if(highlight){_this.scrollViewerTo(highlight);}};_this.cancelLatestHighlight=function(){var highlights=_this.state.highlights;highlights.pop();_this.setState({highlights:_toConsumableArray(highlights),changeMode:ChangeMode.AddNew});};_this.cancelEditHighlight=function(highlight){var highlights=_this.state.highlights;var index=highlights.findIndex(function(element){return element.id===highlight.id;});if(index===-1){_this.setState({highlights:[highlight].concat(_toConsumableArray(highlights)),changeMode:ChangeMode.AddNew});}else{highlights[index]=highlight;_this.setState({changeMode:ChangeMode.AddNew});}_this.scrollViewerTo(highlight);};_this.state={url:props.url,highlights:props.highlights||[],changeMode:ChangeMode.AddNew};return _this;}_createClass(PDFwrapper,[{key:"componentDidMount",value:function componentDidMount(){var _this2=this;// FIXME: Add listener snot for window level but element level only
window.addEventListener("hashchange",this.scrollToHighlightFromHash,false);// FIXME: Add listener snot for window level but element level only
if(!this.setUrlListener){this.setUrlListener=window.addEventListener('jquery-pdf-viewer:setPDFwrapperUrl',function(e){if(e instanceof CustomEvent){var _e$detail;console.debug(e);if(e!==null&&e!==void 0&&(_e$detail=e.detail)!==null&&_e$detail!==void 0&&_e$detail.url){var _e$detail2;_this2.toggleDocument(e===null||e===void 0?void 0:(_e$detail2=e.detail)===null||_e$detail2===void 0?void 0:_e$detail2.url);}}},false);}if(!this.setHighlightsListener){this.setHighlightsListener=window.addEventListener('jquery-pdf-viewer:setHighlights',function(e){var _detail;console.debug(e);if((_detail=e.detail)!==null&&_detail!==void 0&&_detail.highlights){_this2.setHighlights(JSON.parse(e.detail.highlights));}},false);}if(!this.cancelLatestHighlightListener){this.cancelLatestHighlightListener=window.addEventListener('pdf-viewer-integration:cancelLatestHighlight',function(e){console.debug(e);_this2.cancelLatestHighlight();},false);}if(!this.selectHighlightListener){this.selectHighlightListener=window.addEventListener('pdf-viewer-integration:selectHighlight',function(e){var _detail2;console.debug(e);if('detail'in e&&(_detail2=e.detail)!==null&&_detail2!==void 0&&_detail2.highlight){_this2.selectHighlight(JSON.parse(e.detail.highlight));}},false);}if(!this.editHighlightListener){this.editHighlightListener=window.addEventListener('pdf-viewer-integration:editHighlight',function(e){var _detail3;console.debug(e);if('detail'in e&&(_detail3=e.detail)!==null&&_detail3!==void 0&&_detail3.highlight){_this2.editHighlight(JSON.parse(e.detail.highlight));}},false);}if(!this.removeHighlightListener){this.removeHighlightListener=window.addEventListener('pdf-viewer-integration:removeHighlight',function(e){var _detail4;console.debug(e);if('detail'in e&&(_detail4=e.detail)!==null&&_detail4!==void 0&&_detail4.highlight){_this2.removeHighlight(JSON.parse(e.detail.highlight));}},false);}if(!this.afterPersistHighlightListener){this.afterPersistHighlightListener=window.addEventListener('pdf-viewer-integration:afterPersistHighlight',function(e){var _detail5;console.debug(e);if('detail'in e&&(_detail5=e.detail)!==null&&_detail5!==void 0&&_detail5.highlight){_this2.afterPersistHighlight(JSON.parse(e.detail.highlight));}},false);}if(!this.cancelEditHighlightListener){this.cancelEditHighlightListener=window.addEventListener('pdf-viewer-integration:cancelEditHighlight',function(e){var _detail6;console.debug(e);if('detail'in e&&(_detail6=e.detail)!==null&&_detail6!==void 0&&_detail6.highlight){_this2.cancelEditHighlight(JSON.parse(e.detail.highlight));}},false);}}},{key:"getHighlightById",value:function getHighlightById(id){var highlights=this.state.highlights;return highlights.find(function(highlight){return highlight.id===id;});}},{key:"hasId",value:function hasId(object){return'id'in object;}},{key:"setHighlights",value:function setHighlights(highlights){if(highlights){this.setState({highlights:_toConsumableArray(highlights),changeMode:ChangeMode.AddNew});}}},{key:"addHighlight",value:function addHighlight(highlight){var highlights=this.state.highlights;// console.log("Saving highlight", highlight)
var identifiedHighlight=_objectSpread2(_objectSpread2({},highlight),{},{id:getNextId()});window.dispatchEvent(new CustomEvent('pdf-viewer:addHighlight',{detail:{highlight:identifiedHighlight}}));this.setState({highlights:[identifiedHighlight].concat(_toConsumableArray(highlights)),changeMode:ChangeMode.ChangeExist});}},{key:"selectHighlight",value:function selectHighlight(highlight){var highlights=this.state.highlights;var index=highlights.findIndex(function(element){return element.id===highlight.id;});if(index===-1){this.setState({highlights:[highlight].concat(_toConsumableArray(highlights))});}else{highlights[index]=highlight;}this.scrollViewerTo(highlight);}},{key:"editHighlight",value:function editHighlight(highlight){var highlights=this.state.highlights;var index=highlights.findIndex(function(element){return element.id===highlight.id;});if(index===-1){this.setState({highlights:[highlight].concat(_toConsumableArray(highlights)),changeMode:ChangeMode.ChangeExist});}else{highlights[index]=highlight;this.setState({changeMode:ChangeMode.ChangeExist});}this.scrollViewerTo(highlight);}},{key:"removeHighlight",value:function removeHighlight(highlight){var highlights=this.state.highlights;var index=highlights.findIndex(function(element){return element.id===highlight.id;});if(index>-1){highlights.splice(index,1);this.setState({highlights:_toConsumableArray(highlights),changeMode:ChangeMode.AddNew});}else{this.setState({changeMode:ChangeMode.AddNew});}this.scrollViewerTo(highlight);}},{key:"afterPersistHighlight",value:function afterPersistHighlight(highlight){var highlights=this.state.highlights;var index=highlights.findIndex(function(element){return element.id===highlight.id;});if(index>-1){highlights.splice(index,1);this.setState({highlights:_toConsumableArray(highlights),changeMode:ChangeMode.AddNew});}else{this.setState({changeMode:ChangeMode.AddNew});}this.scrollViewerTo(highlight);}},{key:"updateHighlight",value:function updateHighlight(highlightId,position,content){// console.debug("Updating highlight", highlightId, position, content)
var modifiedHighlight={position:position,content:content,id:highlightId};window.dispatchEvent(new CustomEvent('pdf-viewer:updateHighlight',{detail:{highlight:modifiedHighlight}}));this.setState({highlights:this.state.highlights.map(function(h){var id=h.id,originalPosition=h.position,originalContent=h.content,rest=_objectWithoutProperties(h,PDFwrapper_excluded);return id===highlightId?_objectSpread2({id:id,position:_objectSpread2(_objectSpread2({},originalPosition),position),content:_objectSpread2(_objectSpread2({},originalContent),content)},rest):h;}),changeMode:ChangeMode.ChangeExist});}},{key:"componentDidUpdate",value:function componentDidUpdate(prevProps,prevState){// console.log(prevState)
}},{key:"render",value:function render(){var _this3=this;var _this$state=this.state,url=_this$state.url,highlights=_this$state.highlights,changeMode=_this$state.changeMode;var self=this;return/*#__PURE__*/(0,jsx_runtime.jsx)("div",{children:/*#__PURE__*/(0,jsx_runtime.jsx)("div",{className:"App",style:{display:"flex",height:"100vh"},children:/*#__PURE__*/(0,jsx_runtime.jsx)("div",{style:{height:"100vh",width:"100vw",position:"relative"},children:/*#__PURE__*/(0,jsx_runtime.jsx)(PdfLoader,{url:url,beforeLoad:/*#__PURE__*/(0,jsx_runtime.jsx)(Spinner,{}),children:function children(pdfDocument){return/*#__PURE__*/(0,jsx_runtime.jsx)(PdfHighlighter_PdfHighlighter,{pdfDocument:pdfDocument,enableAreaSelection:function enableAreaSelection(event){var _self$state;return((_self$state=self.state)===null||_self$state===void 0?void 0:_self$state.changeMode)===ChangeMode.AddNew;},onScrollChange:resetHash// pdfScaleValue="page-width"
,scrollRef:function scrollRef(scrollTo){_this3.scrollViewerTo=scrollTo;_this3.scrollToHighlightFromHash();},onSelectionFinished:function onSelectionFinished(position,content,hideTipAndSelection,transformSelection){return/*#__PURE__*/(0,jsx_runtime.jsx)(Tip_Tip,{changeMode:changeMode,textAvailable:content.text&&content.text!=='-'?true:false,onAction:function onAction(withText){transformSelection();if(!withText){content.text='-';}_this3.addHighlight({content:content,position:position,comment:{text:'',emoji:''}});hideTipAndSelection();}});},highlightTransform:function highlightTransform(highlight,index,setTip,hideTip,viewportToScaled,screenshot,isScrolledTo){return/*#__PURE__*/(0,jsx_runtime.jsx)(Popup,{popupContent:/*#__PURE__*/(0,jsx_runtime.jsx)(HighlightPopup,_objectSpread2({},highlight)),onMouseOver:function onMouseOver(popupContent){return setTip(highlight,function(highlight){return popupContent;});},onMouseOut:hideTip,children:/*#__PURE__*/(0,jsx_runtime.jsx)(AreaHighlight_AreaHighlight,{locked:false,highlight:highlight,onChange:function onChange(boundingRect){_this3.updateHighlight(highlight.id,{pageNumber:boundingRect.pageNumber,boundingRect:viewportToScaled(boundingRect)},{text:highlight.content.text,image:screenshot(boundingRect)});}})},index);},highlights:highlights});}})})})});}}]);return PDFwrapper;}(react.Component);/* harmony default export */ var components_PDFwrapper = (PDFwrapper);
;// CONCATENATED MODULE: ./src/style/jquery-pdf-viewer.css
// extracted by mini-css-extract-plugin
/* harmony default export */ var jquery_pdf_viewer = ({});
;// CONCATENATED MODULE: external "jQuery"
var external_jQuery_namespaceObject = jQuery;
var external_jQuery_default = /*#__PURE__*/__webpack_require__.n(external_jQuery_namespaceObject);
;// CONCATENATED MODULE: ./src/jquery-pdf-viewer.jsx
if(typeof (external_jQuery_default())!=='undefined'){(function($){// mugine
// var Mugine = (function () { var e = document, H = window, r = "div", g = "wrap", f = "push", v = "join", m = "data", x = "split", o = "object", K = "string", O = "replace", F = "element", u = "nodeType", L = "innerHTML", s = "attributes", k = "childNodes", l = "parentNode", y = "firstChild", t = "appendChild", G = "insertBefore", E = "replaceChild", z = "setAttribute", N = "createElement", a = "data-variable", d = "querySelectorAll", J = "createDocumentFragment", C = { start: "#{", end: "}", buffer: "" }, c = { start: "<%", end: "%>", buffer: "=" }, n = (function () { var P = {}; return function (W, U, S) { S = S || {}; for (var R in A) { U["_" + R] = (function (X, Y) { return function () { X._data = Y; var Z = X.apply(this, arguments); delete X._data; return Z } })(A[R], U) } var V = S.tokens || c; var T = P[W] = P[W] || new Function("obj", "var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('" + W[O](/[\r\t\n]/g, " ")[x](V.start)[v]("\t")[O](new RegExp("\\(\\(\\^\\|" + V.end + "\\)\\[\\^\t\\]\\*\\)", "g"), "$1\r")[O](new RegExp("\t" + V.buffer + "(.*?)" + V.end, "g"), "',$1,'")[x]("\t")[v]("');")[x](V.end)[v]("p.push('")[x]("\r")[v]("\\'") + "');} p = p.filter(function(v) {return typeof v == 'string' ? v.replace(/^s+|s+$/g, '').length : true});for (var i = 0; i < p.length; i++) { var o = p[i]; if (o && o.outerHTML) p[i] = o.outerHTML; }return p.length > 1 ? p.join('') : typeof p[0] == 'undefined' ? '' : p[0];"); var Q = U ? T(U) : T; for (var R in A) { delete U["_" + R] } return Q } })(); function q(ad, U, ae) { ae = ae || {}; var S = i(U); for (var R in S) { var ac = S[R]; ac[u] ? ac[z](a, R) : null } var V = n(ad, U, ae); var af = h(V); var Y = af[d]("*[" + a + "]"); var Y = af.querySelectorAll("*[" + a + "]"); for (var T = 0, ab; ab = Y[T]; T++) { var P = ab.getAttribute(a), ac = S[P]; if (ac) { if (ac[u]) { for (var Z = 0, W; W = ab[s][Z]; Z++) { ac[z](W.nodeName, W.nodeValue) } if (!ac[k].length) { for (var X = 0, Q = ab[k]; X < Q.length; X++) { ac[t](Q[X--]) } } ab[l][E](ac, ab) } else { if (typeof elem != "object") { var aa = ac; ac = ab; ac[L] = aa } } } } for (var R in S) { var ac = S[R]; ac[u] ? ac.removeAttribute(a) : null } return af } var A = { build: function () { return D.call(this, arguments[0], arguments[1], arguments.callee._data) } }; function D(Q, U, P) { var X = null, P = P || {}; if (typeof U == "string") { X = q(U, P, { helpers: A }) } else { if (U instanceof Array) { X = Q = Q || e[J](); for (var R = 0, W; W = U[R]; R++) { Q[t](D.call(this, null, W, P)) } } else { if (typeof U == "object") { var S = Q || U[F]; X = (function () { if (typeof S == "string") { var Y = q(S, P, { helpers: A, tokens: C })[k]; if (Y.length == 1 && Y[0][u] == 1) { return Y[0] } else { throw ("property 'element' must evaluate to a single dom element") } } else { if (typeof S == "object" && S[u]) { return S } } return null })() || e[N](U.nodeName || U.tagName || r); Q = X; var V = U[g]; for (var T in U[s]) { Q[z](b(T), n(U[s][T], P)) } if (U[k]) { D.call(this, Q, U[k], P) } j(Q, U, P); if (V) { X = Q = I(Q, D.call(this, null, V, P)) } } } } return X } var p = []; function B(R) { for (var Q = 0, T; T = p[Q]; Q++) { if (T[F] == R) { p.splice(Q--, 1); for (var P = 0, S; S = T.markup[P]; P++) { S[l][E](R, S) } break } } } function w(U, X, T) { T = T || {}; B.call(this, U); var V = U.cloneNode(), W = U[l], R = V; W ? W[G](V, U) : null; var Z = X[k]; if (typeof X == "object" && !(X instanceof Array) && (!Z || Z.length == 1)) { X[F] = U } T[F] = T[F] || U; var aa = D.call(this, null, X, T); var Q = [], Y = aa[k]; for (var S = 0, P; P = Y[S]; S++) { Q[f](P) } p[f]({ element: U, markup: Q }); if (R) { R[l][E](aa, R) } return aa } function M() { } M.prototype = { render: function (Q, R, U) { var T = typeof Q == K ? e[d](Q) : Q instanceof Array ? Q : [Q]; for (var P = 0, S; S = T[P]; P++) { w.call(this, S, R, U) } return T }, clean: function (P) { B.call(this, P) }, helpers: A }; function b(P) { return P[O](/\W+/g, "-")[O](/([a-z\d])([A-Z])/g, "$1-$2") } function h(Q) { if (typeof Q != "string") { return Q } var S, R = e[N](r), P = e[J](); R[L] = Q; while (S = R[y]) { P[t](S) } return P } function j(Q, R, T) { for (var P in R) { if (!!([F, s, m, k, g].indexOf(P) + 1)) { continue } var S = R[P]; typeof S == o && !S[u] ? arguments.callee(Q[P] || {}, S, T) : Q[P] = typeof S == K ? n(S, T, { helpers: A, tokens: S.indexOf(c.start) >= 0 ? c : C }) : S } return Q } function I(P, S) { if (!S) { return P } var Q = P[l], R = P.nextSibling; S = S[u] === 11 ? S[y] : S; S[t](P); if (Q) { Q[G](S, R) } return S } function i(T, S, P) { S = S || "", P = P || {}; for (var R in T) { var Q = T[R], U = S ? S + "[" + R + "]" : R; if (typeof Q == "undefined" || Q == null) { continue } P[U] = Q; if (typeof Q == o && !Q.outerHTML) { i(Q, U, P) } } return P } if ($ = jQuery) { $.fn.render = $.fn.render || function (P, Q) { return this.each(function () { H.mugine.render(this, P, Q); return $(this) }) } } H.Mugine = H.Mugine || M; H.mugine = H.mugine || new M(); return M })();
var $window=$(window);var pluginName="pdfViewer",defaults={value:0};// var dataOptions = ['label'];
function getFilename(url){var match=/\/([^\\\/:*?\"<>|]+)$/i.exec(url);if(match)return match[1];return null;}function getFileExtension(url){var match=/\.([0-9a-z]+)(?:[\?#]|$)/i.exec(url);if(match)return match[1];return null;}// function PdfViewer(element, options) {
//     this.element = element;
//     this.settings = $.extend({}, defaults, options);
//     this._defaults = defaults;
//     this._name = pluginName;
//     this.init();
// }
function PdfViewer(element,options){var $element=$(element);var instance=this;var files=[];// var mugine = new Mugine();
var $preview=$('<div></div>'),preview=$preview.get(0);var $input=$('<input/>'),input=$input.get(0);var $button=$('<button type="button"></button>'),button=$button.get(0);// var style = typeof options.style == 'string' ? $.fn.filepicker.getStyle(
//     options.style === "auto" ?
//         // detect styles
//         isBootstrap() ? 'bootstrap' :
//             isJQueryUI() ? 'jquery-ui' :
//                 'default'
//         // option value
//         : options.style
// ) : options.style;
$window.on('resize',function(e){layout.call(instance);});$element.on('change',function(e){handleFileSelect(e);});$button.on('click',function(){$element.trigger('click');});$input.on('click',function(){$element.trigger('click');}).on('focus',function(){$(this).blur();});function renderUI(){var renderStyle=true;if(typeof options.renderUI=="function"){var retVal=options.renderUI.call(this,element,button,input,preview);if(typeof retVal!='undefined'){renderStyle=retVal;}}// if (renderStyle) {
//     // render
//     var result = mugine.render(element, style.ui, {
//         button: button,
//         input: input,
//         preview: preview
//     });
// }
// return result;
}function changed(){// changed
}function update(){// filenames
var fileNames=$(files).map(function(){return this.name;}).get();$(input).prop('value',fileNames.join(", "));}function renderPreview(){if($preview[0].hasOwnProperty('_reactRootContainer')){// FIXME: Add listeners not for window level but element level only
window.dispatchEvent(new CustomEvent('jquery-pdf-viewer:setPDFwrapperUrl',{detail:{url:null}}));}// Loop through the FileList and render image files as thumbnails.
$(files).each(function(){if(!this.type.match('application/pdf')){return;}var fileUrl=files[0].src;if(!$preview[0].hasOwnProperty('_reactRootContainer')){react_dom.render(/*#__PURE__*/(0,jsx_runtime.jsx)(components_PDFwrapper,{}),$preview[0]);}window.dispatchEvent(new CustomEvent('jquery-pdf-viewer:setPDFwrapperUrl',{detail:{url:fileUrl}}));//$preview.append($thumbnail);
// var renderStyle = true;
// if (typeof options.renderThumbnail == "function") {
//     var retVal = options.renderThumbnail.call(instance, $thumbnail[0], this);
//     if (typeof retVal != 'undefined') {
//         renderStyle = retVal;
//     }
// }
// if (renderStyle) {
//     mugine.render($thumbnail.get(0), style.thumbnail, this);
// }
});}function layout(){$element.css({position:'absolute',visibility:'hidden',display:'none'});if(typeof options.resize=="function"){options.resize.call(this);}}function handleFileSelect(evt){files=evt.target.files;// FileList object
for(var i=0,file;file=files[i];i++){// Only process pdf files.
if(!file.type.match('application/pdf')){continue;}var reader=new FileReader();// Closure to capture the file information.
reader.onload=function(file){return function(e){file.src=e.target.result;renderPreview();};}(file);// Read in the image file as a data URL.
reader.readAsDataURL(file);}if(typeof options.change==='function'){options.change.call(this,files);}update.call(instance);}// function isBootstrap() {
//     return $('<div></div>').addClass('pull-right').css('float') === "right";
// }
// function isJQueryUI() {
//     return $('<div></div>').addClass('ui-front').css('z-index') > 1;
// }
function init(){var value=$element.attr('value')||$element.attr('url');var values=value?value.split(","):[];files=$(values).map(function(){var filename=getFilename(this);var fileExtension=getFileExtension(this);var type="";if($.inArray(fileExtension,['jpg','jpeg','png','gif'])>=0){// image
type="image/"+fileExtension;}if($.inArray(fileExtension,['pdf'])>=0){// image
type="application/"+fileExtension;}return{name:filename,type:type,src:this};}).get();renderUI.call(this);renderPreview.call(this);layout.call(this);update.call(this);}init.call(this);}$.extend(PdfViewer.prototype,{//     init: function () {
//         this.component = ReactDOM.render(
//             <PDFwrapper url={this.settings.url} highlights={this.settings.highlights} />,
//             this.element
//         );
//         return this;
//     },
url:function url(_url){if(!arguments.length){return this.component.state.url;}else{this.settings.url=_url;this.init();}},highlights:function highlights(_highlights){if(!arguments.length){return this.component.state.highlights;}else{this.settings.highlights=_highlights;this.init();}},workerSrc:function workerSrc(_workerSrc){if(!arguments.length){return this.component.state.workerSrc;}else{this.settings.workerSrc=_workerSrc;this.init();}}});var pluginClass=PdfViewer;// register plugin
$.fn[pluginName]=function(options){options=$.extend({},defaults,options);return this.each(function(){if(!$(this).data(pluginName)){$(this).data(pluginName,new pluginClass(this,options));}return $(this);});};// default styles
var _styles={'default':{ui:[{element:'#{ preview }',className:'pdf-viewer-preview'},{className:'pdf-viewer-ui',childNodes:[{element:'#{ button }',className:'pdf-viewer-ui',innerHTML:'<%= element.getAttribute("data-label") %>'},{element:'#{ input }',className:'pdf-viewer-ui'}]},{element:'#{ element }'}],thumbnail:{wrap:'<div style="margin-bottom: 20px; text-align: center; border-radius: 0px"></div>',style:"max-width: 100%"}},'bootstrap':{ui:[{element:'#{ preview }'},{className:'input-group',childNodes:[{element:'#{ button }',className:'btn btn-default',wrap:'<div class="input-group-btn"></div>',innerHTML:'<i class="glyphicon glyphicon-upload"></i> <%= element.getAttribute("data-label") %>'},{element:'#{ input }',className:'form-control',placeholder:'#{ element.placeholder }'}]},{element:'#{ element }'}],thumbnail:{wrap:'<div class="thumbnail"></div>'}},'jquery-ui':{ui:[{element:'#{ preview }'},{className:'ui-buttonset',childNodes:[{element:'#{ button }',className:'ui-button ui-state-default ui-corner-left <% if (!element.getAttribute("data-label")) { %> ui-button-icon-only<% } else { %> ui-button-text-icon-primary<% } %>',innerHTML:'<span class="ui-button-icon-primary ui-icon  ui-icon-document"></span><span class="ui-button-text"><%= element.getAttribute("data-label") || "&nbsp;" %></span>'},{element:'#{ input }',className:'ui-button ui-state-default ui-corner-right',placeholder:'#{ element.placeholder }'},{element:'#{ element }'}]}],thumbnail:{wrap:'<div style="padding: 5px; margin-bottom: 20px; text-align: center" class="ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>',style:{maxWidth:'100%'}}}};$.fn[pluginName].registerStyle=function(name,json){_styles[name]=json;};$.fn[pluginName].getStyle=function(name){return _styles[name];};})((external_jQuery_default()));}
}();
/******/ })()
;
//# sourceMappingURL=jquery-pdf-viewer.js.map