hsu-utils 0.0.12 → 0.0.14

Sign up to get free protection for your applications and to get access to all the features.
package/dist/hsu-utils.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  *
3
- * hsu-utils v0.0.11
3
+ * hsu-utils v0.0.13
4
4
  *
5
5
  * some front-end utils
6
6
  *
@@ -46,15 +46,25 @@
46
46
  root["hsu-utils"] = factory();
47
47
  })(this, () => {
48
48
  return /******/ (() => { // webpackBootstrap
49
- /******/ "use strict";
50
49
  /******/ var __webpack_modules__ = ({
51
50
 
51
+ /***/ "./node_modules/pdfjs-dist/legacy/build/pdf.js":
52
+ /*!*****************************************************!*\
53
+ !*** ./node_modules/pdfjs-dist/legacy/build/pdf.js ***!
54
+ \*****************************************************/
55
+ /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
56
+
57
+ eval("/**\n * @licstart The following is the entire license notice for the\n * Javascript code in this page\n *\n * Copyright 2022 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @licend The above is the entire license notice for the\n * Javascript code in this page\n */\n\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(true)\n\t\tmodule.exports = factory();\n\telse {}\n})(this, function() {\nreturn /******/ (() => { // webpackBootstrap\n/******/ \tvar __webpack_modules__ = ([\n/* 0 */,\n/* 1 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.VerbosityLevel = exports.Util = exports.UnknownErrorException = exports.UnexpectedResponseException = exports.UNSUPPORTED_FEATURES = 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;\nexports.arrayByteLength = arrayByteLength;\nexports.arraysToBytes = arraysToBytes;\nexports.assert = assert;\nexports.bytesToString = bytesToString;\nexports.createPromiseCapability = createPromiseCapability;\nexports.createValidAbsoluteUrl = createValidAbsoluteUrl;\nexports.escapeString = escapeString;\nexports.getModificationDate = getModificationDate;\nexports.getVerbosityLevel = getVerbosityLevel;\nexports.info = info;\nexports.isArrayBuffer = isArrayBuffer;\nexports.isArrayEqual = isArrayEqual;\nexports.isAscii = isAscii;\nexports.isSameOrigin = isSameOrigin;\nexports.objectFromMap = objectFromMap;\nexports.objectSize = objectSize;\nexports.setVerbosityLevel = setVerbosityLevel;\nexports.shadow = shadow;\nexports.string32 = string32;\nexports.stringToBytes = stringToBytes;\nexports.stringToPDFString = stringToPDFString;\nexports.stringToUTF16BEString = stringToUTF16BEString;\nexports.stringToUTF8String = stringToUTF8String;\nexports.unreachable = unreachable;\nexports.utf8StringToString = utf8StringToString;\nexports.warn = warn;\n\n__w_pdfjs_require__(2);\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _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.\"); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _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.\"); }\n\nfunction _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; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _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; } } }; }\n\nfunction _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); }\n\nfunction _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; }\n\nfunction _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); }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _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); }; }\n\nfunction _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); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _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; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar IDENTITY_MATRIX = [1, 0, 0, 1, 0, 0];\nexports.IDENTITY_MATRIX = IDENTITY_MATRIX;\nvar FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0];\nexports.FONT_IDENTITY_MATRIX = FONT_IDENTITY_MATRIX;\nvar RenderingIntentFlag = {\n ANY: 0x01,\n DISPLAY: 0x02,\n PRINT: 0x04,\n ANNOTATIONS_FORMS: 0x10,\n ANNOTATIONS_STORAGE: 0x20,\n ANNOTATIONS_DISABLE: 0x40,\n OPLIST: 0x100\n};\nexports.RenderingIntentFlag = RenderingIntentFlag;\nvar AnnotationMode = {\n DISABLE: 0,\n ENABLE: 1,\n ENABLE_FORMS: 2,\n ENABLE_STORAGE: 3\n};\nexports.AnnotationMode = AnnotationMode;\nvar PermissionFlag = {\n PRINT: 0x04,\n MODIFY_CONTENTS: 0x08,\n COPY: 0x10,\n MODIFY_ANNOTATIONS: 0x20,\n FILL_INTERACTIVE_FORMS: 0x100,\n COPY_FOR_ACCESSIBILITY: 0x200,\n ASSEMBLE: 0x400,\n PRINT_HIGH_QUALITY: 0x800\n};\nexports.PermissionFlag = PermissionFlag;\nvar TextRenderingMode = {\n FILL: 0,\n STROKE: 1,\n FILL_STROKE: 2,\n INVISIBLE: 3,\n FILL_ADD_TO_PATH: 4,\n STROKE_ADD_TO_PATH: 5,\n FILL_STROKE_ADD_TO_PATH: 6,\n ADD_TO_PATH: 7,\n FILL_STROKE_MASK: 3,\n ADD_TO_PATH_FLAG: 4\n};\nexports.TextRenderingMode = TextRenderingMode;\nvar ImageKind = {\n GRAYSCALE_1BPP: 1,\n RGB_24BPP: 2,\n RGBA_32BPP: 3\n};\nexports.ImageKind = ImageKind;\nvar AnnotationType = {\n TEXT: 1,\n LINK: 2,\n FREETEXT: 3,\n LINE: 4,\n SQUARE: 5,\n CIRCLE: 6,\n POLYGON: 7,\n POLYLINE: 8,\n HIGHLIGHT: 9,\n UNDERLINE: 10,\n SQUIGGLY: 11,\n STRIKEOUT: 12,\n STAMP: 13,\n CARET: 14,\n INK: 15,\n POPUP: 16,\n FILEATTACHMENT: 17,\n SOUND: 18,\n MOVIE: 19,\n WIDGET: 20,\n SCREEN: 21,\n PRINTERMARK: 22,\n TRAPNET: 23,\n WATERMARK: 24,\n THREED: 25,\n REDACT: 26\n};\nexports.AnnotationType = AnnotationType;\nvar AnnotationStateModelType = {\n MARKED: \"Marked\",\n REVIEW: \"Review\"\n};\nexports.AnnotationStateModelType = AnnotationStateModelType;\nvar AnnotationMarkedState = {\n MARKED: \"Marked\",\n UNMARKED: \"Unmarked\"\n};\nexports.AnnotationMarkedState = AnnotationMarkedState;\nvar AnnotationReviewState = {\n ACCEPTED: \"Accepted\",\n REJECTED: \"Rejected\",\n CANCELLED: \"Cancelled\",\n COMPLETED: \"Completed\",\n NONE: \"None\"\n};\nexports.AnnotationReviewState = AnnotationReviewState;\nvar AnnotationReplyType = {\n GROUP: \"Group\",\n REPLY: \"R\"\n};\nexports.AnnotationReplyType = AnnotationReplyType;\nvar AnnotationFlag = {\n INVISIBLE: 0x01,\n HIDDEN: 0x02,\n PRINT: 0x04,\n NOZOOM: 0x08,\n NOROTATE: 0x10,\n NOVIEW: 0x20,\n READONLY: 0x40,\n LOCKED: 0x80,\n TOGGLENOVIEW: 0x100,\n LOCKEDCONTENTS: 0x200\n};\nexports.AnnotationFlag = AnnotationFlag;\nvar AnnotationFieldFlag = {\n READONLY: 0x0000001,\n REQUIRED: 0x0000002,\n NOEXPORT: 0x0000004,\n MULTILINE: 0x0001000,\n PASSWORD: 0x0002000,\n NOTOGGLETOOFF: 0x0004000,\n RADIO: 0x0008000,\n PUSHBUTTON: 0x0010000,\n COMBO: 0x0020000,\n EDIT: 0x0040000,\n SORT: 0x0080000,\n FILESELECT: 0x0100000,\n MULTISELECT: 0x0200000,\n DONOTSPELLCHECK: 0x0400000,\n DONOTSCROLL: 0x0800000,\n COMB: 0x1000000,\n RICHTEXT: 0x2000000,\n RADIOSINUNISON: 0x2000000,\n COMMITONSELCHANGE: 0x4000000\n};\nexports.AnnotationFieldFlag = AnnotationFieldFlag;\nvar AnnotationBorderStyleType = {\n SOLID: 1,\n DASHED: 2,\n BEVELED: 3,\n INSET: 4,\n UNDERLINE: 5\n};\nexports.AnnotationBorderStyleType = AnnotationBorderStyleType;\nvar AnnotationActionEventType = {\n E: \"Mouse Enter\",\n X: \"Mouse Exit\",\n D: \"Mouse Down\",\n U: \"Mouse Up\",\n Fo: \"Focus\",\n Bl: \"Blur\",\n PO: \"PageOpen\",\n PC: \"PageClose\",\n PV: \"PageVisible\",\n PI: \"PageInvisible\",\n K: \"Keystroke\",\n F: \"Format\",\n V: \"Validate\",\n C: \"Calculate\"\n};\nexports.AnnotationActionEventType = AnnotationActionEventType;\nvar DocumentActionEventType = {\n WC: \"WillClose\",\n WS: \"WillSave\",\n DS: \"DidSave\",\n WP: \"WillPrint\",\n DP: \"DidPrint\"\n};\nexports.DocumentActionEventType = DocumentActionEventType;\nvar PageActionEventType = {\n O: \"PageOpen\",\n C: \"PageClose\"\n};\nexports.PageActionEventType = PageActionEventType;\nvar StreamType = {\n UNKNOWN: \"UNKNOWN\",\n FLATE: \"FLATE\",\n LZW: \"LZW\",\n DCT: \"DCT\",\n JPX: \"JPX\",\n JBIG: \"JBIG\",\n A85: \"A85\",\n AHX: \"AHX\",\n CCF: \"CCF\",\n RLX: \"RLX\"\n};\nexports.StreamType = StreamType;\nvar FontType = {\n UNKNOWN: \"UNKNOWN\",\n TYPE1: \"TYPE1\",\n TYPE1STANDARD: \"TYPE1STANDARD\",\n TYPE1C: \"TYPE1C\",\n CIDFONTTYPE0: \"CIDFONTTYPE0\",\n CIDFONTTYPE0C: \"CIDFONTTYPE0C\",\n TRUETYPE: \"TRUETYPE\",\n CIDFONTTYPE2: \"CIDFONTTYPE2\",\n TYPE3: \"TYPE3\",\n OPENTYPE: \"OPENTYPE\",\n TYPE0: \"TYPE0\",\n MMTYPE1: \"MMTYPE1\"\n};\nexports.FontType = FontType;\nvar VerbosityLevel = {\n ERRORS: 0,\n WARNINGS: 1,\n INFOS: 5\n};\nexports.VerbosityLevel = VerbosityLevel;\nvar CMapCompressionType = {\n NONE: 0,\n BINARY: 1,\n STREAM: 2\n};\nexports.CMapCompressionType = CMapCompressionType;\nvar OPS = {\n dependency: 1,\n setLineWidth: 2,\n setLineCap: 3,\n setLineJoin: 4,\n setMiterLimit: 5,\n setDash: 6,\n setRenderingIntent: 7,\n setFlatness: 8,\n setGState: 9,\n save: 10,\n restore: 11,\n transform: 12,\n moveTo: 13,\n lineTo: 14,\n curveTo: 15,\n curveTo2: 16,\n curveTo3: 17,\n closePath: 18,\n rectangle: 19,\n stroke: 20,\n closeStroke: 21,\n fill: 22,\n eoFill: 23,\n fillStroke: 24,\n eoFillStroke: 25,\n closeFillStroke: 26,\n closeEOFillStroke: 27,\n endPath: 28,\n clip: 29,\n eoClip: 30,\n beginText: 31,\n endText: 32,\n setCharSpacing: 33,\n setWordSpacing: 34,\n setHScale: 35,\n setLeading: 36,\n setFont: 37,\n setTextRenderingMode: 38,\n setTextRise: 39,\n moveText: 40,\n setLeadingMoveText: 41,\n setTextMatrix: 42,\n nextLine: 43,\n showText: 44,\n showSpacedText: 45,\n nextLineShowText: 46,\n nextLineSetSpacingShowText: 47,\n setCharWidth: 48,\n setCharWidthAndBounds: 49,\n setStrokeColorSpace: 50,\n setFillColorSpace: 51,\n setStrokeColor: 52,\n setStrokeColorN: 53,\n setFillColor: 54,\n setFillColorN: 55,\n setStrokeGray: 56,\n setFillGray: 57,\n setStrokeRGBColor: 58,\n setFillRGBColor: 59,\n setStrokeCMYKColor: 60,\n setFillCMYKColor: 61,\n shadingFill: 62,\n beginInlineImage: 63,\n beginImageData: 64,\n endInlineImage: 65,\n paintXObject: 66,\n markPoint: 67,\n markPointProps: 68,\n beginMarkedContent: 69,\n beginMarkedContentProps: 70,\n endMarkedContent: 71,\n beginCompat: 72,\n endCompat: 73,\n paintFormXObjectBegin: 74,\n paintFormXObjectEnd: 75,\n beginGroup: 76,\n endGroup: 77,\n beginAnnotations: 78,\n endAnnotations: 79,\n beginAnnotation: 80,\n endAnnotation: 81,\n paintJpegXObject: 82,\n paintImageMaskXObject: 83,\n paintImageMaskXObjectGroup: 84,\n paintImageXObject: 85,\n paintInlineImageXObject: 86,\n paintInlineImageXObjectGroup: 87,\n paintImageXObjectRepeat: 88,\n paintImageMaskXObjectRepeat: 89,\n paintSolidColorImageMask: 90,\n constructPath: 91\n};\nexports.OPS = OPS;\nvar UNSUPPORTED_FEATURES = {\n unknown: \"unknown\",\n forms: \"forms\",\n javaScript: \"javaScript\",\n signatures: \"signatures\",\n smask: \"smask\",\n shadingPattern: \"shadingPattern\",\n font: \"font\",\n errorTilingPattern: \"errorTilingPattern\",\n errorExtGState: \"errorExtGState\",\n errorXObject: \"errorXObject\",\n errorFontLoadType3: \"errorFontLoadType3\",\n errorFontState: \"errorFontState\",\n errorFontMissing: \"errorFontMissing\",\n errorFontTranslate: \"errorFontTranslate\",\n errorColorSpace: \"errorColorSpace\",\n errorOperatorList: \"errorOperatorList\",\n errorFontToUnicode: \"errorFontToUnicode\",\n errorFontLoadNative: \"errorFontLoadNative\",\n errorFontBuildPath: \"errorFontBuildPath\",\n errorFontGetPath: \"errorFontGetPath\",\n errorMarkedContent: \"errorMarkedContent\",\n errorContentSubStream: \"errorContentSubStream\"\n};\nexports.UNSUPPORTED_FEATURES = UNSUPPORTED_FEATURES;\nvar PasswordResponses = {\n NEED_PASSWORD: 1,\n INCORRECT_PASSWORD: 2\n};\nexports.PasswordResponses = PasswordResponses;\nvar verbosity = VerbosityLevel.WARNINGS;\n\nfunction setVerbosityLevel(level) {\n if (Number.isInteger(level)) {\n verbosity = level;\n }\n}\n\nfunction getVerbosityLevel() {\n return verbosity;\n}\n\nfunction info(msg) {\n if (verbosity >= VerbosityLevel.INFOS) {\n console.log(\"Info: \".concat(msg));\n }\n}\n\nfunction warn(msg) {\n if (verbosity >= VerbosityLevel.WARNINGS) {\n console.log(\"Warning: \".concat(msg));\n }\n}\n\nfunction unreachable(msg) {\n throw new Error(msg);\n}\n\nfunction assert(cond, msg) {\n if (!cond) {\n unreachable(msg);\n }\n}\n\nfunction isSameOrigin(baseUrl, otherUrl) {\n var base;\n\n try {\n base = new URL(baseUrl);\n\n if (!base.origin || base.origin === \"null\") {\n return false;\n }\n } catch (e) {\n return false;\n }\n\n var other = new URL(otherUrl, base);\n return base.origin === other.origin;\n}\n\nfunction _isValidProtocol(url) {\n if (!url) {\n return false;\n }\n\n switch (url.protocol) {\n case \"http:\":\n case \"https:\":\n case \"ftp:\":\n case \"mailto:\":\n case \"tel:\":\n return true;\n\n default:\n return false;\n }\n}\n\nfunction createValidAbsoluteUrl(url) {\n var baseUrl = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n\n if (!url) {\n return null;\n }\n\n try {\n if (options && typeof url === \"string\") {\n if (options.addDefaultProtocol && url.startsWith(\"www.\")) {\n var dots = url.match(/\\./g);\n\n if (dots && dots.length >= 2) {\n url = \"http://\".concat(url);\n }\n }\n\n if (options.tryConvertEncoding) {\n try {\n url = stringToUTF8String(url);\n } catch (ex) {}\n }\n }\n\n var absoluteUrl = baseUrl ? new URL(url, baseUrl) : new URL(url);\n\n if (_isValidProtocol(absoluteUrl)) {\n return absoluteUrl;\n }\n } catch (ex) {}\n\n return null;\n}\n\nfunction shadow(obj, prop, value) {\n Object.defineProperty(obj, prop, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: false\n });\n return value;\n}\n\nvar BaseException = function BaseExceptionClosure() {\n function BaseException(message, name) {\n if (this.constructor === BaseException) {\n unreachable(\"Cannot initialize BaseException.\");\n }\n\n this.message = message;\n this.name = name;\n }\n\n BaseException.prototype = new Error();\n BaseException.constructor = BaseException;\n return BaseException;\n}();\n\nexports.BaseException = BaseException;\n\nvar PasswordException = /*#__PURE__*/function (_BaseException) {\n _inherits(PasswordException, _BaseException);\n\n var _super = _createSuper(PasswordException);\n\n function PasswordException(msg, code) {\n var _this;\n\n _classCallCheck(this, PasswordException);\n\n _this = _super.call(this, msg, \"PasswordException\");\n _this.code = code;\n return _this;\n }\n\n return _createClass(PasswordException);\n}(BaseException);\n\nexports.PasswordException = PasswordException;\n\nvar UnknownErrorException = /*#__PURE__*/function (_BaseException2) {\n _inherits(UnknownErrorException, _BaseException2);\n\n var _super2 = _createSuper(UnknownErrorException);\n\n function UnknownErrorException(msg, details) {\n var _this2;\n\n _classCallCheck(this, UnknownErrorException);\n\n _this2 = _super2.call(this, msg, \"UnknownErrorException\");\n _this2.details = details;\n return _this2;\n }\n\n return _createClass(UnknownErrorException);\n}(BaseException);\n\nexports.UnknownErrorException = UnknownErrorException;\n\nvar InvalidPDFException = /*#__PURE__*/function (_BaseException3) {\n _inherits(InvalidPDFException, _BaseException3);\n\n var _super3 = _createSuper(InvalidPDFException);\n\n function InvalidPDFException(msg) {\n _classCallCheck(this, InvalidPDFException);\n\n return _super3.call(this, msg, \"InvalidPDFException\");\n }\n\n return _createClass(InvalidPDFException);\n}(BaseException);\n\nexports.InvalidPDFException = InvalidPDFException;\n\nvar MissingPDFException = /*#__PURE__*/function (_BaseException4) {\n _inherits(MissingPDFException, _BaseException4);\n\n var _super4 = _createSuper(MissingPDFException);\n\n function MissingPDFException(msg) {\n _classCallCheck(this, MissingPDFException);\n\n return _super4.call(this, msg, \"MissingPDFException\");\n }\n\n return _createClass(MissingPDFException);\n}(BaseException);\n\nexports.MissingPDFException = MissingPDFException;\n\nvar UnexpectedResponseException = /*#__PURE__*/function (_BaseException5) {\n _inherits(UnexpectedResponseException, _BaseException5);\n\n var _super5 = _createSuper(UnexpectedResponseException);\n\n function UnexpectedResponseException(msg, status) {\n var _this3;\n\n _classCallCheck(this, UnexpectedResponseException);\n\n _this3 = _super5.call(this, msg, \"UnexpectedResponseException\");\n _this3.status = status;\n return _this3;\n }\n\n return _createClass(UnexpectedResponseException);\n}(BaseException);\n\nexports.UnexpectedResponseException = UnexpectedResponseException;\n\nvar FormatError = /*#__PURE__*/function (_BaseException6) {\n _inherits(FormatError, _BaseException6);\n\n var _super6 = _createSuper(FormatError);\n\n function FormatError(msg) {\n _classCallCheck(this, FormatError);\n\n return _super6.call(this, msg, \"FormatError\");\n }\n\n return _createClass(FormatError);\n}(BaseException);\n\nexports.FormatError = FormatError;\n\nvar AbortException = /*#__PURE__*/function (_BaseException7) {\n _inherits(AbortException, _BaseException7);\n\n var _super7 = _createSuper(AbortException);\n\n function AbortException(msg) {\n _classCallCheck(this, AbortException);\n\n return _super7.call(this, msg, \"AbortException\");\n }\n\n return _createClass(AbortException);\n}(BaseException);\n\nexports.AbortException = AbortException;\n\nfunction bytesToString(bytes) {\n if (_typeof(bytes) !== \"object\" || bytes === null || bytes.length === undefined) {\n unreachable(\"Invalid argument for bytesToString\");\n }\n\n var length = bytes.length;\n var MAX_ARGUMENT_COUNT = 8192;\n\n if (length < MAX_ARGUMENT_COUNT) {\n return String.fromCharCode.apply(null, bytes);\n }\n\n var strBuf = [];\n\n for (var i = 0; i < length; i += MAX_ARGUMENT_COUNT) {\n var chunkEnd = Math.min(i + MAX_ARGUMENT_COUNT, length);\n var chunk = bytes.subarray(i, chunkEnd);\n strBuf.push(String.fromCharCode.apply(null, chunk));\n }\n\n return strBuf.join(\"\");\n}\n\nfunction stringToBytes(str) {\n if (typeof str !== \"string\") {\n unreachable(\"Invalid argument for stringToBytes\");\n }\n\n var length = str.length;\n var bytes = new Uint8Array(length);\n\n for (var i = 0; i < length; ++i) {\n bytes[i] = str.charCodeAt(i) & 0xff;\n }\n\n return bytes;\n}\n\nfunction arrayByteLength(arr) {\n if (arr.length !== undefined) {\n return arr.length;\n }\n\n if (arr.byteLength !== undefined) {\n return arr.byteLength;\n }\n\n unreachable(\"Invalid argument for arrayByteLength\");\n}\n\nfunction arraysToBytes(arr) {\n var length = arr.length;\n\n if (length === 1 && arr[0] instanceof Uint8Array) {\n return arr[0];\n }\n\n var resultLength = 0;\n\n for (var i = 0; i < length; i++) {\n resultLength += arrayByteLength(arr[i]);\n }\n\n var pos = 0;\n var data = new Uint8Array(resultLength);\n\n for (var _i = 0; _i < length; _i++) {\n var item = arr[_i];\n\n if (!(item instanceof Uint8Array)) {\n if (typeof item === \"string\") {\n item = stringToBytes(item);\n } else {\n item = new Uint8Array(item);\n }\n }\n\n var itemLength = item.byteLength;\n data.set(item, pos);\n pos += itemLength;\n }\n\n return data;\n}\n\nfunction string32(value) {\n return String.fromCharCode(value >> 24 & 0xff, value >> 16 & 0xff, value >> 8 & 0xff, value & 0xff);\n}\n\nfunction objectSize(obj) {\n return Object.keys(obj).length;\n}\n\nfunction objectFromMap(map) {\n var obj = Object.create(null);\n\n var _iterator = _createForOfIteratorHelper(map),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var _step$value = _slicedToArray(_step.value, 2),\n key = _step$value[0],\n value = _step$value[1];\n\n obj[key] = value;\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n return obj;\n}\n\nfunction isLittleEndian() {\n var buffer8 = new Uint8Array(4);\n buffer8[0] = 1;\n var view32 = new Uint32Array(buffer8.buffer, 0, 1);\n return view32[0] === 1;\n}\n\nvar IsLittleEndianCached = {\n get value() {\n return shadow(this, \"value\", isLittleEndian());\n }\n\n};\nexports.IsLittleEndianCached = IsLittleEndianCached;\n\nfunction isEvalSupported() {\n try {\n new Function(\"\");\n return true;\n } catch (e) {\n return false;\n }\n}\n\nvar IsEvalSupportedCached = {\n get value() {\n return shadow(this, \"value\", isEvalSupported());\n }\n\n};\nexports.IsEvalSupportedCached = IsEvalSupportedCached;\n\nvar hexNumbers = _toConsumableArray(Array(256).keys()).map(function (n) {\n return n.toString(16).padStart(2, \"0\");\n});\n\nvar Util = /*#__PURE__*/function () {\n function Util() {\n _classCallCheck(this, Util);\n }\n\n _createClass(Util, null, [{\n key: \"makeHexColor\",\n value: function makeHexColor(r, g, b) {\n return \"#\".concat(hexNumbers[r]).concat(hexNumbers[g]).concat(hexNumbers[b]);\n }\n }, {\n key: \"transform\",\n value: function transform(m1, m2) {\n 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]];\n }\n }, {\n key: \"applyTransform\",\n value: function applyTransform(p, m) {\n var xt = p[0] * m[0] + p[1] * m[2] + m[4];\n var yt = p[0] * m[1] + p[1] * m[3] + m[5];\n return [xt, yt];\n }\n }, {\n key: \"applyInverseTransform\",\n value: function applyInverseTransform(p, m) {\n var d = m[0] * m[3] - m[1] * m[2];\n var xt = (p[0] * m[3] - p[1] * m[2] + m[2] * m[5] - m[4] * m[3]) / d;\n var yt = (-p[0] * m[1] + p[1] * m[0] + m[4] * m[1] - m[5] * m[0]) / d;\n return [xt, yt];\n }\n }, {\n key: \"getAxialAlignedBoundingBox\",\n value: function getAxialAlignedBoundingBox(r, m) {\n var p1 = Util.applyTransform(r, m);\n var p2 = Util.applyTransform(r.slice(2, 4), m);\n var p3 = Util.applyTransform([r[0], r[3]], m);\n var p4 = Util.applyTransform([r[2], r[1]], m);\n 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])];\n }\n }, {\n key: \"inverseTransform\",\n value: function inverseTransform(m) {\n var d = m[0] * m[3] - m[1] * m[2];\n 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];\n }\n }, {\n key: \"apply3dTransform\",\n value: function apply3dTransform(m, v) {\n 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]];\n }\n }, {\n key: \"singularValueDecompose2dScale\",\n value: function singularValueDecompose2dScale(m) {\n var transpose = [m[0], m[2], m[1], m[3]];\n var a = m[0] * transpose[0] + m[1] * transpose[2];\n var b = m[0] * transpose[1] + m[1] * transpose[3];\n var c = m[2] * transpose[0] + m[3] * transpose[2];\n var d = m[2] * transpose[1] + m[3] * transpose[3];\n var first = (a + d) / 2;\n var second = Math.sqrt(Math.pow(a + d, 2) - 4 * (a * d - c * b)) / 2;\n var sx = first + second || 1;\n var sy = first - second || 1;\n return [Math.sqrt(sx), Math.sqrt(sy)];\n }\n }, {\n key: \"normalizeRect\",\n value: function normalizeRect(rect) {\n var r = rect.slice(0);\n\n if (rect[0] > rect[2]) {\n r[0] = rect[2];\n r[2] = rect[0];\n }\n\n if (rect[1] > rect[3]) {\n r[1] = rect[3];\n r[3] = rect[1];\n }\n\n return r;\n }\n }, {\n key: \"intersect\",\n value: function intersect(rect1, rect2) {\n function compare(a, b) {\n return a - b;\n }\n\n var orderedX = [rect1[0], rect1[2], rect2[0], rect2[2]].sort(compare);\n var orderedY = [rect1[1], rect1[3], rect2[1], rect2[3]].sort(compare);\n var result = [];\n rect1 = Util.normalizeRect(rect1);\n rect2 = Util.normalizeRect(rect2);\n\n if (orderedX[0] === rect1[0] && orderedX[1] === rect2[0] || orderedX[0] === rect2[0] && orderedX[1] === rect1[0]) {\n result[0] = orderedX[1];\n result[2] = orderedX[2];\n } else {\n return null;\n }\n\n if (orderedY[0] === rect1[1] && orderedY[1] === rect2[1] || orderedY[0] === rect2[1] && orderedY[1] === rect1[1]) {\n result[1] = orderedY[1];\n result[3] = orderedY[2];\n } else {\n return null;\n }\n\n return result;\n }\n }, {\n key: \"bezierBoundingBox\",\n value: function bezierBoundingBox(x0, y0, x1, y1, x2, y2, x3, y3) {\n var tvalues = [],\n bounds = [[], []];\n var a, b, c, t, t1, t2, b2ac, sqrtb2ac;\n\n for (var i = 0; i < 2; ++i) {\n if (i === 0) {\n b = 6 * x0 - 12 * x1 + 6 * x2;\n a = -3 * x0 + 9 * x1 - 9 * x2 + 3 * x3;\n c = 3 * x1 - 3 * x0;\n } else {\n b = 6 * y0 - 12 * y1 + 6 * y2;\n a = -3 * y0 + 9 * y1 - 9 * y2 + 3 * y3;\n c = 3 * y1 - 3 * y0;\n }\n\n if (Math.abs(a) < 1e-12) {\n if (Math.abs(b) < 1e-12) {\n continue;\n }\n\n t = -c / b;\n\n if (0 < t && t < 1) {\n tvalues.push(t);\n }\n\n continue;\n }\n\n b2ac = b * b - 4 * c * a;\n sqrtb2ac = Math.sqrt(b2ac);\n\n if (b2ac < 0) {\n continue;\n }\n\n t1 = (-b + sqrtb2ac) / (2 * a);\n\n if (0 < t1 && t1 < 1) {\n tvalues.push(t1);\n }\n\n t2 = (-b - sqrtb2ac) / (2 * a);\n\n if (0 < t2 && t2 < 1) {\n tvalues.push(t2);\n }\n }\n\n var j = tvalues.length,\n mt;\n var jlen = j;\n\n while (j--) {\n t = tvalues[j];\n mt = 1 - t;\n bounds[0][j] = mt * mt * mt * x0 + 3 * mt * mt * t * x1 + 3 * mt * t * t * x2 + t * t * t * x3;\n bounds[1][j] = mt * mt * mt * y0 + 3 * mt * mt * t * y1 + 3 * mt * t * t * y2 + t * t * t * y3;\n }\n\n bounds[0][jlen] = x0;\n bounds[1][jlen] = y0;\n bounds[0][jlen + 1] = x3;\n bounds[1][jlen + 1] = y3;\n bounds[0].length = bounds[1].length = jlen + 2;\n return [Math.min.apply(Math, _toConsumableArray(bounds[0])), Math.min.apply(Math, _toConsumableArray(bounds[1])), Math.max.apply(Math, _toConsumableArray(bounds[0])), Math.max.apply(Math, _toConsumableArray(bounds[1]))];\n }\n }]);\n\n return Util;\n}();\n\nexports.Util = Util;\nvar 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];\n\nfunction stringToPDFString(str) {\n if (str[0] >= \"\\xEF\") {\n var encoding;\n\n if (str[0] === \"\\xFE\" && str[1] === \"\\xFF\") {\n encoding = \"utf-16be\";\n } else if (str[0] === \"\\xFF\" && str[1] === \"\\xFE\") {\n encoding = \"utf-16le\";\n } else if (str[0] === \"\\xEF\" && str[1] === \"\\xBB\" && str[2] === \"\\xBF\") {\n encoding = \"utf-8\";\n }\n\n if (encoding) {\n try {\n var decoder = new TextDecoder(encoding, {\n fatal: true\n });\n var buffer = stringToBytes(str);\n return decoder.decode(buffer);\n } catch (ex) {\n warn(\"stringToPDFString: \\\"\".concat(ex, \"\\\".\"));\n }\n }\n }\n\n var strBuf = [];\n\n for (var i = 0, ii = str.length; i < ii; i++) {\n var code = PDFStringTranslateTable[str.charCodeAt(i)];\n strBuf.push(code ? String.fromCharCode(code) : str.charAt(i));\n }\n\n return strBuf.join(\"\");\n}\n\nfunction escapeString(str) {\n return str.replace(/([()\\\\\\n\\r])/g, function (match) {\n if (match === \"\\n\") {\n return \"\\\\n\";\n } else if (match === \"\\r\") {\n return \"\\\\r\";\n }\n\n return \"\\\\\".concat(match);\n });\n}\n\nfunction isAscii(str) {\n return /^[\\x00-\\x7F]*$/.test(str);\n}\n\nfunction stringToUTF16BEString(str) {\n var buf = [\"\\xFE\\xFF\"];\n\n for (var i = 0, ii = str.length; i < ii; i++) {\n var _char = str.charCodeAt(i);\n\n buf.push(String.fromCharCode(_char >> 8 & 0xff), String.fromCharCode(_char & 0xff));\n }\n\n return buf.join(\"\");\n}\n\nfunction stringToUTF8String(str) {\n return decodeURIComponent(escape(str));\n}\n\nfunction utf8StringToString(str) {\n return unescape(encodeURIComponent(str));\n}\n\nfunction isArrayBuffer(v) {\n return _typeof(v) === \"object\" && v !== null && v.byteLength !== undefined;\n}\n\nfunction isArrayEqual(arr1, arr2) {\n if (arr1.length !== arr2.length) {\n return false;\n }\n\n for (var i = 0, ii = arr1.length; i < ii; i++) {\n if (arr1[i] !== arr2[i]) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction getModificationDate() {\n var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Date();\n 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\")];\n return buffer.join(\"\");\n}\n\nfunction createPromiseCapability() {\n var capability = Object.create(null);\n var isSettled = false;\n Object.defineProperty(capability, \"settled\", {\n get: function get() {\n return isSettled;\n }\n });\n capability.promise = new Promise(function (resolve, reject) {\n capability.resolve = function (data) {\n isSettled = true;\n resolve(data);\n };\n\n capability.reject = function (reason) {\n isSettled = true;\n reject(reason);\n };\n });\n return capability;\n}\n\n/***/ }),\n/* 2 */\n/***/ ((__unused_webpack_module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\n\"use strict\";\n\n\nvar _is_node = __w_pdfjs_require__(3);\n\nif (!globalThis._pdfjsCompatibilityChecked) {\n globalThis._pdfjsCompatibilityChecked = true;\n\n (function checkNodeBtoa() {\n if (globalThis.btoa || !_is_node.isNodeJS) {\n return;\n }\n\n globalThis.btoa = function (chars) {\n return Buffer.from(chars, \"binary\").toString(\"base64\");\n };\n })();\n\n (function checkNodeAtob() {\n if (globalThis.atob || !_is_node.isNodeJS) {\n return;\n }\n\n globalThis.atob = function (input) {\n return Buffer.from(input, \"base64\").toString(\"binary\");\n };\n })();\n\n (function checkDOMMatrix() {\n if (globalThis.DOMMatrix || !_is_node.isNodeJS) {\n return;\n }\n\n globalThis.DOMMatrix = __w_pdfjs_require__(4);\n })();\n\n (function checkPromise() {\n if (globalThis.Promise.allSettled) {\n return;\n }\n\n globalThis.Promise = __w_pdfjs_require__(5);\n })();\n\n (function checkReadableStream() {\n if (globalThis.ReadableStream || !_is_node.isNodeJS) {\n return;\n }\n\n globalThis.ReadableStream = (__webpack_require__(/*! web-streams-polyfill/dist/ponyfill.js */ \"./node_modules/web-streams-polyfill/dist/ponyfill.js\").ReadableStream);\n })();\n\n (function checkStructuredClone() {\n if (globalThis.structuredClone) {\n return;\n }\n\n __w_pdfjs_require__(129);\n })();\n}\n\n/***/ }),\n/* 3 */\n/***/ ((__unused_webpack_module, exports) => {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.isNodeJS = void 0;\n\nfunction _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); }\n\nvar isNodeJS = (typeof process === \"undefined\" ? \"undefined\" : _typeof(process)) === \"object\" && process + \"\" === \"[object process]\" && !process.versions.nw && !(process.versions.electron && process.type && process.type !== \"browser\");\nexports.isNodeJS = isNodeJS;\n\n/***/ }),\n/* 4 */\n/***/ ((module, exports, __w_pdfjs_require__) => {\n\n\"use strict\";\nvar __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;\n\nfunction _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); }\n\n(function (global, factory) {\n ( false ? 0 : _typeof(exports)) === 'object' && \"object\" !== 'undefined' ? module.exports = factory() : true ? !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __w_pdfjs_require__, exports, module)) :\n\t\t__WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : (0);\n})(void 0, function () {\n 'use strict';\n\n function fromArray(array) {\n var m = new CSSMatrix();\n var a = Array.from(array);\n\n if (!a.every(function (n) {\n return !Number.isNaN(n);\n })) {\n throw TypeError(\"CSSMatrix: \\\"\" + array + \"\\\" must only have numbers.\");\n }\n\n if (a.length === 16) {\n var m11 = a[0];\n var m12 = a[1];\n var m13 = a[2];\n var m14 = a[3];\n var m21 = a[4];\n var m22 = a[5];\n var m23 = a[6];\n var m24 = a[7];\n var m31 = a[8];\n var m32 = a[9];\n var m33 = a[10];\n var m34 = a[11];\n var m41 = a[12];\n var m42 = a[13];\n var m43 = a[14];\n var m44 = a[15];\n m.m11 = m11;\n m.a = m11;\n m.m21 = m21;\n m.c = m21;\n m.m31 = m31;\n m.m41 = m41;\n m.e = m41;\n m.m12 = m12;\n m.b = m12;\n m.m22 = m22;\n m.d = m22;\n m.m32 = m32;\n m.m42 = m42;\n m.f = m42;\n m.m13 = m13;\n m.m23 = m23;\n m.m33 = m33;\n m.m43 = m43;\n m.m14 = m14;\n m.m24 = m24;\n m.m34 = m34;\n m.m44 = m44;\n } else if (a.length === 6) {\n var M11 = a[0];\n var M12 = a[1];\n var M21 = a[2];\n var M22 = a[3];\n var M41 = a[4];\n var M42 = a[5];\n m.m11 = M11;\n m.a = M11;\n m.m12 = M12;\n m.b = M12;\n m.m21 = M21;\n m.c = M21;\n m.m22 = M22;\n m.d = M22;\n m.m41 = M41;\n m.e = M41;\n m.m42 = M42;\n m.f = M42;\n } else {\n throw new TypeError('CSSMatrix: expecting an Array of 6/16 values.');\n }\n\n return m;\n }\n\n function fromMatrix(m) {\n var keys = Object.keys(new CSSMatrix());\n\n if (_typeof(m) === 'object' && keys.every(function (k) {\n return k in m;\n })) {\n return fromArray([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]);\n }\n\n throw TypeError(\"CSSMatrix: \\\"\" + m + \"\\\" is not a DOMMatrix / CSSMatrix / JSON compatible object.\");\n }\n\n function fromString(source) {\n if (typeof source !== 'string') {\n throw TypeError(\"CSSMatrix: \\\"\" + source + \"\\\" is not a string.\");\n }\n\n var str = String(source).replace(/\\s/g, '');\n var m = new CSSMatrix();\n var invalidStringError = \"CSSMatrix: invalid transform string \\\"\" + source + \"\\\"\";\n str.split(')').filter(function (f) {\n return f;\n }).forEach(function (tf) {\n var ref = tf.split('(');\n var prop = ref[0];\n var value = ref[1];\n\n if (!value) {\n throw TypeError(invalidStringError);\n }\n\n var components = value.split(',').map(function (n) {\n return n.includes('rad') ? parseFloat(n) * (180 / Math.PI) : parseFloat(n);\n });\n var x = components[0];\n var y = components[1];\n var z = components[2];\n var a = components[3];\n var xyz = [x, y, z];\n var xyza = [x, y, z, a];\n\n if (prop === 'perspective' && x && [y, z].every(function (n) {\n return n === undefined;\n })) {\n m.m34 = -1 / x;\n } else if (prop.includes('matrix') && [6, 16].includes(components.length) && components.every(function (n) {\n return !Number.isNaN(+n);\n })) {\n var values = components.map(function (n) {\n return Math.abs(n) < 1e-6 ? 0 : n;\n });\n m = m.multiply(fromArray(values));\n } else if (prop === 'translate3d' && xyz.every(function (n) {\n return !Number.isNaN(+n);\n })) {\n m = m.translate(x, y, z);\n } else if (prop === 'translate' && x && z === undefined) {\n m = m.translate(x, y || 0, 0);\n } else if (prop === 'rotate3d' && xyza.every(function (n) {\n return !Number.isNaN(+n);\n }) && a) {\n m = m.rotateAxisAngle(x, y, z, a);\n } else if (prop === 'rotate' && x && [y, z].every(function (n) {\n return n === undefined;\n })) {\n m = m.rotate(0, 0, x);\n } else if (prop === 'scale3d' && xyz.every(function (n) {\n return !Number.isNaN(+n);\n }) && xyz.some(function (n) {\n return n !== 1;\n })) {\n m = m.scale(x, y, z);\n } else if (prop === 'scale' && !Number.isNaN(x) && x !== 1 && z === undefined) {\n var nosy = Number.isNaN(+y);\n var sy = nosy ? x : y;\n m = m.scale(x, sy, 1);\n } else if (prop === 'skew' && x && z === undefined) {\n m = m.skewX(x);\n m = y ? m.skewY(y) : m;\n } else if (/[XYZ]/.test(prop) && x && [y, z].every(function (n) {\n return n === undefined;\n }) && ['translate', 'rotate', 'scale', 'skew'].some(function (p) {\n return prop.includes(p);\n })) {\n if (['skewX', 'skewY'].includes(prop)) {\n m = m[prop](x);\n } else {\n var fn = prop.replace(/[XYZ]/, '');\n var axis = prop.replace(fn, '');\n var idx = ['X', 'Y', 'Z'].indexOf(axis);\n var axeValues = [idx === 0 ? x : 0, idx === 1 ? x : 0, idx === 2 ? x : 0];\n m = m[fn].apply(m, axeValues);\n }\n } else {\n throw TypeError(invalidStringError);\n }\n });\n return m;\n }\n\n function Translate(x, y, z) {\n var m = new CSSMatrix();\n m.m41 = x;\n m.e = x;\n m.m42 = y;\n m.f = y;\n m.m43 = z;\n return m;\n }\n\n function Rotate(rx, ry, rz) {\n var m = new CSSMatrix();\n var degToRad = Math.PI / 180;\n var radX = rx * degToRad;\n var radY = ry * degToRad;\n var radZ = rz * degToRad;\n var cosx = Math.cos(radX);\n var sinx = -Math.sin(radX);\n var cosy = Math.cos(radY);\n var siny = -Math.sin(radY);\n var cosz = Math.cos(radZ);\n var sinz = -Math.sin(radZ);\n var m11 = cosy * cosz;\n var m12 = -cosy * sinz;\n m.m11 = m11;\n m.a = m11;\n m.m12 = m12;\n m.b = m12;\n m.m13 = siny;\n var m21 = sinx * siny * cosz + cosx * sinz;\n m.m21 = m21;\n m.c = m21;\n var m22 = cosx * cosz - sinx * siny * sinz;\n m.m22 = m22;\n m.d = m22;\n m.m23 = -sinx * cosy;\n m.m31 = sinx * sinz - cosx * siny * cosz;\n m.m32 = sinx * cosz + cosx * siny * sinz;\n m.m33 = cosx * cosy;\n return m;\n }\n\n function RotateAxisAngle(x, y, z, alpha) {\n var m = new CSSMatrix();\n var angle = alpha * (Math.PI / 360);\n var sinA = Math.sin(angle);\n var cosA = Math.cos(angle);\n var sinA2 = sinA * sinA;\n var length = Math.sqrt(x * x + y * y + z * z);\n var X = x;\n var Y = y;\n var Z = z;\n\n if (length === 0) {\n X = 0;\n Y = 0;\n Z = 1;\n } else {\n X /= length;\n Y /= length;\n Z /= length;\n }\n\n var x2 = X * X;\n var y2 = Y * Y;\n var z2 = Z * Z;\n var m11 = 1 - 2 * (y2 + z2) * sinA2;\n m.m11 = m11;\n m.a = m11;\n var m12 = 2 * (X * Y * sinA2 + Z * sinA * cosA);\n m.m12 = m12;\n m.b = m12;\n m.m13 = 2 * (X * Z * sinA2 - Y * sinA * cosA);\n var m21 = 2 * (Y * X * sinA2 - Z * sinA * cosA);\n m.m21 = m21;\n m.c = m21;\n var m22 = 1 - 2 * (z2 + x2) * sinA2;\n m.m22 = m22;\n m.d = m22;\n m.m23 = 2 * (Y * Z * sinA2 + X * sinA * cosA);\n m.m31 = 2 * (Z * X * sinA2 + Y * sinA * cosA);\n m.m32 = 2 * (Z * Y * sinA2 - X * sinA * cosA);\n m.m33 = 1 - 2 * (x2 + y2) * sinA2;\n return m;\n }\n\n function Scale(x, y, z) {\n var m = new CSSMatrix();\n m.m11 = x;\n m.a = x;\n m.m22 = y;\n m.d = y;\n m.m33 = z;\n return m;\n }\n\n function SkewX(angle) {\n var m = new CSSMatrix();\n var radA = angle * Math.PI / 180;\n var t = Math.tan(radA);\n m.m21 = t;\n m.c = t;\n return m;\n }\n\n function SkewY(angle) {\n var m = new CSSMatrix();\n var radA = angle * Math.PI / 180;\n var t = Math.tan(radA);\n m.m12 = t;\n m.b = t;\n return m;\n }\n\n function Multiply(m1, m2) {\n var m11 = m2.m11 * m1.m11 + m2.m12 * m1.m21 + m2.m13 * m1.m31 + m2.m14 * m1.m41;\n var m12 = m2.m11 * m1.m12 + m2.m12 * m1.m22 + m2.m13 * m1.m32 + m2.m14 * m1.m42;\n var m13 = m2.m11 * m1.m13 + m2.m12 * m1.m23 + m2.m13 * m1.m33 + m2.m14 * m1.m43;\n var m14 = m2.m11 * m1.m14 + m2.m12 * m1.m24 + m2.m13 * m1.m34 + m2.m14 * m1.m44;\n var m21 = m2.m21 * m1.m11 + m2.m22 * m1.m21 + m2.m23 * m1.m31 + m2.m24 * m1.m41;\n var m22 = m2.m21 * m1.m12 + m2.m22 * m1.m22 + m2.m23 * m1.m32 + m2.m24 * m1.m42;\n var m23 = m2.m21 * m1.m13 + m2.m22 * m1.m23 + m2.m23 * m1.m33 + m2.m24 * m1.m43;\n var m24 = m2.m21 * m1.m14 + m2.m22 * m1.m24 + m2.m23 * m1.m34 + m2.m24 * m1.m44;\n var m31 = m2.m31 * m1.m11 + m2.m32 * m1.m21 + m2.m33 * m1.m31 + m2.m34 * m1.m41;\n var m32 = m2.m31 * m1.m12 + m2.m32 * m1.m22 + m2.m33 * m1.m32 + m2.m34 * m1.m42;\n var m33 = m2.m31 * m1.m13 + m2.m32 * m1.m23 + m2.m33 * m1.m33 + m2.m34 * m1.m43;\n var m34 = m2.m31 * m1.m14 + m2.m32 * m1.m24 + m2.m33 * m1.m34 + m2.m34 * m1.m44;\n var m41 = m2.m41 * m1.m11 + m2.m42 * m1.m21 + m2.m43 * m1.m31 + m2.m44 * m1.m41;\n var m42 = m2.m41 * m1.m12 + m2.m42 * m1.m22 + m2.m43 * m1.m32 + m2.m44 * m1.m42;\n var m43 = m2.m41 * m1.m13 + m2.m42 * m1.m23 + m2.m43 * m1.m33 + m2.m44 * m1.m43;\n var m44 = m2.m41 * m1.m14 + m2.m42 * m1.m24 + m2.m43 * m1.m34 + m2.m44 * m1.m44;\n return fromArray([m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34, m41, m42, m43, m44]);\n }\n\n var CSSMatrix = function CSSMatrix() {\n var args = [],\n len = arguments.length;\n\n while (len--) {\n args[len] = arguments[len];\n }\n\n var m = this;\n m.a = 1;\n m.b = 0;\n m.c = 0;\n m.d = 1;\n m.e = 0;\n m.f = 0;\n m.m11 = 1;\n m.m12 = 0;\n m.m13 = 0;\n m.m14 = 0;\n m.m21 = 0;\n m.m22 = 1;\n m.m23 = 0;\n m.m24 = 0;\n m.m31 = 0;\n m.m32 = 0;\n m.m33 = 1;\n m.m34 = 0;\n m.m41 = 0;\n m.m42 = 0;\n m.m43 = 0;\n m.m44 = 1;\n\n if (args && args.length) {\n var ARGS = [16, 6].some(function (l) {\n return l === args.length;\n }) ? args : args[0];\n return m.setMatrixValue(ARGS);\n }\n\n return m;\n };\n\n var prototypeAccessors = {\n isIdentity: {\n configurable: true\n },\n is2D: {\n configurable: true\n }\n };\n\n prototypeAccessors.isIdentity.set = function (value) {\n this.isIdentity = value;\n };\n\n prototypeAccessors.isIdentity.get = function () {\n var m = this;\n 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;\n };\n\n prototypeAccessors.is2D.get = function () {\n var m = this;\n return m.m31 === 0 && m.m32 === 0 && m.m33 === 1 && m.m34 === 0 && m.m43 === 0 && m.m44 === 1;\n };\n\n prototypeAccessors.is2D.set = function (value) {\n this.is2D = value;\n };\n\n CSSMatrix.prototype.setMatrixValue = function setMatrixValue(source) {\n var m = this;\n\n if ([Array, Float64Array, Float32Array].some(function (a) {\n return source instanceof a;\n })) {\n return fromArray(source);\n }\n\n if (typeof source === 'string' && source.length && source !== 'none') {\n return fromString(source);\n }\n\n if (_typeof(source) === 'object') {\n return fromMatrix(source);\n }\n\n return m;\n };\n\n CSSMatrix.prototype.toArray = function toArray() {\n var m = this;\n var pow = Math.pow(10, 6);\n var result;\n\n if (m.is2D) {\n result = [m.a, m.b, m.c, m.d, m.e, m.f];\n } else {\n 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];\n }\n\n return result.map(function (n) {\n return Math.abs(n) < 1e-6 ? 0 : (n * pow >> 0) / pow;\n });\n };\n\n CSSMatrix.prototype.toString = function toString() {\n var m = this;\n var values = m.toArray();\n var type = m.is2D ? 'matrix' : 'matrix3d';\n return type + \"(\" + values + \")\";\n };\n\n CSSMatrix.prototype.toJSON = function toJSON() {\n var m = this;\n var is2D = m.is2D;\n var isIdentity = m.isIdentity;\n return Object.assign({}, m, {\n is2D: is2D,\n isIdentity: isIdentity\n });\n };\n\n CSSMatrix.prototype.multiply = function multiply(m2) {\n return Multiply(this, m2);\n };\n\n CSSMatrix.prototype.translate = function translate(x, y, z) {\n var X = x;\n var Y = y;\n var Z = z;\n\n if (Z === undefined) {\n Z = 0;\n }\n\n if (Y === undefined) {\n Y = 0;\n }\n\n return Multiply(this, Translate(X, Y, Z));\n };\n\n CSSMatrix.prototype.scale = function scale(x, y, z) {\n var X = x;\n var Y = y;\n var Z = z;\n\n if (Y === undefined) {\n Y = x;\n }\n\n if (Z === undefined) {\n Z = 1;\n }\n\n return Multiply(this, Scale(X, Y, Z));\n };\n\n CSSMatrix.prototype.rotate = function rotate(rx, ry, rz) {\n var RX = rx;\n var RY = ry;\n var RZ = rz;\n\n if (RY === undefined) {\n RY = 0;\n }\n\n if (RZ === undefined) {\n RZ = RX;\n RX = 0;\n }\n\n return Multiply(this, Rotate(RX, RY, RZ));\n };\n\n CSSMatrix.prototype.rotateAxisAngle = function rotateAxisAngle(x, y, z, angle) {\n if ([x, y, z, angle].some(function (n) {\n return Number.isNaN(n);\n })) {\n throw new TypeError('CSSMatrix: expecting 4 values');\n }\n\n return Multiply(this, RotateAxisAngle(x, y, z, angle));\n };\n\n CSSMatrix.prototype.skewX = function skewX(angle) {\n return Multiply(this, SkewX(angle));\n };\n\n CSSMatrix.prototype.skewY = function skewY(angle) {\n return Multiply(this, SkewY(angle));\n };\n\n CSSMatrix.prototype.transformPoint = function transformPoint(v) {\n var M = this;\n var m = Translate(v.x, v.y, v.z);\n m.m44 = v.w || 1;\n m = M.multiply(m);\n return {\n x: m.m41,\n y: m.m42,\n z: m.m43,\n w: m.m44\n };\n };\n\n CSSMatrix.prototype.transform = function transform(t) {\n var m = this;\n var x = m.m11 * t.x + m.m12 * t.y + m.m13 * t.z + m.m14 * t.w;\n var y = m.m21 * t.x + m.m22 * t.y + m.m23 * t.z + m.m24 * t.w;\n var z = m.m31 * t.x + m.m32 * t.y + m.m33 * t.z + m.m34 * t.w;\n var w = m.m41 * t.x + m.m42 * t.y + m.m43 * t.z + m.m44 * t.w;\n return {\n x: x / w,\n y: y / w,\n z: z / w,\n w: w\n };\n };\n\n Object.defineProperties(CSSMatrix.prototype, prototypeAccessors);\n Object.assign(CSSMatrix, {\n Translate: Translate,\n Rotate: Rotate,\n RotateAxisAngle: RotateAxisAngle,\n Scale: Scale,\n SkewX: SkewX,\n SkewY: SkewY,\n Multiply: Multiply,\n fromArray: fromArray,\n fromMatrix: fromMatrix,\n fromString: fromString\n });\n var version = \"0.0.24\";\n var Version = version;\n Object.assign(CSSMatrix, {\n Version: Version\n });\n return CSSMatrix;\n});\n\n/***/ }),\n/* 5 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\n__w_pdfjs_require__(6);\n__w_pdfjs_require__(91);\n__w_pdfjs_require__(97);\n__w_pdfjs_require__(99);\n__w_pdfjs_require__(123);\n__w_pdfjs_require__(124);\n__w_pdfjs_require__(125);\n__w_pdfjs_require__(126);\nvar path = __w_pdfjs_require__(128);\nmodule.exports = path.Promise;\n\n/***/ }),\n/* 6 */\n/***/ ((__unused_webpack_module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\n\"use strict\";\n\nvar $ = __w_pdfjs_require__(7);\nvar global = __w_pdfjs_require__(8);\nvar isPrototypeOf = __w_pdfjs_require__(27);\nvar getPrototypeOf = __w_pdfjs_require__(69);\nvar setPrototypeOf = __w_pdfjs_require__(71);\nvar copyConstructorProperties = __w_pdfjs_require__(57);\nvar create = __w_pdfjs_require__(73);\nvar createNonEnumerableProperty = __w_pdfjs_require__(46);\nvar createPropertyDescriptor = __w_pdfjs_require__(15);\nvar clearErrorStack = __w_pdfjs_require__(77);\nvar installErrorCause = __w_pdfjs_require__(78);\nvar iterate = __w_pdfjs_require__(79);\nvar normalizeStringArgument = __w_pdfjs_require__(88);\nvar wellKnownSymbol = __w_pdfjs_require__(36);\nvar ERROR_STACK_INSTALLABLE = __w_pdfjs_require__(90);\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar Error = global.Error;\nvar push = [].push;\nvar $AggregateError = function AggregateError(errors, message) {\n var options = arguments.length > 2 ? arguments[2] : undefined;\n var isInstance = isPrototypeOf(AggregateErrorPrototype, this);\n var that;\n if (setPrototypeOf) {\n that = setPrototypeOf(new Error(), isInstance ? getPrototypeOf(this) : AggregateErrorPrototype);\n } else {\n that = isInstance ? this : create(AggregateErrorPrototype);\n createNonEnumerableProperty(that, TO_STRING_TAG, 'Error');\n }\n if (message !== undefined)\n createNonEnumerableProperty(that, 'message', normalizeStringArgument(message));\n if (ERROR_STACK_INSTALLABLE)\n createNonEnumerableProperty(that, 'stack', clearErrorStack(that.stack, 1));\n installErrorCause(that, options);\n var errorsArray = [];\n iterate(errors, push, { that: errorsArray });\n createNonEnumerableProperty(that, 'errors', errorsArray);\n return that;\n};\nif (setPrototypeOf)\n setPrototypeOf($AggregateError, Error);\nelse\n copyConstructorProperties($AggregateError, Error, { name: true });\nvar AggregateErrorPrototype = $AggregateError.prototype = create(Error.prototype, {\n constructor: createPropertyDescriptor(1, $AggregateError),\n message: createPropertyDescriptor(1, ''),\n name: createPropertyDescriptor(1, 'AggregateError')\n});\n$({ global: true }, { AggregateError: $AggregateError });\n\n/***/ }),\n/* 7 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar global = __w_pdfjs_require__(8);\nvar getOwnPropertyDescriptor = (__w_pdfjs_require__(9).f);\nvar createNonEnumerableProperty = __w_pdfjs_require__(46);\nvar redefine = __w_pdfjs_require__(50);\nvar setGlobal = __w_pdfjs_require__(40);\nvar copyConstructorProperties = __w_pdfjs_require__(57);\nvar isForced = __w_pdfjs_require__(68);\nmodule.exports = function (options, source) {\n var TARGET = options.target;\n var GLOBAL = options.global;\n var STATIC = options.stat;\n var FORCED, target, key, targetProperty, sourceProperty, descriptor;\n if (GLOBAL) {\n target = global;\n } else if (STATIC) {\n target = global[TARGET] || setGlobal(TARGET, {});\n } else {\n target = (global[TARGET] || {}).prototype;\n }\n if (target)\n for (key in source) {\n sourceProperty = source[key];\n if (options.noTargetGet) {\n descriptor = getOwnPropertyDescriptor(target, key);\n targetProperty = descriptor && descriptor.value;\n } else\n targetProperty = target[key];\n FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);\n if (!FORCED && targetProperty !== undefined) {\n if (typeof sourceProperty == typeof targetProperty)\n continue;\n copyConstructorProperties(sourceProperty, targetProperty);\n }\n if (options.sham || targetProperty && targetProperty.sham) {\n createNonEnumerableProperty(sourceProperty, 'sham', true);\n }\n redefine(target, key, sourceProperty, options);\n }\n};\n\n/***/ }),\n/* 8 */\n/***/ ((module) => {\n\nvar check = function (it) {\n return it && it.Math == Math && it;\n};\nmodule.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 () {\n return this;\n}()) || Function('return this')();\n\n/***/ }),\n/* 9 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\nvar DESCRIPTORS = __w_pdfjs_require__(10);\nvar call = __w_pdfjs_require__(12);\nvar propertyIsEnumerableModule = __w_pdfjs_require__(14);\nvar createPropertyDescriptor = __w_pdfjs_require__(15);\nvar toIndexedObject = __w_pdfjs_require__(16);\nvar toPropertyKey = __w_pdfjs_require__(21);\nvar hasOwn = __w_pdfjs_require__(41);\nvar IE8_DOM_DEFINE = __w_pdfjs_require__(44);\nvar $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nexports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {\n O = toIndexedObject(O);\n P = toPropertyKey(P);\n if (IE8_DOM_DEFINE)\n try {\n return $getOwnPropertyDescriptor(O, P);\n } catch (error) {\n }\n if (hasOwn(O, P))\n return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]);\n};\n\n/***/ }),\n/* 10 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar fails = __w_pdfjs_require__(11);\nmodule.exports = !fails(function () {\n return Object.defineProperty({}, 1, {\n get: function () {\n return 7;\n }\n })[1] != 7;\n});\n\n/***/ }),\n/* 11 */\n/***/ ((module) => {\n\nmodule.exports = function (exec) {\n try {\n return !!exec();\n } catch (error) {\n return true;\n }\n};\n\n/***/ }),\n/* 12 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar NATIVE_BIND = __w_pdfjs_require__(13);\nvar call = Function.prototype.call;\nmodule.exports = NATIVE_BIND ? call.bind(call) : function () {\n return call.apply(call, arguments);\n};\n\n/***/ }),\n/* 13 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar fails = __w_pdfjs_require__(11);\nmodule.exports = !fails(function () {\n var test = function () {\n }.bind();\n return typeof test != 'function' || test.hasOwnProperty('prototype');\n});\n\n/***/ }),\n/* 14 */\n/***/ ((__unused_webpack_module, exports) => {\n\n\"use strict\";\n\nvar $propertyIsEnumerable = {}.propertyIsEnumerable;\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);\nexports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {\n var descriptor = getOwnPropertyDescriptor(this, V);\n return !!descriptor && descriptor.enumerable;\n} : $propertyIsEnumerable;\n\n/***/ }),\n/* 15 */\n/***/ ((module) => {\n\nmodule.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n\n/***/ }),\n/* 16 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar IndexedObject = __w_pdfjs_require__(17);\nvar requireObjectCoercible = __w_pdfjs_require__(20);\nmodule.exports = function (it) {\n return IndexedObject(requireObjectCoercible(it));\n};\n\n/***/ }),\n/* 17 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar global = __w_pdfjs_require__(8);\nvar uncurryThis = __w_pdfjs_require__(18);\nvar fails = __w_pdfjs_require__(11);\nvar classof = __w_pdfjs_require__(19);\nvar Object = global.Object;\nvar split = uncurryThis(''.split);\nmodule.exports = fails(function () {\n return !Object('z').propertyIsEnumerable(0);\n}) ? function (it) {\n return classof(it) == 'String' ? split(it, '') : Object(it);\n} : Object;\n\n/***/ }),\n/* 18 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar NATIVE_BIND = __w_pdfjs_require__(13);\nvar FunctionPrototype = Function.prototype;\nvar bind = FunctionPrototype.bind;\nvar call = FunctionPrototype.call;\nvar uncurryThis = NATIVE_BIND && bind.bind(call, call);\nmodule.exports = NATIVE_BIND ? function (fn) {\n return fn && uncurryThis(fn);\n} : function (fn) {\n return fn && function () {\n return call.apply(fn, arguments);\n };\n};\n\n/***/ }),\n/* 19 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar uncurryThis = __w_pdfjs_require__(18);\nvar toString = uncurryThis({}.toString);\nvar stringSlice = uncurryThis(''.slice);\nmodule.exports = function (it) {\n return stringSlice(toString(it), 8, -1);\n};\n\n/***/ }),\n/* 20 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar global = __w_pdfjs_require__(8);\nvar TypeError = global.TypeError;\nmodule.exports = function (it) {\n if (it == undefined)\n throw TypeError(\"Can't call method on \" + it);\n return it;\n};\n\n/***/ }),\n/* 21 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar toPrimitive = __w_pdfjs_require__(22);\nvar isSymbol = __w_pdfjs_require__(25);\nmodule.exports = function (argument) {\n var key = toPrimitive(argument, 'string');\n return isSymbol(key) ? key : key + '';\n};\n\n/***/ }),\n/* 22 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar global = __w_pdfjs_require__(8);\nvar call = __w_pdfjs_require__(12);\nvar isObject = __w_pdfjs_require__(23);\nvar isSymbol = __w_pdfjs_require__(25);\nvar getMethod = __w_pdfjs_require__(32);\nvar ordinaryToPrimitive = __w_pdfjs_require__(35);\nvar wellKnownSymbol = __w_pdfjs_require__(36);\nvar TypeError = global.TypeError;\nvar TO_PRIMITIVE = wellKnownSymbol('toPrimitive');\nmodule.exports = function (input, pref) {\n if (!isObject(input) || isSymbol(input))\n return input;\n var exoticToPrim = getMethod(input, TO_PRIMITIVE);\n var result;\n if (exoticToPrim) {\n if (pref === undefined)\n pref = 'default';\n result = call(exoticToPrim, input, pref);\n if (!isObject(result) || isSymbol(result))\n return result;\n throw TypeError(\"Can't convert object to primitive value\");\n }\n if (pref === undefined)\n pref = 'number';\n return ordinaryToPrimitive(input, pref);\n};\n\n/***/ }),\n/* 23 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar isCallable = __w_pdfjs_require__(24);\nmodule.exports = function (it) {\n return typeof it == 'object' ? it !== null : isCallable(it);\n};\n\n/***/ }),\n/* 24 */\n/***/ ((module) => {\n\nmodule.exports = function (argument) {\n return typeof argument == 'function';\n};\n\n/***/ }),\n/* 25 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar global = __w_pdfjs_require__(8);\nvar getBuiltIn = __w_pdfjs_require__(26);\nvar isCallable = __w_pdfjs_require__(24);\nvar isPrototypeOf = __w_pdfjs_require__(27);\nvar USE_SYMBOL_AS_UID = __w_pdfjs_require__(28);\nvar Object = global.Object;\nmodule.exports = USE_SYMBOL_AS_UID ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n var $Symbol = getBuiltIn('Symbol');\n return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, Object(it));\n};\n\n/***/ }),\n/* 26 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar global = __w_pdfjs_require__(8);\nvar isCallable = __w_pdfjs_require__(24);\nvar aFunction = function (argument) {\n return isCallable(argument) ? argument : undefined;\n};\nmodule.exports = function (namespace, method) {\n return arguments.length < 2 ? aFunction(global[namespace]) : global[namespace] && global[namespace][method];\n};\n\n/***/ }),\n/* 27 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar uncurryThis = __w_pdfjs_require__(18);\nmodule.exports = uncurryThis({}.isPrototypeOf);\n\n/***/ }),\n/* 28 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar NATIVE_SYMBOL = __w_pdfjs_require__(29);\nmodule.exports = NATIVE_SYMBOL && !Symbol.sham && typeof Symbol.iterator == 'symbol';\n\n/***/ }),\n/* 29 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar V8_VERSION = __w_pdfjs_require__(30);\nvar fails = __w_pdfjs_require__(11);\nmodule.exports = !!Object.getOwnPropertySymbols && !fails(function () {\n var symbol = Symbol();\n return !String(symbol) || !(Object(symbol) instanceof Symbol) || !Symbol.sham && V8_VERSION && V8_VERSION < 41;\n});\n\n/***/ }),\n/* 30 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar global = __w_pdfjs_require__(8);\nvar userAgent = __w_pdfjs_require__(31);\nvar process = global.process;\nvar Deno = global.Deno;\nvar versions = process && process.versions || Deno && Deno.version;\nvar v8 = versions && versions.v8;\nvar match, version;\nif (v8) {\n match = v8.split('.');\n version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);\n}\nif (!version && userAgent) {\n match = userAgent.match(/Edge\\/(\\d+)/);\n if (!match || match[1] >= 74) {\n match = userAgent.match(/Chrome\\/(\\d+)/);\n if (match)\n version = +match[1];\n }\n}\nmodule.exports = version;\n\n/***/ }),\n/* 31 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar getBuiltIn = __w_pdfjs_require__(26);\nmodule.exports = getBuiltIn('navigator', 'userAgent') || '';\n\n/***/ }),\n/* 32 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar aCallable = __w_pdfjs_require__(33);\nmodule.exports = function (V, P) {\n var func = V[P];\n return func == null ? undefined : aCallable(func);\n};\n\n/***/ }),\n/* 33 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar global = __w_pdfjs_require__(8);\nvar isCallable = __w_pdfjs_require__(24);\nvar tryToString = __w_pdfjs_require__(34);\nvar TypeError = global.TypeError;\nmodule.exports = function (argument) {\n if (isCallable(argument))\n return argument;\n throw TypeError(tryToString(argument) + ' is not a function');\n};\n\n/***/ }),\n/* 34 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar global = __w_pdfjs_require__(8);\nvar String = global.String;\nmodule.exports = function (argument) {\n try {\n return String(argument);\n } catch (error) {\n return 'Object';\n }\n};\n\n/***/ }),\n/* 35 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar global = __w_pdfjs_require__(8);\nvar call = __w_pdfjs_require__(12);\nvar isCallable = __w_pdfjs_require__(24);\nvar isObject = __w_pdfjs_require__(23);\nvar TypeError = global.TypeError;\nmodule.exports = function (input, pref) {\n var fn, val;\n if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input)))\n return val;\n if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input)))\n return val;\n if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input)))\n return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n\n/***/ }),\n/* 36 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar global = __w_pdfjs_require__(8);\nvar shared = __w_pdfjs_require__(37);\nvar hasOwn = __w_pdfjs_require__(41);\nvar uid = __w_pdfjs_require__(43);\nvar NATIVE_SYMBOL = __w_pdfjs_require__(29);\nvar USE_SYMBOL_AS_UID = __w_pdfjs_require__(28);\nvar WellKnownSymbolsStore = shared('wks');\nvar Symbol = global.Symbol;\nvar symbolFor = Symbol && Symbol['for'];\nvar createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid;\nmodule.exports = function (name) {\n if (!hasOwn(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {\n var description = 'Symbol.' + name;\n if (NATIVE_SYMBOL && hasOwn(Symbol, name)) {\n WellKnownSymbolsStore[name] = Symbol[name];\n } else if (USE_SYMBOL_AS_UID && symbolFor) {\n WellKnownSymbolsStore[name] = symbolFor(description);\n } else {\n WellKnownSymbolsStore[name] = createWellKnownSymbol(description);\n }\n }\n return WellKnownSymbolsStore[name];\n};\n\n/***/ }),\n/* 37 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar IS_PURE = __w_pdfjs_require__(38);\nvar store = __w_pdfjs_require__(39);\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: '3.21.1',\n mode: IS_PURE ? 'pure' : 'global',\n copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',\n license: 'https://github.com/zloirock/core-js/blob/v3.21.1/LICENSE',\n source: 'https://github.com/zloirock/core-js'\n});\n\n/***/ }),\n/* 38 */\n/***/ ((module) => {\n\nmodule.exports = false;\n\n/***/ }),\n/* 39 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar global = __w_pdfjs_require__(8);\nvar setGlobal = __w_pdfjs_require__(40);\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || setGlobal(SHARED, {});\nmodule.exports = store;\n\n/***/ }),\n/* 40 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar global = __w_pdfjs_require__(8);\nvar defineProperty = Object.defineProperty;\nmodule.exports = function (key, value) {\n try {\n defineProperty(global, key, {\n value: value,\n configurable: true,\n writable: true\n });\n } catch (error) {\n global[key] = value;\n }\n return value;\n};\n\n/***/ }),\n/* 41 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar uncurryThis = __w_pdfjs_require__(18);\nvar toObject = __w_pdfjs_require__(42);\nvar hasOwnProperty = uncurryThis({}.hasOwnProperty);\nmodule.exports = Object.hasOwn || function hasOwn(it, key) {\n return hasOwnProperty(toObject(it), key);\n};\n\n/***/ }),\n/* 42 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar global = __w_pdfjs_require__(8);\nvar requireObjectCoercible = __w_pdfjs_require__(20);\nvar Object = global.Object;\nmodule.exports = function (argument) {\n return Object(requireObjectCoercible(argument));\n};\n\n/***/ }),\n/* 43 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar uncurryThis = __w_pdfjs_require__(18);\nvar id = 0;\nvar postfix = Math.random();\nvar toString = uncurryThis(1.0.toString);\nmodule.exports = function (key) {\n return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);\n};\n\n/***/ }),\n/* 44 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar DESCRIPTORS = __w_pdfjs_require__(10);\nvar fails = __w_pdfjs_require__(11);\nvar createElement = __w_pdfjs_require__(45);\nmodule.exports = !DESCRIPTORS && !fails(function () {\n return Object.defineProperty(createElement('div'), 'a', {\n get: function () {\n return 7;\n }\n }).a != 7;\n});\n\n/***/ }),\n/* 45 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar global = __w_pdfjs_require__(8);\nvar isObject = __w_pdfjs_require__(23);\nvar document = global.document;\nvar EXISTS = isObject(document) && isObject(document.createElement);\nmodule.exports = function (it) {\n return EXISTS ? document.createElement(it) : {};\n};\n\n/***/ }),\n/* 46 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar DESCRIPTORS = __w_pdfjs_require__(10);\nvar definePropertyModule = __w_pdfjs_require__(47);\nvar createPropertyDescriptor = __w_pdfjs_require__(15);\nmodule.exports = DESCRIPTORS ? function (object, key, value) {\n return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n\n/***/ }),\n/* 47 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\nvar global = __w_pdfjs_require__(8);\nvar DESCRIPTORS = __w_pdfjs_require__(10);\nvar IE8_DOM_DEFINE = __w_pdfjs_require__(44);\nvar V8_PROTOTYPE_DEFINE_BUG = __w_pdfjs_require__(48);\nvar anObject = __w_pdfjs_require__(49);\nvar toPropertyKey = __w_pdfjs_require__(21);\nvar TypeError = global.TypeError;\nvar $defineProperty = Object.defineProperty;\nvar $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar ENUMERABLE = 'enumerable';\nvar CONFIGURABLE = 'configurable';\nvar WRITABLE = 'writable';\nexports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPropertyKey(P);\n anObject(Attributes);\n if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {\n var current = $getOwnPropertyDescriptor(O, P);\n if (current && current[WRITABLE]) {\n O[P] = Attributes.value;\n Attributes = {\n configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],\n enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],\n writable: false\n };\n }\n }\n return $defineProperty(O, P, Attributes);\n} : $defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPropertyKey(P);\n anObject(Attributes);\n if (IE8_DOM_DEFINE)\n try {\n return $defineProperty(O, P, Attributes);\n } catch (error) {\n }\n if ('get' in Attributes || 'set' in Attributes)\n throw TypeError('Accessors not supported');\n if ('value' in Attributes)\n O[P] = Attributes.value;\n return O;\n};\n\n/***/ }),\n/* 48 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar DESCRIPTORS = __w_pdfjs_require__(10);\nvar fails = __w_pdfjs_require__(11);\nmodule.exports = DESCRIPTORS && fails(function () {\n return Object.defineProperty(function () {\n }, 'prototype', {\n value: 42,\n writable: false\n }).prototype != 42;\n});\n\n/***/ }),\n/* 49 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar global = __w_pdfjs_require__(8);\nvar isObject = __w_pdfjs_require__(23);\nvar String = global.String;\nvar TypeError = global.TypeError;\nmodule.exports = function (argument) {\n if (isObject(argument))\n return argument;\n throw TypeError(String(argument) + ' is not an object');\n};\n\n/***/ }),\n/* 50 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar global = __w_pdfjs_require__(8);\nvar isCallable = __w_pdfjs_require__(24);\nvar hasOwn = __w_pdfjs_require__(41);\nvar createNonEnumerableProperty = __w_pdfjs_require__(46);\nvar setGlobal = __w_pdfjs_require__(40);\nvar inspectSource = __w_pdfjs_require__(51);\nvar InternalStateModule = __w_pdfjs_require__(52);\nvar CONFIGURABLE_FUNCTION_NAME = (__w_pdfjs_require__(56).CONFIGURABLE);\nvar getInternalState = InternalStateModule.get;\nvar enforceInternalState = InternalStateModule.enforce;\nvar TEMPLATE = String(String).split('String');\n(module.exports = function (O, key, value, options) {\n var unsafe = options ? !!options.unsafe : false;\n var simple = options ? !!options.enumerable : false;\n var noTargetGet = options ? !!options.noTargetGet : false;\n var name = options && options.name !== undefined ? options.name : key;\n var state;\n if (isCallable(value)) {\n if (String(name).slice(0, 7) === 'Symbol(') {\n name = '[' + String(name).replace(/^Symbol\\(([^)]*)\\)/, '$1') + ']';\n }\n if (!hasOwn(value, 'name') || CONFIGURABLE_FUNCTION_NAME && value.name !== name) {\n createNonEnumerableProperty(value, 'name', name);\n }\n state = enforceInternalState(value);\n if (!state.source) {\n state.source = TEMPLATE.join(typeof name == 'string' ? name : '');\n }\n }\n if (O === global) {\n if (simple)\n O[key] = value;\n else\n setGlobal(key, value);\n return;\n } else if (!unsafe) {\n delete O[key];\n } else if (!noTargetGet && O[key]) {\n simple = true;\n }\n if (simple)\n O[key] = value;\n else\n createNonEnumerableProperty(O, key, value);\n})(Function.prototype, 'toString', function toString() {\n return isCallable(this) && getInternalState(this).source || inspectSource(this);\n});\n\n/***/ }),\n/* 51 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar uncurryThis = __w_pdfjs_require__(18);\nvar isCallable = __w_pdfjs_require__(24);\nvar store = __w_pdfjs_require__(39);\nvar functionToString = uncurryThis(Function.toString);\nif (!isCallable(store.inspectSource)) {\n store.inspectSource = function (it) {\n return functionToString(it);\n };\n}\nmodule.exports = store.inspectSource;\n\n/***/ }),\n/* 52 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar NATIVE_WEAK_MAP = __w_pdfjs_require__(53);\nvar global = __w_pdfjs_require__(8);\nvar uncurryThis = __w_pdfjs_require__(18);\nvar isObject = __w_pdfjs_require__(23);\nvar createNonEnumerableProperty = __w_pdfjs_require__(46);\nvar hasOwn = __w_pdfjs_require__(41);\nvar shared = __w_pdfjs_require__(39);\nvar sharedKey = __w_pdfjs_require__(54);\nvar hiddenKeys = __w_pdfjs_require__(55);\nvar OBJECT_ALREADY_INITIALIZED = 'Object already initialized';\nvar TypeError = global.TypeError;\nvar WeakMap = global.WeakMap;\nvar set, get, has;\nvar enforce = function (it) {\n return has(it) ? get(it) : set(it, {});\n};\nvar getterFor = function (TYPE) {\n return function (it) {\n var state;\n if (!isObject(it) || (state = get(it)).type !== TYPE) {\n throw TypeError('Incompatible receiver, ' + TYPE + ' required');\n }\n return state;\n };\n};\nif (NATIVE_WEAK_MAP || shared.state) {\n var store = shared.state || (shared.state = new WeakMap());\n var wmget = uncurryThis(store.get);\n var wmhas = uncurryThis(store.has);\n var wmset = uncurryThis(store.set);\n set = function (it, metadata) {\n if (wmhas(store, it))\n throw new TypeError(OBJECT_ALREADY_INITIALIZED);\n metadata.facade = it;\n wmset(store, it, metadata);\n return metadata;\n };\n get = function (it) {\n return wmget(store, it) || {};\n };\n has = function (it) {\n return wmhas(store, it);\n };\n} else {\n var STATE = sharedKey('state');\n hiddenKeys[STATE] = true;\n set = function (it, metadata) {\n if (hasOwn(it, STATE))\n throw new TypeError(OBJECT_ALREADY_INITIALIZED);\n metadata.facade = it;\n createNonEnumerableProperty(it, STATE, metadata);\n return metadata;\n };\n get = function (it) {\n return hasOwn(it, STATE) ? it[STATE] : {};\n };\n has = function (it) {\n return hasOwn(it, STATE);\n };\n}\nmodule.exports = {\n set: set,\n get: get,\n has: has,\n enforce: enforce,\n getterFor: getterFor\n};\n\n/***/ }),\n/* 53 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar global = __w_pdfjs_require__(8);\nvar isCallable = __w_pdfjs_require__(24);\nvar inspectSource = __w_pdfjs_require__(51);\nvar WeakMap = global.WeakMap;\nmodule.exports = isCallable(WeakMap) && /native code/.test(inspectSource(WeakMap));\n\n/***/ }),\n/* 54 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar shared = __w_pdfjs_require__(37);\nvar uid = __w_pdfjs_require__(43);\nvar keys = shared('keys');\nmodule.exports = function (key) {\n return keys[key] || (keys[key] = uid(key));\n};\n\n/***/ }),\n/* 55 */\n/***/ ((module) => {\n\nmodule.exports = {};\n\n/***/ }),\n/* 56 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar DESCRIPTORS = __w_pdfjs_require__(10);\nvar hasOwn = __w_pdfjs_require__(41);\nvar FunctionPrototype = Function.prototype;\nvar getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;\nvar EXISTS = hasOwn(FunctionPrototype, 'name');\nvar PROPER = EXISTS && function something() {\n}.name === 'something';\nvar CONFIGURABLE = EXISTS && (!DESCRIPTORS || DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable);\nmodule.exports = {\n EXISTS: EXISTS,\n PROPER: PROPER,\n CONFIGURABLE: CONFIGURABLE\n};\n\n/***/ }),\n/* 57 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar hasOwn = __w_pdfjs_require__(41);\nvar ownKeys = __w_pdfjs_require__(58);\nvar getOwnPropertyDescriptorModule = __w_pdfjs_require__(9);\nvar definePropertyModule = __w_pdfjs_require__(47);\nmodule.exports = function (target, source, exceptions) {\n var keys = ownKeys(source);\n var defineProperty = definePropertyModule.f;\n var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {\n defineProperty(target, key, getOwnPropertyDescriptor(source, key));\n }\n }\n};\n\n/***/ }),\n/* 58 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar getBuiltIn = __w_pdfjs_require__(26);\nvar uncurryThis = __w_pdfjs_require__(18);\nvar getOwnPropertyNamesModule = __w_pdfjs_require__(59);\nvar getOwnPropertySymbolsModule = __w_pdfjs_require__(67);\nvar anObject = __w_pdfjs_require__(49);\nvar concat = uncurryThis([].concat);\nmodule.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {\n var keys = getOwnPropertyNamesModule.f(anObject(it));\n var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;\n return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;\n};\n\n/***/ }),\n/* 59 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\nvar internalObjectKeys = __w_pdfjs_require__(60);\nvar enumBugKeys = __w_pdfjs_require__(66);\nvar hiddenKeys = enumBugKeys.concat('length', 'prototype');\nexports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {\n return internalObjectKeys(O, hiddenKeys);\n};\n\n/***/ }),\n/* 60 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar uncurryThis = __w_pdfjs_require__(18);\nvar hasOwn = __w_pdfjs_require__(41);\nvar toIndexedObject = __w_pdfjs_require__(16);\nvar indexOf = (__w_pdfjs_require__(61).indexOf);\nvar hiddenKeys = __w_pdfjs_require__(55);\nvar push = uncurryThis([].push);\nmodule.exports = function (object, names) {\n var O = toIndexedObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O)\n !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key);\n while (names.length > i)\n if (hasOwn(O, key = names[i++])) {\n ~indexOf(result, key) || push(result, key);\n }\n return result;\n};\n\n/***/ }),\n/* 61 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar toIndexedObject = __w_pdfjs_require__(16);\nvar toAbsoluteIndex = __w_pdfjs_require__(62);\nvar lengthOfArrayLike = __w_pdfjs_require__(64);\nvar createMethod = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIndexedObject($this);\n var length = lengthOfArrayLike(O);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n if (IS_INCLUDES && el != el)\n while (length > index) {\n value = O[index++];\n if (value != value)\n return true;\n }\n else\n for (; length > index; index++) {\n if ((IS_INCLUDES || index in O) && O[index] === el)\n return IS_INCLUDES || index || 0;\n }\n return !IS_INCLUDES && -1;\n };\n};\nmodule.exports = {\n includes: createMethod(true),\n indexOf: createMethod(false)\n};\n\n/***/ }),\n/* 62 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar toIntegerOrInfinity = __w_pdfjs_require__(63);\nvar max = Math.max;\nvar min = Math.min;\nmodule.exports = function (index, length) {\n var integer = toIntegerOrInfinity(index);\n return integer < 0 ? max(integer + length, 0) : min(integer, length);\n};\n\n/***/ }),\n/* 63 */\n/***/ ((module) => {\n\nvar ceil = Math.ceil;\nvar floor = Math.floor;\nmodule.exports = function (argument) {\n var number = +argument;\n return number !== number || number === 0 ? 0 : (number > 0 ? floor : ceil)(number);\n};\n\n/***/ }),\n/* 64 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar toLength = __w_pdfjs_require__(65);\nmodule.exports = function (obj) {\n return toLength(obj.length);\n};\n\n/***/ }),\n/* 65 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar toIntegerOrInfinity = __w_pdfjs_require__(63);\nvar min = Math.min;\nmodule.exports = function (argument) {\n return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0;\n};\n\n/***/ }),\n/* 66 */\n/***/ ((module) => {\n\nmodule.exports = [\n 'constructor',\n 'hasOwnProperty',\n 'isPrototypeOf',\n 'propertyIsEnumerable',\n 'toLocaleString',\n 'toString',\n 'valueOf'\n];\n\n/***/ }),\n/* 67 */\n/***/ ((__unused_webpack_module, exports) => {\n\nexports.f = Object.getOwnPropertySymbols;\n\n/***/ }),\n/* 68 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar fails = __w_pdfjs_require__(11);\nvar isCallable = __w_pdfjs_require__(24);\nvar replacement = /#|\\.prototype\\./;\nvar isForced = function (feature, detection) {\n var value = data[normalize(feature)];\n return value == POLYFILL ? true : value == NATIVE ? false : isCallable(detection) ? fails(detection) : !!detection;\n};\nvar normalize = isForced.normalize = function (string) {\n return String(string).replace(replacement, '.').toLowerCase();\n};\nvar data = isForced.data = {};\nvar NATIVE = isForced.NATIVE = 'N';\nvar POLYFILL = isForced.POLYFILL = 'P';\nmodule.exports = isForced;\n\n/***/ }),\n/* 69 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar global = __w_pdfjs_require__(8);\nvar hasOwn = __w_pdfjs_require__(41);\nvar isCallable = __w_pdfjs_require__(24);\nvar toObject = __w_pdfjs_require__(42);\nvar sharedKey = __w_pdfjs_require__(54);\nvar CORRECT_PROTOTYPE_GETTER = __w_pdfjs_require__(70);\nvar IE_PROTO = sharedKey('IE_PROTO');\nvar Object = global.Object;\nvar ObjectPrototype = Object.prototype;\nmodule.exports = CORRECT_PROTOTYPE_GETTER ? Object.getPrototypeOf : function (O) {\n var object = toObject(O);\n if (hasOwn(object, IE_PROTO))\n return object[IE_PROTO];\n var constructor = object.constructor;\n if (isCallable(constructor) && object instanceof constructor) {\n return constructor.prototype;\n }\n return object instanceof Object ? ObjectPrototype : null;\n};\n\n/***/ }),\n/* 70 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar fails = __w_pdfjs_require__(11);\nmodule.exports = !fails(function () {\n function F() {\n }\n F.prototype.constructor = null;\n return Object.getPrototypeOf(new F()) !== F.prototype;\n});\n\n/***/ }),\n/* 71 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar uncurryThis = __w_pdfjs_require__(18);\nvar anObject = __w_pdfjs_require__(49);\nvar aPossiblePrototype = __w_pdfjs_require__(72);\nmodule.exports = Object.setPrototypeOf || ('__proto__' in {} ? (function () {\n var CORRECT_SETTER = false;\n var test = {};\n var setter;\n try {\n setter = uncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);\n setter(test, []);\n CORRECT_SETTER = test instanceof Array;\n } catch (error) {\n }\n return function setPrototypeOf(O, proto) {\n anObject(O);\n aPossiblePrototype(proto);\n if (CORRECT_SETTER)\n setter(O, proto);\n else\n O.__proto__ = proto;\n return O;\n };\n}()) : undefined);\n\n/***/ }),\n/* 72 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar global = __w_pdfjs_require__(8);\nvar isCallable = __w_pdfjs_require__(24);\nvar String = global.String;\nvar TypeError = global.TypeError;\nmodule.exports = function (argument) {\n if (typeof argument == 'object' || isCallable(argument))\n return argument;\n throw TypeError(\"Can't set \" + String(argument) + ' as a prototype');\n};\n\n/***/ }),\n/* 73 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar anObject = __w_pdfjs_require__(49);\nvar definePropertiesModule = __w_pdfjs_require__(74);\nvar enumBugKeys = __w_pdfjs_require__(66);\nvar hiddenKeys = __w_pdfjs_require__(55);\nvar html = __w_pdfjs_require__(76);\nvar documentCreateElement = __w_pdfjs_require__(45);\nvar sharedKey = __w_pdfjs_require__(54);\nvar GT = '>';\nvar LT = '<';\nvar PROTOTYPE = 'prototype';\nvar SCRIPT = 'script';\nvar IE_PROTO = sharedKey('IE_PROTO');\nvar EmptyConstructor = function () {\n};\nvar scriptTag = function (content) {\n return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;\n};\nvar NullProtoObjectViaActiveX = function (activeXDocument) {\n activeXDocument.write(scriptTag(''));\n activeXDocument.close();\n var temp = activeXDocument.parentWindow.Object;\n activeXDocument = null;\n return temp;\n};\nvar NullProtoObjectViaIFrame = function () {\n var iframe = documentCreateElement('iframe');\n var JS = 'java' + SCRIPT + ':';\n var iframeDocument;\n iframe.style.display = 'none';\n html.appendChild(iframe);\n iframe.src = String(JS);\n iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.write(scriptTag('document.F=Object'));\n iframeDocument.close();\n return iframeDocument.F;\n};\nvar activeXDocument;\nvar NullProtoObject = function () {\n try {\n activeXDocument = new ActiveXObject('htmlfile');\n } catch (error) {\n }\n NullProtoObject = typeof document != 'undefined' ? document.domain && activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame() : NullProtoObjectViaActiveX(activeXDocument);\n var length = enumBugKeys.length;\n while (length--)\n delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];\n return NullProtoObject();\n};\nhiddenKeys[IE_PROTO] = true;\nmodule.exports = Object.create || function create(O, Properties) {\n var result;\n if (O !== null) {\n EmptyConstructor[PROTOTYPE] = anObject(O);\n result = new EmptyConstructor();\n EmptyConstructor[PROTOTYPE] = null;\n result[IE_PROTO] = O;\n } else\n result = NullProtoObject();\n return Properties === undefined ? result : definePropertiesModule.f(result, Properties);\n};\n\n/***/ }),\n/* 74 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\nvar DESCRIPTORS = __w_pdfjs_require__(10);\nvar V8_PROTOTYPE_DEFINE_BUG = __w_pdfjs_require__(48);\nvar definePropertyModule = __w_pdfjs_require__(47);\nvar anObject = __w_pdfjs_require__(49);\nvar toIndexedObject = __w_pdfjs_require__(16);\nvar objectKeys = __w_pdfjs_require__(75);\nexports.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {\n anObject(O);\n var props = toIndexedObject(Properties);\n var keys = objectKeys(Properties);\n var length = keys.length;\n var index = 0;\n var key;\n while (length > index)\n definePropertyModule.f(O, key = keys[index++], props[key]);\n return O;\n};\n\n/***/ }),\n/* 75 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar internalObjectKeys = __w_pdfjs_require__(60);\nvar enumBugKeys = __w_pdfjs_require__(66);\nmodule.exports = Object.keys || function keys(O) {\n return internalObjectKeys(O, enumBugKeys);\n};\n\n/***/ }),\n/* 76 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar getBuiltIn = __w_pdfjs_require__(26);\nmodule.exports = getBuiltIn('document', 'documentElement');\n\n/***/ }),\n/* 77 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar uncurryThis = __w_pdfjs_require__(18);\nvar replace = uncurryThis(''.replace);\nvar TEST = function (arg) {\n return String(Error(arg).stack);\n}('zxcasd');\nvar V8_OR_CHAKRA_STACK_ENTRY = /\\n\\s*at [^:]*:[^\\n]*/;\nvar IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST);\nmodule.exports = function (stack, dropEntries) {\n if (IS_V8_OR_CHAKRA_STACK && typeof stack == 'string') {\n while (dropEntries--)\n stack = replace(stack, V8_OR_CHAKRA_STACK_ENTRY, '');\n }\n return stack;\n};\n\n/***/ }),\n/* 78 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar isObject = __w_pdfjs_require__(23);\nvar createNonEnumerableProperty = __w_pdfjs_require__(46);\nmodule.exports = function (O, options) {\n if (isObject(options) && 'cause' in options) {\n createNonEnumerableProperty(O, 'cause', options.cause);\n }\n};\n\n/***/ }),\n/* 79 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar global = __w_pdfjs_require__(8);\nvar bind = __w_pdfjs_require__(80);\nvar call = __w_pdfjs_require__(12);\nvar anObject = __w_pdfjs_require__(49);\nvar tryToString = __w_pdfjs_require__(34);\nvar isArrayIteratorMethod = __w_pdfjs_require__(81);\nvar lengthOfArrayLike = __w_pdfjs_require__(64);\nvar isPrototypeOf = __w_pdfjs_require__(27);\nvar getIterator = __w_pdfjs_require__(83);\nvar getIteratorMethod = __w_pdfjs_require__(84);\nvar iteratorClose = __w_pdfjs_require__(87);\nvar TypeError = global.TypeError;\nvar Result = function (stopped, result) {\n this.stopped = stopped;\n this.result = result;\n};\nvar ResultPrototype = Result.prototype;\nmodule.exports = function (iterable, unboundFunction, options) {\n var that = options && options.that;\n var AS_ENTRIES = !!(options && options.AS_ENTRIES);\n var IS_ITERATOR = !!(options && options.IS_ITERATOR);\n var INTERRUPTED = !!(options && options.INTERRUPTED);\n var fn = bind(unboundFunction, that);\n var iterator, iterFn, index, length, result, next, step;\n var stop = function (condition) {\n if (iterator)\n iteratorClose(iterator, 'normal', condition);\n return new Result(true, condition);\n };\n var callFn = function (value) {\n if (AS_ENTRIES) {\n anObject(value);\n return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);\n }\n return INTERRUPTED ? fn(value, stop) : fn(value);\n };\n if (IS_ITERATOR) {\n iterator = iterable;\n } else {\n iterFn = getIteratorMethod(iterable);\n if (!iterFn)\n throw TypeError(tryToString(iterable) + ' is not iterable');\n if (isArrayIteratorMethod(iterFn)) {\n for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {\n result = callFn(iterable[index]);\n if (result && isPrototypeOf(ResultPrototype, result))\n return result;\n }\n return new Result(false);\n }\n iterator = getIterator(iterable, iterFn);\n }\n next = iterator.next;\n while (!(step = call(next, iterator)).done) {\n try {\n result = callFn(step.value);\n } catch (error) {\n iteratorClose(iterator, 'throw', error);\n }\n if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result))\n return result;\n }\n return new Result(false);\n};\n\n/***/ }),\n/* 80 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar uncurryThis = __w_pdfjs_require__(18);\nvar aCallable = __w_pdfjs_require__(33);\nvar NATIVE_BIND = __w_pdfjs_require__(13);\nvar bind = uncurryThis(uncurryThis.bind);\nmodule.exports = function (fn, that) {\n aCallable(fn);\n return that === undefined ? fn : NATIVE_BIND ? bind(fn, that) : function () {\n return fn.apply(that, arguments);\n };\n};\n\n/***/ }),\n/* 81 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar wellKnownSymbol = __w_pdfjs_require__(36);\nvar Iterators = __w_pdfjs_require__(82);\nvar ITERATOR = wellKnownSymbol('iterator');\nvar ArrayPrototype = Array.prototype;\nmodule.exports = function (it) {\n return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);\n};\n\n/***/ }),\n/* 82 */\n/***/ ((module) => {\n\nmodule.exports = {};\n\n/***/ }),\n/* 83 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar global = __w_pdfjs_require__(8);\nvar call = __w_pdfjs_require__(12);\nvar aCallable = __w_pdfjs_require__(33);\nvar anObject = __w_pdfjs_require__(49);\nvar tryToString = __w_pdfjs_require__(34);\nvar getIteratorMethod = __w_pdfjs_require__(84);\nvar TypeError = global.TypeError;\nmodule.exports = function (argument, usingIterator) {\n var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;\n if (aCallable(iteratorMethod))\n return anObject(call(iteratorMethod, argument));\n throw TypeError(tryToString(argument) + ' is not iterable');\n};\n\n/***/ }),\n/* 84 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar classof = __w_pdfjs_require__(85);\nvar getMethod = __w_pdfjs_require__(32);\nvar Iterators = __w_pdfjs_require__(82);\nvar wellKnownSymbol = __w_pdfjs_require__(36);\nvar ITERATOR = wellKnownSymbol('iterator');\nmodule.exports = function (it) {\n if (it != undefined)\n return getMethod(it, ITERATOR) || getMethod(it, '@@iterator') || Iterators[classof(it)];\n};\n\n/***/ }),\n/* 85 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar global = __w_pdfjs_require__(8);\nvar TO_STRING_TAG_SUPPORT = __w_pdfjs_require__(86);\nvar isCallable = __w_pdfjs_require__(24);\nvar classofRaw = __w_pdfjs_require__(19);\nvar wellKnownSymbol = __w_pdfjs_require__(36);\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar Object = global.Object;\nvar CORRECT_ARGUMENTS = classofRaw((function () {\n return arguments;\n}())) == 'Arguments';\nvar tryGet = function (it, key) {\n try {\n return it[key];\n } catch (error) {\n }\n};\nmodule.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {\n var O, tag, result;\n 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' && isCallable(O.callee) ? 'Arguments' : result;\n};\n\n/***/ }),\n/* 86 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar wellKnownSymbol = __w_pdfjs_require__(36);\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar test = {};\ntest[TO_STRING_TAG] = 'z';\nmodule.exports = String(test) === '[object z]';\n\n/***/ }),\n/* 87 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar call = __w_pdfjs_require__(12);\nvar anObject = __w_pdfjs_require__(49);\nvar getMethod = __w_pdfjs_require__(32);\nmodule.exports = function (iterator, kind, value) {\n var innerResult, innerError;\n anObject(iterator);\n try {\n innerResult = getMethod(iterator, 'return');\n if (!innerResult) {\n if (kind === 'throw')\n throw value;\n return value;\n }\n innerResult = call(innerResult, iterator);\n } catch (error) {\n innerError = true;\n innerResult = error;\n }\n if (kind === 'throw')\n throw value;\n if (innerError)\n throw innerResult;\n anObject(innerResult);\n return value;\n};\n\n/***/ }),\n/* 88 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar toString = __w_pdfjs_require__(89);\nmodule.exports = function (argument, $default) {\n return argument === undefined ? arguments.length < 2 ? '' : $default : toString(argument);\n};\n\n/***/ }),\n/* 89 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar global = __w_pdfjs_require__(8);\nvar classof = __w_pdfjs_require__(85);\nvar String = global.String;\nmodule.exports = function (argument) {\n if (classof(argument) === 'Symbol')\n throw TypeError('Cannot convert a Symbol value to a string');\n return String(argument);\n};\n\n/***/ }),\n/* 90 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar fails = __w_pdfjs_require__(11);\nvar createPropertyDescriptor = __w_pdfjs_require__(15);\nmodule.exports = !fails(function () {\n var error = Error('a');\n if (!('stack' in error))\n return true;\n Object.defineProperty(error, 'stack', createPropertyDescriptor(1, 7));\n return error.stack !== 7;\n});\n\n/***/ }),\n/* 91 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\n\"use strict\";\n\nvar toIndexedObject = __w_pdfjs_require__(16);\nvar addToUnscopables = __w_pdfjs_require__(92);\nvar Iterators = __w_pdfjs_require__(82);\nvar InternalStateModule = __w_pdfjs_require__(52);\nvar defineProperty = (__w_pdfjs_require__(47).f);\nvar defineIterator = __w_pdfjs_require__(93);\nvar IS_PURE = __w_pdfjs_require__(38);\nvar DESCRIPTORS = __w_pdfjs_require__(10);\nvar ARRAY_ITERATOR = 'Array Iterator';\nvar setInternalState = InternalStateModule.set;\nvar getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);\nmodule.exports = defineIterator(Array, 'Array', function (iterated, kind) {\n setInternalState(this, {\n type: ARRAY_ITERATOR,\n target: toIndexedObject(iterated),\n index: 0,\n kind: kind\n });\n}, function () {\n var state = getInternalState(this);\n var target = state.target;\n var kind = state.kind;\n var index = state.index++;\n if (!target || index >= target.length) {\n state.target = undefined;\n return {\n value: undefined,\n done: true\n };\n }\n if (kind == 'keys')\n return {\n value: index,\n done: false\n };\n if (kind == 'values')\n return {\n value: target[index],\n done: false\n };\n return {\n value: [\n index,\n target[index]\n ],\n done: false\n };\n}, 'values');\nvar values = Iterators.Arguments = Iterators.Array;\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');\nif (!IS_PURE && DESCRIPTORS && values.name !== 'values')\n try {\n defineProperty(values, 'name', { value: 'values' });\n } catch (error) {\n }\n\n/***/ }),\n/* 92 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar wellKnownSymbol = __w_pdfjs_require__(36);\nvar create = __w_pdfjs_require__(73);\nvar definePropertyModule = __w_pdfjs_require__(47);\nvar UNSCOPABLES = wellKnownSymbol('unscopables');\nvar ArrayPrototype = Array.prototype;\nif (ArrayPrototype[UNSCOPABLES] == undefined) {\n definePropertyModule.f(ArrayPrototype, UNSCOPABLES, {\n configurable: true,\n value: create(null)\n });\n}\nmodule.exports = function (key) {\n ArrayPrototype[UNSCOPABLES][key] = true;\n};\n\n/***/ }),\n/* 93 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\n\"use strict\";\n\nvar $ = __w_pdfjs_require__(7);\nvar call = __w_pdfjs_require__(12);\nvar IS_PURE = __w_pdfjs_require__(38);\nvar FunctionName = __w_pdfjs_require__(56);\nvar isCallable = __w_pdfjs_require__(24);\nvar createIteratorConstructor = __w_pdfjs_require__(94);\nvar getPrototypeOf = __w_pdfjs_require__(69);\nvar setPrototypeOf = __w_pdfjs_require__(71);\nvar setToStringTag = __w_pdfjs_require__(96);\nvar createNonEnumerableProperty = __w_pdfjs_require__(46);\nvar redefine = __w_pdfjs_require__(50);\nvar wellKnownSymbol = __w_pdfjs_require__(36);\nvar Iterators = __w_pdfjs_require__(82);\nvar IteratorsCore = __w_pdfjs_require__(95);\nvar PROPER_FUNCTION_NAME = FunctionName.PROPER;\nvar CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;\nvar IteratorPrototype = IteratorsCore.IteratorPrototype;\nvar BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;\nvar ITERATOR = wellKnownSymbol('iterator');\nvar KEYS = 'keys';\nvar VALUES = 'values';\nvar ENTRIES = 'entries';\nvar returnThis = function () {\n return this;\n};\nmodule.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {\n createIteratorConstructor(IteratorConstructor, NAME, next);\n var getIterationMethod = function (KIND) {\n if (KIND === DEFAULT && defaultIterator)\n return defaultIterator;\n if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype)\n return IterablePrototype[KIND];\n switch (KIND) {\n case KEYS:\n return function keys() {\n return new IteratorConstructor(this, KIND);\n };\n case VALUES:\n return function values() {\n return new IteratorConstructor(this, KIND);\n };\n case ENTRIES:\n return function entries() {\n return new IteratorConstructor(this, KIND);\n };\n }\n return function () {\n return new IteratorConstructor(this);\n };\n };\n var TO_STRING_TAG = NAME + ' Iterator';\n var INCORRECT_VALUES_NAME = false;\n var IterablePrototype = Iterable.prototype;\n var nativeIterator = IterablePrototype[ITERATOR] || IterablePrototype['@@iterator'] || DEFAULT && IterablePrototype[DEFAULT];\n var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);\n var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;\n var CurrentIteratorPrototype, methods, KEY;\n if (anyNativeIterator) {\n CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));\n if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {\n if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {\n if (setPrototypeOf) {\n setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);\n } else if (!isCallable(CurrentIteratorPrototype[ITERATOR])) {\n redefine(CurrentIteratorPrototype, ITERATOR, returnThis);\n }\n }\n setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);\n if (IS_PURE)\n Iterators[TO_STRING_TAG] = returnThis;\n }\n }\n if (PROPER_FUNCTION_NAME && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {\n if (!IS_PURE && CONFIGURABLE_FUNCTION_NAME) {\n createNonEnumerableProperty(IterablePrototype, 'name', VALUES);\n } else {\n INCORRECT_VALUES_NAME = true;\n defaultIterator = function values() {\n return call(nativeIterator, this);\n };\n }\n }\n if (DEFAULT) {\n methods = {\n values: getIterationMethod(VALUES),\n keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),\n entries: getIterationMethod(ENTRIES)\n };\n if (FORCED)\n for (KEY in methods) {\n if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {\n redefine(IterablePrototype, KEY, methods[KEY]);\n }\n }\n else\n $({\n target: NAME,\n proto: true,\n forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME\n }, methods);\n }\n if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {\n redefine(IterablePrototype, ITERATOR, defaultIterator, { name: DEFAULT });\n }\n Iterators[NAME] = defaultIterator;\n return methods;\n};\n\n/***/ }),\n/* 94 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\n\"use strict\";\n\nvar IteratorPrototype = (__w_pdfjs_require__(95).IteratorPrototype);\nvar create = __w_pdfjs_require__(73);\nvar createPropertyDescriptor = __w_pdfjs_require__(15);\nvar setToStringTag = __w_pdfjs_require__(96);\nvar Iterators = __w_pdfjs_require__(82);\nvar returnThis = function () {\n return this;\n};\nmodule.exports = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {\n var TO_STRING_TAG = NAME + ' Iterator';\n IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });\n setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);\n Iterators[TO_STRING_TAG] = returnThis;\n return IteratorConstructor;\n};\n\n/***/ }),\n/* 95 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\n\"use strict\";\n\nvar fails = __w_pdfjs_require__(11);\nvar isCallable = __w_pdfjs_require__(24);\nvar create = __w_pdfjs_require__(73);\nvar getPrototypeOf = __w_pdfjs_require__(69);\nvar redefine = __w_pdfjs_require__(50);\nvar wellKnownSymbol = __w_pdfjs_require__(36);\nvar IS_PURE = __w_pdfjs_require__(38);\nvar ITERATOR = wellKnownSymbol('iterator');\nvar BUGGY_SAFARI_ITERATORS = false;\nvar IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;\nif ([].keys) {\n arrayIterator = [].keys();\n if (!('next' in arrayIterator))\n BUGGY_SAFARI_ITERATORS = true;\n else {\n PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));\n if (PrototypeOfArrayIteratorPrototype !== Object.prototype)\n IteratorPrototype = PrototypeOfArrayIteratorPrototype;\n }\n}\nvar NEW_ITERATOR_PROTOTYPE = IteratorPrototype == undefined || fails(function () {\n var test = {};\n return IteratorPrototype[ITERATOR].call(test) !== test;\n});\nif (NEW_ITERATOR_PROTOTYPE)\n IteratorPrototype = {};\nelse if (IS_PURE)\n IteratorPrototype = create(IteratorPrototype);\nif (!isCallable(IteratorPrototype[ITERATOR])) {\n redefine(IteratorPrototype, ITERATOR, function () {\n return this;\n });\n}\nmodule.exports = {\n IteratorPrototype: IteratorPrototype,\n BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS\n};\n\n/***/ }),\n/* 96 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar defineProperty = (__w_pdfjs_require__(47).f);\nvar hasOwn = __w_pdfjs_require__(41);\nvar wellKnownSymbol = __w_pdfjs_require__(36);\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nmodule.exports = function (target, TAG, STATIC) {\n if (target && !STATIC)\n target = target.prototype;\n if (target && !hasOwn(target, TO_STRING_TAG)) {\n defineProperty(target, TO_STRING_TAG, {\n configurable: true,\n value: TAG\n });\n }\n};\n\n/***/ }),\n/* 97 */\n/***/ ((__unused_webpack_module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar TO_STRING_TAG_SUPPORT = __w_pdfjs_require__(86);\nvar redefine = __w_pdfjs_require__(50);\nvar toString = __w_pdfjs_require__(98);\nif (!TO_STRING_TAG_SUPPORT) {\n redefine(Object.prototype, 'toString', toString, { unsafe: true });\n}\n\n/***/ }),\n/* 98 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\n\"use strict\";\n\nvar TO_STRING_TAG_SUPPORT = __w_pdfjs_require__(86);\nvar classof = __w_pdfjs_require__(85);\nmodule.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() {\n return '[object ' + classof(this) + ']';\n};\n\n/***/ }),\n/* 99 */\n/***/ ((__unused_webpack_module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\n\"use strict\";\n\nvar $ = __w_pdfjs_require__(7);\nvar IS_PURE = __w_pdfjs_require__(38);\nvar global = __w_pdfjs_require__(8);\nvar getBuiltIn = __w_pdfjs_require__(26);\nvar call = __w_pdfjs_require__(12);\nvar NativePromise = __w_pdfjs_require__(100);\nvar redefine = __w_pdfjs_require__(50);\nvar redefineAll = __w_pdfjs_require__(101);\nvar setPrototypeOf = __w_pdfjs_require__(71);\nvar setToStringTag = __w_pdfjs_require__(96);\nvar setSpecies = __w_pdfjs_require__(102);\nvar aCallable = __w_pdfjs_require__(33);\nvar isCallable = __w_pdfjs_require__(24);\nvar isObject = __w_pdfjs_require__(23);\nvar anInstance = __w_pdfjs_require__(103);\nvar inspectSource = __w_pdfjs_require__(51);\nvar iterate = __w_pdfjs_require__(79);\nvar checkCorrectnessOfIteration = __w_pdfjs_require__(104);\nvar speciesConstructor = __w_pdfjs_require__(105);\nvar task = (__w_pdfjs_require__(108).set);\nvar microtask = __w_pdfjs_require__(114);\nvar promiseResolve = __w_pdfjs_require__(117);\nvar hostReportErrors = __w_pdfjs_require__(119);\nvar newPromiseCapabilityModule = __w_pdfjs_require__(118);\nvar perform = __w_pdfjs_require__(120);\nvar Queue = __w_pdfjs_require__(121);\nvar InternalStateModule = __w_pdfjs_require__(52);\nvar isForced = __w_pdfjs_require__(68);\nvar wellKnownSymbol = __w_pdfjs_require__(36);\nvar IS_BROWSER = __w_pdfjs_require__(122);\nvar IS_NODE = __w_pdfjs_require__(113);\nvar V8_VERSION = __w_pdfjs_require__(30);\nvar SPECIES = wellKnownSymbol('species');\nvar PROMISE = 'Promise';\nvar getInternalState = InternalStateModule.getterFor(PROMISE);\nvar setInternalState = InternalStateModule.set;\nvar getInternalPromiseState = InternalStateModule.getterFor(PROMISE);\nvar NativePromisePrototype = NativePromise && NativePromise.prototype;\nvar PromiseConstructor = NativePromise;\nvar PromisePrototype = NativePromisePrototype;\nvar TypeError = global.TypeError;\nvar document = global.document;\nvar process = global.process;\nvar newPromiseCapability = newPromiseCapabilityModule.f;\nvar newGenericPromiseCapability = newPromiseCapability;\nvar DISPATCH_EVENT = !!(document && document.createEvent && global.dispatchEvent);\nvar NATIVE_REJECTION_EVENT = isCallable(global.PromiseRejectionEvent);\nvar UNHANDLED_REJECTION = 'unhandledrejection';\nvar REJECTION_HANDLED = 'rejectionhandled';\nvar PENDING = 0;\nvar FULFILLED = 1;\nvar REJECTED = 2;\nvar HANDLED = 1;\nvar UNHANDLED = 2;\nvar SUBCLASSING = false;\nvar Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;\nvar FORCED = isForced(PROMISE, function () {\n var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(PromiseConstructor);\n var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(PromiseConstructor);\n if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66)\n return true;\n if (IS_PURE && !PromisePrototype['finally'])\n return true;\n if (V8_VERSION >= 51 && /native code/.test(PROMISE_CONSTRUCTOR_SOURCE))\n return false;\n var promise = new PromiseConstructor(function (resolve) {\n resolve(1);\n });\n var FakePromise = function (exec) {\n exec(function () {\n }, function () {\n });\n };\n var constructor = promise.constructor = {};\n constructor[SPECIES] = FakePromise;\n SUBCLASSING = promise.then(function () {\n }) instanceof FakePromise;\n if (!SUBCLASSING)\n return true;\n return !GLOBAL_CORE_JS_PROMISE && IS_BROWSER && !NATIVE_REJECTION_EVENT;\n});\nvar INCORRECT_ITERATION = FORCED || !checkCorrectnessOfIteration(function (iterable) {\n PromiseConstructor.all(iterable)['catch'](function () {\n });\n});\nvar isThenable = function (it) {\n var then;\n return isObject(it) && isCallable(then = it.then) ? then : false;\n};\nvar callReaction = function (reaction, state) {\n var value = state.value;\n var ok = state.state == FULFILLED;\n var handler = ok ? reaction.ok : reaction.fail;\n var resolve = reaction.resolve;\n var reject = reaction.reject;\n var domain = reaction.domain;\n var result, then, exited;\n try {\n if (handler) {\n if (!ok) {\n if (state.rejection === UNHANDLED)\n onHandleUnhandled(state);\n state.rejection = HANDLED;\n }\n if (handler === true)\n result = value;\n else {\n if (domain)\n domain.enter();\n result = handler(value);\n if (domain) {\n domain.exit();\n exited = true;\n }\n }\n if (result === reaction.promise) {\n reject(TypeError('Promise-chain cycle'));\n } else if (then = isThenable(result)) {\n call(then, result, resolve, reject);\n } else\n resolve(result);\n } else\n reject(value);\n } catch (error) {\n if (domain && !exited)\n domain.exit();\n reject(error);\n }\n};\nvar notify = function (state, isReject) {\n if (state.notified)\n return;\n state.notified = true;\n microtask(function () {\n var reactions = state.reactions;\n var reaction;\n while (reaction = reactions.get()) {\n callReaction(reaction, state);\n }\n state.notified = false;\n if (isReject && !state.rejection)\n onUnhandled(state);\n });\n};\nvar dispatchEvent = function (name, promise, reason) {\n var event, handler;\n if (DISPATCH_EVENT) {\n event = document.createEvent('Event');\n event.promise = promise;\n event.reason = reason;\n event.initEvent(name, false, true);\n global.dispatchEvent(event);\n } else\n event = {\n promise: promise,\n reason: reason\n };\n if (!NATIVE_REJECTION_EVENT && (handler = global['on' + name]))\n handler(event);\n else if (name === UNHANDLED_REJECTION)\n hostReportErrors('Unhandled promise rejection', reason);\n};\nvar onUnhandled = function (state) {\n call(task, global, function () {\n var promise = state.facade;\n var value = state.value;\n var IS_UNHANDLED = isUnhandled(state);\n var result;\n if (IS_UNHANDLED) {\n result = perform(function () {\n if (IS_NODE) {\n process.emit('unhandledRejection', value, promise);\n } else\n dispatchEvent(UNHANDLED_REJECTION, promise, value);\n });\n state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;\n if (result.error)\n throw result.value;\n }\n });\n};\nvar isUnhandled = function (state) {\n return state.rejection !== HANDLED && !state.parent;\n};\nvar onHandleUnhandled = function (state) {\n call(task, global, function () {\n var promise = state.facade;\n if (IS_NODE) {\n process.emit('rejectionHandled', promise);\n } else\n dispatchEvent(REJECTION_HANDLED, promise, state.value);\n });\n};\nvar bind = function (fn, state, unwrap) {\n return function (value) {\n fn(state, value, unwrap);\n };\n};\nvar internalReject = function (state, value, unwrap) {\n if (state.done)\n return;\n state.done = true;\n if (unwrap)\n state = unwrap;\n state.value = value;\n state.state = REJECTED;\n notify(state, true);\n};\nvar internalResolve = function (state, value, unwrap) {\n if (state.done)\n return;\n state.done = true;\n if (unwrap)\n state = unwrap;\n try {\n if (state.facade === value)\n throw TypeError(\"Promise can't be resolved itself\");\n var then = isThenable(value);\n if (then) {\n microtask(function () {\n var wrapper = { done: false };\n try {\n call(then, value, bind(internalResolve, wrapper, state), bind(internalReject, wrapper, state));\n } catch (error) {\n internalReject(wrapper, error, state);\n }\n });\n } else {\n state.value = value;\n state.state = FULFILLED;\n notify(state, false);\n }\n } catch (error) {\n internalReject({ done: false }, error, state);\n }\n};\nif (FORCED) {\n PromiseConstructor = function Promise(executor) {\n anInstance(this, PromisePrototype);\n aCallable(executor);\n call(Internal, this);\n var state = getInternalState(this);\n try {\n executor(bind(internalResolve, state), bind(internalReject, state));\n } catch (error) {\n internalReject(state, error);\n }\n };\n PromisePrototype = PromiseConstructor.prototype;\n Internal = function Promise(executor) {\n setInternalState(this, {\n type: PROMISE,\n done: false,\n notified: false,\n parent: false,\n reactions: new Queue(),\n rejection: false,\n state: PENDING,\n value: undefined\n });\n };\n Internal.prototype = redefineAll(PromisePrototype, {\n then: function then(onFulfilled, onRejected) {\n var state = getInternalPromiseState(this);\n var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor));\n state.parent = true;\n reaction.ok = isCallable(onFulfilled) ? onFulfilled : true;\n reaction.fail = isCallable(onRejected) && onRejected;\n reaction.domain = IS_NODE ? process.domain : undefined;\n if (state.state == PENDING)\n state.reactions.add(reaction);\n else\n microtask(function () {\n callReaction(reaction, state);\n });\n return reaction.promise;\n },\n 'catch': function (onRejected) {\n return this.then(undefined, onRejected);\n }\n });\n OwnPromiseCapability = function () {\n var promise = new Internal();\n var state = getInternalState(promise);\n this.promise = promise;\n this.resolve = bind(internalResolve, state);\n this.reject = bind(internalReject, state);\n };\n newPromiseCapabilityModule.f = newPromiseCapability = function (C) {\n return C === PromiseConstructor || C === PromiseWrapper ? new OwnPromiseCapability(C) : newGenericPromiseCapability(C);\n };\n if (!IS_PURE && isCallable(NativePromise) && NativePromisePrototype !== Object.prototype) {\n nativeThen = NativePromisePrototype.then;\n if (!SUBCLASSING) {\n redefine(NativePromisePrototype, 'then', function then(onFulfilled, onRejected) {\n var that = this;\n return new PromiseConstructor(function (resolve, reject) {\n call(nativeThen, that, resolve, reject);\n }).then(onFulfilled, onRejected);\n }, { unsafe: true });\n redefine(NativePromisePrototype, 'catch', PromisePrototype['catch'], { unsafe: true });\n }\n try {\n delete NativePromisePrototype.constructor;\n } catch (error) {\n }\n if (setPrototypeOf) {\n setPrototypeOf(NativePromisePrototype, PromisePrototype);\n }\n }\n}\n$({\n global: true,\n wrap: true,\n forced: FORCED\n}, { Promise: PromiseConstructor });\nsetToStringTag(PromiseConstructor, PROMISE, false, true);\nsetSpecies(PROMISE);\nPromiseWrapper = getBuiltIn(PROMISE);\n$({\n target: PROMISE,\n stat: true,\n forced: FORCED\n}, {\n reject: function reject(r) {\n var capability = newPromiseCapability(this);\n call(capability.reject, undefined, r);\n return capability.promise;\n }\n});\n$({\n target: PROMISE,\n stat: true,\n forced: IS_PURE || FORCED\n}, {\n resolve: function resolve(x) {\n return promiseResolve(IS_PURE && this === PromiseWrapper ? PromiseConstructor : this, x);\n }\n});\n$({\n target: PROMISE,\n stat: true,\n forced: INCORRECT_ITERATION\n}, {\n all: function all(iterable) {\n var C = this;\n var capability = newPromiseCapability(C);\n var resolve = capability.resolve;\n var reject = capability.reject;\n var result = perform(function () {\n var $promiseResolve = aCallable(C.resolve);\n var values = [];\n var counter = 0;\n var remaining = 1;\n iterate(iterable, function (promise) {\n var index = counter++;\n var alreadyCalled = false;\n remaining++;\n call($promiseResolve, C, promise).then(function (value) {\n if (alreadyCalled)\n return;\n alreadyCalled = true;\n values[index] = value;\n --remaining || resolve(values);\n }, reject);\n });\n --remaining || resolve(values);\n });\n if (result.error)\n reject(result.value);\n return capability.promise;\n },\n race: function race(iterable) {\n var C = this;\n var capability = newPromiseCapability(C);\n var reject = capability.reject;\n var result = perform(function () {\n var $promiseResolve = aCallable(C.resolve);\n iterate(iterable, function (promise) {\n call($promiseResolve, C, promise).then(capability.resolve, reject);\n });\n });\n if (result.error)\n reject(result.value);\n return capability.promise;\n }\n});\n\n/***/ }),\n/* 100 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar global = __w_pdfjs_require__(8);\nmodule.exports = global.Promise;\n\n/***/ }),\n/* 101 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar redefine = __w_pdfjs_require__(50);\nmodule.exports = function (target, src, options) {\n for (var key in src)\n redefine(target, key, src[key], options);\n return target;\n};\n\n/***/ }),\n/* 102 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\n\"use strict\";\n\nvar getBuiltIn = __w_pdfjs_require__(26);\nvar definePropertyModule = __w_pdfjs_require__(47);\nvar wellKnownSymbol = __w_pdfjs_require__(36);\nvar DESCRIPTORS = __w_pdfjs_require__(10);\nvar SPECIES = wellKnownSymbol('species');\nmodule.exports = function (CONSTRUCTOR_NAME) {\n var Constructor = getBuiltIn(CONSTRUCTOR_NAME);\n var defineProperty = definePropertyModule.f;\n if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) {\n defineProperty(Constructor, SPECIES, {\n configurable: true,\n get: function () {\n return this;\n }\n });\n }\n};\n\n/***/ }),\n/* 103 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar global = __w_pdfjs_require__(8);\nvar isPrototypeOf = __w_pdfjs_require__(27);\nvar TypeError = global.TypeError;\nmodule.exports = function (it, Prototype) {\n if (isPrototypeOf(Prototype, it))\n return it;\n throw TypeError('Incorrect invocation');\n};\n\n/***/ }),\n/* 104 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar wellKnownSymbol = __w_pdfjs_require__(36);\nvar ITERATOR = wellKnownSymbol('iterator');\nvar SAFE_CLOSING = false;\ntry {\n var called = 0;\n var iteratorWithReturn = {\n next: function () {\n return { done: !!called++ };\n },\n 'return': function () {\n SAFE_CLOSING = true;\n }\n };\n iteratorWithReturn[ITERATOR] = function () {\n return this;\n };\n Array.from(iteratorWithReturn, function () {\n throw 2;\n });\n} catch (error) {\n}\nmodule.exports = function (exec, SKIP_CLOSING) {\n if (!SKIP_CLOSING && !SAFE_CLOSING)\n return false;\n var ITERATION_SUPPORT = false;\n try {\n var object = {};\n object[ITERATOR] = function () {\n return {\n next: function () {\n return { done: ITERATION_SUPPORT = true };\n }\n };\n };\n exec(object);\n } catch (error) {\n }\n return ITERATION_SUPPORT;\n};\n\n/***/ }),\n/* 105 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar anObject = __w_pdfjs_require__(49);\nvar aConstructor = __w_pdfjs_require__(106);\nvar wellKnownSymbol = __w_pdfjs_require__(36);\nvar SPECIES = wellKnownSymbol('species');\nmodule.exports = function (O, defaultConstructor) {\n var C = anObject(O).constructor;\n var S;\n return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? defaultConstructor : aConstructor(S);\n};\n\n/***/ }),\n/* 106 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar global = __w_pdfjs_require__(8);\nvar isConstructor = __w_pdfjs_require__(107);\nvar tryToString = __w_pdfjs_require__(34);\nvar TypeError = global.TypeError;\nmodule.exports = function (argument) {\n if (isConstructor(argument))\n return argument;\n throw TypeError(tryToString(argument) + ' is not a constructor');\n};\n\n/***/ }),\n/* 107 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar uncurryThis = __w_pdfjs_require__(18);\nvar fails = __w_pdfjs_require__(11);\nvar isCallable = __w_pdfjs_require__(24);\nvar classof = __w_pdfjs_require__(85);\nvar getBuiltIn = __w_pdfjs_require__(26);\nvar inspectSource = __w_pdfjs_require__(51);\nvar noop = function () {\n};\nvar empty = [];\nvar construct = getBuiltIn('Reflect', 'construct');\nvar constructorRegExp = /^\\s*(?:class|function)\\b/;\nvar exec = uncurryThis(constructorRegExp.exec);\nvar INCORRECT_TO_STRING = !constructorRegExp.exec(noop);\nvar isConstructorModern = function isConstructor(argument) {\n if (!isCallable(argument))\n return false;\n try {\n construct(noop, empty, argument);\n return true;\n } catch (error) {\n return false;\n }\n};\nvar isConstructorLegacy = function isConstructor(argument) {\n if (!isCallable(argument))\n return false;\n switch (classof(argument)) {\n case 'AsyncFunction':\n case 'GeneratorFunction':\n case 'AsyncGeneratorFunction':\n return false;\n }\n try {\n return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));\n } catch (error) {\n return true;\n }\n};\nisConstructorLegacy.sham = true;\nmodule.exports = !construct || fails(function () {\n var called;\n return isConstructorModern(isConstructorModern.call) || !isConstructorModern(Object) || !isConstructorModern(function () {\n called = true;\n }) || called;\n}) ? isConstructorLegacy : isConstructorModern;\n\n/***/ }),\n/* 108 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar global = __w_pdfjs_require__(8);\nvar apply = __w_pdfjs_require__(109);\nvar bind = __w_pdfjs_require__(80);\nvar isCallable = __w_pdfjs_require__(24);\nvar hasOwn = __w_pdfjs_require__(41);\nvar fails = __w_pdfjs_require__(11);\nvar html = __w_pdfjs_require__(76);\nvar arraySlice = __w_pdfjs_require__(110);\nvar createElement = __w_pdfjs_require__(45);\nvar validateArgumentsLength = __w_pdfjs_require__(111);\nvar IS_IOS = __w_pdfjs_require__(112);\nvar IS_NODE = __w_pdfjs_require__(113);\nvar set = global.setImmediate;\nvar clear = global.clearImmediate;\nvar process = global.process;\nvar Dispatch = global.Dispatch;\nvar Function = global.Function;\nvar MessageChannel = global.MessageChannel;\nvar String = global.String;\nvar counter = 0;\nvar queue = {};\nvar ONREADYSTATECHANGE = 'onreadystatechange';\nvar location, defer, channel, port;\ntry {\n location = global.location;\n} catch (error) {\n}\nvar run = function (id) {\n if (hasOwn(queue, id)) {\n var fn = queue[id];\n delete queue[id];\n fn();\n }\n};\nvar runner = function (id) {\n return function () {\n run(id);\n };\n};\nvar listener = function (event) {\n run(event.data);\n};\nvar post = function (id) {\n global.postMessage(String(id), location.protocol + '//' + location.host);\n};\nif (!set || !clear) {\n set = function setImmediate(handler) {\n validateArgumentsLength(arguments.length, 1);\n var fn = isCallable(handler) ? handler : Function(handler);\n var args = arraySlice(arguments, 1);\n queue[++counter] = function () {\n apply(fn, undefined, args);\n };\n defer(counter);\n return counter;\n };\n clear = function clearImmediate(id) {\n delete queue[id];\n };\n if (IS_NODE) {\n defer = function (id) {\n process.nextTick(runner(id));\n };\n } else if (Dispatch && Dispatch.now) {\n defer = function (id) {\n Dispatch.now(runner(id));\n };\n } else if (MessageChannel && !IS_IOS) {\n channel = new MessageChannel();\n port = channel.port2;\n channel.port1.onmessage = listener;\n defer = bind(port.postMessage, port);\n } else if (global.addEventListener && isCallable(global.postMessage) && !global.importScripts && location && location.protocol !== 'file:' && !fails(post)) {\n defer = post;\n global.addEventListener('message', listener, false);\n } else if (ONREADYSTATECHANGE in createElement('script')) {\n defer = function (id) {\n html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {\n html.removeChild(this);\n run(id);\n };\n };\n } else {\n defer = function (id) {\n setTimeout(runner(id), 0);\n };\n }\n}\nmodule.exports = {\n set: set,\n clear: clear\n};\n\n/***/ }),\n/* 109 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar NATIVE_BIND = __w_pdfjs_require__(13);\nvar FunctionPrototype = Function.prototype;\nvar apply = FunctionPrototype.apply;\nvar call = FunctionPrototype.call;\nmodule.exports = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function () {\n return call.apply(apply, arguments);\n});\n\n/***/ }),\n/* 110 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar uncurryThis = __w_pdfjs_require__(18);\nmodule.exports = uncurryThis([].slice);\n\n/***/ }),\n/* 111 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar global = __w_pdfjs_require__(8);\nvar TypeError = global.TypeError;\nmodule.exports = function (passed, required) {\n if (passed < required)\n throw TypeError('Not enough arguments');\n return passed;\n};\n\n/***/ }),\n/* 112 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar userAgent = __w_pdfjs_require__(31);\nmodule.exports = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent);\n\n/***/ }),\n/* 113 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar classof = __w_pdfjs_require__(19);\nvar global = __w_pdfjs_require__(8);\nmodule.exports = classof(global.process) == 'process';\n\n/***/ }),\n/* 114 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar global = __w_pdfjs_require__(8);\nvar bind = __w_pdfjs_require__(80);\nvar getOwnPropertyDescriptor = (__w_pdfjs_require__(9).f);\nvar macrotask = (__w_pdfjs_require__(108).set);\nvar IS_IOS = __w_pdfjs_require__(112);\nvar IS_IOS_PEBBLE = __w_pdfjs_require__(115);\nvar IS_WEBOS_WEBKIT = __w_pdfjs_require__(116);\nvar IS_NODE = __w_pdfjs_require__(113);\nvar MutationObserver = global.MutationObserver || global.WebKitMutationObserver;\nvar document = global.document;\nvar process = global.process;\nvar Promise = global.Promise;\nvar queueMicrotaskDescriptor = getOwnPropertyDescriptor(global, 'queueMicrotask');\nvar queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;\nvar flush, head, last, notify, toggle, node, promise, then;\nif (!queueMicrotask) {\n flush = function () {\n var parent, fn;\n if (IS_NODE && (parent = process.domain))\n parent.exit();\n while (head) {\n fn = head.fn;\n head = head.next;\n try {\n fn();\n } catch (error) {\n if (head)\n notify();\n else\n last = undefined;\n throw error;\n }\n }\n last = undefined;\n if (parent)\n parent.enter();\n };\n if (!IS_IOS && !IS_NODE && !IS_WEBOS_WEBKIT && MutationObserver && document) {\n toggle = true;\n node = document.createTextNode('');\n new MutationObserver(flush).observe(node, { characterData: true });\n notify = function () {\n node.data = toggle = !toggle;\n };\n } else if (!IS_IOS_PEBBLE && Promise && Promise.resolve) {\n promise = Promise.resolve(undefined);\n promise.constructor = Promise;\n then = bind(promise.then, promise);\n notify = function () {\n then(flush);\n };\n } else if (IS_NODE) {\n notify = function () {\n process.nextTick(flush);\n };\n } else {\n macrotask = bind(macrotask, global);\n notify = function () {\n macrotask(flush);\n };\n }\n}\nmodule.exports = queueMicrotask || function (fn) {\n var task = {\n fn: fn,\n next: undefined\n };\n if (last)\n last.next = task;\n if (!head) {\n head = task;\n notify();\n }\n last = task;\n};\n\n/***/ }),\n/* 115 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar userAgent = __w_pdfjs_require__(31);\nvar global = __w_pdfjs_require__(8);\nmodule.exports = /ipad|iphone|ipod/i.test(userAgent) && global.Pebble !== undefined;\n\n/***/ }),\n/* 116 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar userAgent = __w_pdfjs_require__(31);\nmodule.exports = /web0s(?!.*chrome)/i.test(userAgent);\n\n/***/ }),\n/* 117 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar anObject = __w_pdfjs_require__(49);\nvar isObject = __w_pdfjs_require__(23);\nvar newPromiseCapability = __w_pdfjs_require__(118);\nmodule.exports = function (C, x) {\n anObject(C);\n if (isObject(x) && x.constructor === C)\n return x;\n var promiseCapability = newPromiseCapability.f(C);\n var resolve = promiseCapability.resolve;\n resolve(x);\n return promiseCapability.promise;\n};\n\n/***/ }),\n/* 118 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\n\"use strict\";\n\nvar aCallable = __w_pdfjs_require__(33);\nvar PromiseCapability = function (C) {\n var resolve, reject;\n this.promise = new C(function ($$resolve, $$reject) {\n if (resolve !== undefined || reject !== undefined)\n throw TypeError('Bad Promise constructor');\n resolve = $$resolve;\n reject = $$reject;\n });\n this.resolve = aCallable(resolve);\n this.reject = aCallable(reject);\n};\nmodule.exports.f = function (C) {\n return new PromiseCapability(C);\n};\n\n/***/ }),\n/* 119 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar global = __w_pdfjs_require__(8);\nmodule.exports = function (a, b) {\n var console = global.console;\n if (console && console.error) {\n arguments.length == 1 ? console.error(a) : console.error(a, b);\n }\n};\n\n/***/ }),\n/* 120 */\n/***/ ((module) => {\n\nmodule.exports = function (exec) {\n try {\n return {\n error: false,\n value: exec()\n };\n } catch (error) {\n return {\n error: true,\n value: error\n };\n }\n};\n\n/***/ }),\n/* 121 */\n/***/ ((module) => {\n\nvar Queue = function () {\n this.head = null;\n this.tail = null;\n};\nQueue.prototype = {\n add: function (item) {\n var entry = {\n item: item,\n next: null\n };\n if (this.head)\n this.tail.next = entry;\n else\n this.head = entry;\n this.tail = entry;\n },\n get: function () {\n var entry = this.head;\n if (entry) {\n this.head = entry.next;\n if (this.tail === entry)\n this.tail = null;\n return entry.item;\n }\n }\n};\nmodule.exports = Queue;\n\n/***/ }),\n/* 122 */\n/***/ ((module) => {\n\nmodule.exports = typeof window == 'object';\n\n/***/ }),\n/* 123 */\n/***/ ((__unused_webpack_module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\n\"use strict\";\n\nvar $ = __w_pdfjs_require__(7);\nvar call = __w_pdfjs_require__(12);\nvar aCallable = __w_pdfjs_require__(33);\nvar newPromiseCapabilityModule = __w_pdfjs_require__(118);\nvar perform = __w_pdfjs_require__(120);\nvar iterate = __w_pdfjs_require__(79);\n$({\n target: 'Promise',\n stat: true\n}, {\n allSettled: function allSettled(iterable) {\n var C = this;\n var capability = newPromiseCapabilityModule.f(C);\n var resolve = capability.resolve;\n var reject = capability.reject;\n var result = perform(function () {\n var promiseResolve = aCallable(C.resolve);\n var values = [];\n var counter = 0;\n var remaining = 1;\n iterate(iterable, function (promise) {\n var index = counter++;\n var alreadyCalled = false;\n remaining++;\n call(promiseResolve, C, promise).then(function (value) {\n if (alreadyCalled)\n return;\n alreadyCalled = true;\n values[index] = {\n status: 'fulfilled',\n value: value\n };\n --remaining || resolve(values);\n }, function (error) {\n if (alreadyCalled)\n return;\n alreadyCalled = true;\n values[index] = {\n status: 'rejected',\n reason: error\n };\n --remaining || resolve(values);\n });\n });\n --remaining || resolve(values);\n });\n if (result.error)\n reject(result.value);\n return capability.promise;\n }\n});\n\n/***/ }),\n/* 124 */\n/***/ ((__unused_webpack_module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\n\"use strict\";\n\nvar $ = __w_pdfjs_require__(7);\nvar aCallable = __w_pdfjs_require__(33);\nvar getBuiltIn = __w_pdfjs_require__(26);\nvar call = __w_pdfjs_require__(12);\nvar newPromiseCapabilityModule = __w_pdfjs_require__(118);\nvar perform = __w_pdfjs_require__(120);\nvar iterate = __w_pdfjs_require__(79);\nvar PROMISE_ANY_ERROR = 'No one promise resolved';\n$({\n target: 'Promise',\n stat: true\n}, {\n any: function any(iterable) {\n var C = this;\n var AggregateError = getBuiltIn('AggregateError');\n var capability = newPromiseCapabilityModule.f(C);\n var resolve = capability.resolve;\n var reject = capability.reject;\n var result = perform(function () {\n var promiseResolve = aCallable(C.resolve);\n var errors = [];\n var counter = 0;\n var remaining = 1;\n var alreadyResolved = false;\n iterate(iterable, function (promise) {\n var index = counter++;\n var alreadyRejected = false;\n remaining++;\n call(promiseResolve, C, promise).then(function (value) {\n if (alreadyRejected || alreadyResolved)\n return;\n alreadyResolved = true;\n resolve(value);\n }, function (error) {\n if (alreadyRejected || alreadyResolved)\n return;\n alreadyRejected = true;\n errors[index] = error;\n --remaining || reject(new AggregateError(errors, PROMISE_ANY_ERROR));\n });\n });\n --remaining || reject(new AggregateError(errors, PROMISE_ANY_ERROR));\n });\n if (result.error)\n reject(result.value);\n return capability.promise;\n }\n});\n\n/***/ }),\n/* 125 */\n/***/ ((__unused_webpack_module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\n\"use strict\";\n\nvar $ = __w_pdfjs_require__(7);\nvar IS_PURE = __w_pdfjs_require__(38);\nvar NativePromise = __w_pdfjs_require__(100);\nvar fails = __w_pdfjs_require__(11);\nvar getBuiltIn = __w_pdfjs_require__(26);\nvar isCallable = __w_pdfjs_require__(24);\nvar speciesConstructor = __w_pdfjs_require__(105);\nvar promiseResolve = __w_pdfjs_require__(117);\nvar redefine = __w_pdfjs_require__(50);\nvar NON_GENERIC = !!NativePromise && fails(function () {\n NativePromise.prototype['finally'].call({\n then: function () {\n }\n }, function () {\n });\n});\n$({\n target: 'Promise',\n proto: true,\n real: true,\n forced: NON_GENERIC\n}, {\n 'finally': function (onFinally) {\n var C = speciesConstructor(this, getBuiltIn('Promise'));\n var isFunction = isCallable(onFinally);\n return this.then(isFunction ? function (x) {\n return promiseResolve(C, onFinally()).then(function () {\n return x;\n });\n } : onFinally, isFunction ? function (e) {\n return promiseResolve(C, onFinally()).then(function () {\n throw e;\n });\n } : onFinally);\n }\n});\nif (!IS_PURE && isCallable(NativePromise)) {\n var method = getBuiltIn('Promise').prototype['finally'];\n if (NativePromise.prototype['finally'] !== method) {\n redefine(NativePromise.prototype, 'finally', method, { unsafe: true });\n }\n}\n\n/***/ }),\n/* 126 */\n/***/ ((__unused_webpack_module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\n\"use strict\";\n\nvar charAt = (__w_pdfjs_require__(127).charAt);\nvar toString = __w_pdfjs_require__(89);\nvar InternalStateModule = __w_pdfjs_require__(52);\nvar defineIterator = __w_pdfjs_require__(93);\nvar STRING_ITERATOR = 'String Iterator';\nvar setInternalState = InternalStateModule.set;\nvar getInternalState = InternalStateModule.getterFor(STRING_ITERATOR);\ndefineIterator(String, 'String', function (iterated) {\n setInternalState(this, {\n type: STRING_ITERATOR,\n string: toString(iterated),\n index: 0\n });\n}, function next() {\n var state = getInternalState(this);\n var string = state.string;\n var index = state.index;\n var point;\n if (index >= string.length)\n return {\n value: undefined,\n done: true\n };\n point = charAt(string, index);\n state.index += point.length;\n return {\n value: point,\n done: false\n };\n});\n\n/***/ }),\n/* 127 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar uncurryThis = __w_pdfjs_require__(18);\nvar toIntegerOrInfinity = __w_pdfjs_require__(63);\nvar toString = __w_pdfjs_require__(89);\nvar requireObjectCoercible = __w_pdfjs_require__(20);\nvar charAt = uncurryThis(''.charAt);\nvar charCodeAt = uncurryThis(''.charCodeAt);\nvar stringSlice = uncurryThis(''.slice);\nvar createMethod = function (CONVERT_TO_STRING) {\n return function ($this, pos) {\n var S = toString(requireObjectCoercible($this));\n var position = toIntegerOrInfinity(pos);\n var size = S.length;\n var first, second;\n if (position < 0 || position >= size)\n return CONVERT_TO_STRING ? '' : undefined;\n first = charCodeAt(S, position);\n return first < 0xD800 || first > 0xDBFF || position + 1 === size || (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF ? CONVERT_TO_STRING ? charAt(S, position) : first : CONVERT_TO_STRING ? stringSlice(S, position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;\n };\n};\nmodule.exports = {\n codeAt: createMethod(false),\n charAt: createMethod(true)\n};\n\n/***/ }),\n/* 128 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar global = __w_pdfjs_require__(8);\nmodule.exports = global;\n\n/***/ }),\n/* 129 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\n__w_pdfjs_require__(91);\n__w_pdfjs_require__(97);\n__w_pdfjs_require__(130);\n__w_pdfjs_require__(141);\n__w_pdfjs_require__(142);\nvar path = __w_pdfjs_require__(128);\nmodule.exports = path.structuredClone;\n\n/***/ }),\n/* 130 */\n/***/ ((__unused_webpack_module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\n\"use strict\";\n\nvar collection = __w_pdfjs_require__(131);\nvar collectionStrong = __w_pdfjs_require__(140);\ncollection('Map', function (init) {\n return function Map() {\n return init(this, arguments.length ? arguments[0] : undefined);\n };\n}, collectionStrong);\n\n/***/ }),\n/* 131 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\n\"use strict\";\n\nvar $ = __w_pdfjs_require__(7);\nvar global = __w_pdfjs_require__(8);\nvar uncurryThis = __w_pdfjs_require__(18);\nvar isForced = __w_pdfjs_require__(68);\nvar redefine = __w_pdfjs_require__(50);\nvar InternalMetadataModule = __w_pdfjs_require__(132);\nvar iterate = __w_pdfjs_require__(79);\nvar anInstance = __w_pdfjs_require__(103);\nvar isCallable = __w_pdfjs_require__(24);\nvar isObject = __w_pdfjs_require__(23);\nvar fails = __w_pdfjs_require__(11);\nvar checkCorrectnessOfIteration = __w_pdfjs_require__(104);\nvar setToStringTag = __w_pdfjs_require__(96);\nvar inheritIfRequired = __w_pdfjs_require__(139);\nmodule.exports = function (CONSTRUCTOR_NAME, wrapper, common) {\n var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1;\n var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1;\n var ADDER = IS_MAP ? 'set' : 'add';\n var NativeConstructor = global[CONSTRUCTOR_NAME];\n var NativePrototype = NativeConstructor && NativeConstructor.prototype;\n var Constructor = NativeConstructor;\n var exported = {};\n var fixMethod = function (KEY) {\n var uncurriedNativeMethod = uncurryThis(NativePrototype[KEY]);\n redefine(NativePrototype, KEY, KEY == 'add' ? function add(value) {\n uncurriedNativeMethod(this, value === 0 ? 0 : value);\n return this;\n } : KEY == 'delete' ? function (key) {\n return IS_WEAK && !isObject(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key);\n } : KEY == 'get' ? function get(key) {\n return IS_WEAK && !isObject(key) ? undefined : uncurriedNativeMethod(this, key === 0 ? 0 : key);\n } : KEY == 'has' ? function has(key) {\n return IS_WEAK && !isObject(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key);\n } : function set(key, value) {\n uncurriedNativeMethod(this, key === 0 ? 0 : key, value);\n return this;\n });\n };\n var REPLACE = isForced(CONSTRUCTOR_NAME, !isCallable(NativeConstructor) || !(IS_WEAK || NativePrototype.forEach && !fails(function () {\n new NativeConstructor().entries().next();\n })));\n if (REPLACE) {\n Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER);\n InternalMetadataModule.enable();\n } else if (isForced(CONSTRUCTOR_NAME, true)) {\n var instance = new Constructor();\n var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance;\n var THROWS_ON_PRIMITIVES = fails(function () {\n instance.has(1);\n });\n var ACCEPT_ITERABLES = checkCorrectnessOfIteration(function (iterable) {\n new NativeConstructor(iterable);\n });\n var BUGGY_ZERO = !IS_WEAK && fails(function () {\n var $instance = new NativeConstructor();\n var index = 5;\n while (index--)\n $instance[ADDER](index, index);\n return !$instance.has(-0);\n });\n if (!ACCEPT_ITERABLES) {\n Constructor = wrapper(function (dummy, iterable) {\n anInstance(dummy, NativePrototype);\n var that = inheritIfRequired(new NativeConstructor(), dummy, Constructor);\n if (iterable != undefined)\n iterate(iterable, that[ADDER], {\n that: that,\n AS_ENTRIES: IS_MAP\n });\n return that;\n });\n Constructor.prototype = NativePrototype;\n NativePrototype.constructor = Constructor;\n }\n if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) {\n fixMethod('delete');\n fixMethod('has');\n IS_MAP && fixMethod('get');\n }\n if (BUGGY_ZERO || HASNT_CHAINING)\n fixMethod(ADDER);\n if (IS_WEAK && NativePrototype.clear)\n delete NativePrototype.clear;\n }\n exported[CONSTRUCTOR_NAME] = Constructor;\n $({\n global: true,\n forced: Constructor != NativeConstructor\n }, exported);\n setToStringTag(Constructor, CONSTRUCTOR_NAME);\n if (!IS_WEAK)\n common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP);\n return Constructor;\n};\n\n/***/ }),\n/* 132 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar $ = __w_pdfjs_require__(7);\nvar uncurryThis = __w_pdfjs_require__(18);\nvar hiddenKeys = __w_pdfjs_require__(55);\nvar isObject = __w_pdfjs_require__(23);\nvar hasOwn = __w_pdfjs_require__(41);\nvar defineProperty = (__w_pdfjs_require__(47).f);\nvar getOwnPropertyNamesModule = __w_pdfjs_require__(59);\nvar getOwnPropertyNamesExternalModule = __w_pdfjs_require__(133);\nvar isExtensible = __w_pdfjs_require__(136);\nvar uid = __w_pdfjs_require__(43);\nvar FREEZING = __w_pdfjs_require__(138);\nvar REQUIRED = false;\nvar METADATA = uid('meta');\nvar id = 0;\nvar setMetadata = function (it) {\n defineProperty(it, METADATA, {\n value: {\n objectID: 'O' + id++,\n weakData: {}\n }\n });\n};\nvar fastKey = function (it, create) {\n if (!isObject(it))\n return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;\n if (!hasOwn(it, METADATA)) {\n if (!isExtensible(it))\n return 'F';\n if (!create)\n return 'E';\n setMetadata(it);\n }\n return it[METADATA].objectID;\n};\nvar getWeakData = function (it, create) {\n if (!hasOwn(it, METADATA)) {\n if (!isExtensible(it))\n return true;\n if (!create)\n return false;\n setMetadata(it);\n }\n return it[METADATA].weakData;\n};\nvar onFreeze = function (it) {\n if (FREEZING && REQUIRED && isExtensible(it) && !hasOwn(it, METADATA))\n setMetadata(it);\n return it;\n};\nvar enable = function () {\n meta.enable = function () {\n };\n REQUIRED = true;\n var getOwnPropertyNames = getOwnPropertyNamesModule.f;\n var splice = uncurryThis([].splice);\n var test = {};\n test[METADATA] = 1;\n if (getOwnPropertyNames(test).length) {\n getOwnPropertyNamesModule.f = function (it) {\n var result = getOwnPropertyNames(it);\n for (var i = 0, length = result.length; i < length; i++) {\n if (result[i] === METADATA) {\n splice(result, i, 1);\n break;\n }\n }\n return result;\n };\n $({\n target: 'Object',\n stat: true,\n forced: true\n }, { getOwnPropertyNames: getOwnPropertyNamesExternalModule.f });\n }\n};\nvar meta = module.exports = {\n enable: enable,\n fastKey: fastKey,\n getWeakData: getWeakData,\n onFreeze: onFreeze\n};\nhiddenKeys[METADATA] = true;\n\n/***/ }),\n/* 133 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar classof = __w_pdfjs_require__(19);\nvar toIndexedObject = __w_pdfjs_require__(16);\nvar $getOwnPropertyNames = (__w_pdfjs_require__(59).f);\nvar arraySlice = __w_pdfjs_require__(134);\nvar windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : [];\nvar getWindowNames = function (it) {\n try {\n return $getOwnPropertyNames(it);\n } catch (error) {\n return arraySlice(windowNames);\n }\n};\nmodule.exports.f = function getOwnPropertyNames(it) {\n return windowNames && classof(it) == 'Window' ? getWindowNames(it) : $getOwnPropertyNames(toIndexedObject(it));\n};\n\n/***/ }),\n/* 134 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar global = __w_pdfjs_require__(8);\nvar toAbsoluteIndex = __w_pdfjs_require__(62);\nvar lengthOfArrayLike = __w_pdfjs_require__(64);\nvar createProperty = __w_pdfjs_require__(135);\nvar Array = global.Array;\nvar max = Math.max;\nmodule.exports = function (O, start, end) {\n var length = lengthOfArrayLike(O);\n var k = toAbsoluteIndex(start, length);\n var fin = toAbsoluteIndex(end === undefined ? length : end, length);\n var result = Array(max(fin - k, 0));\n for (var n = 0; k < fin; k++, n++)\n createProperty(result, n, O[k]);\n result.length = n;\n return result;\n};\n\n/***/ }),\n/* 135 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\n\"use strict\";\n\nvar toPropertyKey = __w_pdfjs_require__(21);\nvar definePropertyModule = __w_pdfjs_require__(47);\nvar createPropertyDescriptor = __w_pdfjs_require__(15);\nmodule.exports = function (object, key, value) {\n var propertyKey = toPropertyKey(key);\n if (propertyKey in object)\n definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));\n else\n object[propertyKey] = value;\n};\n\n/***/ }),\n/* 136 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar fails = __w_pdfjs_require__(11);\nvar isObject = __w_pdfjs_require__(23);\nvar classof = __w_pdfjs_require__(19);\nvar ARRAY_BUFFER_NON_EXTENSIBLE = __w_pdfjs_require__(137);\nvar $isExtensible = Object.isExtensible;\nvar FAILS_ON_PRIMITIVES = fails(function () {\n $isExtensible(1);\n});\nmodule.exports = FAILS_ON_PRIMITIVES || ARRAY_BUFFER_NON_EXTENSIBLE ? function isExtensible(it) {\n if (!isObject(it))\n return false;\n if (ARRAY_BUFFER_NON_EXTENSIBLE && classof(it) == 'ArrayBuffer')\n return false;\n return $isExtensible ? $isExtensible(it) : true;\n} : $isExtensible;\n\n/***/ }),\n/* 137 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar fails = __w_pdfjs_require__(11);\nmodule.exports = fails(function () {\n if (typeof ArrayBuffer == 'function') {\n var buffer = new ArrayBuffer(8);\n if (Object.isExtensible(buffer))\n Object.defineProperty(buffer, 'a', { value: 8 });\n }\n});\n\n/***/ }),\n/* 138 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar fails = __w_pdfjs_require__(11);\nmodule.exports = !fails(function () {\n return Object.isExtensible(Object.preventExtensions({}));\n});\n\n/***/ }),\n/* 139 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar isCallable = __w_pdfjs_require__(24);\nvar isObject = __w_pdfjs_require__(23);\nvar setPrototypeOf = __w_pdfjs_require__(71);\nmodule.exports = function ($this, dummy, Wrapper) {\n var NewTarget, NewTargetPrototype;\n if (setPrototypeOf && isCallable(NewTarget = dummy.constructor) && NewTarget !== Wrapper && isObject(NewTargetPrototype = NewTarget.prototype) && NewTargetPrototype !== Wrapper.prototype)\n setPrototypeOf($this, NewTargetPrototype);\n return $this;\n};\n\n/***/ }),\n/* 140 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\n\"use strict\";\n\nvar defineProperty = (__w_pdfjs_require__(47).f);\nvar create = __w_pdfjs_require__(73);\nvar redefineAll = __w_pdfjs_require__(101);\nvar bind = __w_pdfjs_require__(80);\nvar anInstance = __w_pdfjs_require__(103);\nvar iterate = __w_pdfjs_require__(79);\nvar defineIterator = __w_pdfjs_require__(93);\nvar setSpecies = __w_pdfjs_require__(102);\nvar DESCRIPTORS = __w_pdfjs_require__(10);\nvar fastKey = (__w_pdfjs_require__(132).fastKey);\nvar InternalStateModule = __w_pdfjs_require__(52);\nvar setInternalState = InternalStateModule.set;\nvar internalStateGetterFor = InternalStateModule.getterFor;\nmodule.exports = {\n getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {\n var Constructor = wrapper(function (that, iterable) {\n anInstance(that, Prototype);\n setInternalState(that, {\n type: CONSTRUCTOR_NAME,\n index: create(null),\n first: undefined,\n last: undefined,\n size: 0\n });\n if (!DESCRIPTORS)\n that.size = 0;\n if (iterable != undefined)\n iterate(iterable, that[ADDER], {\n that: that,\n AS_ENTRIES: IS_MAP\n });\n });\n var Prototype = Constructor.prototype;\n var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);\n var define = function (that, key, value) {\n var state = getInternalState(that);\n var entry = getEntry(that, key);\n var previous, index;\n if (entry) {\n entry.value = value;\n } else {\n state.last = entry = {\n index: index = fastKey(key, true),\n key: key,\n value: value,\n previous: previous = state.last,\n next: undefined,\n removed: false\n };\n if (!state.first)\n state.first = entry;\n if (previous)\n previous.next = entry;\n if (DESCRIPTORS)\n state.size++;\n else\n that.size++;\n if (index !== 'F')\n state.index[index] = entry;\n }\n return that;\n };\n var getEntry = function (that, key) {\n var state = getInternalState(that);\n var index = fastKey(key);\n var entry;\n if (index !== 'F')\n return state.index[index];\n for (entry = state.first; entry; entry = entry.next) {\n if (entry.key == key)\n return entry;\n }\n };\n redefineAll(Prototype, {\n clear: function clear() {\n var that = this;\n var state = getInternalState(that);\n var data = state.index;\n var entry = state.first;\n while (entry) {\n entry.removed = true;\n if (entry.previous)\n entry.previous = entry.previous.next = undefined;\n delete data[entry.index];\n entry = entry.next;\n }\n state.first = state.last = undefined;\n if (DESCRIPTORS)\n state.size = 0;\n else\n that.size = 0;\n },\n 'delete': function (key) {\n var that = this;\n var state = getInternalState(that);\n var entry = getEntry(that, key);\n if (entry) {\n var next = entry.next;\n var prev = entry.previous;\n delete state.index[entry.index];\n entry.removed = true;\n if (prev)\n prev.next = next;\n if (next)\n next.previous = prev;\n if (state.first == entry)\n state.first = next;\n if (state.last == entry)\n state.last = prev;\n if (DESCRIPTORS)\n state.size--;\n else\n that.size--;\n }\n return !!entry;\n },\n forEach: function forEach(callbackfn) {\n var state = getInternalState(this);\n var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n var entry;\n while (entry = entry ? entry.next : state.first) {\n boundFunction(entry.value, entry.key, this);\n while (entry && entry.removed)\n entry = entry.previous;\n }\n },\n has: function has(key) {\n return !!getEntry(this, key);\n }\n });\n redefineAll(Prototype, IS_MAP ? {\n get: function get(key) {\n var entry = getEntry(this, key);\n return entry && entry.value;\n },\n set: function set(key, value) {\n return define(this, key === 0 ? 0 : key, value);\n }\n } : {\n add: function add(value) {\n return define(this, value = value === 0 ? 0 : value, value);\n }\n });\n if (DESCRIPTORS)\n defineProperty(Prototype, 'size', {\n get: function () {\n return getInternalState(this).size;\n }\n });\n return Constructor;\n },\n setStrong: function (Constructor, CONSTRUCTOR_NAME, IS_MAP) {\n var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator';\n var getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME);\n var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME);\n defineIterator(Constructor, CONSTRUCTOR_NAME, function (iterated, kind) {\n setInternalState(this, {\n type: ITERATOR_NAME,\n target: iterated,\n state: getInternalCollectionState(iterated),\n kind: kind,\n last: undefined\n });\n }, function () {\n var state = getInternalIteratorState(this);\n var kind = state.kind;\n var entry = state.last;\n while (entry && entry.removed)\n entry = entry.previous;\n if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) {\n state.target = undefined;\n return {\n value: undefined,\n done: true\n };\n }\n if (kind == 'keys')\n return {\n value: entry.key,\n done: false\n };\n if (kind == 'values')\n return {\n value: entry.value,\n done: false\n };\n return {\n value: [\n entry.key,\n entry.value\n ],\n done: false\n };\n }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);\n setSpecies(CONSTRUCTOR_NAME);\n }\n};\n\n/***/ }),\n/* 141 */\n/***/ ((__unused_webpack_module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\n\"use strict\";\n\nvar collection = __w_pdfjs_require__(131);\nvar collectionStrong = __w_pdfjs_require__(140);\ncollection('Set', function (init) {\n return function Set() {\n return init(this, arguments.length ? arguments[0] : undefined);\n };\n}, collectionStrong);\n\n/***/ }),\n/* 142 */\n/***/ ((__unused_webpack_module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\nvar IS_PURE = __w_pdfjs_require__(38);\nvar $ = __w_pdfjs_require__(7);\nvar global = __w_pdfjs_require__(8);\nvar getBuiltin = __w_pdfjs_require__(26);\nvar uncurryThis = __w_pdfjs_require__(18);\nvar fails = __w_pdfjs_require__(11);\nvar uid = __w_pdfjs_require__(43);\nvar isCallable = __w_pdfjs_require__(24);\nvar isConstructor = __w_pdfjs_require__(107);\nvar isObject = __w_pdfjs_require__(23);\nvar isSymbol = __w_pdfjs_require__(25);\nvar iterate = __w_pdfjs_require__(79);\nvar anObject = __w_pdfjs_require__(49);\nvar classof = __w_pdfjs_require__(85);\nvar hasOwn = __w_pdfjs_require__(41);\nvar createProperty = __w_pdfjs_require__(135);\nvar createNonEnumerableProperty = __w_pdfjs_require__(46);\nvar lengthOfArrayLike = __w_pdfjs_require__(64);\nvar validateArgumentsLength = __w_pdfjs_require__(111);\nvar regExpFlags = __w_pdfjs_require__(143);\nvar ERROR_STACK_INSTALLABLE = __w_pdfjs_require__(90);\nvar Object = global.Object;\nvar Date = global.Date;\nvar Error = global.Error;\nvar EvalError = global.EvalError;\nvar RangeError = global.RangeError;\nvar ReferenceError = global.ReferenceError;\nvar SyntaxError = global.SyntaxError;\nvar TypeError = global.TypeError;\nvar URIError = global.URIError;\nvar PerformanceMark = global.PerformanceMark;\nvar WebAssembly = global.WebAssembly;\nvar CompileError = WebAssembly && WebAssembly.CompileError || Error;\nvar LinkError = WebAssembly && WebAssembly.LinkError || Error;\nvar RuntimeError = WebAssembly && WebAssembly.RuntimeError || Error;\nvar DOMException = getBuiltin('DOMException');\nvar Set = getBuiltin('Set');\nvar Map = getBuiltin('Map');\nvar MapPrototype = Map.prototype;\nvar mapHas = uncurryThis(MapPrototype.has);\nvar mapGet = uncurryThis(MapPrototype.get);\nvar mapSet = uncurryThis(MapPrototype.set);\nvar setAdd = uncurryThis(Set.prototype.add);\nvar objectKeys = getBuiltin('Object', 'keys');\nvar push = uncurryThis([].push);\nvar booleanValueOf = uncurryThis(true.valueOf);\nvar numberValueOf = uncurryThis(1.0.valueOf);\nvar stringValueOf = uncurryThis(''.valueOf);\nvar getFlags = uncurryThis(regExpFlags);\nvar getTime = uncurryThis(Date.prototype.getTime);\nvar PERFORMANCE_MARK = uid('structuredClone');\nvar DATA_CLONE_ERROR = 'DataCloneError';\nvar TRANSFERRING = 'Transferring';\nvar checkBasicSemantic = function (structuredCloneImplementation) {\n return !fails(function () {\n var set1 = new global.Set([7]);\n var set2 = structuredCloneImplementation(set1);\n var number = structuredCloneImplementation(Object(7));\n return set2 == set1 || !set2.has(7) || typeof number != 'object' || number != 7;\n }) && structuredCloneImplementation;\n};\nvar checkNewErrorsSemantic = function (structuredCloneImplementation) {\n return !fails(function () {\n var test = structuredCloneImplementation(new global.AggregateError([1], PERFORMANCE_MARK, { cause: 3 }));\n return test.name != 'AggregateError' || test.errors[0] != 1 || test.message != PERFORMANCE_MARK || test.cause != 3;\n }) && structuredCloneImplementation;\n};\nvar nativeStructuredClone = global.structuredClone;\nvar FORCED_REPLACEMENT = IS_PURE || !checkNewErrorsSemantic(nativeStructuredClone);\nvar structuredCloneFromMark = !nativeStructuredClone && checkBasicSemantic(function (value) {\n return new PerformanceMark(PERFORMANCE_MARK, { detail: value }).detail;\n});\nvar nativeRestrictedStructuredClone = checkBasicSemantic(nativeStructuredClone) || structuredCloneFromMark;\nvar throwUncloneable = function (type) {\n throw new DOMException('Uncloneable type: ' + type, DATA_CLONE_ERROR);\n};\nvar throwUnpolyfillable = function (type, kind) {\n throw new DOMException((kind || 'Cloning') + ' of ' + type + ' cannot be properly polyfilled in this engine', DATA_CLONE_ERROR);\n};\nvar structuredCloneInternal = function (value, map) {\n if (isSymbol(value))\n throwUncloneable('Symbol');\n if (!isObject(value))\n return value;\n if (map) {\n if (mapHas(map, value))\n return mapGet(map, value);\n } else\n map = new Map();\n var type = classof(value);\n var deep = false;\n var C, name, cloned, dataTransfer, i, length, keys, key, source, target;\n switch (type) {\n case 'Array':\n cloned = [];\n deep = true;\n break;\n case 'Object':\n cloned = {};\n deep = true;\n break;\n case 'Map':\n cloned = new Map();\n deep = true;\n break;\n case 'Set':\n cloned = new Set();\n deep = true;\n break;\n case 'RegExp':\n cloned = new RegExp(value.source, 'flags' in value ? value.flags : getFlags(value));\n break;\n case 'Error':\n name = value.name;\n switch (name) {\n case 'AggregateError':\n cloned = getBuiltin('AggregateError')([]);\n break;\n case 'EvalError':\n cloned = EvalError();\n break;\n case 'RangeError':\n cloned = RangeError();\n break;\n case 'ReferenceError':\n cloned = ReferenceError();\n break;\n case 'SyntaxError':\n cloned = SyntaxError();\n break;\n case 'TypeError':\n cloned = TypeError();\n break;\n case 'URIError':\n cloned = URIError();\n break;\n case 'CompileError':\n cloned = CompileError();\n break;\n case 'LinkError':\n cloned = LinkError();\n break;\n case 'RuntimeError':\n cloned = RuntimeError();\n break;\n default:\n cloned = Error();\n }\n deep = true;\n break;\n case 'DOMException':\n cloned = new DOMException(value.message, value.name);\n deep = true;\n break;\n case 'DataView':\n case 'Int8Array':\n case 'Uint8Array':\n case 'Uint8ClampedArray':\n case 'Int16Array':\n case 'Uint16Array':\n case 'Int32Array':\n case 'Uint32Array':\n case 'Float32Array':\n case 'Float64Array':\n case 'BigInt64Array':\n case 'BigUint64Array':\n C = global[type];\n if (!isObject(C))\n throwUnpolyfillable(type);\n cloned = new C(structuredCloneInternal(value.buffer, map), value.byteOffset, type === 'DataView' ? value.byteLength : value.length);\n break;\n case 'DOMQuad':\n try {\n cloned = new DOMQuad(structuredCloneInternal(value.p1, map), structuredCloneInternal(value.p2, map), structuredCloneInternal(value.p3, map), structuredCloneInternal(value.p4, map));\n } catch (error) {\n if (nativeRestrictedStructuredClone) {\n cloned = nativeRestrictedStructuredClone(value);\n } else\n throwUnpolyfillable(type);\n }\n break;\n case 'FileList':\n C = global.DataTransfer;\n if (isConstructor(C)) {\n dataTransfer = new C();\n for (i = 0, length = lengthOfArrayLike(value); i < length; i++) {\n dataTransfer.items.add(structuredCloneInternal(value[i], map));\n }\n cloned = dataTransfer.files;\n } else if (nativeRestrictedStructuredClone) {\n cloned = nativeRestrictedStructuredClone(value);\n } else\n throwUnpolyfillable(type);\n break;\n case 'ImageData':\n try {\n cloned = new ImageData(structuredCloneInternal(value.data, map), value.width, value.height, { colorSpace: value.colorSpace });\n } catch (error) {\n if (nativeRestrictedStructuredClone) {\n cloned = nativeRestrictedStructuredClone(value);\n } else\n throwUnpolyfillable(type);\n }\n break;\n default:\n if (nativeRestrictedStructuredClone) {\n cloned = nativeRestrictedStructuredClone(value);\n } else\n switch (type) {\n case 'BigInt':\n cloned = Object(value.valueOf());\n break;\n case 'Boolean':\n cloned = Object(booleanValueOf(value));\n break;\n case 'Number':\n cloned = Object(numberValueOf(value));\n break;\n case 'String':\n cloned = Object(stringValueOf(value));\n break;\n case 'Date':\n cloned = new Date(getTime(value));\n break;\n case 'ArrayBuffer':\n C = global.DataView;\n if (!C && typeof value.slice != 'function')\n throwUnpolyfillable(type);\n try {\n if (typeof value.slice == 'function') {\n cloned = value.slice(0);\n } else {\n length = value.byteLength;\n cloned = new ArrayBuffer(length);\n source = new C(value);\n target = new C(cloned);\n for (i = 0; i < length; i++) {\n target.setUint8(i, source.getUint8(i));\n }\n }\n } catch (error) {\n throw new DOMException('ArrayBuffer is detached', DATA_CLONE_ERROR);\n }\n break;\n case 'SharedArrayBuffer':\n cloned = value;\n break;\n case 'Blob':\n try {\n cloned = value.slice(0, value.size, value.type);\n } catch (error) {\n throwUnpolyfillable(type);\n }\n break;\n case 'DOMPoint':\n case 'DOMPointReadOnly':\n C = global[type];\n try {\n cloned = C.fromPoint ? C.fromPoint(value) : new C(value.x, value.y, value.z, value.w);\n } catch (error) {\n throwUnpolyfillable(type);\n }\n break;\n case 'DOMRect':\n case 'DOMRectReadOnly':\n C = global[type];\n try {\n cloned = C.fromRect ? C.fromRect(value) : new C(value.x, value.y, value.width, value.height);\n } catch (error) {\n throwUnpolyfillable(type);\n }\n break;\n case 'DOMMatrix':\n case 'DOMMatrixReadOnly':\n C = global[type];\n try {\n cloned = C.fromMatrix ? C.fromMatrix(value) : new C(value);\n } catch (error) {\n throwUnpolyfillable(type);\n }\n break;\n case 'AudioData':\n case 'VideoFrame':\n if (!isCallable(value.clone))\n throwUnpolyfillable(type);\n try {\n cloned = value.clone();\n } catch (error) {\n throwUncloneable(type);\n }\n break;\n case 'File':\n try {\n cloned = new File([value], value.name, value);\n } catch (error) {\n throwUnpolyfillable(type);\n }\n break;\n case 'CryptoKey':\n case 'GPUCompilationMessage':\n case 'GPUCompilationInfo':\n case 'ImageBitmap':\n case 'RTCCertificate':\n case 'WebAssembly.Module':\n throwUnpolyfillable(type);\n default:\n throwUncloneable(type);\n }\n }\n mapSet(map, value, cloned);\n if (deep)\n switch (type) {\n case 'Array':\n case 'Object':\n keys = objectKeys(value);\n for (i = 0, length = lengthOfArrayLike(keys); i < length; i++) {\n key = keys[i];\n createProperty(cloned, key, structuredCloneInternal(value[key], map));\n }\n break;\n case 'Map':\n value.forEach(function (v, k) {\n mapSet(cloned, structuredCloneInternal(k, map), structuredCloneInternal(v, map));\n });\n break;\n case 'Set':\n value.forEach(function (v) {\n setAdd(cloned, structuredCloneInternal(v, map));\n });\n break;\n case 'Error':\n createNonEnumerableProperty(cloned, 'message', structuredCloneInternal(value.message, map));\n if (hasOwn(value, 'cause')) {\n createNonEnumerableProperty(cloned, 'cause', structuredCloneInternal(value.cause, map));\n }\n if (name == 'AggregateError') {\n cloned.errors = structuredCloneInternal(value.errors, map);\n }\n case 'DOMException':\n if (ERROR_STACK_INSTALLABLE) {\n createNonEnumerableProperty(cloned, 'stack', structuredCloneInternal(value.stack, map));\n }\n }\n return cloned;\n};\nvar PROPER_TRANSFER = nativeStructuredClone && !fails(function () {\n var buffer = new ArrayBuffer(8);\n var clone = nativeStructuredClone(buffer, { transfer: [buffer] });\n return buffer.byteLength != 0 || clone.byteLength != 8;\n});\nvar tryToTransfer = function (rawTransfer, map) {\n if (!isObject(rawTransfer))\n throw TypeError('Transfer option cannot be converted to a sequence');\n var transfer = [];\n iterate(rawTransfer, function (value) {\n push(transfer, anObject(value));\n });\n var i = 0;\n var length = lengthOfArrayLike(transfer);\n var value, type, C, transferredArray, transferred, canvas, context;\n if (PROPER_TRANSFER) {\n transferredArray = nativeStructuredClone(transfer, { transfer: transfer });\n while (i < length)\n mapSet(map, transfer[i], transferredArray[i++]);\n } else\n while (i < length) {\n value = transfer[i++];\n if (mapHas(map, value))\n throw new DOMException('Duplicate transferable', DATA_CLONE_ERROR);\n type = classof(value);\n switch (type) {\n case 'ImageBitmap':\n C = global.OffscreenCanvas;\n if (!isConstructor(C))\n throwUnpolyfillable(type, TRANSFERRING);\n try {\n canvas = new C(value.width, value.height);\n context = canvas.getContext('bitmaprenderer');\n context.transferFromImageBitmap(value);\n transferred = canvas.transferToImageBitmap();\n } catch (error) {\n }\n break;\n case 'AudioData':\n case 'VideoFrame':\n if (!isCallable(value.clone) || !isCallable(value.close))\n throwUnpolyfillable(type, TRANSFERRING);\n try {\n transferred = value.clone();\n value.close();\n } catch (error) {\n }\n break;\n case 'ArrayBuffer':\n case 'MessagePort':\n case 'OffscreenCanvas':\n case 'ReadableStream':\n case 'TransformStream':\n case 'WritableStream':\n throwUnpolyfillable(type, TRANSFERRING);\n }\n if (transferred === undefined)\n throw new DOMException('This object cannot be transferred: ' + type, DATA_CLONE_ERROR);\n mapSet(map, value, transferred);\n }\n};\n$({\n global: true,\n enumerable: true,\n sham: !PROPER_TRANSFER,\n forced: FORCED_REPLACEMENT\n}, {\n structuredClone: function structuredClone(value) {\n var options = validateArgumentsLength(arguments.length, 1) > 1 ? anObject(arguments[1]) : undefined;\n var transfer = options ? options.transfer : undefined;\n var map;\n if (transfer !== undefined) {\n map = new Map();\n tryToTransfer(transfer, map);\n }\n return structuredCloneInternal(value, map);\n }\n});\n\n/***/ }),\n/* 143 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\n\"use strict\";\n\nvar anObject = __w_pdfjs_require__(49);\nmodule.exports = function () {\n var that = anObject(this);\n var result = '';\n if (that.global)\n result += 'g';\n if (that.ignoreCase)\n result += 'i';\n if (that.multiline)\n result += 'm';\n if (that.dotAll)\n result += 's';\n if (that.unicode)\n result += 'u';\n if (that.sticky)\n result += 'y';\n return result;\n};\n\n/***/ }),\n/* 144 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.build = exports.RenderTask = exports.PDFWorker = exports.PDFPageProxy = exports.PDFDocumentProxy = exports.PDFDocumentLoadingTask = exports.PDFDataRangeTransport = exports.LoopbackPort = exports.DefaultStandardFontDataFactory = exports.DefaultCanvasFactory = exports.DefaultCMapReaderFactory = void 0;\nexports.getDocument = getDocument;\nexports.setPDFNetworkStreamFactory = setPDFNetworkStreamFactory;\nexports.version = void 0;\n\nvar _regenerator = _interopRequireDefault(__w_pdfjs_require__(145));\n\nvar _util = __w_pdfjs_require__(1);\n\nvar _display_utils = __w_pdfjs_require__(147);\n\nvar _font_loader = __w_pdfjs_require__(149);\n\nvar _node_utils = __w_pdfjs_require__(150);\n\nvar _annotation_storage = __w_pdfjs_require__(151);\n\nvar _canvas = __w_pdfjs_require__(152);\n\nvar _worker_options = __w_pdfjs_require__(154);\n\nvar _is_node = __w_pdfjs_require__(3);\n\nvar _message_handler = __w_pdfjs_require__(155);\n\nvar _metadata = __w_pdfjs_require__(156);\n\nvar _optional_content_config = __w_pdfjs_require__(157);\n\nvar _transport_stream = __w_pdfjs_require__(158);\n\nvar _xfa_text = __w_pdfjs_require__(159);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }\n\nfunction _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError(\"attempted to get private field on non-instance\"); } return fn; }\n\nfunction _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }\n\nfunction _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError(\"Cannot initialize the same private elements twice on an object\"); } }\n\nfunction _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, \"set\"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }\n\nfunction _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError(\"attempted to set read only private field\"); } descriptor.value = value; } }\n\nfunction _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, \"get\"); return _classApplyDescriptorGet(receiver, descriptor); }\n\nfunction _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError(\"attempted to \" + action + \" private field on non-instance\"); } return privateMap.get(receiver); }\n\nfunction _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _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.\"); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _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; } } }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction 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); } }\n\nfunction _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); }); }; }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _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.\"); }\n\nfunction _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); }\n\nfunction _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; }\n\nfunction _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; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _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); }\n\nvar DEFAULT_RANGE_CHUNK_SIZE = 65536;\nvar RENDERING_CANCELLED_TIMEOUT = 100;\nvar DefaultCanvasFactory = _is_node.isNodeJS ? _node_utils.NodeCanvasFactory : _display_utils.DOMCanvasFactory;\nexports.DefaultCanvasFactory = DefaultCanvasFactory;\nvar DefaultCMapReaderFactory = _is_node.isNodeJS ? _node_utils.NodeCMapReaderFactory : _display_utils.DOMCMapReaderFactory;\nexports.DefaultCMapReaderFactory = DefaultCMapReaderFactory;\nvar DefaultStandardFontDataFactory = _is_node.isNodeJS ? _node_utils.NodeStandardFontDataFactory : _display_utils.DOMStandardFontDataFactory;\nexports.DefaultStandardFontDataFactory = DefaultStandardFontDataFactory;\nvar createPDFNetworkStream;\n\nfunction setPDFNetworkStreamFactory(pdfNetworkStreamFactory) {\n createPDFNetworkStream = pdfNetworkStreamFactory;\n}\n\nfunction getDocument(src) {\n var task = new PDFDocumentLoadingTask();\n var source;\n\n if (typeof src === \"string\" || src instanceof URL) {\n source = {\n url: src\n };\n } else if ((0, _util.isArrayBuffer)(src)) {\n source = {\n data: src\n };\n } else if (src instanceof PDFDataRangeTransport) {\n source = {\n range: src\n };\n } else {\n if (_typeof(src) !== \"object\") {\n throw new Error(\"Invalid parameter in getDocument, \" + \"need either string, URL, Uint8Array, or parameter object.\");\n }\n\n if (!src.url && !src.data && !src.range) {\n throw new Error(\"Invalid parameter object: need either .data, .range or .url\");\n }\n\n source = src;\n }\n\n var params = Object.create(null);\n var rangeTransport = null,\n worker = null;\n\n for (var key in source) {\n var value = source[key];\n\n switch (key) {\n case \"url\":\n if (typeof window !== \"undefined\") {\n try {\n params[key] = new URL(value, window.location).href;\n continue;\n } catch (ex) {\n (0, _util.warn)(\"Cannot create valid URL: \\\"\".concat(ex, \"\\\".\"));\n }\n } else if (typeof value === \"string\" || value instanceof URL) {\n params[key] = value.toString();\n continue;\n }\n\n throw new Error(\"Invalid PDF url data: \" + \"either string or URL-object is expected in the url property.\");\n\n case \"range\":\n rangeTransport = value;\n continue;\n\n case \"worker\":\n worker = value;\n continue;\n\n case \"data\":\n if (_is_node.isNodeJS && typeof Buffer !== \"undefined\" && value instanceof Buffer) {\n params[key] = new Uint8Array(value);\n } else if (value instanceof Uint8Array) {\n break;\n } else if (typeof value === \"string\") {\n params[key] = (0, _util.stringToBytes)(value);\n } else if (_typeof(value) === \"object\" && value !== null && !isNaN(value.length)) {\n params[key] = new Uint8Array(value);\n } else if ((0, _util.isArrayBuffer)(value)) {\n params[key] = new Uint8Array(value);\n } else {\n throw new Error(\"Invalid PDF binary data: either typed array, \" + \"string, or array-like object is expected in the data property.\");\n }\n\n continue;\n }\n\n params[key] = value;\n }\n\n params.rangeChunkSize = params.rangeChunkSize || DEFAULT_RANGE_CHUNK_SIZE;\n params.CMapReaderFactory = params.CMapReaderFactory || DefaultCMapReaderFactory;\n params.StandardFontDataFactory = params.StandardFontDataFactory || DefaultStandardFontDataFactory;\n params.ignoreErrors = params.stopAtErrors !== true;\n params.fontExtraProperties = params.fontExtraProperties === true;\n params.pdfBug = params.pdfBug === true;\n params.enableXfa = params.enableXfa === true;\n\n if (typeof params.docBaseUrl !== \"string\" || (0, _display_utils.isDataScheme)(params.docBaseUrl)) {\n params.docBaseUrl = null;\n }\n\n if (!Number.isInteger(params.maxImageSize)) {\n params.maxImageSize = -1;\n }\n\n if (typeof params.useWorkerFetch !== \"boolean\") {\n params.useWorkerFetch = params.CMapReaderFactory === _display_utils.DOMCMapReaderFactory && params.StandardFontDataFactory === _display_utils.DOMStandardFontDataFactory;\n }\n\n if (typeof params.isEvalSupported !== \"boolean\") {\n params.isEvalSupported = true;\n }\n\n if (typeof params.disableFontFace !== \"boolean\") {\n params.disableFontFace = _is_node.isNodeJS;\n }\n\n if (typeof params.useSystemFonts !== \"boolean\") {\n params.useSystemFonts = !_is_node.isNodeJS && !params.disableFontFace;\n }\n\n if (typeof params.ownerDocument === \"undefined\") {\n params.ownerDocument = globalThis.document;\n }\n\n if (typeof params.disableRange !== \"boolean\") {\n params.disableRange = false;\n }\n\n if (typeof params.disableStream !== \"boolean\") {\n params.disableStream = false;\n }\n\n if (typeof params.disableAutoFetch !== \"boolean\") {\n params.disableAutoFetch = false;\n }\n\n (0, _util.setVerbosityLevel)(params.verbosity);\n\n if (!worker) {\n var workerParams = {\n verbosity: params.verbosity,\n port: _worker_options.GlobalWorkerOptions.workerPort\n };\n worker = workerParams.port ? PDFWorker.fromPort(workerParams) : new PDFWorker(workerParams);\n task._worker = worker;\n }\n\n var docId = task.docId;\n worker.promise.then(function () {\n if (task.destroyed) {\n throw new Error(\"Loading aborted\");\n }\n\n var workerIdPromise = _fetchDocument(worker, params, rangeTransport, docId);\n\n var networkStreamPromise = new Promise(function (resolve) {\n var networkStream;\n\n if (rangeTransport) {\n networkStream = new _transport_stream.PDFDataTransportStream({\n length: params.length,\n initialData: params.initialData,\n progressiveDone: params.progressiveDone,\n contentDispositionFilename: params.contentDispositionFilename,\n disableRange: params.disableRange,\n disableStream: params.disableStream\n }, rangeTransport);\n } else if (!params.data) {\n networkStream = createPDFNetworkStream({\n url: params.url,\n length: params.length,\n httpHeaders: params.httpHeaders,\n withCredentials: params.withCredentials,\n rangeChunkSize: params.rangeChunkSize,\n disableRange: params.disableRange,\n disableStream: params.disableStream\n });\n }\n\n resolve(networkStream);\n });\n return Promise.all([workerIdPromise, networkStreamPromise]).then(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n workerId = _ref2[0],\n networkStream = _ref2[1];\n\n if (task.destroyed) {\n throw new Error(\"Loading aborted\");\n }\n\n var messageHandler = new _message_handler.MessageHandler(docId, workerId, worker.port);\n var transport = new WorkerTransport(messageHandler, task, networkStream, params);\n task._transport = transport;\n messageHandler.send(\"Ready\", null);\n });\n })[\"catch\"](task._capability.reject);\n return task;\n}\n\nfunction _fetchDocument(_x, _x2, _x3, _x4) {\n return _fetchDocument2.apply(this, arguments);\n}\n\nfunction _fetchDocument2() {\n _fetchDocument2 = _asyncToGenerator( /*#__PURE__*/_regenerator[\"default\"].mark(function _callee7(worker, source, pdfDataRangeTransport, docId) {\n var workerId;\n return _regenerator[\"default\"].wrap(function _callee7$(_context7) {\n while (1) {\n switch (_context7.prev = _context7.next) {\n case 0:\n if (!worker.destroyed) {\n _context7.next = 2;\n break;\n }\n\n throw new Error(\"Worker was destroyed\");\n\n case 2:\n if (pdfDataRangeTransport) {\n source.length = pdfDataRangeTransport.length;\n source.initialData = pdfDataRangeTransport.initialData;\n source.progressiveDone = pdfDataRangeTransport.progressiveDone;\n source.contentDispositionFilename = pdfDataRangeTransport.contentDispositionFilename;\n }\n\n _context7.next = 5;\n return worker.messageHandler.sendWithPromise(\"GetDocRequest\", {\n docId: docId,\n apiVersion: '2.13.216',\n source: {\n data: source.data,\n url: source.url,\n password: source.password,\n disableAutoFetch: source.disableAutoFetch,\n rangeChunkSize: source.rangeChunkSize,\n length: source.length\n },\n maxImageSize: source.maxImageSize,\n disableFontFace: source.disableFontFace,\n docBaseUrl: source.docBaseUrl,\n ignoreErrors: source.ignoreErrors,\n isEvalSupported: source.isEvalSupported,\n fontExtraProperties: source.fontExtraProperties,\n enableXfa: source.enableXfa,\n useSystemFonts: source.useSystemFonts,\n cMapUrl: source.useWorkerFetch ? source.cMapUrl : null,\n standardFontDataUrl: source.useWorkerFetch ? source.standardFontDataUrl : null\n });\n\n case 5:\n workerId = _context7.sent;\n\n if (!worker.destroyed) {\n _context7.next = 8;\n break;\n }\n\n throw new Error(\"Worker was destroyed\");\n\n case 8:\n return _context7.abrupt(\"return\", workerId);\n\n case 9:\n case \"end\":\n return _context7.stop();\n }\n }\n }, _callee7);\n }));\n return _fetchDocument2.apply(this, arguments);\n}\n\nvar PDFDocumentLoadingTask = /*#__PURE__*/function () {\n function PDFDocumentLoadingTask() {\n _classCallCheck(this, PDFDocumentLoadingTask);\n\n this._capability = (0, _util.createPromiseCapability)();\n this._transport = null;\n this._worker = null;\n this.docId = \"d\".concat(PDFDocumentLoadingTask.idCounters.doc++);\n this.destroyed = false;\n this.onPassword = null;\n this.onProgress = null;\n this.onUnsupportedFeature = null;\n }\n\n _createClass(PDFDocumentLoadingTask, [{\n key: \"promise\",\n get: function get() {\n return this._capability.promise;\n }\n }, {\n key: \"destroy\",\n value: function () {\n var _destroy = _asyncToGenerator( /*#__PURE__*/_regenerator[\"default\"].mark(function _callee() {\n var _this$_transport;\n\n return _regenerator[\"default\"].wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n this.destroyed = true;\n _context.next = 3;\n return (_this$_transport = this._transport) === null || _this$_transport === void 0 ? void 0 : _this$_transport.destroy();\n\n case 3:\n this._transport = null;\n\n if (this._worker) {\n this._worker.destroy();\n\n this._worker = null;\n }\n\n case 5:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n\n function destroy() {\n return _destroy.apply(this, arguments);\n }\n\n return destroy;\n }()\n }], [{\n key: \"idCounters\",\n get: function get() {\n return (0, _util.shadow)(this, \"idCounters\", {\n doc: 0\n });\n }\n }]);\n\n return PDFDocumentLoadingTask;\n}();\n\nexports.PDFDocumentLoadingTask = PDFDocumentLoadingTask;\n\nvar PDFDataRangeTransport = /*#__PURE__*/function () {\n function PDFDataRangeTransport(length, initialData) {\n var progressiveDone = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var contentDispositionFilename = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;\n\n _classCallCheck(this, PDFDataRangeTransport);\n\n this.length = length;\n this.initialData = initialData;\n this.progressiveDone = progressiveDone;\n this.contentDispositionFilename = contentDispositionFilename;\n this._rangeListeners = [];\n this._progressListeners = [];\n this._progressiveReadListeners = [];\n this._progressiveDoneListeners = [];\n this._readyCapability = (0, _util.createPromiseCapability)();\n }\n\n _createClass(PDFDataRangeTransport, [{\n key: \"addRangeListener\",\n value: function addRangeListener(listener) {\n this._rangeListeners.push(listener);\n }\n }, {\n key: \"addProgressListener\",\n value: function addProgressListener(listener) {\n this._progressListeners.push(listener);\n }\n }, {\n key: \"addProgressiveReadListener\",\n value: function addProgressiveReadListener(listener) {\n this._progressiveReadListeners.push(listener);\n }\n }, {\n key: \"addProgressiveDoneListener\",\n value: function addProgressiveDoneListener(listener) {\n this._progressiveDoneListeners.push(listener);\n }\n }, {\n key: \"onDataRange\",\n value: function onDataRange(begin, chunk) {\n var _iterator = _createForOfIteratorHelper(this._rangeListeners),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var listener = _step.value;\n listener(begin, chunk);\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n }\n }, {\n key: \"onDataProgress\",\n value: function onDataProgress(loaded, total) {\n var _this = this;\n\n this._readyCapability.promise.then(function () {\n var _iterator2 = _createForOfIteratorHelper(_this._progressListeners),\n _step2;\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var listener = _step2.value;\n listener(loaded, total);\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n });\n }\n }, {\n key: \"onDataProgressiveRead\",\n value: function onDataProgressiveRead(chunk) {\n var _this2 = this;\n\n this._readyCapability.promise.then(function () {\n var _iterator3 = _createForOfIteratorHelper(_this2._progressiveReadListeners),\n _step3;\n\n try {\n for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n var listener = _step3.value;\n listener(chunk);\n }\n } catch (err) {\n _iterator3.e(err);\n } finally {\n _iterator3.f();\n }\n });\n }\n }, {\n key: \"onDataProgressiveDone\",\n value: function onDataProgressiveDone() {\n var _this3 = this;\n\n this._readyCapability.promise.then(function () {\n var _iterator4 = _createForOfIteratorHelper(_this3._progressiveDoneListeners),\n _step4;\n\n try {\n for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {\n var listener = _step4.value;\n listener();\n }\n } catch (err) {\n _iterator4.e(err);\n } finally {\n _iterator4.f();\n }\n });\n }\n }, {\n key: \"transportReady\",\n value: function transportReady() {\n this._readyCapability.resolve();\n }\n }, {\n key: \"requestDataRange\",\n value: function requestDataRange(begin, end) {\n (0, _util.unreachable)(\"Abstract method PDFDataRangeTransport.requestDataRange\");\n }\n }, {\n key: \"abort\",\n value: function abort() {}\n }]);\n\n return PDFDataRangeTransport;\n}();\n\nexports.PDFDataRangeTransport = PDFDataRangeTransport;\n\nvar PDFDocumentProxy = /*#__PURE__*/function () {\n function PDFDocumentProxy(pdfInfo, transport) {\n var _this4 = this;\n\n _classCallCheck(this, PDFDocumentProxy);\n\n this._pdfInfo = pdfInfo;\n this._transport = transport;\n Object.defineProperty(this, \"fingerprint\", {\n get: function get() {\n (0, _display_utils.deprecated)(\"`PDFDocumentProxy.fingerprint`, \" + \"please use `PDFDocumentProxy.fingerprints` instead.\");\n return this.fingerprints[0];\n }\n });\n Object.defineProperty(this, \"getStats\", {\n value: function () {\n var _value = _asyncToGenerator( /*#__PURE__*/_regenerator[\"default\"].mark(function _callee2() {\n return _regenerator[\"default\"].wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n (0, _display_utils.deprecated)(\"`PDFDocumentProxy.getStats`, \" + \"please use the `PDFDocumentProxy.stats`-getter instead.\");\n return _context2.abrupt(\"return\", _this4.stats || {\n streamTypes: {},\n fontTypes: {}\n });\n\n case 2:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2);\n }));\n\n function value() {\n return _value.apply(this, arguments);\n }\n\n return value;\n }()\n });\n }\n\n _createClass(PDFDocumentProxy, [{\n key: \"annotationStorage\",\n get: function get() {\n return this._transport.annotationStorage;\n }\n }, {\n key: \"numPages\",\n get: function get() {\n return this._pdfInfo.numPages;\n }\n }, {\n key: \"fingerprints\",\n get: function get() {\n return this._pdfInfo.fingerprints;\n }\n }, {\n key: \"stats\",\n get: function get() {\n return this._transport.stats;\n }\n }, {\n key: \"isPureXfa\",\n get: function get() {\n return !!this._transport._htmlForXfa;\n }\n }, {\n key: \"allXfaHtml\",\n get: function get() {\n return this._transport._htmlForXfa;\n }\n }, {\n key: \"getPage\",\n value: function getPage(pageNumber) {\n return this._transport.getPage(pageNumber);\n }\n }, {\n key: \"getPageIndex\",\n value: function getPageIndex(ref) {\n return this._transport.getPageIndex(ref);\n }\n }, {\n key: \"getDestinations\",\n value: function getDestinations() {\n return this._transport.getDestinations();\n }\n }, {\n key: \"getDestination\",\n value: function getDestination(id) {\n return this._transport.getDestination(id);\n }\n }, {\n key: \"getPageLabels\",\n value: function getPageLabels() {\n return this._transport.getPageLabels();\n }\n }, {\n key: \"getPageLayout\",\n value: function getPageLayout() {\n return this._transport.getPageLayout();\n }\n }, {\n key: \"getPageMode\",\n value: function getPageMode() {\n return this._transport.getPageMode();\n }\n }, {\n key: \"getViewerPreferences\",\n value: function getViewerPreferences() {\n return this._transport.getViewerPreferences();\n }\n }, {\n key: \"getOpenAction\",\n value: function getOpenAction() {\n return this._transport.getOpenAction();\n }\n }, {\n key: \"getAttachments\",\n value: function getAttachments() {\n return this._transport.getAttachments();\n }\n }, {\n key: \"getJavaScript\",\n value: function getJavaScript() {\n return this._transport.getJavaScript();\n }\n }, {\n key: \"getJSActions\",\n value: function getJSActions() {\n return this._transport.getDocJSActions();\n }\n }, {\n key: \"getOutline\",\n value: function getOutline() {\n return this._transport.getOutline();\n }\n }, {\n key: \"getOptionalContentConfig\",\n value: function getOptionalContentConfig() {\n return this._transport.getOptionalContentConfig();\n }\n }, {\n key: \"getPermissions\",\n value: function getPermissions() {\n return this._transport.getPermissions();\n }\n }, {\n key: \"getMetadata\",\n value: function getMetadata() {\n return this._transport.getMetadata();\n }\n }, {\n key: \"getMarkInfo\",\n value: function getMarkInfo() {\n return this._transport.getMarkInfo();\n }\n }, {\n key: \"getData\",\n value: function getData() {\n return this._transport.getData();\n }\n }, {\n key: \"getDownloadInfo\",\n value: function getDownloadInfo() {\n return this._transport.downloadInfoCapability.promise;\n }\n }, {\n key: \"cleanup\",\n value: function cleanup() {\n var keepLoadedFonts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n return this._transport.startCleanup(keepLoadedFonts || this.isPureXfa);\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n return this.loadingTask.destroy();\n }\n }, {\n key: \"loadingParams\",\n get: function get() {\n return this._transport.loadingParams;\n }\n }, {\n key: \"loadingTask\",\n get: function get() {\n return this._transport.loadingTask;\n }\n }, {\n key: \"saveDocument\",\n value: function saveDocument() {\n if (this._transport.annotationStorage.size <= 0) {\n (0, _display_utils.deprecated)(\"saveDocument called while `annotationStorage` is empty, \" + \"please use the getData-method instead.\");\n }\n\n return this._transport.saveDocument();\n }\n }, {\n key: \"getFieldObjects\",\n value: function getFieldObjects() {\n return this._transport.getFieldObjects();\n }\n }, {\n key: \"hasJSActions\",\n value: function hasJSActions() {\n return this._transport.hasJSActions();\n }\n }, {\n key: \"getCalculationOrderIds\",\n value: function getCalculationOrderIds() {\n return this._transport.getCalculationOrderIds();\n }\n }]);\n\n return PDFDocumentProxy;\n}();\n\nexports.PDFDocumentProxy = PDFDocumentProxy;\n\nvar PDFPageProxy = /*#__PURE__*/function () {\n function PDFPageProxy(pageIndex, pageInfo, transport, ownerDocument) {\n var pdfBug = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;\n\n _classCallCheck(this, PDFPageProxy);\n\n this._pageIndex = pageIndex;\n this._pageInfo = pageInfo;\n this._ownerDocument = ownerDocument;\n this._transport = transport;\n this._stats = pdfBug ? new _display_utils.StatTimer() : null;\n this._pdfBug = pdfBug;\n this.commonObjs = transport.commonObjs;\n this.objs = new PDFObjects();\n this.cleanupAfterRender = false;\n this.pendingCleanup = false;\n this._intentStates = new Map();\n this._annotationPromises = new Map();\n this.destroyed = false;\n }\n\n _createClass(PDFPageProxy, [{\n key: \"pageNumber\",\n get: function get() {\n return this._pageIndex + 1;\n }\n }, {\n key: \"rotate\",\n get: function get() {\n return this._pageInfo.rotate;\n }\n }, {\n key: \"ref\",\n get: function get() {\n return this._pageInfo.ref;\n }\n }, {\n key: \"userUnit\",\n get: function get() {\n return this._pageInfo.userUnit;\n }\n }, {\n key: \"view\",\n get: function get() {\n return this._pageInfo.view;\n }\n }, {\n key: \"getViewport\",\n value: function getViewport() {\n var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n scale = _ref3.scale,\n _ref3$rotation = _ref3.rotation,\n rotation = _ref3$rotation === void 0 ? this.rotate : _ref3$rotation,\n _ref3$offsetX = _ref3.offsetX,\n offsetX = _ref3$offsetX === void 0 ? 0 : _ref3$offsetX,\n _ref3$offsetY = _ref3.offsetY,\n offsetY = _ref3$offsetY === void 0 ? 0 : _ref3$offsetY,\n _ref3$dontFlip = _ref3.dontFlip,\n dontFlip = _ref3$dontFlip === void 0 ? false : _ref3$dontFlip;\n\n return new _display_utils.PageViewport({\n viewBox: this.view,\n scale: scale,\n rotation: rotation,\n offsetX: offsetX,\n offsetY: offsetY,\n dontFlip: dontFlip\n });\n }\n }, {\n key: \"getAnnotations\",\n value: function getAnnotations() {\n var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref4$intent = _ref4.intent,\n intent = _ref4$intent === void 0 ? \"display\" : _ref4$intent;\n\n var intentArgs = this._transport.getRenderingIntent(intent);\n\n var promise = this._annotationPromises.get(intentArgs.cacheKey);\n\n if (!promise) {\n promise = this._transport.getAnnotations(this._pageIndex, intentArgs.renderingIntent);\n\n this._annotationPromises.set(intentArgs.cacheKey, promise);\n\n promise = promise.then(function (annotations) {\n var _iterator5 = _createForOfIteratorHelper(annotations),\n _step5;\n\n try {\n var _loop = function _loop() {\n var annotation = _step5.value;\n\n if (annotation.titleObj !== undefined) {\n Object.defineProperty(annotation, \"title\", {\n get: function get() {\n (0, _display_utils.deprecated)(\"`title`-property on annotation, please use `titleObj` instead.\");\n return annotation.titleObj.str;\n }\n });\n }\n\n if (annotation.contentsObj !== undefined) {\n Object.defineProperty(annotation, \"contents\", {\n get: function get() {\n (0, _display_utils.deprecated)(\"`contents`-property on annotation, please use `contentsObj` instead.\");\n return annotation.contentsObj.str;\n }\n });\n }\n };\n\n for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {\n _loop();\n }\n } catch (err) {\n _iterator5.e(err);\n } finally {\n _iterator5.f();\n }\n\n return annotations;\n });\n }\n\n return promise;\n }\n }, {\n key: \"getJSActions\",\n value: function getJSActions() {\n return this._jsActionsPromise || (this._jsActionsPromise = this._transport.getPageJSActions(this._pageIndex));\n }\n }, {\n key: \"getXfa\",\n value: function () {\n var _getXfa = _asyncToGenerator( /*#__PURE__*/_regenerator[\"default\"].mark(function _callee3() {\n var _this$_transport$_htm;\n\n return _regenerator[\"default\"].wrap(function _callee3$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n return _context3.abrupt(\"return\", ((_this$_transport$_htm = this._transport._htmlForXfa) === null || _this$_transport$_htm === void 0 ? void 0 : _this$_transport$_htm.children[this._pageIndex]) || null);\n\n case 1:\n case \"end\":\n return _context3.stop();\n }\n }\n }, _callee3, this);\n }));\n\n function getXfa() {\n return _getXfa.apply(this, arguments);\n }\n\n return getXfa;\n }()\n }, {\n key: \"render\",\n value: function render(_ref5) {\n var _arguments$,\n _arguments$2,\n _this5 = this,\n _intentState;\n\n var canvasContext = _ref5.canvasContext,\n viewport = _ref5.viewport,\n _ref5$intent = _ref5.intent,\n intent = _ref5$intent === void 0 ? \"display\" : _ref5$intent,\n _ref5$annotationMode = _ref5.annotationMode,\n annotationMode = _ref5$annotationMode === void 0 ? _util.AnnotationMode.ENABLE : _ref5$annotationMode,\n _ref5$transform = _ref5.transform,\n transform = _ref5$transform === void 0 ? null : _ref5$transform,\n _ref5$imageLayer = _ref5.imageLayer,\n imageLayer = _ref5$imageLayer === void 0 ? null : _ref5$imageLayer,\n _ref5$canvasFactory = _ref5.canvasFactory,\n canvasFactory = _ref5$canvasFactory === void 0 ? null : _ref5$canvasFactory,\n _ref5$background = _ref5.background,\n background = _ref5$background === void 0 ? null : _ref5$background,\n _ref5$optionalContent = _ref5.optionalContentConfigPromise,\n optionalContentConfigPromise = _ref5$optionalContent === void 0 ? null : _ref5$optionalContent,\n _ref5$annotationCanva = _ref5.annotationCanvasMap,\n annotationCanvasMap = _ref5$annotationCanva === void 0 ? null : _ref5$annotationCanva;\n\n if (((_arguments$ = arguments[0]) === null || _arguments$ === void 0 ? void 0 : _arguments$.renderInteractiveForms) !== undefined) {\n (0, _display_utils.deprecated)(\"render no longer accepts the `renderInteractiveForms`-option, \" + \"please use the `annotationMode`-option instead.\");\n\n if (arguments[0].renderInteractiveForms === true && annotationMode === _util.AnnotationMode.ENABLE) {\n annotationMode = _util.AnnotationMode.ENABLE_FORMS;\n }\n }\n\n if (((_arguments$2 = arguments[0]) === null || _arguments$2 === void 0 ? void 0 : _arguments$2.includeAnnotationStorage) !== undefined) {\n (0, _display_utils.deprecated)(\"render no longer accepts the `includeAnnotationStorage`-option, \" + \"please use the `annotationMode`-option instead.\");\n\n if (arguments[0].includeAnnotationStorage === true && annotationMode === _util.AnnotationMode.ENABLE) {\n annotationMode = _util.AnnotationMode.ENABLE_STORAGE;\n }\n }\n\n if (this._stats) {\n this._stats.time(\"Overall\");\n }\n\n var intentArgs = this._transport.getRenderingIntent(intent, annotationMode);\n\n this.pendingCleanup = false;\n\n if (!optionalContentConfigPromise) {\n optionalContentConfigPromise = this._transport.getOptionalContentConfig();\n }\n\n var intentState = this._intentStates.get(intentArgs.cacheKey);\n\n if (!intentState) {\n intentState = Object.create(null);\n\n this._intentStates.set(intentArgs.cacheKey, intentState);\n }\n\n if (intentState.streamReaderCancelTimeout) {\n clearTimeout(intentState.streamReaderCancelTimeout);\n intentState.streamReaderCancelTimeout = null;\n }\n\n var canvasFactoryInstance = canvasFactory || new DefaultCanvasFactory({\n ownerDocument: this._ownerDocument\n });\n var intentPrint = !!(intentArgs.renderingIntent & _util.RenderingIntentFlag.PRINT);\n\n if (!intentState.displayReadyCapability) {\n intentState.displayReadyCapability = (0, _util.createPromiseCapability)();\n intentState.operatorList = {\n fnArray: [],\n argsArray: [],\n lastChunk: false\n };\n\n if (this._stats) {\n this._stats.time(\"Page Request\");\n }\n\n this._pumpOperatorList(intentArgs);\n }\n\n var complete = function complete(error) {\n intentState.renderTasks[\"delete\"](internalRenderTask);\n\n if (_this5.cleanupAfterRender || intentPrint) {\n _this5.pendingCleanup = true;\n }\n\n _this5._tryCleanup();\n\n if (error) {\n internalRenderTask.capability.reject(error);\n\n _this5._abortOperatorList({\n intentState: intentState,\n reason: error instanceof Error ? error : new Error(error)\n });\n } else {\n internalRenderTask.capability.resolve();\n }\n\n if (_this5._stats) {\n _this5._stats.timeEnd(\"Rendering\");\n\n _this5._stats.timeEnd(\"Overall\");\n }\n };\n\n var internalRenderTask = new InternalRenderTask({\n callback: complete,\n params: {\n canvasContext: canvasContext,\n viewport: viewport,\n transform: transform,\n imageLayer: imageLayer,\n background: background\n },\n objs: this.objs,\n commonObjs: this.commonObjs,\n annotationCanvasMap: annotationCanvasMap,\n operatorList: intentState.operatorList,\n pageIndex: this._pageIndex,\n canvasFactory: canvasFactoryInstance,\n useRequestAnimationFrame: !intentPrint,\n pdfBug: this._pdfBug\n });\n ((_intentState = intentState).renderTasks || (_intentState.renderTasks = new Set())).add(internalRenderTask);\n var renderTask = internalRenderTask.task;\n Promise.all([intentState.displayReadyCapability.promise, optionalContentConfigPromise]).then(function (_ref6) {\n var _ref7 = _slicedToArray(_ref6, 2),\n transparency = _ref7[0],\n optionalContentConfig = _ref7[1];\n\n if (_this5.pendingCleanup) {\n complete();\n return;\n }\n\n if (_this5._stats) {\n _this5._stats.time(\"Rendering\");\n }\n\n internalRenderTask.initializeGraphics({\n transparency: transparency,\n optionalContentConfig: optionalContentConfig\n });\n internalRenderTask.operatorListChanged();\n })[\"catch\"](complete);\n return renderTask;\n }\n }, {\n key: \"getOperatorList\",\n value: function getOperatorList() {\n var _ref8 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref8$intent = _ref8.intent,\n intent = _ref8$intent === void 0 ? \"display\" : _ref8$intent,\n _ref8$annotationMode = _ref8.annotationMode,\n annotationMode = _ref8$annotationMode === void 0 ? _util.AnnotationMode.ENABLE : _ref8$annotationMode;\n\n function operatorListChanged() {\n if (intentState.operatorList.lastChunk) {\n intentState.opListReadCapability.resolve(intentState.operatorList);\n intentState.renderTasks[\"delete\"](opListTask);\n }\n }\n\n var intentArgs = this._transport.getRenderingIntent(intent, annotationMode, true);\n\n var intentState = this._intentStates.get(intentArgs.cacheKey);\n\n if (!intentState) {\n intentState = Object.create(null);\n\n this._intentStates.set(intentArgs.cacheKey, intentState);\n }\n\n var opListTask;\n\n if (!intentState.opListReadCapability) {\n var _intentState2;\n\n opListTask = Object.create(null);\n opListTask.operatorListChanged = operatorListChanged;\n intentState.opListReadCapability = (0, _util.createPromiseCapability)();\n ((_intentState2 = intentState).renderTasks || (_intentState2.renderTasks = new Set())).add(opListTask);\n intentState.operatorList = {\n fnArray: [],\n argsArray: [],\n lastChunk: false\n };\n\n if (this._stats) {\n this._stats.time(\"Page Request\");\n }\n\n this._pumpOperatorList(intentArgs);\n }\n\n return intentState.opListReadCapability.promise;\n }\n }, {\n key: \"streamTextContent\",\n value: function streamTextContent() {\n var _ref9 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref9$disableCombineT = _ref9.disableCombineTextItems,\n disableCombineTextItems = _ref9$disableCombineT === void 0 ? false : _ref9$disableCombineT,\n _ref9$includeMarkedCo = _ref9.includeMarkedContent,\n includeMarkedContent = _ref9$includeMarkedCo === void 0 ? false : _ref9$includeMarkedCo;\n\n var TEXT_CONTENT_CHUNK_SIZE = 100;\n return this._transport.messageHandler.sendWithStream(\"GetTextContent\", {\n pageIndex: this._pageIndex,\n combineTextItems: disableCombineTextItems !== true,\n includeMarkedContent: includeMarkedContent === true\n }, {\n highWaterMark: TEXT_CONTENT_CHUNK_SIZE,\n size: function size(textContent) {\n return textContent.items.length;\n }\n });\n }\n }, {\n key: \"getTextContent\",\n value: function getTextContent() {\n var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n if (this._transport._htmlForXfa) {\n return this.getXfa().then(function (xfa) {\n return _xfa_text.XfaText.textContent(xfa);\n });\n }\n\n var readableStream = this.streamTextContent(params);\n return new Promise(function (resolve, reject) {\n function pump() {\n reader.read().then(function (_ref10) {\n var _textContent$items;\n\n var value = _ref10.value,\n done = _ref10.done;\n\n if (done) {\n resolve(textContent);\n return;\n }\n\n Object.assign(textContent.styles, value.styles);\n\n (_textContent$items = textContent.items).push.apply(_textContent$items, _toConsumableArray(value.items));\n\n pump();\n }, reject);\n }\n\n var reader = readableStream.getReader();\n var textContent = {\n items: [],\n styles: Object.create(null)\n };\n pump();\n });\n }\n }, {\n key: \"getStructTree\",\n value: function getStructTree() {\n return this._structTreePromise || (this._structTreePromise = this._transport.getStructTree(this._pageIndex));\n }\n }, {\n key: \"_destroy\",\n value: function _destroy() {\n this.destroyed = true;\n var waitOn = [];\n\n var _iterator6 = _createForOfIteratorHelper(this._intentStates.values()),\n _step6;\n\n try {\n for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {\n var intentState = _step6.value;\n\n this._abortOperatorList({\n intentState: intentState,\n reason: new Error(\"Page was destroyed.\"),\n force: true\n });\n\n if (intentState.opListReadCapability) {\n continue;\n }\n\n var _iterator7 = _createForOfIteratorHelper(intentState.renderTasks),\n _step7;\n\n try {\n for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {\n var internalRenderTask = _step7.value;\n waitOn.push(internalRenderTask.completed);\n internalRenderTask.cancel();\n }\n } catch (err) {\n _iterator7.e(err);\n } finally {\n _iterator7.f();\n }\n }\n } catch (err) {\n _iterator6.e(err);\n } finally {\n _iterator6.f();\n }\n\n this.objs.clear();\n\n this._annotationPromises.clear();\n\n this._jsActionsPromise = null;\n this._structTreePromise = null;\n this.pendingCleanup = false;\n return Promise.all(waitOn);\n }\n }, {\n key: \"cleanup\",\n value: function cleanup() {\n var resetStats = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n this.pendingCleanup = true;\n return this._tryCleanup(resetStats);\n }\n }, {\n key: \"_tryCleanup\",\n value: function _tryCleanup() {\n var resetStats = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n if (!this.pendingCleanup) {\n return false;\n }\n\n var _iterator8 = _createForOfIteratorHelper(this._intentStates.values()),\n _step8;\n\n try {\n for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {\n var _step8$value = _step8.value,\n renderTasks = _step8$value.renderTasks,\n operatorList = _step8$value.operatorList;\n\n if (renderTasks.size > 0 || !operatorList.lastChunk) {\n return false;\n }\n }\n } catch (err) {\n _iterator8.e(err);\n } finally {\n _iterator8.f();\n }\n\n this._intentStates.clear();\n\n this.objs.clear();\n\n this._annotationPromises.clear();\n\n this._jsActionsPromise = null;\n this._structTreePromise = null;\n\n if (resetStats && this._stats) {\n this._stats = new _display_utils.StatTimer();\n }\n\n this.pendingCleanup = false;\n return true;\n }\n }, {\n key: \"_startRenderPage\",\n value: function _startRenderPage(transparency, cacheKey) {\n var intentState = this._intentStates.get(cacheKey);\n\n if (!intentState) {\n return;\n }\n\n if (this._stats) {\n this._stats.timeEnd(\"Page Request\");\n }\n\n if (intentState.displayReadyCapability) {\n intentState.displayReadyCapability.resolve(transparency);\n }\n }\n }, {\n key: \"_renderPageChunk\",\n value: function _renderPageChunk(operatorListChunk, intentState) {\n for (var i = 0, ii = operatorListChunk.length; i < ii; i++) {\n intentState.operatorList.fnArray.push(operatorListChunk.fnArray[i]);\n intentState.operatorList.argsArray.push(operatorListChunk.argsArray[i]);\n }\n\n intentState.operatorList.lastChunk = operatorListChunk.lastChunk;\n\n var _iterator9 = _createForOfIteratorHelper(intentState.renderTasks),\n _step9;\n\n try {\n for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {\n var internalRenderTask = _step9.value;\n internalRenderTask.operatorListChanged();\n }\n } catch (err) {\n _iterator9.e(err);\n } finally {\n _iterator9.f();\n }\n\n if (operatorListChunk.lastChunk) {\n this._tryCleanup();\n }\n }\n }, {\n key: \"_pumpOperatorList\",\n value: function _pumpOperatorList(_ref11) {\n var _this6 = this;\n\n var renderingIntent = _ref11.renderingIntent,\n cacheKey = _ref11.cacheKey;\n\n var readableStream = this._transport.messageHandler.sendWithStream(\"GetOperatorList\", {\n pageIndex: this._pageIndex,\n intent: renderingIntent,\n cacheKey: cacheKey,\n annotationStorage: renderingIntent & _util.RenderingIntentFlag.ANNOTATIONS_STORAGE ? this._transport.annotationStorage.serializable : null\n });\n\n var reader = readableStream.getReader();\n\n var intentState = this._intentStates.get(cacheKey);\n\n intentState.streamReader = reader;\n\n var pump = function pump() {\n reader.read().then(function (_ref12) {\n var value = _ref12.value,\n done = _ref12.done;\n\n if (done) {\n intentState.streamReader = null;\n return;\n }\n\n if (_this6._transport.destroyed) {\n return;\n }\n\n _this6._renderPageChunk(value, intentState);\n\n pump();\n }, function (reason) {\n intentState.streamReader = null;\n\n if (_this6._transport.destroyed) {\n return;\n }\n\n if (intentState.operatorList) {\n intentState.operatorList.lastChunk = true;\n\n var _iterator10 = _createForOfIteratorHelper(intentState.renderTasks),\n _step10;\n\n try {\n for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {\n var internalRenderTask = _step10.value;\n internalRenderTask.operatorListChanged();\n }\n } catch (err) {\n _iterator10.e(err);\n } finally {\n _iterator10.f();\n }\n\n _this6._tryCleanup();\n }\n\n if (intentState.displayReadyCapability) {\n intentState.displayReadyCapability.reject(reason);\n } else if (intentState.opListReadCapability) {\n intentState.opListReadCapability.reject(reason);\n } else {\n throw reason;\n }\n });\n };\n\n pump();\n }\n }, {\n key: \"_abortOperatorList\",\n value: function _abortOperatorList(_ref13) {\n var _this7 = this;\n\n var intentState = _ref13.intentState,\n reason = _ref13.reason,\n _ref13$force = _ref13.force,\n force = _ref13$force === void 0 ? false : _ref13$force;\n\n if (!intentState.streamReader) {\n return;\n }\n\n if (!force) {\n if (intentState.renderTasks.size > 0) {\n return;\n }\n\n if (reason instanceof _display_utils.RenderingCancelledException) {\n intentState.streamReaderCancelTimeout = setTimeout(function () {\n _this7._abortOperatorList({\n intentState: intentState,\n reason: reason,\n force: true\n });\n\n intentState.streamReaderCancelTimeout = null;\n }, RENDERING_CANCELLED_TIMEOUT);\n return;\n }\n }\n\n intentState.streamReader.cancel(new _util.AbortException(reason.message))[\"catch\"](function () {});\n intentState.streamReader = null;\n\n if (this._transport.destroyed) {\n return;\n }\n\n var _iterator11 = _createForOfIteratorHelper(this._intentStates),\n _step11;\n\n try {\n for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {\n var _step11$value = _slicedToArray(_step11.value, 2),\n curCacheKey = _step11$value[0],\n curIntentState = _step11$value[1];\n\n if (curIntentState === intentState) {\n this._intentStates[\"delete\"](curCacheKey);\n\n break;\n }\n }\n } catch (err) {\n _iterator11.e(err);\n } finally {\n _iterator11.f();\n }\n\n this.cleanup();\n }\n }, {\n key: \"stats\",\n get: function get() {\n return this._stats;\n }\n }]);\n\n return PDFPageProxy;\n}();\n\nexports.PDFPageProxy = PDFPageProxy;\n\nvar LoopbackPort = /*#__PURE__*/function () {\n function LoopbackPort() {\n _classCallCheck(this, LoopbackPort);\n\n this._listeners = [];\n this._deferred = Promise.resolve();\n }\n\n _createClass(LoopbackPort, [{\n key: \"postMessage\",\n value: function postMessage(obj, transfers) {\n var _this8 = this;\n\n var event = {\n data: transfers ? structuredClone(obj, transfers) : structuredClone(obj)\n };\n\n this._deferred.then(function () {\n var _iterator12 = _createForOfIteratorHelper(_this8._listeners),\n _step12;\n\n try {\n for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {\n var listener = _step12.value;\n listener.call(_this8, event);\n }\n } catch (err) {\n _iterator12.e(err);\n } finally {\n _iterator12.f();\n }\n });\n }\n }, {\n key: \"addEventListener\",\n value: function addEventListener(name, listener) {\n this._listeners.push(listener);\n }\n }, {\n key: \"removeEventListener\",\n value: function removeEventListener(name, listener) {\n var i = this._listeners.indexOf(listener);\n\n this._listeners.splice(i, 1);\n }\n }, {\n key: \"terminate\",\n value: function terminate() {\n this._listeners.length = 0;\n }\n }]);\n\n return LoopbackPort;\n}();\n\nexports.LoopbackPort = LoopbackPort;\nvar PDFWorkerUtil = {\n isWorkerDisabled: false,\n fallbackWorkerSrc: null,\n fakeWorkerId: 0\n};\n{\n if (_is_node.isNodeJS && \"function\" === \"function\") {\n PDFWorkerUtil.isWorkerDisabled = true;\n PDFWorkerUtil.fallbackWorkerSrc = \"./pdf.worker.js\";\n } else if ((typeof document === \"undefined\" ? \"undefined\" : _typeof(document)) === \"object\") {\n var _document, _document$currentScri;\n\n var pdfjsFilePath = (_document = document) === null || _document === void 0 ? void 0 : (_document$currentScri = _document.currentScript) === null || _document$currentScri === void 0 ? void 0 : _document$currentScri.src;\n\n if (pdfjsFilePath) {\n PDFWorkerUtil.fallbackWorkerSrc = pdfjsFilePath.replace(/(\\.(?:min\\.)?js)(\\?.*)?$/i, \".worker$1$2\");\n }\n }\n\n PDFWorkerUtil.createCDNWrapper = function (url) {\n var wrapper = \"importScripts(\\\"\".concat(url, \"\\\");\");\n return URL.createObjectURL(new Blob([wrapper]));\n };\n}\n\nvar PDFWorker = /*#__PURE__*/function () {\n function PDFWorker() {\n var _ref14 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref14$name = _ref14.name,\n name = _ref14$name === void 0 ? null : _ref14$name,\n _ref14$port = _ref14.port,\n port = _ref14$port === void 0 ? null : _ref14$port,\n _ref14$verbosity = _ref14.verbosity,\n verbosity = _ref14$verbosity === void 0 ? (0, _util.getVerbosityLevel)() : _ref14$verbosity;\n\n _classCallCheck(this, PDFWorker);\n\n if (port && PDFWorker._workerPorts.has(port)) {\n throw new Error(\"Cannot use more than one PDFWorker per port.\");\n }\n\n this.name = name;\n this.destroyed = false;\n this.verbosity = verbosity;\n this._readyCapability = (0, _util.createPromiseCapability)();\n this._port = null;\n this._webWorker = null;\n this._messageHandler = null;\n\n if (port) {\n PDFWorker._workerPorts.set(port, this);\n\n this._initializeFromPort(port);\n\n return;\n }\n\n this._initialize();\n }\n\n _createClass(PDFWorker, [{\n key: \"promise\",\n get: function get() {\n return this._readyCapability.promise;\n }\n }, {\n key: \"port\",\n get: function get() {\n return this._port;\n }\n }, {\n key: \"messageHandler\",\n get: function get() {\n return this._messageHandler;\n }\n }, {\n key: \"_initializeFromPort\",\n value: function _initializeFromPort(port) {\n this._port = port;\n this._messageHandler = new _message_handler.MessageHandler(\"main\", \"worker\", port);\n\n this._messageHandler.on(\"ready\", function () {});\n\n this._readyCapability.resolve();\n }\n }, {\n key: \"_initialize\",\n value: function _initialize() {\n var _this9 = this;\n\n if (typeof Worker !== \"undefined\" && !PDFWorkerUtil.isWorkerDisabled && !PDFWorker._mainThreadWorkerMessageHandler) {\n var workerSrc = PDFWorker.workerSrc;\n\n try {\n if (!(0, _util.isSameOrigin)(window.location.href, workerSrc)) {\n workerSrc = PDFWorkerUtil.createCDNWrapper(new URL(workerSrc, window.location).href);\n }\n\n var worker = new Worker(workerSrc);\n var messageHandler = new _message_handler.MessageHandler(\"main\", \"worker\", worker);\n\n var terminateEarly = function terminateEarly() {\n worker.removeEventListener(\"error\", onWorkerError);\n messageHandler.destroy();\n worker.terminate();\n\n if (_this9.destroyed) {\n _this9._readyCapability.reject(new Error(\"Worker was destroyed\"));\n } else {\n _this9._setupFakeWorker();\n }\n };\n\n var onWorkerError = function onWorkerError() {\n if (!_this9._webWorker) {\n terminateEarly();\n }\n };\n\n worker.addEventListener(\"error\", onWorkerError);\n messageHandler.on(\"test\", function (data) {\n worker.removeEventListener(\"error\", onWorkerError);\n\n if (_this9.destroyed) {\n terminateEarly();\n return;\n }\n\n if (data) {\n _this9._messageHandler = messageHandler;\n _this9._port = worker;\n _this9._webWorker = worker;\n\n _this9._readyCapability.resolve();\n\n messageHandler.send(\"configure\", {\n verbosity: _this9.verbosity\n });\n } else {\n _this9._setupFakeWorker();\n\n messageHandler.destroy();\n worker.terminate();\n }\n });\n messageHandler.on(\"ready\", function (data) {\n worker.removeEventListener(\"error\", onWorkerError);\n\n if (_this9.destroyed) {\n terminateEarly();\n return;\n }\n\n try {\n sendTest();\n } catch (e) {\n _this9._setupFakeWorker();\n }\n });\n\n var sendTest = function sendTest() {\n var testObj = new Uint8Array([255]);\n\n try {\n messageHandler.send(\"test\", testObj, [testObj.buffer]);\n } catch (ex) {\n (0, _util.warn)(\"Cannot use postMessage transfers.\");\n testObj[0] = 0;\n messageHandler.send(\"test\", testObj);\n }\n };\n\n sendTest();\n return;\n } catch (e) {\n (0, _util.info)(\"The worker has been disabled.\");\n }\n }\n\n this._setupFakeWorker();\n }\n }, {\n key: \"_setupFakeWorker\",\n value: function _setupFakeWorker() {\n var _this10 = this;\n\n if (!PDFWorkerUtil.isWorkerDisabled) {\n (0, _util.warn)(\"Setting up fake worker.\");\n PDFWorkerUtil.isWorkerDisabled = true;\n }\n\n PDFWorker._setupFakeWorkerGlobal.then(function (WorkerMessageHandler) {\n if (_this10.destroyed) {\n _this10._readyCapability.reject(new Error(\"Worker was destroyed\"));\n\n return;\n }\n\n var port = new LoopbackPort();\n _this10._port = port;\n var id = \"fake\".concat(PDFWorkerUtil.fakeWorkerId++);\n var workerHandler = new _message_handler.MessageHandler(id + \"_worker\", id, port);\n WorkerMessageHandler.setup(workerHandler, port);\n var messageHandler = new _message_handler.MessageHandler(id, id + \"_worker\", port);\n _this10._messageHandler = messageHandler;\n\n _this10._readyCapability.resolve();\n\n messageHandler.send(\"configure\", {\n verbosity: _this10.verbosity\n });\n })[\"catch\"](function (reason) {\n _this10._readyCapability.reject(new Error(\"Setting up fake worker failed: \\\"\".concat(reason.message, \"\\\".\")));\n });\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.destroyed = true;\n\n if (this._webWorker) {\n this._webWorker.terminate();\n\n this._webWorker = null;\n }\n\n PDFWorker._workerPorts[\"delete\"](this._port);\n\n this._port = null;\n\n if (this._messageHandler) {\n this._messageHandler.destroy();\n\n this._messageHandler = null;\n }\n }\n }], [{\n key: \"_workerPorts\",\n get: function get() {\n return (0, _util.shadow)(this, \"_workerPorts\", new WeakMap());\n }\n }, {\n key: \"fromPort\",\n value: function fromPort(params) {\n if (!(params !== null && params !== void 0 && params.port)) {\n throw new Error(\"PDFWorker.fromPort - invalid method signature.\");\n }\n\n if (this._workerPorts.has(params.port)) {\n return this._workerPorts.get(params.port);\n }\n\n return new PDFWorker(params);\n }\n }, {\n key: \"workerSrc\",\n get: function get() {\n if (_worker_options.GlobalWorkerOptions.workerSrc) {\n return _worker_options.GlobalWorkerOptions.workerSrc;\n }\n\n if (PDFWorkerUtil.fallbackWorkerSrc !== null) {\n if (!_is_node.isNodeJS) {\n (0, _display_utils.deprecated)('No \"GlobalWorkerOptions.workerSrc\" specified.');\n }\n\n return PDFWorkerUtil.fallbackWorkerSrc;\n }\n\n throw new Error('No \"GlobalWorkerOptions.workerSrc\" specified.');\n }\n }, {\n key: \"_mainThreadWorkerMessageHandler\",\n get: function get() {\n try {\n var _globalThis$pdfjsWork;\n\n return ((_globalThis$pdfjsWork = globalThis.pdfjsWorker) === null || _globalThis$pdfjsWork === void 0 ? void 0 : _globalThis$pdfjsWork.WorkerMessageHandler) || null;\n } catch (ex) {\n return null;\n }\n }\n }, {\n key: \"_setupFakeWorkerGlobal\",\n get: function get() {\n var _this11 = this;\n\n var loader = /*#__PURE__*/function () {\n var _ref15 = _asyncToGenerator( /*#__PURE__*/_regenerator[\"default\"].mark(function _callee4() {\n var mainWorkerMessageHandler, worker;\n return _regenerator[\"default\"].wrap(function _callee4$(_context4) {\n while (1) {\n switch (_context4.prev = _context4.next) {\n case 0:\n mainWorkerMessageHandler = _this11._mainThreadWorkerMessageHandler;\n\n if (!mainWorkerMessageHandler) {\n _context4.next = 3;\n break;\n }\n\n return _context4.abrupt(\"return\", mainWorkerMessageHandler);\n\n case 3:\n if (!(_is_node.isNodeJS && \"function\" === \"function\")) {\n _context4.next = 6;\n break;\n }\n\n worker = eval(\"require\")(_this11.workerSrc);\n return _context4.abrupt(\"return\", worker.WorkerMessageHandler);\n\n case 6:\n _context4.next = 8;\n return (0, _display_utils.loadScript)(_this11.workerSrc);\n\n case 8:\n return _context4.abrupt(\"return\", window.pdfjsWorker.WorkerMessageHandler);\n\n case 9:\n case \"end\":\n return _context4.stop();\n }\n }\n }, _callee4);\n }));\n\n return function loader() {\n return _ref15.apply(this, arguments);\n };\n }();\n\n return (0, _util.shadow)(this, \"_setupFakeWorkerGlobal\", loader());\n }\n }]);\n\n return PDFWorker;\n}();\n\nexports.PDFWorker = PDFWorker;\n{\n PDFWorker.getWorkerSrc = function () {\n (0, _display_utils.deprecated)(\"`PDFWorker.getWorkerSrc()`, please use `PDFWorker.workerSrc` instead.\");\n return this.workerSrc;\n };\n}\n\nvar _docStats = /*#__PURE__*/new WeakMap();\n\nvar _pageCache = /*#__PURE__*/new WeakMap();\n\nvar _pagePromises = /*#__PURE__*/new WeakMap();\n\nvar _metadataPromise = /*#__PURE__*/new WeakMap();\n\nvar WorkerTransport = /*#__PURE__*/function () {\n function WorkerTransport(messageHandler, loadingTask, networkStream, params) {\n _classCallCheck(this, WorkerTransport);\n\n _classPrivateFieldInitSpec(this, _docStats, {\n writable: true,\n value: null\n });\n\n _classPrivateFieldInitSpec(this, _pageCache, {\n writable: true,\n value: new Map()\n });\n\n _classPrivateFieldInitSpec(this, _pagePromises, {\n writable: true,\n value: new Map()\n });\n\n _classPrivateFieldInitSpec(this, _metadataPromise, {\n writable: true,\n value: null\n });\n\n this.messageHandler = messageHandler;\n this.loadingTask = loadingTask;\n this.commonObjs = new PDFObjects();\n this.fontLoader = new _font_loader.FontLoader({\n docId: loadingTask.docId,\n onUnsupportedFeature: this._onUnsupportedFeature.bind(this),\n ownerDocument: params.ownerDocument,\n styleElement: params.styleElement\n });\n this._params = params;\n\n if (!params.useWorkerFetch) {\n this.CMapReaderFactory = new params.CMapReaderFactory({\n baseUrl: params.cMapUrl,\n isCompressed: params.cMapPacked\n });\n this.StandardFontDataFactory = new params.StandardFontDataFactory({\n baseUrl: params.standardFontDataUrl\n });\n }\n\n this.destroyed = false;\n this.destroyCapability = null;\n this._passwordCapability = null;\n this._networkStream = networkStream;\n this._fullReader = null;\n this._lastProgress = null;\n this.downloadInfoCapability = (0, _util.createPromiseCapability)();\n this.setupMessageHandler();\n }\n\n _createClass(WorkerTransport, [{\n key: \"annotationStorage\",\n get: function get() {\n return (0, _util.shadow)(this, \"annotationStorage\", new _annotation_storage.AnnotationStorage());\n }\n }, {\n key: \"stats\",\n get: function get() {\n return _classPrivateFieldGet(this, _docStats);\n }\n }, {\n key: \"getRenderingIntent\",\n value: function getRenderingIntent(intent) {\n var annotationMode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _util.AnnotationMode.ENABLE;\n var isOpList = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var renderingIntent = _util.RenderingIntentFlag.DISPLAY;\n var lastModified = \"\";\n\n switch (intent) {\n case \"any\":\n renderingIntent = _util.RenderingIntentFlag.ANY;\n break;\n\n case \"display\":\n break;\n\n case \"print\":\n renderingIntent = _util.RenderingIntentFlag.PRINT;\n break;\n\n default:\n (0, _util.warn)(\"getRenderingIntent - invalid intent: \".concat(intent));\n }\n\n switch (annotationMode) {\n case _util.AnnotationMode.DISABLE:\n renderingIntent += _util.RenderingIntentFlag.ANNOTATIONS_DISABLE;\n break;\n\n case _util.AnnotationMode.ENABLE:\n break;\n\n case _util.AnnotationMode.ENABLE_FORMS:\n renderingIntent += _util.RenderingIntentFlag.ANNOTATIONS_FORMS;\n break;\n\n case _util.AnnotationMode.ENABLE_STORAGE:\n renderingIntent += _util.RenderingIntentFlag.ANNOTATIONS_STORAGE;\n lastModified = this.annotationStorage.lastModified;\n break;\n\n default:\n (0, _util.warn)(\"getRenderingIntent - invalid annotationMode: \".concat(annotationMode));\n }\n\n if (isOpList) {\n renderingIntent += _util.RenderingIntentFlag.OPLIST;\n }\n\n return {\n renderingIntent: renderingIntent,\n cacheKey: \"\".concat(renderingIntent, \"_\").concat(lastModified)\n };\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n var _this12 = this;\n\n if (this.destroyCapability) {\n return this.destroyCapability.promise;\n }\n\n this.destroyed = true;\n this.destroyCapability = (0, _util.createPromiseCapability)();\n\n if (this._passwordCapability) {\n this._passwordCapability.reject(new Error(\"Worker was destroyed during onPassword callback\"));\n }\n\n var waitOn = [];\n\n var _iterator13 = _createForOfIteratorHelper(_classPrivateFieldGet(this, _pageCache).values()),\n _step13;\n\n try {\n for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {\n var page = _step13.value;\n waitOn.push(page._destroy());\n }\n } catch (err) {\n _iterator13.e(err);\n } finally {\n _iterator13.f();\n }\n\n _classPrivateFieldGet(this, _pageCache).clear();\n\n _classPrivateFieldGet(this, _pagePromises).clear();\n\n if (this.hasOwnProperty(\"annotationStorage\")) {\n this.annotationStorage.resetModified();\n }\n\n var terminated = this.messageHandler.sendWithPromise(\"Terminate\", null);\n waitOn.push(terminated);\n Promise.all(waitOn).then(function () {\n _this12.commonObjs.clear();\n\n _this12.fontLoader.clear();\n\n _classPrivateFieldSet(_this12, _metadataPromise, null);\n\n _this12._getFieldObjectsPromise = null;\n _this12._hasJSActionsPromise = null;\n\n if (_this12._networkStream) {\n _this12._networkStream.cancelAllRequests(new _util.AbortException(\"Worker was terminated.\"));\n }\n\n if (_this12.messageHandler) {\n _this12.messageHandler.destroy();\n\n _this12.messageHandler = null;\n }\n\n _this12.destroyCapability.resolve();\n }, this.destroyCapability.reject);\n return this.destroyCapability.promise;\n }\n }, {\n key: \"setupMessageHandler\",\n value: function setupMessageHandler() {\n var _this13 = this;\n\n var messageHandler = this.messageHandler,\n loadingTask = this.loadingTask;\n messageHandler.on(\"GetReader\", function (data, sink) {\n (0, _util.assert)(_this13._networkStream, \"GetReader - no `IPDFStream` instance available.\");\n _this13._fullReader = _this13._networkStream.getFullReader();\n\n _this13._fullReader.onProgress = function (evt) {\n _this13._lastProgress = {\n loaded: evt.loaded,\n total: evt.total\n };\n };\n\n sink.onPull = function () {\n _this13._fullReader.read().then(function (_ref16) {\n var value = _ref16.value,\n done = _ref16.done;\n\n if (done) {\n sink.close();\n return;\n }\n\n (0, _util.assert)((0, _util.isArrayBuffer)(value), \"GetReader - expected an ArrayBuffer.\");\n sink.enqueue(new Uint8Array(value), 1, [value]);\n })[\"catch\"](function (reason) {\n sink.error(reason);\n });\n };\n\n sink.onCancel = function (reason) {\n _this13._fullReader.cancel(reason);\n\n sink.ready[\"catch\"](function (readyReason) {\n if (_this13.destroyed) {\n return;\n }\n\n throw readyReason;\n });\n };\n });\n messageHandler.on(\"ReaderHeadersReady\", function (data) {\n var headersCapability = (0, _util.createPromiseCapability)();\n var fullReader = _this13._fullReader;\n fullReader.headersReady.then(function () {\n if (!fullReader.isStreamingSupported || !fullReader.isRangeSupported) {\n if (_this13._lastProgress) {\n var _loadingTask$onProgre;\n\n (_loadingTask$onProgre = loadingTask.onProgress) === null || _loadingTask$onProgre === void 0 ? void 0 : _loadingTask$onProgre.call(loadingTask, _this13._lastProgress);\n }\n\n fullReader.onProgress = function (evt) {\n var _loadingTask$onProgre2;\n\n (_loadingTask$onProgre2 = loadingTask.onProgress) === null || _loadingTask$onProgre2 === void 0 ? void 0 : _loadingTask$onProgre2.call(loadingTask, {\n loaded: evt.loaded,\n total: evt.total\n });\n };\n }\n\n headersCapability.resolve({\n isStreamingSupported: fullReader.isStreamingSupported,\n isRangeSupported: fullReader.isRangeSupported,\n contentLength: fullReader.contentLength\n });\n }, headersCapability.reject);\n return headersCapability.promise;\n });\n messageHandler.on(\"GetRangeReader\", function (data, sink) {\n (0, _util.assert)(_this13._networkStream, \"GetRangeReader - no `IPDFStream` instance available.\");\n\n var rangeReader = _this13._networkStream.getRangeReader(data.begin, data.end);\n\n if (!rangeReader) {\n sink.close();\n return;\n }\n\n sink.onPull = function () {\n rangeReader.read().then(function (_ref17) {\n var value = _ref17.value,\n done = _ref17.done;\n\n if (done) {\n sink.close();\n return;\n }\n\n (0, _util.assert)((0, _util.isArrayBuffer)(value), \"GetRangeReader - expected an ArrayBuffer.\");\n sink.enqueue(new Uint8Array(value), 1, [value]);\n })[\"catch\"](function (reason) {\n sink.error(reason);\n });\n };\n\n sink.onCancel = function (reason) {\n rangeReader.cancel(reason);\n sink.ready[\"catch\"](function (readyReason) {\n if (_this13.destroyed) {\n return;\n }\n\n throw readyReason;\n });\n };\n });\n messageHandler.on(\"GetDoc\", function (_ref18) {\n var pdfInfo = _ref18.pdfInfo;\n _this13._numPages = pdfInfo.numPages;\n _this13._htmlForXfa = pdfInfo.htmlForXfa;\n delete pdfInfo.htmlForXfa;\n\n loadingTask._capability.resolve(new PDFDocumentProxy(pdfInfo, _this13));\n });\n messageHandler.on(\"DocException\", function (ex) {\n var reason;\n\n switch (ex.name) {\n case \"PasswordException\":\n reason = new _util.PasswordException(ex.message, ex.code);\n break;\n\n case \"InvalidPDFException\":\n reason = new _util.InvalidPDFException(ex.message);\n break;\n\n case \"MissingPDFException\":\n reason = new _util.MissingPDFException(ex.message);\n break;\n\n case \"UnexpectedResponseException\":\n reason = new _util.UnexpectedResponseException(ex.message, ex.status);\n break;\n\n case \"UnknownErrorException\":\n reason = new _util.UnknownErrorException(ex.message, ex.details);\n break;\n\n default:\n (0, _util.unreachable)(\"DocException - expected a valid Error.\");\n }\n\n loadingTask._capability.reject(reason);\n });\n messageHandler.on(\"PasswordRequest\", function (exception) {\n _this13._passwordCapability = (0, _util.createPromiseCapability)();\n\n if (loadingTask.onPassword) {\n var updatePassword = function updatePassword(password) {\n if (password instanceof Error) {\n _this13._passwordCapability.reject(password);\n } else {\n _this13._passwordCapability.resolve({\n password: password\n });\n }\n };\n\n try {\n loadingTask.onPassword(updatePassword, exception.code);\n } catch (ex) {\n _this13._passwordCapability.reject(ex);\n }\n } else {\n _this13._passwordCapability.reject(new _util.PasswordException(exception.message, exception.code));\n }\n\n return _this13._passwordCapability.promise;\n });\n messageHandler.on(\"DataLoaded\", function (data) {\n var _loadingTask$onProgre3;\n\n (_loadingTask$onProgre3 = loadingTask.onProgress) === null || _loadingTask$onProgre3 === void 0 ? void 0 : _loadingTask$onProgre3.call(loadingTask, {\n loaded: data.length,\n total: data.length\n });\n\n _this13.downloadInfoCapability.resolve(data);\n });\n messageHandler.on(\"StartRenderPage\", function (data) {\n if (_this13.destroyed) {\n return;\n }\n\n var page = _classPrivateFieldGet(_this13, _pageCache).get(data.pageIndex);\n\n page._startRenderPage(data.transparency, data.cacheKey);\n });\n messageHandler.on(\"commonobj\", function (_ref19) {\n var _globalThis$FontInspe;\n\n var _ref20 = _slicedToArray(_ref19, 3),\n id = _ref20[0],\n type = _ref20[1],\n exportedData = _ref20[2];\n\n if (_this13.destroyed) {\n return;\n }\n\n if (_this13.commonObjs.has(id)) {\n return;\n }\n\n switch (type) {\n case \"Font\":\n var params = _this13._params;\n\n if (\"error\" in exportedData) {\n var exportedError = exportedData.error;\n (0, _util.warn)(\"Error during font loading: \".concat(exportedError));\n\n _this13.commonObjs.resolve(id, exportedError);\n\n break;\n }\n\n var fontRegistry = null;\n\n if (params.pdfBug && (_globalThis$FontInspe = globalThis.FontInspector) !== null && _globalThis$FontInspe !== void 0 && _globalThis$FontInspe.enabled) {\n fontRegistry = {\n registerFont: function registerFont(font, url) {\n globalThis.FontInspector.fontAdded(font, url);\n }\n };\n }\n\n var font = new _font_loader.FontFaceObject(exportedData, {\n isEvalSupported: params.isEvalSupported,\n disableFontFace: params.disableFontFace,\n ignoreErrors: params.ignoreErrors,\n onUnsupportedFeature: _this13._onUnsupportedFeature.bind(_this13),\n fontRegistry: fontRegistry\n });\n\n _this13.fontLoader.bind(font)[\"catch\"](function (reason) {\n return messageHandler.sendWithPromise(\"FontFallback\", {\n id: id\n });\n })[\"finally\"](function () {\n if (!params.fontExtraProperties && font.data) {\n font.data = null;\n }\n\n _this13.commonObjs.resolve(id, font);\n });\n\n break;\n\n case \"FontPath\":\n case \"Image\":\n _this13.commonObjs.resolve(id, exportedData);\n\n break;\n\n default:\n throw new Error(\"Got unknown common object type \".concat(type));\n }\n });\n messageHandler.on(\"obj\", function (_ref21) {\n var _imageData$data;\n\n var _ref22 = _slicedToArray(_ref21, 4),\n id = _ref22[0],\n pageIndex = _ref22[1],\n type = _ref22[2],\n imageData = _ref22[3];\n\n if (_this13.destroyed) {\n return;\n }\n\n var pageProxy = _classPrivateFieldGet(_this13, _pageCache).get(pageIndex);\n\n if (pageProxy.objs.has(id)) {\n return;\n }\n\n switch (type) {\n case \"Image\":\n pageProxy.objs.resolve(id, imageData);\n var MAX_IMAGE_SIZE_TO_STORE = 8000000;\n\n 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) {\n pageProxy.cleanupAfterRender = true;\n }\n\n break;\n\n case \"Pattern\":\n pageProxy.objs.resolve(id, imageData);\n break;\n\n default:\n throw new Error(\"Got unknown object type \".concat(type));\n }\n });\n messageHandler.on(\"DocProgress\", function (data) {\n var _loadingTask$onProgre4;\n\n if (_this13.destroyed) {\n return;\n }\n\n (_loadingTask$onProgre4 = loadingTask.onProgress) === null || _loadingTask$onProgre4 === void 0 ? void 0 : _loadingTask$onProgre4.call(loadingTask, {\n loaded: data.loaded,\n total: data.total\n });\n });\n messageHandler.on(\"DocStats\", function (data) {\n if (_this13.destroyed) {\n return;\n }\n\n _classPrivateFieldSet(_this13, _docStats, Object.freeze({\n streamTypes: Object.freeze(data.streamTypes),\n fontTypes: Object.freeze(data.fontTypes)\n }));\n });\n messageHandler.on(\"UnsupportedFeature\", this._onUnsupportedFeature.bind(this));\n messageHandler.on(\"FetchBuiltInCMap\", function (data) {\n if (_this13.destroyed) {\n return Promise.reject(new Error(\"Worker was destroyed.\"));\n }\n\n if (!_this13.CMapReaderFactory) {\n return Promise.reject(new Error(\"CMapReaderFactory not initialized, see the `useWorkerFetch` parameter.\"));\n }\n\n return _this13.CMapReaderFactory.fetch(data);\n });\n messageHandler.on(\"FetchStandardFontData\", function (data) {\n if (_this13.destroyed) {\n return Promise.reject(new Error(\"Worker was destroyed.\"));\n }\n\n if (!_this13.StandardFontDataFactory) {\n return Promise.reject(new Error(\"StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.\"));\n }\n\n return _this13.StandardFontDataFactory.fetch(data);\n });\n }\n }, {\n key: \"_onUnsupportedFeature\",\n value: function _onUnsupportedFeature(_ref23) {\n var _this$loadingTask$onU, _this$loadingTask;\n\n var featureId = _ref23.featureId;\n\n if (this.destroyed) {\n return;\n }\n\n (_this$loadingTask$onU = (_this$loadingTask = this.loadingTask).onUnsupportedFeature) === null || _this$loadingTask$onU === void 0 ? void 0 : _this$loadingTask$onU.call(_this$loadingTask, featureId);\n }\n }, {\n key: \"getData\",\n value: function getData() {\n return this.messageHandler.sendWithPromise(\"GetData\", null);\n }\n }, {\n key: \"getPage\",\n value: function getPage(pageNumber) {\n var _this14 = this;\n\n if (!Number.isInteger(pageNumber) || pageNumber <= 0 || pageNumber > this._numPages) {\n return Promise.reject(new Error(\"Invalid page request.\"));\n }\n\n var pageIndex = pageNumber - 1,\n cachedPromise = _classPrivateFieldGet(this, _pagePromises).get(pageIndex);\n\n if (cachedPromise) {\n return cachedPromise;\n }\n\n var promise = this.messageHandler.sendWithPromise(\"GetPage\", {\n pageIndex: pageIndex\n }).then(function (pageInfo) {\n if (_this14.destroyed) {\n throw new Error(\"Transport destroyed\");\n }\n\n var page = new PDFPageProxy(pageIndex, pageInfo, _this14, _this14._params.ownerDocument, _this14._params.pdfBug);\n\n _classPrivateFieldGet(_this14, _pageCache).set(pageIndex, page);\n\n return page;\n });\n\n _classPrivateFieldGet(this, _pagePromises).set(pageIndex, promise);\n\n return promise;\n }\n }, {\n key: \"getPageIndex\",\n value: function getPageIndex(ref) {\n if (_typeof(ref) !== \"object\" || ref === null || !Number.isInteger(ref.num) || ref.num < 0 || !Number.isInteger(ref.gen) || ref.gen < 0) {\n return Promise.reject(new Error(\"Invalid pageIndex request.\"));\n }\n\n return this.messageHandler.sendWithPromise(\"GetPageIndex\", {\n num: ref.num,\n gen: ref.gen\n });\n }\n }, {\n key: \"getAnnotations\",\n value: function getAnnotations(pageIndex, intent) {\n return this.messageHandler.sendWithPromise(\"GetAnnotations\", {\n pageIndex: pageIndex,\n intent: intent\n });\n }\n }, {\n key: \"saveDocument\",\n value: function saveDocument() {\n var _this$_fullReader$fil,\n _this$_fullReader,\n _this15 = this;\n\n return this.messageHandler.sendWithPromise(\"SaveDocument\", {\n isPureXfa: !!this._htmlForXfa,\n numPages: this._numPages,\n annotationStorage: this.annotationStorage.serializable,\n 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\n })[\"finally\"](function () {\n _this15.annotationStorage.resetModified();\n });\n }\n }, {\n key: \"getFieldObjects\",\n value: function getFieldObjects() {\n return this._getFieldObjectsPromise || (this._getFieldObjectsPromise = this.messageHandler.sendWithPromise(\"GetFieldObjects\", null));\n }\n }, {\n key: \"hasJSActions\",\n value: function hasJSActions() {\n return this._hasJSActionsPromise || (this._hasJSActionsPromise = this.messageHandler.sendWithPromise(\"HasJSActions\", null));\n }\n }, {\n key: \"getCalculationOrderIds\",\n value: function getCalculationOrderIds() {\n return this.messageHandler.sendWithPromise(\"GetCalculationOrderIds\", null);\n }\n }, {\n key: \"getDestinations\",\n value: function getDestinations() {\n return this.messageHandler.sendWithPromise(\"GetDestinations\", null);\n }\n }, {\n key: \"getDestination\",\n value: function getDestination(id) {\n if (typeof id !== \"string\") {\n return Promise.reject(new Error(\"Invalid destination request.\"));\n }\n\n return this.messageHandler.sendWithPromise(\"GetDestination\", {\n id: id\n });\n }\n }, {\n key: \"getPageLabels\",\n value: function getPageLabels() {\n return this.messageHandler.sendWithPromise(\"GetPageLabels\", null);\n }\n }, {\n key: \"getPageLayout\",\n value: function getPageLayout() {\n return this.messageHandler.sendWithPromise(\"GetPageLayout\", null);\n }\n }, {\n key: \"getPageMode\",\n value: function getPageMode() {\n return this.messageHandler.sendWithPromise(\"GetPageMode\", null);\n }\n }, {\n key: \"getViewerPreferences\",\n value: function getViewerPreferences() {\n return this.messageHandler.sendWithPromise(\"GetViewerPreferences\", null);\n }\n }, {\n key: \"getOpenAction\",\n value: function getOpenAction() {\n return this.messageHandler.sendWithPromise(\"GetOpenAction\", null);\n }\n }, {\n key: \"getAttachments\",\n value: function getAttachments() {\n return this.messageHandler.sendWithPromise(\"GetAttachments\", null);\n }\n }, {\n key: \"getJavaScript\",\n value: function getJavaScript() {\n return this.messageHandler.sendWithPromise(\"GetJavaScript\", null);\n }\n }, {\n key: \"getDocJSActions\",\n value: function getDocJSActions() {\n return this.messageHandler.sendWithPromise(\"GetDocJSActions\", null);\n }\n }, {\n key: \"getPageJSActions\",\n value: function getPageJSActions(pageIndex) {\n return this.messageHandler.sendWithPromise(\"GetPageJSActions\", {\n pageIndex: pageIndex\n });\n }\n }, {\n key: \"getStructTree\",\n value: function getStructTree(pageIndex) {\n return this.messageHandler.sendWithPromise(\"GetStructTree\", {\n pageIndex: pageIndex\n });\n }\n }, {\n key: \"getOutline\",\n value: function getOutline() {\n return this.messageHandler.sendWithPromise(\"GetOutline\", null);\n }\n }, {\n key: \"getOptionalContentConfig\",\n value: function getOptionalContentConfig() {\n return this.messageHandler.sendWithPromise(\"GetOptionalContentConfig\", null).then(function (results) {\n return new _optional_content_config.OptionalContentConfig(results);\n });\n }\n }, {\n key: \"getPermissions\",\n value: function getPermissions() {\n return this.messageHandler.sendWithPromise(\"GetPermissions\", null);\n }\n }, {\n key: \"getMetadata\",\n value: function getMetadata() {\n var _this16 = this;\n\n return _classPrivateFieldGet(this, _metadataPromise) || _classPrivateFieldSet(this, _metadataPromise, this.messageHandler.sendWithPromise(\"GetMetadata\", null).then(function (results) {\n var _this16$_fullReader$f, _this16$_fullReader, _this16$_fullReader$c, _this16$_fullReader2;\n\n return {\n info: results[0],\n metadata: results[1] ? new _metadata.Metadata(results[1]) : null,\n contentDispositionFilename: (_this16$_fullReader$f = (_this16$_fullReader = _this16._fullReader) === null || _this16$_fullReader === void 0 ? void 0 : _this16$_fullReader.filename) !== null && _this16$_fullReader$f !== void 0 ? _this16$_fullReader$f : null,\n contentLength: (_this16$_fullReader$c = (_this16$_fullReader2 = _this16._fullReader) === null || _this16$_fullReader2 === void 0 ? void 0 : _this16$_fullReader2.contentLength) !== null && _this16$_fullReader$c !== void 0 ? _this16$_fullReader$c : null\n };\n }));\n }\n }, {\n key: \"getMarkInfo\",\n value: function getMarkInfo() {\n return this.messageHandler.sendWithPromise(\"GetMarkInfo\", null);\n }\n }, {\n key: \"startCleanup\",\n value: function () {\n var _startCleanup = _asyncToGenerator( /*#__PURE__*/_regenerator[\"default\"].mark(function _callee5() {\n var keepLoadedFonts,\n _iterator14,\n _step14,\n page,\n cleanupSuccessful,\n _args5 = arguments;\n\n return _regenerator[\"default\"].wrap(function _callee5$(_context5) {\n while (1) {\n switch (_context5.prev = _context5.next) {\n case 0:\n keepLoadedFonts = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : false;\n _context5.next = 3;\n return this.messageHandler.sendWithPromise(\"Cleanup\", null);\n\n case 3:\n if (!this.destroyed) {\n _context5.next = 5;\n break;\n }\n\n return _context5.abrupt(\"return\");\n\n case 5:\n _iterator14 = _createForOfIteratorHelper(_classPrivateFieldGet(this, _pageCache).values());\n _context5.prev = 6;\n\n _iterator14.s();\n\n case 8:\n if ((_step14 = _iterator14.n()).done) {\n _context5.next = 15;\n break;\n }\n\n page = _step14.value;\n cleanupSuccessful = page.cleanup();\n\n if (cleanupSuccessful) {\n _context5.next = 13;\n break;\n }\n\n throw new Error(\"startCleanup: Page \".concat(page.pageNumber, \" is currently rendering.\"));\n\n case 13:\n _context5.next = 8;\n break;\n\n case 15:\n _context5.next = 20;\n break;\n\n case 17:\n _context5.prev = 17;\n _context5.t0 = _context5[\"catch\"](6);\n\n _iterator14.e(_context5.t0);\n\n case 20:\n _context5.prev = 20;\n\n _iterator14.f();\n\n return _context5.finish(20);\n\n case 23:\n this.commonObjs.clear();\n\n if (!keepLoadedFonts) {\n this.fontLoader.clear();\n }\n\n _classPrivateFieldSet(this, _metadataPromise, null);\n\n this._getFieldObjectsPromise = null;\n this._hasJSActionsPromise = null;\n\n case 28:\n case \"end\":\n return _context5.stop();\n }\n }\n }, _callee5, this, [[6, 17, 20, 23]]);\n }));\n\n function startCleanup() {\n return _startCleanup.apply(this, arguments);\n }\n\n return startCleanup;\n }()\n }, {\n key: \"loadingParams\",\n get: function get() {\n var params = this._params;\n return (0, _util.shadow)(this, \"loadingParams\", {\n disableAutoFetch: params.disableAutoFetch,\n enableXfa: params.enableXfa\n });\n }\n }]);\n\n return WorkerTransport;\n}();\n\nvar _objs = /*#__PURE__*/new WeakMap();\n\nvar _ensureObj = /*#__PURE__*/new WeakSet();\n\nvar PDFObjects = /*#__PURE__*/function () {\n function PDFObjects() {\n _classCallCheck(this, PDFObjects);\n\n _classPrivateMethodInitSpec(this, _ensureObj);\n\n _classPrivateFieldInitSpec(this, _objs, {\n writable: true,\n value: Object.create(null)\n });\n }\n\n _createClass(PDFObjects, [{\n key: \"get\",\n value: function get(objId) {\n var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n if (callback) {\n var _obj = _classPrivateMethodGet(this, _ensureObj, _ensureObj2).call(this, objId);\n\n _obj.capability.promise.then(function () {\n return callback(_obj.data);\n });\n\n return null;\n }\n\n var obj = _classPrivateFieldGet(this, _objs)[objId];\n\n if (!(obj !== null && obj !== void 0 && obj.capability.settled)) {\n throw new Error(\"Requesting object that isn't resolved yet \".concat(objId, \".\"));\n }\n\n return obj.data;\n }\n }, {\n key: \"has\",\n value: function has(objId) {\n var obj = _classPrivateFieldGet(this, _objs)[objId];\n\n return (obj === null || obj === void 0 ? void 0 : obj.capability.settled) || false;\n }\n }, {\n key: \"resolve\",\n value: function resolve(objId) {\n var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n var obj = _classPrivateMethodGet(this, _ensureObj, _ensureObj2).call(this, objId);\n\n obj.data = data;\n obj.capability.resolve();\n }\n }, {\n key: \"clear\",\n value: function clear() {\n _classPrivateFieldSet(this, _objs, Object.create(null));\n }\n }]);\n\n return PDFObjects;\n}();\n\nfunction _ensureObj2(objId) {\n var obj = _classPrivateFieldGet(this, _objs)[objId];\n\n if (obj) {\n return obj;\n }\n\n return _classPrivateFieldGet(this, _objs)[objId] = {\n capability: (0, _util.createPromiseCapability)(),\n data: null\n };\n}\n\nvar RenderTask = /*#__PURE__*/function () {\n function RenderTask(internalRenderTask) {\n _classCallCheck(this, RenderTask);\n\n this._internalRenderTask = internalRenderTask;\n this.onContinue = null;\n }\n\n _createClass(RenderTask, [{\n key: \"promise\",\n get: function get() {\n return this._internalRenderTask.capability.promise;\n }\n }, {\n key: \"cancel\",\n value: function cancel() {\n this._internalRenderTask.cancel();\n }\n }]);\n\n return RenderTask;\n}();\n\nexports.RenderTask = RenderTask;\n\nvar InternalRenderTask = /*#__PURE__*/function () {\n function InternalRenderTask(_ref24) {\n var callback = _ref24.callback,\n params = _ref24.params,\n objs = _ref24.objs,\n commonObjs = _ref24.commonObjs,\n annotationCanvasMap = _ref24.annotationCanvasMap,\n operatorList = _ref24.operatorList,\n pageIndex = _ref24.pageIndex,\n canvasFactory = _ref24.canvasFactory,\n _ref24$useRequestAnim = _ref24.useRequestAnimationFrame,\n useRequestAnimationFrame = _ref24$useRequestAnim === void 0 ? false : _ref24$useRequestAnim,\n _ref24$pdfBug = _ref24.pdfBug,\n pdfBug = _ref24$pdfBug === void 0 ? false : _ref24$pdfBug;\n\n _classCallCheck(this, InternalRenderTask);\n\n this.callback = callback;\n this.params = params;\n this.objs = objs;\n this.commonObjs = commonObjs;\n this.annotationCanvasMap = annotationCanvasMap;\n this.operatorListIdx = null;\n this.operatorList = operatorList;\n this._pageIndex = pageIndex;\n this.canvasFactory = canvasFactory;\n this._pdfBug = pdfBug;\n this.running = false;\n this.graphicsReadyCallback = null;\n this.graphicsReady = false;\n this._useRequestAnimationFrame = useRequestAnimationFrame === true && typeof window !== \"undefined\";\n this.cancelled = false;\n this.capability = (0, _util.createPromiseCapability)();\n this.task = new RenderTask(this);\n this._cancelBound = this.cancel.bind(this);\n this._continueBound = this._continue.bind(this);\n this._scheduleNextBound = this._scheduleNext.bind(this);\n this._nextBound = this._next.bind(this);\n this._canvas = params.canvasContext.canvas;\n }\n\n _createClass(InternalRenderTask, [{\n key: \"completed\",\n get: function get() {\n return this.capability.promise[\"catch\"](function () {});\n }\n }, {\n key: \"initializeGraphics\",\n value: function initializeGraphics(_ref25) {\n var _globalThis$StepperMa;\n\n var _ref25$transparency = _ref25.transparency,\n transparency = _ref25$transparency === void 0 ? false : _ref25$transparency,\n optionalContentConfig = _ref25.optionalContentConfig;\n\n if (this.cancelled) {\n return;\n }\n\n if (this._canvas) {\n if (InternalRenderTask.canvasInUse.has(this._canvas)) {\n throw new Error(\"Cannot use the same canvas during multiple render() operations. \" + \"Use different canvas or ensure previous operations were \" + \"cancelled or completed.\");\n }\n\n InternalRenderTask.canvasInUse.add(this._canvas);\n }\n\n if (this._pdfBug && (_globalThis$StepperMa = globalThis.StepperManager) !== null && _globalThis$StepperMa !== void 0 && _globalThis$StepperMa.enabled) {\n this.stepper = globalThis.StepperManager.create(this._pageIndex);\n this.stepper.init(this.operatorList);\n this.stepper.nextBreakPoint = this.stepper.getNextBreakPoint();\n }\n\n var _this$params = this.params,\n canvasContext = _this$params.canvasContext,\n viewport = _this$params.viewport,\n transform = _this$params.transform,\n imageLayer = _this$params.imageLayer,\n background = _this$params.background;\n this.gfx = new _canvas.CanvasGraphics(canvasContext, this.commonObjs, this.objs, this.canvasFactory, imageLayer, optionalContentConfig, this.annotationCanvasMap);\n this.gfx.beginDrawing({\n transform: transform,\n viewport: viewport,\n transparency: transparency,\n background: background\n });\n this.operatorListIdx = 0;\n this.graphicsReady = true;\n\n if (this.graphicsReadyCallback) {\n this.graphicsReadyCallback();\n }\n }\n }, {\n key: \"cancel\",\n value: function cancel() {\n var error = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n this.running = false;\n this.cancelled = true;\n\n if (this.gfx) {\n this.gfx.endDrawing();\n }\n\n if (this._canvas) {\n InternalRenderTask.canvasInUse[\"delete\"](this._canvas);\n }\n\n this.callback(error || new _display_utils.RenderingCancelledException(\"Rendering cancelled, page \".concat(this._pageIndex + 1), \"canvas\"));\n }\n }, {\n key: \"operatorListChanged\",\n value: function operatorListChanged() {\n if (!this.graphicsReady) {\n if (!this.graphicsReadyCallback) {\n this.graphicsReadyCallback = this._continueBound;\n }\n\n return;\n }\n\n if (this.stepper) {\n this.stepper.updateOperatorList(this.operatorList);\n }\n\n if (this.running) {\n return;\n }\n\n this._continue();\n }\n }, {\n key: \"_continue\",\n value: function _continue() {\n this.running = true;\n\n if (this.cancelled) {\n return;\n }\n\n if (this.task.onContinue) {\n this.task.onContinue(this._scheduleNextBound);\n } else {\n this._scheduleNext();\n }\n }\n }, {\n key: \"_scheduleNext\",\n value: function _scheduleNext() {\n var _this17 = this;\n\n if (this._useRequestAnimationFrame) {\n window.requestAnimationFrame(function () {\n _this17._nextBound()[\"catch\"](_this17._cancelBound);\n });\n } else {\n Promise.resolve().then(this._nextBound)[\"catch\"](this._cancelBound);\n }\n }\n }, {\n key: \"_next\",\n value: function () {\n var _next2 = _asyncToGenerator( /*#__PURE__*/_regenerator[\"default\"].mark(function _callee6() {\n return _regenerator[\"default\"].wrap(function _callee6$(_context6) {\n while (1) {\n switch (_context6.prev = _context6.next) {\n case 0:\n if (!this.cancelled) {\n _context6.next = 2;\n break;\n }\n\n return _context6.abrupt(\"return\");\n\n case 2:\n this.operatorListIdx = this.gfx.executeOperatorList(this.operatorList, this.operatorListIdx, this._continueBound, this.stepper);\n\n if (this.operatorListIdx === this.operatorList.argsArray.length) {\n this.running = false;\n\n if (this.operatorList.lastChunk) {\n this.gfx.endDrawing();\n\n if (this._canvas) {\n InternalRenderTask.canvasInUse[\"delete\"](this._canvas);\n }\n\n this.callback();\n }\n }\n\n case 4:\n case \"end\":\n return _context6.stop();\n }\n }\n }, _callee6, this);\n }));\n\n function _next() {\n return _next2.apply(this, arguments);\n }\n\n return _next;\n }()\n }], [{\n key: \"canvasInUse\",\n get: function get() {\n return (0, _util.shadow)(this, \"canvasInUse\", new WeakSet());\n }\n }]);\n\n return InternalRenderTask;\n}();\n\nvar version = '2.13.216';\nexports.version = version;\nvar build = '399a0ec60';\nexports.build = build;\n\n/***/ }),\n/* 145 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\n\"use strict\";\n\n\nmodule.exports = __w_pdfjs_require__(146);\n\n/***/ }),\n/* 146 */\n/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\n\"use strict\";\n/* module decorator */ module = __w_pdfjs_require__.nmd(module);\n\n\nfunction _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); }\n\nvar runtime = function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined;\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n\n try {\n define({}, \"\");\n } catch (err) {\n define = function define(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n return generator;\n }\n\n exports.wrap = wrap;\n\n function tryCatch(fn, obj, arg) {\n try {\n return {\n type: \"normal\",\n arg: fn.call(obj, arg)\n };\n } catch (err) {\n return {\n type: \"throw\",\n arg: err\n };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n var ContinueSentinel = {};\n\n function Generator() {}\n\n function GeneratorFunction() {}\n\n function GeneratorFunctionPrototype() {}\n\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n\n if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = GeneratorFunctionPrototype;\n define(Gp, \"constructor\", GeneratorFunctionPrototype);\n define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction);\n GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, \"GeneratorFunction\");\n\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n define(prototype, method, function (arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function (genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor ? ctor === GeneratorFunction || (ctor.displayName || ctor.name) === \"GeneratorFunction\" : false;\n };\n\n exports.mark = function (genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n exports.awrap = function (arg) {\n return {\n __await: arg\n };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n\n if (value && _typeof(value) === \"object\" && hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function (value) {\n invoke(\"next\", value, resolve, reject);\n }, function (err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function (unwrapped) {\n result.value = unwrapped;\n resolve(result);\n }, function (error) {\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function (resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();\n }\n\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n });\n exports.AsyncIterator = AsyncIterator;\n\n exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);\n return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n context.sent = context._sent = context.arg;\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n var record = tryCatch(innerFn, self, context);\n\n if (record.type === \"normal\") {\n state = context.done ? GenStateCompleted : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n\n if (method === undefined) {\n context.delegate = null;\n\n if (context.method === \"throw\") {\n if (delegate.iterator[\"return\"]) {\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (!info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n context[delegate.resultName] = info.value;\n context.next = delegate.nextLoc;\n\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n } else {\n return info;\n }\n\n context.delegate = null;\n return ContinueSentinel;\n }\n\n defineIteratorMethods(Gp);\n define(Gp, toStringTagSymbol, \"Generator\");\n define(Gp, iteratorSymbol, function () {\n return this;\n });\n define(Gp, \"toString\", function () {\n return \"[object Generator]\";\n });\n\n function pushTryEntry(locs) {\n var entry = {\n tryLoc: locs[0]\n };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n this.tryEntries = [{\n tryLoc: \"root\"\n }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function (object) {\n var keys = [];\n\n for (var key in object) {\n keys.push(key);\n }\n\n keys.reverse();\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1,\n next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n return next;\n };\n\n return next.next = next;\n }\n }\n\n return {\n next: doneResult\n };\n }\n\n exports.values = values;\n\n function doneResult() {\n return {\n value: undefined,\n done: true\n };\n }\n\n Context.prototype = {\n constructor: Context,\n reset: function reset(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n this.method = \"next\";\n this.arg = undefined;\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n if (name.charAt(0) === \"t\" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n stop: function stop() {\n this.done = true;\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n dispatchException: function dispatchException(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !!caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n abrupt: function abrupt(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n\n if (entry.tryLoc <= this.prev && hasOwn.call(entry, \"finallyLoc\") && this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry && (type === \"break\" || type === \"continue\") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) {\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n complete: function complete(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" || record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n finish: function finish(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n \"catch\": function _catch(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n\n return thrown;\n }\n }\n\n throw new Error(\"illegal catch attempt\");\n },\n delegateYield: function delegateYield(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n return exports;\n}(( false ? 0 : _typeof(module)) === \"object\" ? module.exports : {});\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n if ((typeof globalThis === \"undefined\" ? \"undefined\" : _typeof(globalThis)) === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n\n/***/ }),\n/* 147 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\"use strict\";\n\n\nfunction _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); }\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.StatTimer = exports.RenderingCancelledException = exports.PixelsPerInch = exports.PageViewport = exports.PDFDateString = exports.DOMStandardFontDataFactory = exports.DOMSVGFactory = exports.DOMCanvasFactory = exports.DOMCMapReaderFactory = void 0;\nexports.deprecated = deprecated;\nexports.getFilenameFromUrl = getFilenameFromUrl;\nexports.getPdfFilenameFromUrl = getPdfFilenameFromUrl;\nexports.getXfaPageViewport = getXfaPageViewport;\nexports.isDataScheme = isDataScheme;\nexports.isPdfFile = isPdfFile;\nexports.isValidFetchUrl = isValidFetchUrl;\nexports.loadScript = loadScript;\n\nvar _regenerator = _interopRequireDefault(__w_pdfjs_require__(145));\n\nvar _base_factory = __w_pdfjs_require__(148);\n\nvar _util = __w_pdfjs_require__(1);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction _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; } } }; }\n\nfunction _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); }\n\nfunction _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; }\n\nfunction 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); } }\n\nfunction _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); }); }; }\n\nfunction _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); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _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); }; }\n\nfunction _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); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _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; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nvar SVG_NS = \"http://www.w3.org/2000/svg\";\n\nvar PixelsPerInch = /*#__PURE__*/_createClass(function PixelsPerInch() {\n _classCallCheck(this, PixelsPerInch);\n});\n\nexports.PixelsPerInch = PixelsPerInch;\n\n_defineProperty(PixelsPerInch, \"CSS\", 96.0);\n\n_defineProperty(PixelsPerInch, \"PDF\", 72.0);\n\n_defineProperty(PixelsPerInch, \"PDF_TO_CSS_UNITS\", PixelsPerInch.CSS / PixelsPerInch.PDF);\n\nvar DOMCanvasFactory = /*#__PURE__*/function (_BaseCanvasFactory) {\n _inherits(DOMCanvasFactory, _BaseCanvasFactory);\n\n var _super = _createSuper(DOMCanvasFactory);\n\n function DOMCanvasFactory() {\n var _this;\n\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$ownerDocument = _ref.ownerDocument,\n ownerDocument = _ref$ownerDocument === void 0 ? globalThis.document : _ref$ownerDocument;\n\n _classCallCheck(this, DOMCanvasFactory);\n\n _this = _super.call(this);\n _this._document = ownerDocument;\n return _this;\n }\n\n _createClass(DOMCanvasFactory, [{\n key: \"_createCanvas\",\n value: function _createCanvas(width, height) {\n var canvas = this._document.createElement(\"canvas\");\n\n canvas.width = width;\n canvas.height = height;\n return canvas;\n }\n }]);\n\n return DOMCanvasFactory;\n}(_base_factory.BaseCanvasFactory);\n\nexports.DOMCanvasFactory = DOMCanvasFactory;\n\nfunction fetchData(_x) {\n return _fetchData.apply(this, arguments);\n}\n\nfunction _fetchData() {\n _fetchData = _asyncToGenerator( /*#__PURE__*/_regenerator[\"default\"].mark(function _callee(url) {\n var asTypedArray,\n response,\n _args = arguments;\n return _regenerator[\"default\"].wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n asTypedArray = _args.length > 1 && _args[1] !== undefined ? _args[1] : false;\n\n if (!isValidFetchUrl(url, document.baseURI)) {\n _context.next = 21;\n break;\n }\n\n _context.next = 4;\n return fetch(url);\n\n case 4:\n response = _context.sent;\n\n if (response.ok) {\n _context.next = 7;\n break;\n }\n\n throw new Error(response.statusText);\n\n case 7:\n if (!asTypedArray) {\n _context.next = 15;\n break;\n }\n\n _context.t1 = Uint8Array;\n _context.next = 11;\n return response.arrayBuffer();\n\n case 11:\n _context.t2 = _context.sent;\n _context.t0 = new _context.t1(_context.t2);\n _context.next = 20;\n break;\n\n case 15:\n _context.t3 = _util.stringToBytes;\n _context.next = 18;\n return response.text();\n\n case 18:\n _context.t4 = _context.sent;\n _context.t0 = (0, _context.t3)(_context.t4);\n\n case 20:\n return _context.abrupt(\"return\", _context.t0);\n\n case 21:\n return _context.abrupt(\"return\", new Promise(function (resolve, reject) {\n var request = new XMLHttpRequest();\n request.open(\"GET\", url, true);\n\n if (asTypedArray) {\n request.responseType = \"arraybuffer\";\n }\n\n request.onreadystatechange = function () {\n if (request.readyState !== XMLHttpRequest.DONE) {\n return;\n }\n\n if (request.status === 200 || request.status === 0) {\n var data;\n\n if (asTypedArray && request.response) {\n data = new Uint8Array(request.response);\n } else if (!asTypedArray && request.responseText) {\n data = (0, _util.stringToBytes)(request.responseText);\n }\n\n if (data) {\n resolve(data);\n return;\n }\n }\n\n reject(new Error(request.statusText));\n };\n\n request.send(null);\n }));\n\n case 22:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n return _fetchData.apply(this, arguments);\n}\n\nvar DOMCMapReaderFactory = /*#__PURE__*/function (_BaseCMapReaderFactor) {\n _inherits(DOMCMapReaderFactory, _BaseCMapReaderFactor);\n\n var _super2 = _createSuper(DOMCMapReaderFactory);\n\n function DOMCMapReaderFactory() {\n _classCallCheck(this, DOMCMapReaderFactory);\n\n return _super2.apply(this, arguments);\n }\n\n _createClass(DOMCMapReaderFactory, [{\n key: \"_fetchData\",\n value: function _fetchData(url, compressionType) {\n return fetchData(url, this.isCompressed).then(function (data) {\n return {\n cMapData: data,\n compressionType: compressionType\n };\n });\n }\n }]);\n\n return DOMCMapReaderFactory;\n}(_base_factory.BaseCMapReaderFactory);\n\nexports.DOMCMapReaderFactory = DOMCMapReaderFactory;\n\nvar DOMStandardFontDataFactory = /*#__PURE__*/function (_BaseStandardFontData) {\n _inherits(DOMStandardFontDataFactory, _BaseStandardFontData);\n\n var _super3 = _createSuper(DOMStandardFontDataFactory);\n\n function DOMStandardFontDataFactory() {\n _classCallCheck(this, DOMStandardFontDataFactory);\n\n return _super3.apply(this, arguments);\n }\n\n _createClass(DOMStandardFontDataFactory, [{\n key: \"_fetchData\",\n value: function _fetchData(url) {\n return fetchData(url, true);\n }\n }]);\n\n return DOMStandardFontDataFactory;\n}(_base_factory.BaseStandardFontDataFactory);\n\nexports.DOMStandardFontDataFactory = DOMStandardFontDataFactory;\n\nvar DOMSVGFactory = /*#__PURE__*/function (_BaseSVGFactory) {\n _inherits(DOMSVGFactory, _BaseSVGFactory);\n\n var _super4 = _createSuper(DOMSVGFactory);\n\n function DOMSVGFactory() {\n _classCallCheck(this, DOMSVGFactory);\n\n return _super4.apply(this, arguments);\n }\n\n _createClass(DOMSVGFactory, [{\n key: \"_createSVG\",\n value: function _createSVG(type) {\n return document.createElementNS(SVG_NS, type);\n }\n }]);\n\n return DOMSVGFactory;\n}(_base_factory.BaseSVGFactory);\n\nexports.DOMSVGFactory = DOMSVGFactory;\n\nvar PageViewport = /*#__PURE__*/function () {\n function PageViewport(_ref2) {\n var viewBox = _ref2.viewBox,\n scale = _ref2.scale,\n rotation = _ref2.rotation,\n _ref2$offsetX = _ref2.offsetX,\n offsetX = _ref2$offsetX === void 0 ? 0 : _ref2$offsetX,\n _ref2$offsetY = _ref2.offsetY,\n offsetY = _ref2$offsetY === void 0 ? 0 : _ref2$offsetY,\n _ref2$dontFlip = _ref2.dontFlip,\n dontFlip = _ref2$dontFlip === void 0 ? false : _ref2$dontFlip;\n\n _classCallCheck(this, PageViewport);\n\n this.viewBox = viewBox;\n this.scale = scale;\n this.rotation = rotation;\n this.offsetX = offsetX;\n this.offsetY = offsetY;\n var centerX = (viewBox[2] + viewBox[0]) / 2;\n var centerY = (viewBox[3] + viewBox[1]) / 2;\n var rotateA, rotateB, rotateC, rotateD;\n rotation %= 360;\n\n if (rotation < 0) {\n rotation += 360;\n }\n\n switch (rotation) {\n case 180:\n rotateA = -1;\n rotateB = 0;\n rotateC = 0;\n rotateD = 1;\n break;\n\n case 90:\n rotateA = 0;\n rotateB = 1;\n rotateC = 1;\n rotateD = 0;\n break;\n\n case 270:\n rotateA = 0;\n rotateB = -1;\n rotateC = -1;\n rotateD = 0;\n break;\n\n case 0:\n rotateA = 1;\n rotateB = 0;\n rotateC = 0;\n rotateD = -1;\n break;\n\n default:\n throw new Error(\"PageViewport: Invalid rotation, must be a multiple of 90 degrees.\");\n }\n\n if (dontFlip) {\n rotateC = -rotateC;\n rotateD = -rotateD;\n }\n\n var offsetCanvasX, offsetCanvasY;\n var width, height;\n\n if (rotateA === 0) {\n offsetCanvasX = Math.abs(centerY - viewBox[1]) * scale + offsetX;\n offsetCanvasY = Math.abs(centerX - viewBox[0]) * scale + offsetY;\n width = Math.abs(viewBox[3] - viewBox[1]) * scale;\n height = Math.abs(viewBox[2] - viewBox[0]) * scale;\n } else {\n offsetCanvasX = Math.abs(centerX - viewBox[0]) * scale + offsetX;\n offsetCanvasY = Math.abs(centerY - viewBox[1]) * scale + offsetY;\n width = Math.abs(viewBox[2] - viewBox[0]) * scale;\n height = Math.abs(viewBox[3] - viewBox[1]) * scale;\n }\n\n this.transform = [rotateA * scale, rotateB * scale, rotateC * scale, rotateD * scale, offsetCanvasX - rotateA * scale * centerX - rotateC * scale * centerY, offsetCanvasY - rotateB * scale * centerX - rotateD * scale * centerY];\n this.width = width;\n this.height = height;\n }\n\n _createClass(PageViewport, [{\n key: \"clone\",\n value: function clone() {\n var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref3$scale = _ref3.scale,\n scale = _ref3$scale === void 0 ? this.scale : _ref3$scale,\n _ref3$rotation = _ref3.rotation,\n rotation = _ref3$rotation === void 0 ? this.rotation : _ref3$rotation,\n _ref3$offsetX = _ref3.offsetX,\n offsetX = _ref3$offsetX === void 0 ? this.offsetX : _ref3$offsetX,\n _ref3$offsetY = _ref3.offsetY,\n offsetY = _ref3$offsetY === void 0 ? this.offsetY : _ref3$offsetY,\n _ref3$dontFlip = _ref3.dontFlip,\n dontFlip = _ref3$dontFlip === void 0 ? false : _ref3$dontFlip;\n\n return new PageViewport({\n viewBox: this.viewBox.slice(),\n scale: scale,\n rotation: rotation,\n offsetX: offsetX,\n offsetY: offsetY,\n dontFlip: dontFlip\n });\n }\n }, {\n key: \"convertToViewportPoint\",\n value: function convertToViewportPoint(x, y) {\n return _util.Util.applyTransform([x, y], this.transform);\n }\n }, {\n key: \"convertToViewportRectangle\",\n value: function convertToViewportRectangle(rect) {\n var topLeft = _util.Util.applyTransform([rect[0], rect[1]], this.transform);\n\n var bottomRight = _util.Util.applyTransform([rect[2], rect[3]], this.transform);\n\n return [topLeft[0], topLeft[1], bottomRight[0], bottomRight[1]];\n }\n }, {\n key: \"convertToPdfPoint\",\n value: function convertToPdfPoint(x, y) {\n return _util.Util.applyInverseTransform([x, y], this.transform);\n }\n }]);\n\n return PageViewport;\n}();\n\nexports.PageViewport = PageViewport;\n\nvar RenderingCancelledException = /*#__PURE__*/function (_BaseException) {\n _inherits(RenderingCancelledException, _BaseException);\n\n var _super5 = _createSuper(RenderingCancelledException);\n\n function RenderingCancelledException(msg, type) {\n var _this2;\n\n _classCallCheck(this, RenderingCancelledException);\n\n _this2 = _super5.call(this, msg, \"RenderingCancelledException\");\n _this2.type = type;\n return _this2;\n }\n\n return _createClass(RenderingCancelledException);\n}(_util.BaseException);\n\nexports.RenderingCancelledException = RenderingCancelledException;\n\nfunction isDataScheme(url) {\n var ii = url.length;\n var i = 0;\n\n while (i < ii && url[i].trim() === \"\") {\n i++;\n }\n\n return url.substring(i, i + 5).toLowerCase() === \"data:\";\n}\n\nfunction isPdfFile(filename) {\n return typeof filename === \"string\" && /\\.pdf$/i.test(filename);\n}\n\nfunction getFilenameFromUrl(url) {\n var anchor = url.indexOf(\"#\");\n var query = url.indexOf(\"?\");\n var end = Math.min(anchor > 0 ? anchor : url.length, query > 0 ? query : url.length);\n return url.substring(url.lastIndexOf(\"/\", end) + 1, end);\n}\n\nfunction getPdfFilenameFromUrl(url) {\n var defaultFilename = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : \"document.pdf\";\n\n if (typeof url !== \"string\") {\n return defaultFilename;\n }\n\n if (isDataScheme(url)) {\n (0, _util.warn)('getPdfFilenameFromUrl: ignore \"data:\"-URL for performance reasons.');\n return defaultFilename;\n }\n\n var reURI = /^(?:(?:[^:]+:)?\\/\\/[^/]+)?([^?#]*)(\\?[^#]*)?(#.*)?$/;\n var reFilename = /[^/?#=]+\\.pdf\\b(?!.*\\.pdf\\b)/i;\n var splitURI = reURI.exec(url);\n var suggestedFilename = reFilename.exec(splitURI[1]) || reFilename.exec(splitURI[2]) || reFilename.exec(splitURI[3]);\n\n if (suggestedFilename) {\n suggestedFilename = suggestedFilename[0];\n\n if (suggestedFilename.includes(\"%\")) {\n try {\n suggestedFilename = reFilename.exec(decodeURIComponent(suggestedFilename))[0];\n } catch (ex) {}\n }\n }\n\n return suggestedFilename || defaultFilename;\n}\n\nvar StatTimer = /*#__PURE__*/function () {\n function StatTimer() {\n _classCallCheck(this, StatTimer);\n\n this.started = Object.create(null);\n this.times = [];\n }\n\n _createClass(StatTimer, [{\n key: \"time\",\n value: function time(name) {\n if (name in this.started) {\n (0, _util.warn)(\"Timer is already running for \".concat(name));\n }\n\n this.started[name] = Date.now();\n }\n }, {\n key: \"timeEnd\",\n value: function timeEnd(name) {\n if (!(name in this.started)) {\n (0, _util.warn)(\"Timer has not been started for \".concat(name));\n }\n\n this.times.push({\n name: name,\n start: this.started[name],\n end: Date.now()\n });\n delete this.started[name];\n }\n }, {\n key: \"toString\",\n value: function toString() {\n var outBuf = [];\n var longest = 0;\n\n var _iterator = _createForOfIteratorHelper(this.times),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var time = _step.value;\n var name = time.name;\n\n if (name.length > longest) {\n longest = name.length;\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n var _iterator2 = _createForOfIteratorHelper(this.times),\n _step2;\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var _time = _step2.value;\n var duration = _time.end - _time.start;\n outBuf.push(\"\".concat(_time.name.padEnd(longest), \" \").concat(duration, \"ms\\n\"));\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n\n return outBuf.join(\"\");\n }\n }]);\n\n return StatTimer;\n}();\n\nexports.StatTimer = StatTimer;\n\nfunction isValidFetchUrl(url, baseUrl) {\n try {\n var _ref4 = baseUrl ? new URL(url, baseUrl) : new URL(url),\n protocol = _ref4.protocol;\n\n return protocol === \"http:\" || protocol === \"https:\";\n } catch (ex) {\n return false;\n }\n}\n\nfunction loadScript(src) {\n var removeScriptElement = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n return new Promise(function (resolve, reject) {\n var script = document.createElement(\"script\");\n script.src = src;\n\n script.onload = function (evt) {\n if (removeScriptElement) {\n script.remove();\n }\n\n resolve(evt);\n };\n\n script.onerror = function () {\n reject(new Error(\"Cannot load script at: \".concat(script.src)));\n };\n\n (document.head || document.documentElement).appendChild(script);\n });\n}\n\nfunction deprecated(details) {\n console.log(\"Deprecated API usage: \" + details);\n}\n\nvar pdfDateStringRegex;\n\nvar PDFDateString = /*#__PURE__*/function () {\n function PDFDateString() {\n _classCallCheck(this, PDFDateString);\n }\n\n _createClass(PDFDateString, null, [{\n key: \"toDateObject\",\n value: function toDateObject(input) {\n if (!input || typeof input !== \"string\") {\n return null;\n }\n\n if (!pdfDateStringRegex) {\n pdfDateStringRegex = new RegExp(\"^D:\" + \"(\\\\d{4})\" + \"(\\\\d{2})?\" + \"(\\\\d{2})?\" + \"(\\\\d{2})?\" + \"(\\\\d{2})?\" + \"(\\\\d{2})?\" + \"([Z|+|-])?\" + \"(\\\\d{2})?\" + \"'?\" + \"(\\\\d{2})?\" + \"'?\");\n }\n\n var matches = pdfDateStringRegex.exec(input);\n\n if (!matches) {\n return null;\n }\n\n var year = parseInt(matches[1], 10);\n var month = parseInt(matches[2], 10);\n month = month >= 1 && month <= 12 ? month - 1 : 0;\n var day = parseInt(matches[3], 10);\n day = day >= 1 && day <= 31 ? day : 1;\n var hour = parseInt(matches[4], 10);\n hour = hour >= 0 && hour <= 23 ? hour : 0;\n var minute = parseInt(matches[5], 10);\n minute = minute >= 0 && minute <= 59 ? minute : 0;\n var second = parseInt(matches[6], 10);\n second = second >= 0 && second <= 59 ? second : 0;\n var universalTimeRelation = matches[7] || \"Z\";\n var offsetHour = parseInt(matches[8], 10);\n offsetHour = offsetHour >= 0 && offsetHour <= 23 ? offsetHour : 0;\n var offsetMinute = parseInt(matches[9], 10) || 0;\n offsetMinute = offsetMinute >= 0 && offsetMinute <= 59 ? offsetMinute : 0;\n\n if (universalTimeRelation === \"-\") {\n hour += offsetHour;\n minute += offsetMinute;\n } else if (universalTimeRelation === \"+\") {\n hour -= offsetHour;\n minute -= offsetMinute;\n }\n\n return new Date(Date.UTC(year, month, day, hour, minute, second));\n }\n }]);\n\n return PDFDateString;\n}();\n\nexports.PDFDateString = PDFDateString;\n\nfunction getXfaPageViewport(xfaPage, _ref5) {\n var _ref5$scale = _ref5.scale,\n scale = _ref5$scale === void 0 ? 1 : _ref5$scale,\n _ref5$rotation = _ref5.rotation,\n rotation = _ref5$rotation === void 0 ? 0 : _ref5$rotation;\n var _xfaPage$attributes$s = xfaPage.attributes.style,\n width = _xfaPage$attributes$s.width,\n height = _xfaPage$attributes$s.height;\n var viewBox = [0, 0, parseInt(width), parseInt(height)];\n return new PageViewport({\n viewBox: viewBox,\n scale: scale,\n rotation: rotation\n });\n}\n\n/***/ }),\n/* 148 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.BaseStandardFontDataFactory = exports.BaseSVGFactory = exports.BaseCanvasFactory = exports.BaseCMapReaderFactory = void 0;\n\nvar _regenerator = _interopRequireDefault(__w_pdfjs_require__(145));\n\nvar _util = __w_pdfjs_require__(1);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction 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); } }\n\nfunction _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); }); }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nvar BaseCanvasFactory = /*#__PURE__*/function () {\n function BaseCanvasFactory() {\n _classCallCheck(this, BaseCanvasFactory);\n\n if (this.constructor === BaseCanvasFactory) {\n (0, _util.unreachable)(\"Cannot initialize BaseCanvasFactory.\");\n }\n }\n\n _createClass(BaseCanvasFactory, [{\n key: \"create\",\n value: function create(width, height) {\n if (width <= 0 || height <= 0) {\n throw new Error(\"Invalid canvas size\");\n }\n\n var canvas = this._createCanvas(width, height);\n\n return {\n canvas: canvas,\n context: canvas.getContext(\"2d\")\n };\n }\n }, {\n key: \"reset\",\n value: function reset(canvasAndContext, width, height) {\n if (!canvasAndContext.canvas) {\n throw new Error(\"Canvas is not specified\");\n }\n\n if (width <= 0 || height <= 0) {\n throw new Error(\"Invalid canvas size\");\n }\n\n canvasAndContext.canvas.width = width;\n canvasAndContext.canvas.height = height;\n }\n }, {\n key: \"destroy\",\n value: function destroy(canvasAndContext) {\n if (!canvasAndContext.canvas) {\n throw new Error(\"Canvas is not specified\");\n }\n\n canvasAndContext.canvas.width = 0;\n canvasAndContext.canvas.height = 0;\n canvasAndContext.canvas = null;\n canvasAndContext.context = null;\n }\n }, {\n key: \"_createCanvas\",\n value: function _createCanvas(width, height) {\n (0, _util.unreachable)(\"Abstract method `_createCanvas` called.\");\n }\n }]);\n\n return BaseCanvasFactory;\n}();\n\nexports.BaseCanvasFactory = BaseCanvasFactory;\n\nvar BaseCMapReaderFactory = /*#__PURE__*/function () {\n function BaseCMapReaderFactory(_ref) {\n var _ref$baseUrl = _ref.baseUrl,\n baseUrl = _ref$baseUrl === void 0 ? null : _ref$baseUrl,\n _ref$isCompressed = _ref.isCompressed,\n isCompressed = _ref$isCompressed === void 0 ? false : _ref$isCompressed;\n\n _classCallCheck(this, BaseCMapReaderFactory);\n\n if (this.constructor === BaseCMapReaderFactory) {\n (0, _util.unreachable)(\"Cannot initialize BaseCMapReaderFactory.\");\n }\n\n this.baseUrl = baseUrl;\n this.isCompressed = isCompressed;\n }\n\n _createClass(BaseCMapReaderFactory, [{\n key: \"fetch\",\n value: function () {\n var _fetch = _asyncToGenerator( /*#__PURE__*/_regenerator[\"default\"].mark(function _callee(_ref2) {\n var _this = this;\n\n var name, url, compressionType;\n return _regenerator[\"default\"].wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n name = _ref2.name;\n\n if (this.baseUrl) {\n _context.next = 3;\n break;\n }\n\n throw new Error('The CMap \"baseUrl\" parameter must be specified, ensure that ' + 'the \"cMapUrl\" and \"cMapPacked\" API parameters are provided.');\n\n case 3:\n if (name) {\n _context.next = 5;\n break;\n }\n\n throw new Error(\"CMap name must be specified.\");\n\n case 5:\n url = this.baseUrl + name + (this.isCompressed ? \".bcmap\" : \"\");\n compressionType = this.isCompressed ? _util.CMapCompressionType.BINARY : _util.CMapCompressionType.NONE;\n return _context.abrupt(\"return\", this._fetchData(url, compressionType)[\"catch\"](function (reason) {\n throw new Error(\"Unable to load \".concat(_this.isCompressed ? \"binary \" : \"\", \"CMap at: \").concat(url));\n }));\n\n case 8:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n\n function fetch(_x) {\n return _fetch.apply(this, arguments);\n }\n\n return fetch;\n }()\n }, {\n key: \"_fetchData\",\n value: function _fetchData(url, compressionType) {\n (0, _util.unreachable)(\"Abstract method `_fetchData` called.\");\n }\n }]);\n\n return BaseCMapReaderFactory;\n}();\n\nexports.BaseCMapReaderFactory = BaseCMapReaderFactory;\n\nvar BaseStandardFontDataFactory = /*#__PURE__*/function () {\n function BaseStandardFontDataFactory(_ref3) {\n var _ref3$baseUrl = _ref3.baseUrl,\n baseUrl = _ref3$baseUrl === void 0 ? null : _ref3$baseUrl;\n\n _classCallCheck(this, BaseStandardFontDataFactory);\n\n if (this.constructor === BaseStandardFontDataFactory) {\n (0, _util.unreachable)(\"Cannot initialize BaseStandardFontDataFactory.\");\n }\n\n this.baseUrl = baseUrl;\n }\n\n _createClass(BaseStandardFontDataFactory, [{\n key: \"fetch\",\n value: function () {\n var _fetch2 = _asyncToGenerator( /*#__PURE__*/_regenerator[\"default\"].mark(function _callee2(_ref4) {\n var filename, url;\n return _regenerator[\"default\"].wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n filename = _ref4.filename;\n\n if (this.baseUrl) {\n _context2.next = 3;\n break;\n }\n\n throw new Error('The standard font \"baseUrl\" parameter must be specified, ensure that ' + 'the \"standardFontDataUrl\" API parameter is provided.');\n\n case 3:\n if (filename) {\n _context2.next = 5;\n break;\n }\n\n throw new Error(\"Font filename must be specified.\");\n\n case 5:\n url = \"\".concat(this.baseUrl).concat(filename);\n return _context2.abrupt(\"return\", this._fetchData(url)[\"catch\"](function (reason) {\n throw new Error(\"Unable to load font data at: \".concat(url));\n }));\n\n case 7:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2, this);\n }));\n\n function fetch(_x2) {\n return _fetch2.apply(this, arguments);\n }\n\n return fetch;\n }()\n }, {\n key: \"_fetchData\",\n value: function _fetchData(url) {\n (0, _util.unreachable)(\"Abstract method `_fetchData` called.\");\n }\n }]);\n\n return BaseStandardFontDataFactory;\n}();\n\nexports.BaseStandardFontDataFactory = BaseStandardFontDataFactory;\n\nvar BaseSVGFactory = /*#__PURE__*/function () {\n function BaseSVGFactory() {\n _classCallCheck(this, BaseSVGFactory);\n\n if (this.constructor === BaseSVGFactory) {\n (0, _util.unreachable)(\"Cannot initialize BaseSVGFactory.\");\n }\n }\n\n _createClass(BaseSVGFactory, [{\n key: \"create\",\n value: function create(width, height) {\n if (width <= 0 || height <= 0) {\n throw new Error(\"Invalid SVG dimensions\");\n }\n\n var svg = this._createSVG(\"svg:svg\");\n\n svg.setAttribute(\"version\", \"1.1\");\n svg.setAttribute(\"width\", \"\".concat(width, \"px\"));\n svg.setAttribute(\"height\", \"\".concat(height, \"px\"));\n svg.setAttribute(\"preserveAspectRatio\", \"none\");\n svg.setAttribute(\"viewBox\", \"0 0 \".concat(width, \" \").concat(height));\n return svg;\n }\n }, {\n key: \"createElement\",\n value: function createElement(type) {\n if (typeof type !== \"string\") {\n throw new Error(\"Invalid SVG element type\");\n }\n\n return this._createSVG(type);\n }\n }, {\n key: \"_createSVG\",\n value: function _createSVG(type) {\n (0, _util.unreachable)(\"Abstract method `_createSVG` called.\");\n }\n }]);\n\n return BaseSVGFactory;\n}();\n\nexports.BaseSVGFactory = BaseSVGFactory;\n\n/***/ }),\n/* 149 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\"use strict\";\n\n\nfunction _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); }\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.FontLoader = exports.FontFaceObject = void 0;\n\nvar _regenerator = _interopRequireDefault(__w_pdfjs_require__(145));\n\nvar _util = __w_pdfjs_require__(1);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction _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); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _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); }; }\n\nfunction _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); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _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; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction 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); } }\n\nfunction _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); }); }; }\n\nfunction _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; } } }; }\n\nfunction _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); }\n\nfunction _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; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nvar BaseFontLoader = /*#__PURE__*/function () {\n function BaseFontLoader(_ref) {\n var docId = _ref.docId,\n onUnsupportedFeature = _ref.onUnsupportedFeature,\n _ref$ownerDocument = _ref.ownerDocument,\n ownerDocument = _ref$ownerDocument === void 0 ? globalThis.document : _ref$ownerDocument,\n _ref$styleElement = _ref.styleElement,\n styleElement = _ref$styleElement === void 0 ? null : _ref$styleElement;\n\n _classCallCheck(this, BaseFontLoader);\n\n if (this.constructor === BaseFontLoader) {\n (0, _util.unreachable)(\"Cannot initialize BaseFontLoader.\");\n }\n\n this.docId = docId;\n this._onUnsupportedFeature = onUnsupportedFeature;\n this._document = ownerDocument;\n this.nativeFontFaces = [];\n this.styleElement = null;\n }\n\n _createClass(BaseFontLoader, [{\n key: \"addNativeFontFace\",\n value: function addNativeFontFace(nativeFontFace) {\n this.nativeFontFaces.push(nativeFontFace);\n\n this._document.fonts.add(nativeFontFace);\n }\n }, {\n key: \"insertRule\",\n value: function insertRule(rule) {\n var styleElement = this.styleElement;\n\n if (!styleElement) {\n styleElement = this.styleElement = this._document.createElement(\"style\");\n styleElement.id = \"PDFJS_FONT_STYLE_TAG_\".concat(this.docId);\n\n this._document.documentElement.getElementsByTagName(\"head\")[0].appendChild(styleElement);\n }\n\n var styleSheet = styleElement.sheet;\n styleSheet.insertRule(rule, styleSheet.cssRules.length);\n }\n }, {\n key: \"clear\",\n value: function clear() {\n var _iterator = _createForOfIteratorHelper(this.nativeFontFaces),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var nativeFontFace = _step.value;\n\n this._document.fonts[\"delete\"](nativeFontFace);\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n this.nativeFontFaces.length = 0;\n\n if (this.styleElement) {\n this.styleElement.remove();\n this.styleElement = null;\n }\n }\n }, {\n key: \"bind\",\n value: function () {\n var _bind = _asyncToGenerator( /*#__PURE__*/_regenerator[\"default\"].mark(function _callee(font) {\n var _this = this;\n\n var nativeFontFace, rule;\n return _regenerator[\"default\"].wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n if (!(font.attached || font.missingFile)) {\n _context.next = 2;\n break;\n }\n\n return _context.abrupt(\"return\");\n\n case 2:\n font.attached = true;\n\n if (!this.isFontLoadingAPISupported) {\n _context.next = 19;\n break;\n }\n\n nativeFontFace = font.createNativeFontFace();\n\n if (!nativeFontFace) {\n _context.next = 18;\n break;\n }\n\n this.addNativeFontFace(nativeFontFace);\n _context.prev = 7;\n _context.next = 10;\n return nativeFontFace.loaded;\n\n case 10:\n _context.next = 18;\n break;\n\n case 12:\n _context.prev = 12;\n _context.t0 = _context[\"catch\"](7);\n\n this._onUnsupportedFeature({\n featureId: _util.UNSUPPORTED_FEATURES.errorFontLoadNative\n });\n\n (0, _util.warn)(\"Failed to load font '\".concat(nativeFontFace.family, \"': '\").concat(_context.t0, \"'.\"));\n font.disableFontFace = true;\n throw _context.t0;\n\n case 18:\n return _context.abrupt(\"return\");\n\n case 19:\n rule = font.createFontFaceRule();\n\n if (!rule) {\n _context.next = 26;\n break;\n }\n\n this.insertRule(rule);\n\n if (!this.isSyncFontLoadingSupported) {\n _context.next = 24;\n break;\n }\n\n return _context.abrupt(\"return\");\n\n case 24:\n _context.next = 26;\n return new Promise(function (resolve) {\n var request = _this._queueLoadingCallback(resolve);\n\n _this._prepareFontLoadEvent([rule], [font], request);\n });\n\n case 26:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this, [[7, 12]]);\n }));\n\n function bind(_x) {\n return _bind.apply(this, arguments);\n }\n\n return bind;\n }()\n }, {\n key: \"_queueLoadingCallback\",\n value: function _queueLoadingCallback(callback) {\n (0, _util.unreachable)(\"Abstract method `_queueLoadingCallback`.\");\n }\n }, {\n key: \"isFontLoadingAPISupported\",\n get: function get() {\n var _this$_document;\n\n var hasFonts = !!((_this$_document = this._document) !== null && _this$_document !== void 0 && _this$_document.fonts);\n return (0, _util.shadow)(this, \"isFontLoadingAPISupported\", hasFonts);\n }\n }, {\n key: \"isSyncFontLoadingSupported\",\n get: function get() {\n (0, _util.unreachable)(\"Abstract method `isSyncFontLoadingSupported`.\");\n }\n }, {\n key: \"_loadTestFont\",\n get: function get() {\n (0, _util.unreachable)(\"Abstract method `_loadTestFont`.\");\n }\n }, {\n key: \"_prepareFontLoadEvent\",\n value: function _prepareFontLoadEvent(rules, fontsToLoad, request) {\n (0, _util.unreachable)(\"Abstract method `_prepareFontLoadEvent`.\");\n }\n }]);\n\n return BaseFontLoader;\n}();\n\nvar FontLoader;\nexports.FontLoader = FontLoader;\n{\n exports.FontLoader = FontLoader = /*#__PURE__*/function (_BaseFontLoader) {\n _inherits(GenericFontLoader, _BaseFontLoader);\n\n var _super = _createSuper(GenericFontLoader);\n\n function GenericFontLoader(params) {\n var _this2;\n\n _classCallCheck(this, GenericFontLoader);\n\n _this2 = _super.call(this, params);\n _this2.loadingContext = {\n requests: [],\n nextRequestId: 0\n };\n _this2.loadTestFontId = 0;\n return _this2;\n }\n\n _createClass(GenericFontLoader, [{\n key: \"isSyncFontLoadingSupported\",\n get: function get() {\n var supported = false;\n\n if (typeof navigator === \"undefined\") {\n supported = true;\n } else {\n var m = /Mozilla\\/5.0.*?rv:(\\d+).*? Gecko/.exec(navigator.userAgent);\n\n if ((m === null || m === void 0 ? void 0 : m[1]) >= 14) {\n supported = true;\n }\n }\n\n return (0, _util.shadow)(this, \"isSyncFontLoadingSupported\", supported);\n }\n }, {\n key: \"_queueLoadingCallback\",\n value: function _queueLoadingCallback(callback) {\n function completeRequest() {\n (0, _util.assert)(!request.done, \"completeRequest() cannot be called twice.\");\n request.done = true;\n\n while (context.requests.length > 0 && context.requests[0].done) {\n var otherRequest = context.requests.shift();\n setTimeout(otherRequest.callback, 0);\n }\n }\n\n var context = this.loadingContext;\n var request = {\n id: \"pdfjs-font-loading-\".concat(context.nextRequestId++),\n done: false,\n complete: completeRequest,\n callback: callback\n };\n context.requests.push(request);\n return request;\n }\n }, {\n key: \"_loadTestFont\",\n get: function get() {\n var getLoadTestFont = function getLoadTestFont() {\n 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==\");\n };\n\n return (0, _util.shadow)(this, \"_loadTestFont\", getLoadTestFont());\n }\n }, {\n key: \"_prepareFontLoadEvent\",\n value: function _prepareFontLoadEvent(rules, fonts, request) {\n function int32(data, offset) {\n return data.charCodeAt(offset) << 24 | data.charCodeAt(offset + 1) << 16 | data.charCodeAt(offset + 2) << 8 | data.charCodeAt(offset + 3) & 0xff;\n }\n\n function spliceString(s, offset, remove, insert) {\n var chunk1 = s.substring(0, offset);\n var chunk2 = s.substring(offset + remove);\n return chunk1 + insert + chunk2;\n }\n\n var i, ii;\n\n var canvas = this._document.createElement(\"canvas\");\n\n canvas.width = 1;\n canvas.height = 1;\n var ctx = canvas.getContext(\"2d\");\n var called = 0;\n\n function isFontReady(name, callback) {\n called++;\n\n if (called > 30) {\n (0, _util.warn)(\"Load test font never loaded.\");\n callback();\n return;\n }\n\n ctx.font = \"30px \" + name;\n ctx.fillText(\".\", 0, 20);\n var imageData = ctx.getImageData(0, 0, 1, 1);\n\n if (imageData.data[3] > 0) {\n callback();\n return;\n }\n\n setTimeout(isFontReady.bind(null, name, callback));\n }\n\n var loadTestFontId = \"lt\".concat(Date.now()).concat(this.loadTestFontId++);\n var data = this._loadTestFont;\n var COMMENT_OFFSET = 976;\n data = spliceString(data, COMMENT_OFFSET, loadTestFontId.length, loadTestFontId);\n var CFF_CHECKSUM_OFFSET = 16;\n var XXXX_VALUE = 0x58585858;\n var checksum = int32(data, CFF_CHECKSUM_OFFSET);\n\n for (i = 0, ii = loadTestFontId.length - 3; i < ii; i += 4) {\n checksum = checksum - XXXX_VALUE + int32(loadTestFontId, i) | 0;\n }\n\n if (i < loadTestFontId.length) {\n checksum = checksum - XXXX_VALUE + int32(loadTestFontId + \"XXX\", i) | 0;\n }\n\n data = spliceString(data, CFF_CHECKSUM_OFFSET, 4, (0, _util.string32)(checksum));\n var url = \"url(data:font/opentype;base64,\".concat(btoa(data), \");\");\n var rule = \"@font-face {font-family:\\\"\".concat(loadTestFontId, \"\\\";src:\").concat(url, \"}\");\n this.insertRule(rule);\n var names = [];\n\n var _iterator2 = _createForOfIteratorHelper(fonts),\n _step2;\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var font = _step2.value;\n names.push(font.loadedName);\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n\n names.push(loadTestFontId);\n\n var div = this._document.createElement(\"div\");\n\n div.style.visibility = \"hidden\";\n div.style.width = div.style.height = \"10px\";\n div.style.position = \"absolute\";\n div.style.top = div.style.left = \"0px\";\n\n for (var _i = 0, _names = names; _i < _names.length; _i++) {\n var name = _names[_i];\n\n var span = this._document.createElement(\"span\");\n\n span.textContent = \"Hi\";\n span.style.fontFamily = name;\n div.appendChild(span);\n }\n\n this._document.body.appendChild(div);\n\n isFontReady(loadTestFontId, function () {\n div.remove();\n request.complete();\n });\n }\n }]);\n\n return GenericFontLoader;\n }(BaseFontLoader);\n}\n\nvar FontFaceObject = /*#__PURE__*/function () {\n function FontFaceObject(translatedData, _ref2) {\n var _ref2$isEvalSupported = _ref2.isEvalSupported,\n isEvalSupported = _ref2$isEvalSupported === void 0 ? true : _ref2$isEvalSupported,\n _ref2$disableFontFace = _ref2.disableFontFace,\n disableFontFace = _ref2$disableFontFace === void 0 ? false : _ref2$disableFontFace,\n _ref2$ignoreErrors = _ref2.ignoreErrors,\n ignoreErrors = _ref2$ignoreErrors === void 0 ? false : _ref2$ignoreErrors,\n onUnsupportedFeature = _ref2.onUnsupportedFeature,\n _ref2$fontRegistry = _ref2.fontRegistry,\n fontRegistry = _ref2$fontRegistry === void 0 ? null : _ref2$fontRegistry;\n\n _classCallCheck(this, FontFaceObject);\n\n this.compiledGlyphs = Object.create(null);\n\n for (var i in translatedData) {\n this[i] = translatedData[i];\n }\n\n this.isEvalSupported = isEvalSupported !== false;\n this.disableFontFace = disableFontFace === true;\n this.ignoreErrors = ignoreErrors === true;\n this._onUnsupportedFeature = onUnsupportedFeature;\n this.fontRegistry = fontRegistry;\n }\n\n _createClass(FontFaceObject, [{\n key: \"createNativeFontFace\",\n value: function createNativeFontFace() {\n if (!this.data || this.disableFontFace) {\n return null;\n }\n\n var nativeFontFace;\n\n if (!this.cssFontInfo) {\n nativeFontFace = new FontFace(this.loadedName, this.data, {});\n } else {\n var css = {\n weight: this.cssFontInfo.fontWeight\n };\n\n if (this.cssFontInfo.italicAngle) {\n css.style = \"oblique \".concat(this.cssFontInfo.italicAngle, \"deg\");\n }\n\n nativeFontFace = new FontFace(this.cssFontInfo.fontFamily, this.data, css);\n }\n\n if (this.fontRegistry) {\n this.fontRegistry.registerFont(this);\n }\n\n return nativeFontFace;\n }\n }, {\n key: \"createFontFaceRule\",\n value: function createFontFaceRule() {\n if (!this.data || this.disableFontFace) {\n return null;\n }\n\n var data = (0, _util.bytesToString)(this.data);\n var url = \"url(data:\".concat(this.mimetype, \";base64,\").concat(btoa(data), \");\");\n var rule;\n\n if (!this.cssFontInfo) {\n rule = \"@font-face {font-family:\\\"\".concat(this.loadedName, \"\\\";src:\").concat(url, \"}\");\n } else {\n var css = \"font-weight: \".concat(this.cssFontInfo.fontWeight, \";\");\n\n if (this.cssFontInfo.italicAngle) {\n css += \"font-style: oblique \".concat(this.cssFontInfo.italicAngle, \"deg;\");\n }\n\n rule = \"@font-face {font-family:\\\"\".concat(this.cssFontInfo.fontFamily, \"\\\";\").concat(css, \"src:\").concat(url, \"}\");\n }\n\n if (this.fontRegistry) {\n this.fontRegistry.registerFont(this, url);\n }\n\n return rule;\n }\n }, {\n key: \"getPathGenerator\",\n value: function getPathGenerator(objs, character) {\n if (this.compiledGlyphs[character] !== undefined) {\n return this.compiledGlyphs[character];\n }\n\n var cmds;\n\n try {\n cmds = objs.get(this.loadedName + \"_path_\" + character);\n } catch (ex) {\n if (!this.ignoreErrors) {\n throw ex;\n }\n\n this._onUnsupportedFeature({\n featureId: _util.UNSUPPORTED_FEATURES.errorFontGetPath\n });\n\n (0, _util.warn)(\"getPathGenerator - ignoring character: \\\"\".concat(ex, \"\\\".\"));\n return this.compiledGlyphs[character] = function (c, size) {};\n }\n\n if (this.isEvalSupported && _util.IsEvalSupportedCached.value) {\n var jsBuf = [];\n\n var _iterator3 = _createForOfIteratorHelper(cmds),\n _step3;\n\n try {\n for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n var current = _step3.value;\n var args = current.args !== undefined ? current.args.join(\",\") : \"\";\n jsBuf.push(\"c.\", current.cmd, \"(\", args, \");\\n\");\n }\n } catch (err) {\n _iterator3.e(err);\n } finally {\n _iterator3.f();\n }\n\n return this.compiledGlyphs[character] = new Function(\"c\", \"size\", jsBuf.join(\"\"));\n }\n\n return this.compiledGlyphs[character] = function (c, size) {\n var _iterator4 = _createForOfIteratorHelper(cmds),\n _step4;\n\n try {\n for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {\n var _current = _step4.value;\n\n if (_current.cmd === \"scale\") {\n _current.args = [size, -size];\n }\n\n c[_current.cmd].apply(c, _current.args);\n }\n } catch (err) {\n _iterator4.e(err);\n } finally {\n _iterator4.f();\n }\n };\n }\n }]);\n\n return FontFaceObject;\n}();\n\nexports.FontFaceObject = FontFaceObject;\n\n/***/ }),\n/* 150 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\"use strict\";\n\n\nfunction _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); }\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.NodeStandardFontDataFactory = exports.NodeCanvasFactory = exports.NodeCMapReaderFactory = void 0;\n\nvar _base_factory = __w_pdfjs_require__(148);\n\nvar _is_node = __w_pdfjs_require__(3);\n\nvar _util = __w_pdfjs_require__(1);\n\nfunction _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); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _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); }; }\n\nfunction _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); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _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; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar NodeCanvasFactory = /*#__PURE__*/_createClass(function NodeCanvasFactory() {\n _classCallCheck(this, NodeCanvasFactory);\n\n (0, _util.unreachable)(\"Not implemented: NodeCanvasFactory\");\n});\n\nexports.NodeCanvasFactory = NodeCanvasFactory;\n\nvar NodeCMapReaderFactory = /*#__PURE__*/_createClass(function NodeCMapReaderFactory() {\n _classCallCheck(this, NodeCMapReaderFactory);\n\n (0, _util.unreachable)(\"Not implemented: NodeCMapReaderFactory\");\n});\n\nexports.NodeCMapReaderFactory = NodeCMapReaderFactory;\n\nvar NodeStandardFontDataFactory = /*#__PURE__*/_createClass(function NodeStandardFontDataFactory() {\n _classCallCheck(this, NodeStandardFontDataFactory);\n\n (0, _util.unreachable)(\"Not implemented: NodeStandardFontDataFactory\");\n});\n\nexports.NodeStandardFontDataFactory = NodeStandardFontDataFactory;\n\nif (_is_node.isNodeJS) {\n var fetchData = function fetchData(url) {\n return new Promise(function (resolve, reject) {\n var fs = __webpack_require__(/*! fs */ \"?0f9d\");\n\n fs.readFile(url, function (error, data) {\n if (error || !data) {\n reject(new Error(error));\n return;\n }\n\n resolve(new Uint8Array(data));\n });\n });\n };\n\n exports.NodeCanvasFactory = NodeCanvasFactory = /*#__PURE__*/function (_BaseCanvasFactory) {\n _inherits(NodeCanvasFactory, _BaseCanvasFactory);\n\n var _super = _createSuper(NodeCanvasFactory);\n\n function NodeCanvasFactory() {\n _classCallCheck(this, NodeCanvasFactory);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(NodeCanvasFactory, [{\n key: \"_createCanvas\",\n value: function _createCanvas(width, height) {\n var Canvas = __webpack_require__(/*! canvas */ \"?5d76\");\n\n return Canvas.createCanvas(width, height);\n }\n }]);\n\n return NodeCanvasFactory;\n }(_base_factory.BaseCanvasFactory);\n\n exports.NodeCMapReaderFactory = NodeCMapReaderFactory = /*#__PURE__*/function (_BaseCMapReaderFactor) {\n _inherits(NodeCMapReaderFactory, _BaseCMapReaderFactor);\n\n var _super2 = _createSuper(NodeCMapReaderFactory);\n\n function NodeCMapReaderFactory() {\n _classCallCheck(this, NodeCMapReaderFactory);\n\n return _super2.apply(this, arguments);\n }\n\n _createClass(NodeCMapReaderFactory, [{\n key: \"_fetchData\",\n value: function _fetchData(url, compressionType) {\n return fetchData(url).then(function (data) {\n return {\n cMapData: data,\n compressionType: compressionType\n };\n });\n }\n }]);\n\n return NodeCMapReaderFactory;\n }(_base_factory.BaseCMapReaderFactory);\n\n exports.NodeStandardFontDataFactory = NodeStandardFontDataFactory = /*#__PURE__*/function (_BaseStandardFontData) {\n _inherits(NodeStandardFontDataFactory, _BaseStandardFontData);\n\n var _super3 = _createSuper(NodeStandardFontDataFactory);\n\n function NodeStandardFontDataFactory() {\n _classCallCheck(this, NodeStandardFontDataFactory);\n\n return _super3.apply(this, arguments);\n }\n\n _createClass(NodeStandardFontDataFactory, [{\n key: \"_fetchData\",\n value: function _fetchData(url) {\n return fetchData(url);\n }\n }]);\n\n return NodeStandardFontDataFactory;\n }(_base_factory.BaseStandardFontDataFactory);\n}\n\n/***/ }),\n/* 151 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.AnnotationStorage = void 0;\n\nvar _util = __w_pdfjs_require__(1);\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _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.\"); }\n\nfunction _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); }\n\nfunction _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; }\n\nfunction _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; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nvar AnnotationStorage = /*#__PURE__*/function () {\n function AnnotationStorage() {\n _classCallCheck(this, AnnotationStorage);\n\n this._storage = new Map();\n this._timeStamp = Date.now();\n this._modified = false;\n this.onSetModified = null;\n this.onResetModified = null;\n }\n\n _createClass(AnnotationStorage, [{\n key: \"getValue\",\n value: function getValue(key, defaultValue) {\n var value = this._storage.get(key);\n\n if (value === undefined) {\n return defaultValue;\n }\n\n return Object.assign(defaultValue, value);\n }\n }, {\n key: \"setValue\",\n value: function setValue(key, value) {\n var obj = this._storage.get(key);\n\n var modified = false;\n\n if (obj !== undefined) {\n for (var _i = 0, _Object$entries = Object.entries(value); _i < _Object$entries.length; _i++) {\n var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),\n entry = _Object$entries$_i[0],\n val = _Object$entries$_i[1];\n\n if (obj[entry] !== val) {\n modified = true;\n obj[entry] = val;\n }\n }\n } else {\n modified = true;\n\n this._storage.set(key, value);\n }\n\n if (modified) {\n this._timeStamp = Date.now();\n\n this._setModified();\n }\n }\n }, {\n key: \"getAll\",\n value: function getAll() {\n return this._storage.size > 0 ? (0, _util.objectFromMap)(this._storage) : null;\n }\n }, {\n key: \"size\",\n get: function get() {\n return this._storage.size;\n }\n }, {\n key: \"_setModified\",\n value: function _setModified() {\n if (!this._modified) {\n this._modified = true;\n\n if (typeof this.onSetModified === \"function\") {\n this.onSetModified();\n }\n }\n }\n }, {\n key: \"resetModified\",\n value: function resetModified() {\n if (this._modified) {\n this._modified = false;\n\n if (typeof this.onResetModified === \"function\") {\n this.onResetModified();\n }\n }\n }\n }, {\n key: \"serializable\",\n get: function get() {\n return this._storage.size > 0 ? this._storage : null;\n }\n }, {\n key: \"lastModified\",\n get: function get() {\n return this._timeStamp.toString();\n }\n }]);\n\n return AnnotationStorage;\n}();\n\nexports.AnnotationStorage = AnnotationStorage;\n\n/***/ }),\n/* 152 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.CanvasGraphics = void 0;\n\nvar _util = __w_pdfjs_require__(1);\n\nvar _pattern_helper = __w_pdfjs_require__(153);\n\nvar _display_utils = __w_pdfjs_require__(147);\n\nfunction _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); }\n\nfunction _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; } } }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _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.\"); }\n\nfunction _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); }\n\nfunction _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; }\n\nfunction _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; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nvar MIN_FONT_SIZE = 16;\nvar MAX_FONT_SIZE = 100;\nvar MAX_GROUP_SIZE = 4096;\nvar EXECUTION_TIME = 15;\nvar EXECUTION_STEPS = 10;\nvar COMPILE_TYPE3_GLYPHS = true;\nvar MAX_SIZE_TO_COMPILE = 1000;\nvar FULL_CHUNK_HEIGHT = 16;\nvar LINEWIDTH_SCALE_FACTOR = 1.000001;\n\nfunction mirrorContextOperations(ctx, destCtx) {\n if (ctx._removeMirroring) {\n throw new Error(\"Context is already forwarding operations.\");\n }\n\n ctx.__originalSave = ctx.save;\n ctx.__originalRestore = ctx.restore;\n ctx.__originalRotate = ctx.rotate;\n ctx.__originalScale = ctx.scale;\n ctx.__originalTranslate = ctx.translate;\n ctx.__originalTransform = ctx.transform;\n ctx.__originalSetTransform = ctx.setTransform;\n ctx.__originalResetTransform = ctx.resetTransform;\n ctx.__originalClip = ctx.clip;\n ctx.__originalMoveTo = ctx.moveTo;\n ctx.__originalLineTo = ctx.lineTo;\n ctx.__originalBezierCurveTo = ctx.bezierCurveTo;\n ctx.__originalRect = ctx.rect;\n ctx.__originalClosePath = ctx.closePath;\n ctx.__originalBeginPath = ctx.beginPath;\n\n ctx._removeMirroring = function () {\n ctx.save = ctx.__originalSave;\n ctx.restore = ctx.__originalRestore;\n ctx.rotate = ctx.__originalRotate;\n ctx.scale = ctx.__originalScale;\n ctx.translate = ctx.__originalTranslate;\n ctx.transform = ctx.__originalTransform;\n ctx.setTransform = ctx.__originalSetTransform;\n ctx.resetTransform = ctx.__originalResetTransform;\n ctx.clip = ctx.__originalClip;\n ctx.moveTo = ctx.__originalMoveTo;\n ctx.lineTo = ctx.__originalLineTo;\n ctx.bezierCurveTo = ctx.__originalBezierCurveTo;\n ctx.rect = ctx.__originalRect;\n ctx.closePath = ctx.__originalClosePath;\n ctx.beginPath = ctx.__originalBeginPath;\n delete ctx._removeMirroring;\n };\n\n ctx.save = function ctxSave() {\n destCtx.save();\n\n this.__originalSave();\n };\n\n ctx.restore = function ctxRestore() {\n destCtx.restore();\n\n this.__originalRestore();\n };\n\n ctx.translate = function ctxTranslate(x, y) {\n destCtx.translate(x, y);\n\n this.__originalTranslate(x, y);\n };\n\n ctx.scale = function ctxScale(x, y) {\n destCtx.scale(x, y);\n\n this.__originalScale(x, y);\n };\n\n ctx.transform = function ctxTransform(a, b, c, d, e, f) {\n destCtx.transform(a, b, c, d, e, f);\n\n this.__originalTransform(a, b, c, d, e, f);\n };\n\n ctx.setTransform = function ctxSetTransform(a, b, c, d, e, f) {\n destCtx.setTransform(a, b, c, d, e, f);\n\n this.__originalSetTransform(a, b, c, d, e, f);\n };\n\n ctx.resetTransform = function ctxResetTransform() {\n destCtx.resetTransform();\n\n this.__originalResetTransform();\n };\n\n ctx.rotate = function ctxRotate(angle) {\n destCtx.rotate(angle);\n\n this.__originalRotate(angle);\n };\n\n ctx.clip = function ctxRotate(rule) {\n destCtx.clip(rule);\n\n this.__originalClip(rule);\n };\n\n ctx.moveTo = function (x, y) {\n destCtx.moveTo(x, y);\n\n this.__originalMoveTo(x, y);\n };\n\n ctx.lineTo = function (x, y) {\n destCtx.lineTo(x, y);\n\n this.__originalLineTo(x, y);\n };\n\n ctx.bezierCurveTo = function (cp1x, cp1y, cp2x, cp2y, x, y) {\n destCtx.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y);\n\n this.__originalBezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y);\n };\n\n ctx.rect = function (x, y, width, height) {\n destCtx.rect(x, y, width, height);\n\n this.__originalRect(x, y, width, height);\n };\n\n ctx.closePath = function () {\n destCtx.closePath();\n\n this.__originalClosePath();\n };\n\n ctx.beginPath = function () {\n destCtx.beginPath();\n\n this.__originalBeginPath();\n };\n}\n\nfunction addContextCurrentTransform(ctx) {\n if (ctx._transformStack) {\n ctx._transformStack = [];\n }\n\n if (ctx.mozCurrentTransform) {\n return;\n }\n\n ctx._originalSave = ctx.save;\n ctx._originalRestore = ctx.restore;\n ctx._originalRotate = ctx.rotate;\n ctx._originalScale = ctx.scale;\n ctx._originalTranslate = ctx.translate;\n ctx._originalTransform = ctx.transform;\n ctx._originalSetTransform = ctx.setTransform;\n ctx._originalResetTransform = ctx.resetTransform;\n ctx._transformMatrix = ctx._transformMatrix || [1, 0, 0, 1, 0, 0];\n ctx._transformStack = [];\n\n try {\n var desc = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(ctx), \"lineWidth\");\n ctx._setLineWidth = desc.set;\n ctx._getLineWidth = desc.get;\n Object.defineProperty(ctx, \"lineWidth\", {\n set: function setLineWidth(width) {\n this._setLineWidth(width * LINEWIDTH_SCALE_FACTOR);\n },\n get: function getLineWidth() {\n return this._getLineWidth();\n }\n });\n } catch (_) {}\n\n Object.defineProperty(ctx, \"mozCurrentTransform\", {\n get: function getCurrentTransform() {\n return this._transformMatrix;\n }\n });\n Object.defineProperty(ctx, \"mozCurrentTransformInverse\", {\n get: function getCurrentTransformInverse() {\n var _this$_transformMatri = _slicedToArray(this._transformMatrix, 6),\n a = _this$_transformMatri[0],\n b = _this$_transformMatri[1],\n c = _this$_transformMatri[2],\n d = _this$_transformMatri[3],\n e = _this$_transformMatri[4],\n f = _this$_transformMatri[5];\n\n var ad_bc = a * d - b * c;\n var bc_ad = b * c - a * d;\n 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];\n }\n });\n\n ctx.save = function ctxSave() {\n var old = this._transformMatrix;\n\n this._transformStack.push(old);\n\n this._transformMatrix = old.slice(0, 6);\n\n this._originalSave();\n };\n\n ctx.restore = function ctxRestore() {\n if (this._transformStack.length === 0) {\n (0, _util.warn)(\"Tried to restore a ctx when the stack was already empty.\");\n }\n\n var prev = this._transformStack.pop();\n\n if (prev) {\n this._transformMatrix = prev;\n\n this._originalRestore();\n }\n };\n\n ctx.translate = function ctxTranslate(x, y) {\n var m = this._transformMatrix;\n m[4] = m[0] * x + m[2] * y + m[4];\n m[5] = m[1] * x + m[3] * y + m[5];\n\n this._originalTranslate(x, y);\n };\n\n ctx.scale = function ctxScale(x, y) {\n var m = this._transformMatrix;\n m[0] *= x;\n m[1] *= x;\n m[2] *= y;\n m[3] *= y;\n\n this._originalScale(x, y);\n };\n\n ctx.transform = function ctxTransform(a, b, c, d, e, f) {\n var m = this._transformMatrix;\n 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]];\n\n ctx._originalTransform(a, b, c, d, e, f);\n };\n\n ctx.setTransform = function ctxSetTransform(a, b, c, d, e, f) {\n this._transformMatrix = [a, b, c, d, e, f];\n\n ctx._originalSetTransform(a, b, c, d, e, f);\n };\n\n ctx.resetTransform = function ctxResetTransform() {\n this._transformMatrix = [1, 0, 0, 1, 0, 0];\n\n ctx._originalResetTransform();\n };\n\n ctx.rotate = function ctxRotate(angle) {\n var cosValue = Math.cos(angle);\n var sinValue = Math.sin(angle);\n var m = this._transformMatrix;\n 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]];\n\n this._originalRotate(angle);\n };\n}\n\nvar CachedCanvases = /*#__PURE__*/function () {\n function CachedCanvases(canvasFactory) {\n _classCallCheck(this, CachedCanvases);\n\n this.canvasFactory = canvasFactory;\n this.cache = Object.create(null);\n }\n\n _createClass(CachedCanvases, [{\n key: \"getCanvas\",\n value: function getCanvas(id, width, height, trackTransform) {\n var canvasEntry;\n\n if (this.cache[id] !== undefined) {\n canvasEntry = this.cache[id];\n this.canvasFactory.reset(canvasEntry, width, height);\n canvasEntry.context.setTransform(1, 0, 0, 1, 0, 0);\n } else {\n canvasEntry = this.canvasFactory.create(width, height);\n this.cache[id] = canvasEntry;\n }\n\n if (trackTransform) {\n addContextCurrentTransform(canvasEntry.context);\n }\n\n return canvasEntry;\n }\n }, {\n key: \"clear\",\n value: function clear() {\n for (var id in this.cache) {\n var canvasEntry = this.cache[id];\n this.canvasFactory.destroy(canvasEntry);\n delete this.cache[id];\n }\n }\n }]);\n\n return CachedCanvases;\n}();\n\nfunction compileType3Glyph(imgData) {\n var POINT_TO_PROCESS_LIMIT = 1000;\n var POINT_TYPES = new Uint8Array([0, 2, 4, 0, 1, 0, 5, 4, 8, 10, 0, 8, 0, 2, 1, 0]);\n var width = imgData.width,\n height = imgData.height,\n width1 = width + 1;\n var i, ii, j, j0;\n var points = new Uint8Array(width1 * (height + 1));\n var lineSize = width + 7 & ~7,\n data0 = imgData.data;\n var data = new Uint8Array(lineSize * height);\n var pos = 0;\n\n for (i = 0, ii = data0.length; i < ii; i++) {\n var elem = data0[i];\n var mask = 128;\n\n while (mask > 0) {\n data[pos++] = elem & mask ? 0 : 255;\n mask >>= 1;\n }\n }\n\n var count = 0;\n pos = 0;\n\n if (data[pos] !== 0) {\n points[0] = 1;\n ++count;\n }\n\n for (j = 1; j < width; j++) {\n if (data[pos] !== data[pos + 1]) {\n points[j] = data[pos] ? 2 : 1;\n ++count;\n }\n\n pos++;\n }\n\n if (data[pos] !== 0) {\n points[j] = 2;\n ++count;\n }\n\n for (i = 1; i < height; i++) {\n pos = i * lineSize;\n j0 = i * width1;\n\n if (data[pos - lineSize] !== data[pos]) {\n points[j0] = data[pos] ? 1 : 8;\n ++count;\n }\n\n var sum = (data[pos] ? 4 : 0) + (data[pos - lineSize] ? 8 : 0);\n\n for (j = 1; j < width; j++) {\n sum = (sum >> 2) + (data[pos + 1] ? 4 : 0) + (data[pos - lineSize + 1] ? 8 : 0);\n\n if (POINT_TYPES[sum]) {\n points[j0 + j] = POINT_TYPES[sum];\n ++count;\n }\n\n pos++;\n }\n\n if (data[pos - lineSize] !== data[pos]) {\n points[j0 + j] = data[pos] ? 2 : 4;\n ++count;\n }\n\n if (count > POINT_TO_PROCESS_LIMIT) {\n return null;\n }\n }\n\n pos = lineSize * (height - 1);\n j0 = i * width1;\n\n if (data[pos] !== 0) {\n points[j0] = 8;\n ++count;\n }\n\n for (j = 1; j < width; j++) {\n if (data[pos] !== data[pos + 1]) {\n points[j0 + j] = data[pos] ? 4 : 8;\n ++count;\n }\n\n pos++;\n }\n\n if (data[pos] !== 0) {\n points[j0 + j] = 4;\n ++count;\n }\n\n if (count > POINT_TO_PROCESS_LIMIT) {\n return null;\n }\n\n var steps = new Int32Array([0, width1, -1, 0, -width1, 0, 0, 0, 1]);\n var outlines = [];\n\n for (i = 0; count && i <= height; i++) {\n var p = i * width1;\n var end = p + width;\n\n while (p < end && !points[p]) {\n p++;\n }\n\n if (p === end) {\n continue;\n }\n\n var coords = [p % width1, i];\n var p0 = p;\n var type = points[p];\n\n do {\n var step = steps[type];\n\n do {\n p += step;\n } while (!points[p]);\n\n var pp = points[p];\n\n if (pp !== 5 && pp !== 10) {\n type = pp;\n points[p] = 0;\n } else {\n type = pp & 0x33 * type >> 4;\n points[p] &= type >> 2 | type << 2;\n }\n\n coords.push(p % width1, p / width1 | 0);\n\n if (!points[p]) {\n --count;\n }\n } while (p0 !== p);\n\n outlines.push(coords);\n --i;\n }\n\n var drawOutline = function drawOutline(c) {\n c.save();\n c.scale(1 / width, -1 / height);\n c.translate(0, -height);\n c.beginPath();\n\n for (var k = 0, kk = outlines.length; k < kk; k++) {\n var o = outlines[k];\n c.moveTo(o[0], o[1]);\n\n for (var l = 2, ll = o.length; l < ll; l += 2) {\n c.lineTo(o[l], o[l + 1]);\n }\n }\n\n c.fill();\n c.beginPath();\n c.restore();\n };\n\n return drawOutline;\n}\n\nvar CanvasExtraState = /*#__PURE__*/function () {\n function CanvasExtraState(width, height) {\n _classCallCheck(this, CanvasExtraState);\n\n this.alphaIsShape = false;\n this.fontSize = 0;\n this.fontSizeScale = 1;\n this.textMatrix = _util.IDENTITY_MATRIX;\n this.textMatrixScale = 1;\n this.fontMatrix = _util.FONT_IDENTITY_MATRIX;\n this.leading = 0;\n this.x = 0;\n this.y = 0;\n this.lineX = 0;\n this.lineY = 0;\n this.charSpacing = 0;\n this.wordSpacing = 0;\n this.textHScale = 1;\n this.textRenderingMode = _util.TextRenderingMode.FILL;\n this.textRise = 0;\n this.fillColor = \"#000000\";\n this.strokeColor = \"#000000\";\n this.patternFill = false;\n this.fillAlpha = 1;\n this.strokeAlpha = 1;\n this.lineWidth = 1;\n this.activeSMask = null;\n this.transferMaps = null;\n this.startNewPathAndClipBox([0, 0, width, height]);\n }\n\n _createClass(CanvasExtraState, [{\n key: \"clone\",\n value: function clone() {\n var clone = Object.create(this);\n clone.clipBox = this.clipBox.slice();\n return clone;\n }\n }, {\n key: \"setCurrentPoint\",\n value: function setCurrentPoint(x, y) {\n this.x = x;\n this.y = y;\n }\n }, {\n key: \"updatePathMinMax\",\n value: function updatePathMinMax(transform, x, y) {\n var _Util$applyTransform = _util.Util.applyTransform([x, y], transform);\n\n var _Util$applyTransform2 = _slicedToArray(_Util$applyTransform, 2);\n\n x = _Util$applyTransform2[0];\n y = _Util$applyTransform2[1];\n this.minX = Math.min(this.minX, x);\n this.minY = Math.min(this.minY, y);\n this.maxX = Math.max(this.maxX, x);\n this.maxY = Math.max(this.maxY, y);\n }\n }, {\n key: \"updateCurvePathMinMax\",\n value: function updateCurvePathMinMax(transform, x0, y0, x1, y1, x2, y2, x3, y3) {\n var box = _util.Util.bezierBoundingBox(x0, y0, x1, y1, x2, y2, x3, y3);\n\n this.updatePathMinMax(transform, box[0], box[1]);\n this.updatePathMinMax(transform, box[2], box[3]);\n }\n }, {\n key: \"getPathBoundingBox\",\n value: function getPathBoundingBox() {\n var pathType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _pattern_helper.PathType.FILL;\n var transform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n var box = [this.minX, this.minY, this.maxX, this.maxY];\n\n if (pathType === _pattern_helper.PathType.STROKE) {\n if (!transform) {\n (0, _util.unreachable)(\"Stroke bounding box must include transform.\");\n }\n\n var scale = _util.Util.singularValueDecompose2dScale(transform);\n\n var xStrokePad = scale[0] * this.lineWidth / 2;\n var yStrokePad = scale[1] * this.lineWidth / 2;\n box[0] -= xStrokePad;\n box[1] -= yStrokePad;\n box[2] += xStrokePad;\n box[3] += yStrokePad;\n }\n\n return box;\n }\n }, {\n key: \"updateClipFromPath\",\n value: function updateClipFromPath() {\n var intersect = _util.Util.intersect(this.clipBox, this.getPathBoundingBox());\n\n this.startNewPathAndClipBox(intersect || [0, 0, 0, 0]);\n }\n }, {\n key: \"startNewPathAndClipBox\",\n value: function startNewPathAndClipBox(box) {\n this.clipBox = box;\n this.minX = Infinity;\n this.minY = Infinity;\n this.maxX = 0;\n this.maxY = 0;\n }\n }, {\n key: \"getClippedPathBoundingBox\",\n value: function getClippedPathBoundingBox() {\n var pathType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _pattern_helper.PathType.FILL;\n var transform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n return _util.Util.intersect(this.clipBox, this.getPathBoundingBox(pathType, transform));\n }\n }]);\n\n return CanvasExtraState;\n}();\n\nfunction putBinaryImageData(ctx, imgData) {\n var transferMaps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n\n if (typeof ImageData !== \"undefined\" && imgData instanceof ImageData) {\n ctx.putImageData(imgData, 0, 0);\n return;\n }\n\n var height = imgData.height,\n width = imgData.width;\n var partialChunkHeight = height % FULL_CHUNK_HEIGHT;\n var fullChunks = (height - partialChunkHeight) / FULL_CHUNK_HEIGHT;\n var totalChunks = partialChunkHeight === 0 ? fullChunks : fullChunks + 1;\n var chunkImgData = ctx.createImageData(width, FULL_CHUNK_HEIGHT);\n var srcPos = 0,\n destPos;\n var src = imgData.data;\n var dest = chunkImgData.data;\n var i, j, thisChunkHeight, elemsInThisChunk;\n var transferMapRed, transferMapGreen, transferMapBlue, transferMapGray;\n\n if (transferMaps) {\n switch (transferMaps.length) {\n case 1:\n transferMapRed = transferMaps[0];\n transferMapGreen = transferMaps[0];\n transferMapBlue = transferMaps[0];\n transferMapGray = transferMaps[0];\n break;\n\n case 4:\n transferMapRed = transferMaps[0];\n transferMapGreen = transferMaps[1];\n transferMapBlue = transferMaps[2];\n transferMapGray = transferMaps[3];\n break;\n }\n }\n\n if (imgData.kind === _util.ImageKind.GRAYSCALE_1BPP) {\n var srcLength = src.byteLength;\n var dest32 = new Uint32Array(dest.buffer, 0, dest.byteLength >> 2);\n var dest32DataLength = dest32.length;\n var fullSrcDiff = width + 7 >> 3;\n var white = 0xffffffff;\n var black = _util.IsLittleEndianCached.value ? 0xff000000 : 0x000000ff;\n\n if (transferMapGray) {\n if (transferMapGray[0] === 0xff && transferMapGray[0xff] === 0) {\n var _ref = [black, white];\n white = _ref[0];\n black = _ref[1];\n }\n }\n\n for (i = 0; i < totalChunks; i++) {\n thisChunkHeight = i < fullChunks ? FULL_CHUNK_HEIGHT : partialChunkHeight;\n destPos = 0;\n\n for (j = 0; j < thisChunkHeight; j++) {\n var srcDiff = srcLength - srcPos;\n var k = 0;\n var kEnd = srcDiff > fullSrcDiff ? width : srcDiff * 8 - 7;\n var kEndUnrolled = kEnd & ~7;\n var mask = 0;\n var srcByte = 0;\n\n for (; k < kEndUnrolled; k += 8) {\n srcByte = src[srcPos++];\n dest32[destPos++] = srcByte & 128 ? white : black;\n dest32[destPos++] = srcByte & 64 ? white : black;\n dest32[destPos++] = srcByte & 32 ? white : black;\n dest32[destPos++] = srcByte & 16 ? white : black;\n dest32[destPos++] = srcByte & 8 ? white : black;\n dest32[destPos++] = srcByte & 4 ? white : black;\n dest32[destPos++] = srcByte & 2 ? white : black;\n dest32[destPos++] = srcByte & 1 ? white : black;\n }\n\n for (; k < kEnd; k++) {\n if (mask === 0) {\n srcByte = src[srcPos++];\n mask = 128;\n }\n\n dest32[destPos++] = srcByte & mask ? white : black;\n mask >>= 1;\n }\n }\n\n while (destPos < dest32DataLength) {\n dest32[destPos++] = 0;\n }\n\n ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT);\n }\n } else if (imgData.kind === _util.ImageKind.RGBA_32BPP) {\n var hasTransferMaps = !!(transferMapRed || transferMapGreen || transferMapBlue);\n j = 0;\n elemsInThisChunk = width * FULL_CHUNK_HEIGHT * 4;\n\n for (i = 0; i < fullChunks; i++) {\n dest.set(src.subarray(srcPos, srcPos + elemsInThisChunk));\n srcPos += elemsInThisChunk;\n\n if (hasTransferMaps) {\n for (var _k = 0; _k < elemsInThisChunk; _k += 4) {\n if (transferMapRed) {\n dest[_k + 0] = transferMapRed[dest[_k + 0]];\n }\n\n if (transferMapGreen) {\n dest[_k + 1] = transferMapGreen[dest[_k + 1]];\n }\n\n if (transferMapBlue) {\n dest[_k + 2] = transferMapBlue[dest[_k + 2]];\n }\n }\n }\n\n ctx.putImageData(chunkImgData, 0, j);\n j += FULL_CHUNK_HEIGHT;\n }\n\n if (i < totalChunks) {\n elemsInThisChunk = width * partialChunkHeight * 4;\n dest.set(src.subarray(srcPos, srcPos + elemsInThisChunk));\n\n if (hasTransferMaps) {\n for (var _k2 = 0; _k2 < elemsInThisChunk; _k2 += 4) {\n if (transferMapRed) {\n dest[_k2 + 0] = transferMapRed[dest[_k2 + 0]];\n }\n\n if (transferMapGreen) {\n dest[_k2 + 1] = transferMapGreen[dest[_k2 + 1]];\n }\n\n if (transferMapBlue) {\n dest[_k2 + 2] = transferMapBlue[dest[_k2 + 2]];\n }\n }\n }\n\n ctx.putImageData(chunkImgData, 0, j);\n }\n } else if (imgData.kind === _util.ImageKind.RGB_24BPP) {\n var _hasTransferMaps = !!(transferMapRed || transferMapGreen || transferMapBlue);\n\n thisChunkHeight = FULL_CHUNK_HEIGHT;\n elemsInThisChunk = width * thisChunkHeight;\n\n for (i = 0; i < totalChunks; i++) {\n if (i >= fullChunks) {\n thisChunkHeight = partialChunkHeight;\n elemsInThisChunk = width * thisChunkHeight;\n }\n\n destPos = 0;\n\n for (j = elemsInThisChunk; j--;) {\n dest[destPos++] = src[srcPos++];\n dest[destPos++] = src[srcPos++];\n dest[destPos++] = src[srcPos++];\n dest[destPos++] = 255;\n }\n\n if (_hasTransferMaps) {\n for (var _k3 = 0; _k3 < destPos; _k3 += 4) {\n if (transferMapRed) {\n dest[_k3 + 0] = transferMapRed[dest[_k3 + 0]];\n }\n\n if (transferMapGreen) {\n dest[_k3 + 1] = transferMapGreen[dest[_k3 + 1]];\n }\n\n if (transferMapBlue) {\n dest[_k3 + 2] = transferMapBlue[dest[_k3 + 2]];\n }\n }\n }\n\n ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT);\n }\n } else {\n throw new Error(\"bad image kind: \".concat(imgData.kind));\n }\n}\n\nfunction putBinaryImageMask(ctx, imgData) {\n var height = imgData.height,\n width = imgData.width;\n var partialChunkHeight = height % FULL_CHUNK_HEIGHT;\n var fullChunks = (height - partialChunkHeight) / FULL_CHUNK_HEIGHT;\n var totalChunks = partialChunkHeight === 0 ? fullChunks : fullChunks + 1;\n var chunkImgData = ctx.createImageData(width, FULL_CHUNK_HEIGHT);\n var srcPos = 0;\n var src = imgData.data;\n var dest = chunkImgData.data;\n\n for (var i = 0; i < totalChunks; i++) {\n var thisChunkHeight = i < fullChunks ? FULL_CHUNK_HEIGHT : partialChunkHeight;\n var destPos = 3;\n\n for (var j = 0; j < thisChunkHeight; j++) {\n var elem = void 0,\n mask = 0;\n\n for (var k = 0; k < width; k++) {\n if (!mask) {\n elem = src[srcPos++];\n mask = 128;\n }\n\n dest[destPos] = elem & mask ? 0 : 255;\n destPos += 4;\n mask >>= 1;\n }\n }\n\n ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT);\n }\n}\n\nfunction copyCtxState(sourceCtx, destCtx) {\n var properties = [\"strokeStyle\", \"fillStyle\", \"fillRule\", \"globalAlpha\", \"lineWidth\", \"lineCap\", \"lineJoin\", \"miterLimit\", \"globalCompositeOperation\", \"font\"];\n\n for (var i = 0, ii = properties.length; i < ii; i++) {\n var property = properties[i];\n\n if (sourceCtx[property] !== undefined) {\n destCtx[property] = sourceCtx[property];\n }\n }\n\n if (sourceCtx.setLineDash !== undefined) {\n destCtx.setLineDash(sourceCtx.getLineDash());\n destCtx.lineDashOffset = sourceCtx.lineDashOffset;\n }\n}\n\nfunction resetCtxToDefault(ctx) {\n ctx.strokeStyle = \"#000000\";\n ctx.fillStyle = \"#000000\";\n ctx.fillRule = \"nonzero\";\n ctx.globalAlpha = 1;\n ctx.lineWidth = 1;\n ctx.lineCap = \"butt\";\n ctx.lineJoin = \"miter\";\n ctx.miterLimit = 10;\n ctx.globalCompositeOperation = \"source-over\";\n ctx.font = \"10px sans-serif\";\n\n if (ctx.setLineDash !== undefined) {\n ctx.setLineDash([]);\n ctx.lineDashOffset = 0;\n }\n}\n\nfunction composeSMaskBackdrop(bytes, r0, g0, b0) {\n var length = bytes.length;\n\n for (var i = 3; i < length; i += 4) {\n var alpha = bytes[i];\n\n if (alpha === 0) {\n bytes[i - 3] = r0;\n bytes[i - 2] = g0;\n bytes[i - 1] = b0;\n } else if (alpha < 255) {\n var alpha_ = 255 - alpha;\n bytes[i - 3] = bytes[i - 3] * alpha + r0 * alpha_ >> 8;\n bytes[i - 2] = bytes[i - 2] * alpha + g0 * alpha_ >> 8;\n bytes[i - 1] = bytes[i - 1] * alpha + b0 * alpha_ >> 8;\n }\n }\n}\n\nfunction composeSMaskAlpha(maskData, layerData, transferMap) {\n var length = maskData.length;\n var scale = 1 / 255;\n\n for (var i = 3; i < length; i += 4) {\n var alpha = transferMap ? transferMap[maskData[i]] : maskData[i];\n layerData[i] = layerData[i] * alpha * scale | 0;\n }\n}\n\nfunction composeSMaskLuminosity(maskData, layerData, transferMap) {\n var length = maskData.length;\n\n for (var i = 3; i < length; i += 4) {\n var y = maskData[i - 3] * 77 + maskData[i - 2] * 152 + maskData[i - 1] * 28;\n layerData[i] = transferMap ? layerData[i] * transferMap[y >> 8] >> 8 : layerData[i] * y >> 16;\n }\n}\n\nfunction genericComposeSMask(maskCtx, layerCtx, width, height, subtype, backdrop, transferMap, layerOffsetX, layerOffsetY, maskOffsetX, maskOffsetY) {\n var hasBackdrop = !!backdrop;\n var r0 = hasBackdrop ? backdrop[0] : 0;\n var g0 = hasBackdrop ? backdrop[1] : 0;\n var b0 = hasBackdrop ? backdrop[2] : 0;\n var composeFn;\n\n if (subtype === \"Luminosity\") {\n composeFn = composeSMaskLuminosity;\n } else {\n composeFn = composeSMaskAlpha;\n }\n\n var PIXELS_TO_PROCESS = 1048576;\n var chunkSize = Math.min(height, Math.ceil(PIXELS_TO_PROCESS / width));\n\n for (var row = 0; row < height; row += chunkSize) {\n var chunkHeight = Math.min(chunkSize, height - row);\n var maskData = maskCtx.getImageData(layerOffsetX - maskOffsetX, row + (layerOffsetY - maskOffsetY), width, chunkHeight);\n var layerData = layerCtx.getImageData(layerOffsetX, row + layerOffsetY, width, chunkHeight);\n\n if (hasBackdrop) {\n composeSMaskBackdrop(maskData.data, r0, g0, b0);\n }\n\n composeFn(maskData.data, layerData.data, transferMap);\n layerCtx.putImageData(layerData, layerOffsetX, row + layerOffsetY);\n }\n}\n\nfunction composeSMask(ctx, smask, layerCtx, layerBox) {\n var layerOffsetX = layerBox[0];\n var layerOffsetY = layerBox[1];\n var layerWidth = layerBox[2] - layerOffsetX;\n var layerHeight = layerBox[3] - layerOffsetY;\n\n if (layerWidth === 0 || layerHeight === 0) {\n return;\n }\n\n genericComposeSMask(smask.context, layerCtx, layerWidth, layerHeight, smask.subtype, smask.backdrop, smask.transferMap, layerOffsetX, layerOffsetY, smask.offsetX, smask.offsetY);\n ctx.save();\n ctx.globalAlpha = 1;\n ctx.globalCompositeOperation = \"source-over\";\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.drawImage(layerCtx.canvas, 0, 0);\n ctx.restore();\n}\n\nfunction getImageSmoothingEnabled(transform, interpolate) {\n var scale = _util.Util.singularValueDecompose2dScale(transform);\n\n scale[0] = Math.fround(scale[0]);\n scale[1] = Math.fround(scale[1]);\n var actualScale = Math.fround((globalThis.devicePixelRatio || 1) * _display_utils.PixelsPerInch.PDF_TO_CSS_UNITS);\n\n if (interpolate !== undefined) {\n return interpolate;\n } else if (scale[0] <= actualScale || scale[1] <= actualScale) {\n return true;\n }\n\n return false;\n}\n\nvar LINE_CAP_STYLES = [\"butt\", \"round\", \"square\"];\nvar LINE_JOIN_STYLES = [\"miter\", \"round\", \"bevel\"];\nvar NORMAL_CLIP = {};\nvar EO_CLIP = {};\n\nvar CanvasGraphics = /*#__PURE__*/function () {\n function CanvasGraphics(canvasCtx, commonObjs, objs, canvasFactory, imageLayer, optionalContentConfig, annotationCanvasMap) {\n _classCallCheck(this, CanvasGraphics);\n\n this.ctx = canvasCtx;\n this.current = new CanvasExtraState(this.ctx.canvas.width, this.ctx.canvas.height);\n this.stateStack = [];\n this.pendingClip = null;\n this.pendingEOFill = false;\n this.res = null;\n this.xobjs = null;\n this.commonObjs = commonObjs;\n this.objs = objs;\n this.canvasFactory = canvasFactory;\n this.imageLayer = imageLayer;\n this.groupStack = [];\n this.processingType3 = null;\n this.baseTransform = null;\n this.baseTransformStack = [];\n this.groupLevel = 0;\n this.smaskStack = [];\n this.smaskCounter = 0;\n this.tempSMask = null;\n this.suspendedCtx = null;\n this.contentVisible = true;\n this.markedContentStack = [];\n this.optionalContentConfig = optionalContentConfig;\n this.cachedCanvases = new CachedCanvases(this.canvasFactory);\n this.cachedPatterns = new Map();\n this.annotationCanvasMap = annotationCanvasMap;\n this.viewportScale = 1;\n this.outputScaleX = 1;\n this.outputScaleY = 1;\n\n if (canvasCtx) {\n addContextCurrentTransform(canvasCtx);\n }\n\n this._cachedGetSinglePixelWidth = null;\n }\n\n _createClass(CanvasGraphics, [{\n key: \"beginDrawing\",\n value: function beginDrawing(_ref2) {\n var transform = _ref2.transform,\n viewport = _ref2.viewport,\n _ref2$transparency = _ref2.transparency,\n transparency = _ref2$transparency === void 0 ? false : _ref2$transparency,\n _ref2$background = _ref2.background,\n background = _ref2$background === void 0 ? null : _ref2$background;\n var width = this.ctx.canvas.width;\n var height = this.ctx.canvas.height;\n this.ctx.save();\n this.ctx.fillStyle = background || \"rgb(255, 255, 255)\";\n this.ctx.fillRect(0, 0, width, height);\n this.ctx.restore();\n\n if (transparency) {\n var transparentCanvas = this.cachedCanvases.getCanvas(\"transparent\", width, height, true);\n this.compositeCtx = this.ctx;\n this.transparentCanvas = transparentCanvas.canvas;\n this.ctx = transparentCanvas.context;\n this.ctx.save();\n this.ctx.transform.apply(this.ctx, this.compositeCtx.mozCurrentTransform);\n }\n\n this.ctx.save();\n resetCtxToDefault(this.ctx);\n\n if (transform) {\n this.ctx.transform.apply(this.ctx, transform);\n this.outputScaleX = transform[0];\n this.outputScaleY = transform[0];\n }\n\n this.ctx.transform.apply(this.ctx, viewport.transform);\n this.viewportScale = viewport.scale;\n this.baseTransform = this.ctx.mozCurrentTransform.slice();\n this._combinedScaleFactor = Math.hypot(this.baseTransform[0], this.baseTransform[2]);\n\n if (this.imageLayer) {\n this.imageLayer.beginLayout();\n }\n }\n }, {\n key: \"executeOperatorList\",\n value: function executeOperatorList(operatorList, executionStartIdx, continueCallback, stepper) {\n var argsArray = operatorList.argsArray;\n var fnArray = operatorList.fnArray;\n var i = executionStartIdx || 0;\n var argsArrayLen = argsArray.length;\n\n if (argsArrayLen === i) {\n return i;\n }\n\n var chunkOperations = argsArrayLen - i > EXECUTION_STEPS && typeof continueCallback === \"function\";\n var endTime = chunkOperations ? Date.now() + EXECUTION_TIME : 0;\n var steps = 0;\n var commonObjs = this.commonObjs;\n var objs = this.objs;\n var fnId;\n\n while (true) {\n if (stepper !== undefined && i === stepper.nextBreakPoint) {\n stepper.breakIt(i, continueCallback);\n return i;\n }\n\n fnId = fnArray[i];\n\n if (fnId !== _util.OPS.dependency) {\n this[fnId].apply(this, argsArray[i]);\n } else {\n var _iterator = _createForOfIteratorHelper(argsArray[i]),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var depObjId = _step.value;\n var objsPool = depObjId.startsWith(\"g_\") ? commonObjs : objs;\n\n if (!objsPool.has(depObjId)) {\n objsPool.get(depObjId, continueCallback);\n return i;\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n }\n\n i++;\n\n if (i === argsArrayLen) {\n return i;\n }\n\n if (chunkOperations && ++steps > EXECUTION_STEPS) {\n if (Date.now() > endTime) {\n continueCallback();\n return i;\n }\n\n steps = 0;\n }\n }\n }\n }, {\n key: \"endDrawing\",\n value: function endDrawing() {\n while (this.stateStack.length || this.inSMaskMode) {\n this.restore();\n }\n\n this.ctx.restore();\n\n if (this.transparentCanvas) {\n this.ctx = this.compositeCtx;\n this.ctx.save();\n this.ctx.setTransform(1, 0, 0, 1, 0, 0);\n this.ctx.drawImage(this.transparentCanvas, 0, 0);\n this.ctx.restore();\n this.transparentCanvas = null;\n }\n\n this.cachedCanvases.clear();\n this.cachedPatterns.clear();\n\n if (this.imageLayer) {\n this.imageLayer.endLayout();\n }\n }\n }, {\n key: \"_scaleImage\",\n value: function _scaleImage(img, inverseTransform) {\n var width = img.width;\n var height = img.height;\n var widthScale = Math.max(Math.hypot(inverseTransform[0], inverseTransform[1]), 1);\n var heightScale = Math.max(Math.hypot(inverseTransform[2], inverseTransform[3]), 1);\n var paintWidth = width,\n paintHeight = height;\n var tmpCanvasId = \"prescale1\";\n var tmpCanvas, tmpCtx;\n\n while (widthScale > 2 && paintWidth > 1 || heightScale > 2 && paintHeight > 1) {\n var newWidth = paintWidth,\n newHeight = paintHeight;\n\n if (widthScale > 2 && paintWidth > 1) {\n newWidth = Math.ceil(paintWidth / 2);\n widthScale /= paintWidth / newWidth;\n }\n\n if (heightScale > 2 && paintHeight > 1) {\n newHeight = Math.ceil(paintHeight / 2);\n heightScale /= paintHeight / newHeight;\n }\n\n tmpCanvas = this.cachedCanvases.getCanvas(tmpCanvasId, newWidth, newHeight);\n tmpCtx = tmpCanvas.context;\n tmpCtx.clearRect(0, 0, newWidth, newHeight);\n tmpCtx.drawImage(img, 0, 0, paintWidth, paintHeight, 0, 0, newWidth, newHeight);\n img = tmpCanvas.canvas;\n paintWidth = newWidth;\n paintHeight = newHeight;\n tmpCanvasId = tmpCanvasId === \"prescale1\" ? \"prescale2\" : \"prescale1\";\n }\n\n return {\n img: img,\n paintWidth: paintWidth,\n paintHeight: paintHeight\n };\n }\n }, {\n key: \"_createMaskCanvas\",\n value: function _createMaskCanvas(img) {\n var ctx = this.ctx;\n var width = img.width,\n height = img.height;\n var fillColor = this.current.fillColor;\n var isPatternFill = this.current.patternFill;\n var maskCanvas = this.cachedCanvases.getCanvas(\"maskCanvas\", width, height);\n var maskCtx = maskCanvas.context;\n putBinaryImageMask(maskCtx, img);\n var objToCanvas = ctx.mozCurrentTransform;\n\n var maskToCanvas = _util.Util.transform(objToCanvas, [1 / width, 0, 0, -1 / height, 0, 0]);\n\n maskToCanvas = _util.Util.transform(maskToCanvas, [1, 0, 0, 1, 0, -height]);\n\n var cord1 = _util.Util.applyTransform([0, 0], maskToCanvas);\n\n var cord2 = _util.Util.applyTransform([width, height], maskToCanvas);\n\n var rect = _util.Util.normalizeRect([cord1[0], cord1[1], cord2[0], cord2[1]]);\n\n var drawnWidth = Math.ceil(rect[2] - rect[0]);\n var drawnHeight = Math.ceil(rect[3] - rect[1]);\n var fillCanvas = this.cachedCanvases.getCanvas(\"fillCanvas\", drawnWidth, drawnHeight, true);\n var fillCtx = fillCanvas.context;\n var offsetX = Math.min(cord1[0], cord2[0]);\n var offsetY = Math.min(cord1[1], cord2[1]);\n fillCtx.translate(-offsetX, -offsetY);\n fillCtx.transform.apply(fillCtx, maskToCanvas);\n\n var scaled = this._scaleImage(maskCanvas.canvas, fillCtx.mozCurrentTransformInverse);\n\n fillCtx.imageSmoothingEnabled = getImageSmoothingEnabled(fillCtx.mozCurrentTransform, img.interpolate);\n fillCtx.drawImage(scaled.img, 0, 0, scaled.img.width, scaled.img.height, 0, 0, width, height);\n fillCtx.globalCompositeOperation = \"source-in\";\n\n var inverse = _util.Util.transform(fillCtx.mozCurrentTransformInverse, [1, 0, 0, 1, -offsetX, -offsetY]);\n\n fillCtx.fillStyle = isPatternFill ? fillColor.getPattern(ctx, this, inverse, _pattern_helper.PathType.FILL) : fillColor;\n fillCtx.fillRect(0, 0, width, height);\n return {\n canvas: fillCanvas.canvas,\n offsetX: Math.round(offsetX),\n offsetY: Math.round(offsetY)\n };\n }\n }, {\n key: \"setLineWidth\",\n value: function setLineWidth(width) {\n this.current.lineWidth = width;\n this.ctx.lineWidth = width;\n }\n }, {\n key: \"setLineCap\",\n value: function setLineCap(style) {\n this.ctx.lineCap = LINE_CAP_STYLES[style];\n }\n }, {\n key: \"setLineJoin\",\n value: function setLineJoin(style) {\n this.ctx.lineJoin = LINE_JOIN_STYLES[style];\n }\n }, {\n key: \"setMiterLimit\",\n value: function setMiterLimit(limit) {\n this.ctx.miterLimit = limit;\n }\n }, {\n key: \"setDash\",\n value: function setDash(dashArray, dashPhase) {\n var ctx = this.ctx;\n\n if (ctx.setLineDash !== undefined) {\n ctx.setLineDash(dashArray);\n ctx.lineDashOffset = dashPhase;\n }\n }\n }, {\n key: \"setRenderingIntent\",\n value: function setRenderingIntent(intent) {}\n }, {\n key: \"setFlatness\",\n value: function setFlatness(flatness) {}\n }, {\n key: \"setGState\",\n value: function setGState(states) {\n for (var i = 0, ii = states.length; i < ii; i++) {\n var state = states[i];\n var key = state[0];\n var value = state[1];\n\n switch (key) {\n case \"LW\":\n this.setLineWidth(value);\n break;\n\n case \"LC\":\n this.setLineCap(value);\n break;\n\n case \"LJ\":\n this.setLineJoin(value);\n break;\n\n case \"ML\":\n this.setMiterLimit(value);\n break;\n\n case \"D\":\n this.setDash(value[0], value[1]);\n break;\n\n case \"RI\":\n this.setRenderingIntent(value);\n break;\n\n case \"FL\":\n this.setFlatness(value);\n break;\n\n case \"Font\":\n this.setFont(value[0], value[1]);\n break;\n\n case \"CA\":\n this.current.strokeAlpha = state[1];\n break;\n\n case \"ca\":\n this.current.fillAlpha = state[1];\n this.ctx.globalAlpha = state[1];\n break;\n\n case \"BM\":\n this.ctx.globalCompositeOperation = value;\n break;\n\n case \"SMask\":\n this.current.activeSMask = value ? this.tempSMask : null;\n this.tempSMask = null;\n this.checkSMaskState();\n break;\n\n case \"TR\":\n this.current.transferMaps = value;\n }\n }\n }\n }, {\n key: \"inSMaskMode\",\n get: function get() {\n return !!this.suspendedCtx;\n }\n }, {\n key: \"checkSMaskState\",\n value: function checkSMaskState() {\n var inSMaskMode = this.inSMaskMode;\n\n if (this.current.activeSMask && !inSMaskMode) {\n this.beginSMaskMode();\n } else if (!this.current.activeSMask && inSMaskMode) {\n this.endSMaskMode();\n }\n }\n }, {\n key: \"beginSMaskMode\",\n value: function beginSMaskMode() {\n if (this.inSMaskMode) {\n throw new Error(\"beginSMaskMode called while already in smask mode\");\n }\n\n var drawnWidth = this.ctx.canvas.width;\n var drawnHeight = this.ctx.canvas.height;\n var cacheId = \"smaskGroupAt\" + this.groupLevel;\n var scratchCanvas = this.cachedCanvases.getCanvas(cacheId, drawnWidth, drawnHeight, true);\n this.suspendedCtx = this.ctx;\n this.ctx = scratchCanvas.context;\n var ctx = this.ctx;\n ctx.setTransform.apply(ctx, this.suspendedCtx.mozCurrentTransform);\n copyCtxState(this.suspendedCtx, ctx);\n mirrorContextOperations(ctx, this.suspendedCtx);\n this.setGState([[\"BM\", \"source-over\"], [\"ca\", 1], [\"CA\", 1]]);\n }\n }, {\n key: \"endSMaskMode\",\n value: function endSMaskMode() {\n if (!this.inSMaskMode) {\n throw new Error(\"endSMaskMode called while not in smask mode\");\n }\n\n this.ctx._removeMirroring();\n\n copyCtxState(this.ctx, this.suspendedCtx);\n this.ctx = this.suspendedCtx;\n this.suspendedCtx = null;\n }\n }, {\n key: \"compose\",\n value: function compose(dirtyBox) {\n if (!this.current.activeSMask) {\n return;\n }\n\n if (!dirtyBox) {\n dirtyBox = [0, 0, this.ctx.canvas.width, this.ctx.canvas.height];\n } else {\n dirtyBox[0] = Math.floor(dirtyBox[0]);\n dirtyBox[1] = Math.floor(dirtyBox[1]);\n dirtyBox[2] = Math.ceil(dirtyBox[2]);\n dirtyBox[3] = Math.ceil(dirtyBox[3]);\n }\n\n var smask = this.current.activeSMask;\n var suspendedCtx = this.suspendedCtx;\n composeSMask(suspendedCtx, smask, this.ctx, dirtyBox);\n this.ctx.save();\n this.ctx.setTransform(1, 0, 0, 1, 0, 0);\n this.ctx.clearRect(0, 0, this.ctx.canvas.width, this.ctx.canvas.height);\n this.ctx.restore();\n }\n }, {\n key: \"save\",\n value: function save() {\n if (this.inSMaskMode) {\n copyCtxState(this.ctx, this.suspendedCtx);\n this.suspendedCtx.save();\n } else {\n this.ctx.save();\n }\n\n var old = this.current;\n this.stateStack.push(old);\n this.current = old.clone();\n }\n }, {\n key: \"restore\",\n value: function restore() {\n if (this.stateStack.length === 0 && this.inSMaskMode) {\n this.endSMaskMode();\n }\n\n if (this.stateStack.length !== 0) {\n this.current = this.stateStack.pop();\n\n if (this.inSMaskMode) {\n this.suspendedCtx.restore();\n copyCtxState(this.suspendedCtx, this.ctx);\n } else {\n this.ctx.restore();\n }\n\n this.checkSMaskState();\n this.pendingClip = null;\n this._cachedGetSinglePixelWidth = null;\n }\n }\n }, {\n key: \"transform\",\n value: function transform(a, b, c, d, e, f) {\n this.ctx.transform(a, b, c, d, e, f);\n this._cachedGetSinglePixelWidth = null;\n }\n }, {\n key: \"constructPath\",\n value: function constructPath(ops, args) {\n var ctx = this.ctx;\n var current = this.current;\n var x = current.x,\n y = current.y;\n var startX, startY;\n\n for (var i = 0, j = 0, ii = ops.length; i < ii; i++) {\n switch (ops[i] | 0) {\n case _util.OPS.rectangle:\n x = args[j++];\n y = args[j++];\n var width = args[j++];\n var height = args[j++];\n var xw = x + width;\n var yh = y + height;\n ctx.moveTo(x, y);\n\n if (width === 0 || height === 0) {\n ctx.lineTo(xw, yh);\n } else {\n ctx.lineTo(xw, y);\n ctx.lineTo(xw, yh);\n ctx.lineTo(x, yh);\n }\n\n current.updatePathMinMax(ctx.mozCurrentTransform, x, y);\n current.updatePathMinMax(ctx.mozCurrentTransform, xw, yh);\n ctx.closePath();\n break;\n\n case _util.OPS.moveTo:\n x = args[j++];\n y = args[j++];\n ctx.moveTo(x, y);\n current.updatePathMinMax(ctx.mozCurrentTransform, x, y);\n break;\n\n case _util.OPS.lineTo:\n x = args[j++];\n y = args[j++];\n ctx.lineTo(x, y);\n current.updatePathMinMax(ctx.mozCurrentTransform, x, y);\n break;\n\n case _util.OPS.curveTo:\n startX = x;\n startY = y;\n x = args[j + 4];\n y = args[j + 5];\n ctx.bezierCurveTo(args[j], args[j + 1], args[j + 2], args[j + 3], x, y);\n current.updateCurvePathMinMax(ctx.mozCurrentTransform, startX, startY, args[j], args[j + 1], args[j + 2], args[j + 3], x, y);\n j += 6;\n break;\n\n case _util.OPS.curveTo2:\n startX = x;\n startY = y;\n ctx.bezierCurveTo(x, y, args[j], args[j + 1], args[j + 2], args[j + 3]);\n current.updateCurvePathMinMax(ctx.mozCurrentTransform, startX, startY, x, y, args[j], args[j + 1], args[j + 2], args[j + 3]);\n x = args[j + 2];\n y = args[j + 3];\n j += 4;\n break;\n\n case _util.OPS.curveTo3:\n startX = x;\n startY = y;\n x = args[j + 2];\n y = args[j + 3];\n ctx.bezierCurveTo(args[j], args[j + 1], x, y, x, y);\n current.updateCurvePathMinMax(ctx.mozCurrentTransform, startX, startY, args[j], args[j + 1], x, y, x, y);\n j += 4;\n break;\n\n case _util.OPS.closePath:\n ctx.closePath();\n break;\n }\n }\n\n current.setCurrentPoint(x, y);\n }\n }, {\n key: \"closePath\",\n value: function closePath() {\n this.ctx.closePath();\n }\n }, {\n key: \"stroke\",\n value: function stroke(consumePath) {\n consumePath = typeof consumePath !== \"undefined\" ? consumePath : true;\n var ctx = this.ctx;\n var strokeColor = this.current.strokeColor;\n ctx.globalAlpha = this.current.strokeAlpha;\n\n if (this.contentVisible) {\n if (_typeof(strokeColor) === \"object\" && strokeColor !== null && strokeColor !== void 0 && strokeColor.getPattern) {\n var lineWidth = this.getSinglePixelWidth();\n ctx.save();\n ctx.strokeStyle = strokeColor.getPattern(ctx, this, ctx.mozCurrentTransformInverse, _pattern_helper.PathType.STROKE);\n ctx.lineWidth = Math.max(lineWidth, this.current.lineWidth);\n ctx.stroke();\n ctx.restore();\n } else {\n var _lineWidth = this.getSinglePixelWidth();\n\n if (_lineWidth < 0 && -_lineWidth >= this.current.lineWidth) {\n ctx.save();\n ctx.resetTransform();\n ctx.lineWidth = Math.floor(this._combinedScaleFactor);\n ctx.stroke();\n ctx.restore();\n } else {\n ctx.lineWidth = Math.max(_lineWidth, this.current.lineWidth);\n ctx.stroke();\n }\n }\n }\n\n if (consumePath) {\n this.consumePath(this.current.getClippedPathBoundingBox());\n }\n\n ctx.globalAlpha = this.current.fillAlpha;\n }\n }, {\n key: \"closeStroke\",\n value: function closeStroke() {\n this.closePath();\n this.stroke();\n }\n }, {\n key: \"fill\",\n value: function fill(consumePath) {\n consumePath = typeof consumePath !== \"undefined\" ? consumePath : true;\n var ctx = this.ctx;\n var fillColor = this.current.fillColor;\n var isPatternFill = this.current.patternFill;\n var needRestore = false;\n\n if (isPatternFill) {\n ctx.save();\n ctx.fillStyle = fillColor.getPattern(ctx, this, ctx.mozCurrentTransformInverse, _pattern_helper.PathType.FILL);\n needRestore = true;\n }\n\n var intersect = this.current.getClippedPathBoundingBox();\n\n if (this.contentVisible && intersect !== null) {\n if (this.pendingEOFill) {\n ctx.fill(\"evenodd\");\n this.pendingEOFill = false;\n } else {\n ctx.fill();\n }\n }\n\n if (needRestore) {\n ctx.restore();\n }\n\n if (consumePath) {\n this.consumePath(intersect);\n }\n }\n }, {\n key: \"eoFill\",\n value: function eoFill() {\n this.pendingEOFill = true;\n this.fill();\n }\n }, {\n key: \"fillStroke\",\n value: function fillStroke() {\n this.fill(false);\n this.stroke(false);\n this.consumePath();\n }\n }, {\n key: \"eoFillStroke\",\n value: function eoFillStroke() {\n this.pendingEOFill = true;\n this.fillStroke();\n }\n }, {\n key: \"closeFillStroke\",\n value: function closeFillStroke() {\n this.closePath();\n this.fillStroke();\n }\n }, {\n key: \"closeEOFillStroke\",\n value: function closeEOFillStroke() {\n this.pendingEOFill = true;\n this.closePath();\n this.fillStroke();\n }\n }, {\n key: \"endPath\",\n value: function endPath() {\n this.consumePath();\n }\n }, {\n key: \"clip\",\n value: function clip() {\n this.pendingClip = NORMAL_CLIP;\n }\n }, {\n key: \"eoClip\",\n value: function eoClip() {\n this.pendingClip = EO_CLIP;\n }\n }, {\n key: \"beginText\",\n value: function beginText() {\n this.current.textMatrix = _util.IDENTITY_MATRIX;\n this.current.textMatrixScale = 1;\n this.current.x = this.current.lineX = 0;\n this.current.y = this.current.lineY = 0;\n }\n }, {\n key: \"endText\",\n value: function endText() {\n var paths = this.pendingTextPaths;\n var ctx = this.ctx;\n\n if (paths === undefined) {\n ctx.beginPath();\n return;\n }\n\n ctx.save();\n ctx.beginPath();\n\n for (var i = 0; i < paths.length; i++) {\n var path = paths[i];\n ctx.setTransform.apply(ctx, path.transform);\n ctx.translate(path.x, path.y);\n path.addToPath(ctx, path.fontSize);\n }\n\n ctx.restore();\n ctx.clip();\n ctx.beginPath();\n delete this.pendingTextPaths;\n }\n }, {\n key: \"setCharSpacing\",\n value: function setCharSpacing(spacing) {\n this.current.charSpacing = spacing;\n }\n }, {\n key: \"setWordSpacing\",\n value: function setWordSpacing(spacing) {\n this.current.wordSpacing = spacing;\n }\n }, {\n key: \"setHScale\",\n value: function setHScale(scale) {\n this.current.textHScale = scale / 100;\n }\n }, {\n key: \"setLeading\",\n value: function setLeading(leading) {\n this.current.leading = -leading;\n }\n }, {\n key: \"setFont\",\n value: function setFont(fontRefName, size) {\n var fontObj = this.commonObjs.get(fontRefName);\n var current = this.current;\n\n if (!fontObj) {\n throw new Error(\"Can't find font for \".concat(fontRefName));\n }\n\n current.fontMatrix = fontObj.fontMatrix || _util.FONT_IDENTITY_MATRIX;\n\n if (current.fontMatrix[0] === 0 || current.fontMatrix[3] === 0) {\n (0, _util.warn)(\"Invalid font matrix for font \" + fontRefName);\n }\n\n if (size < 0) {\n size = -size;\n current.fontDirection = -1;\n } else {\n current.fontDirection = 1;\n }\n\n this.current.font = fontObj;\n this.current.fontSize = size;\n\n if (fontObj.isType3Font) {\n return;\n }\n\n var name = fontObj.loadedName || \"sans-serif\";\n var bold = \"normal\";\n\n if (fontObj.black) {\n bold = \"900\";\n } else if (fontObj.bold) {\n bold = \"bold\";\n }\n\n var italic = fontObj.italic ? \"italic\" : \"normal\";\n var typeface = \"\\\"\".concat(name, \"\\\", \").concat(fontObj.fallbackName);\n var browserFontSize = size;\n\n if (size < MIN_FONT_SIZE) {\n browserFontSize = MIN_FONT_SIZE;\n } else if (size > MAX_FONT_SIZE) {\n browserFontSize = MAX_FONT_SIZE;\n }\n\n this.current.fontSizeScale = size / browserFontSize;\n this.ctx.font = \"\".concat(italic, \" \").concat(bold, \" \").concat(browserFontSize, \"px \").concat(typeface);\n }\n }, {\n key: \"setTextRenderingMode\",\n value: function setTextRenderingMode(mode) {\n this.current.textRenderingMode = mode;\n }\n }, {\n key: \"setTextRise\",\n value: function setTextRise(rise) {\n this.current.textRise = rise;\n }\n }, {\n key: \"moveText\",\n value: function moveText(x, y) {\n this.current.x = this.current.lineX += x;\n this.current.y = this.current.lineY += y;\n }\n }, {\n key: \"setLeadingMoveText\",\n value: function setLeadingMoveText(x, y) {\n this.setLeading(-y);\n this.moveText(x, y);\n }\n }, {\n key: \"setTextMatrix\",\n value: function setTextMatrix(a, b, c, d, e, f) {\n this.current.textMatrix = [a, b, c, d, e, f];\n this.current.textMatrixScale = Math.hypot(a, b);\n this.current.x = this.current.lineX = 0;\n this.current.y = this.current.lineY = 0;\n }\n }, {\n key: \"nextLine\",\n value: function nextLine() {\n this.moveText(0, this.current.leading);\n }\n }, {\n key: \"paintChar\",\n value: function paintChar(character, x, y, patternTransform, resetLineWidthToOne) {\n var ctx = this.ctx;\n var current = this.current;\n var font = current.font;\n var textRenderingMode = current.textRenderingMode;\n var fontSize = current.fontSize / current.fontSizeScale;\n var fillStrokeMode = textRenderingMode & _util.TextRenderingMode.FILL_STROKE_MASK;\n var isAddToPathSet = !!(textRenderingMode & _util.TextRenderingMode.ADD_TO_PATH_FLAG);\n var patternFill = current.patternFill && !font.missingFile;\n var addToPath;\n\n if (font.disableFontFace || isAddToPathSet || patternFill) {\n addToPath = font.getPathGenerator(this.commonObjs, character);\n }\n\n if (font.disableFontFace || patternFill) {\n ctx.save();\n ctx.translate(x, y);\n ctx.beginPath();\n addToPath(ctx, fontSize);\n\n if (patternTransform) {\n ctx.setTransform.apply(ctx, patternTransform);\n }\n\n if (fillStrokeMode === _util.TextRenderingMode.FILL || fillStrokeMode === _util.TextRenderingMode.FILL_STROKE) {\n ctx.fill();\n }\n\n if (fillStrokeMode === _util.TextRenderingMode.STROKE || fillStrokeMode === _util.TextRenderingMode.FILL_STROKE) {\n if (resetLineWidthToOne) {\n ctx.resetTransform();\n ctx.lineWidth = Math.floor(this._combinedScaleFactor);\n }\n\n ctx.stroke();\n }\n\n ctx.restore();\n } else {\n if (fillStrokeMode === _util.TextRenderingMode.FILL || fillStrokeMode === _util.TextRenderingMode.FILL_STROKE) {\n ctx.fillText(character, x, y);\n }\n\n if (fillStrokeMode === _util.TextRenderingMode.STROKE || fillStrokeMode === _util.TextRenderingMode.FILL_STROKE) {\n if (resetLineWidthToOne) {\n ctx.save();\n ctx.moveTo(x, y);\n ctx.resetTransform();\n ctx.lineWidth = Math.floor(this._combinedScaleFactor);\n ctx.strokeText(character, 0, 0);\n ctx.restore();\n } else {\n ctx.strokeText(character, x, y);\n }\n }\n }\n\n if (isAddToPathSet) {\n var paths = this.pendingTextPaths || (this.pendingTextPaths = []);\n paths.push({\n transform: ctx.mozCurrentTransform,\n x: x,\n y: y,\n fontSize: fontSize,\n addToPath: addToPath\n });\n }\n }\n }, {\n key: \"isFontSubpixelAAEnabled\",\n get: function get() {\n var _this$cachedCanvases$ = this.cachedCanvases.getCanvas(\"isFontSubpixelAAEnabled\", 10, 10),\n ctx = _this$cachedCanvases$.context;\n\n ctx.scale(1.5, 1);\n ctx.fillText(\"I\", 0, 10);\n var data = ctx.getImageData(0, 0, 10, 10).data;\n var enabled = false;\n\n for (var i = 3; i < data.length; i += 4) {\n if (data[i] > 0 && data[i] < 255) {\n enabled = true;\n break;\n }\n }\n\n return (0, _util.shadow)(this, \"isFontSubpixelAAEnabled\", enabled);\n }\n }, {\n key: \"showText\",\n value: function showText(glyphs) {\n var current = this.current;\n var font = current.font;\n\n if (font.isType3Font) {\n return this.showType3Text(glyphs);\n }\n\n var fontSize = current.fontSize;\n\n if (fontSize === 0) {\n return undefined;\n }\n\n var ctx = this.ctx;\n var fontSizeScale = current.fontSizeScale;\n var charSpacing = current.charSpacing;\n var wordSpacing = current.wordSpacing;\n var fontDirection = current.fontDirection;\n var textHScale = current.textHScale * fontDirection;\n var glyphsLength = glyphs.length;\n var vertical = font.vertical;\n var spacingDir = vertical ? 1 : -1;\n var defaultVMetrics = font.defaultVMetrics;\n var widthAdvanceScale = fontSize * current.fontMatrix[0];\n var simpleFillText = current.textRenderingMode === _util.TextRenderingMode.FILL && !font.disableFontFace && !current.patternFill;\n ctx.save();\n ctx.transform.apply(ctx, current.textMatrix);\n ctx.translate(current.x, current.y + current.textRise);\n\n if (fontDirection > 0) {\n ctx.scale(textHScale, -1);\n } else {\n ctx.scale(textHScale, 1);\n }\n\n var patternTransform;\n\n if (current.patternFill) {\n ctx.save();\n var pattern = current.fillColor.getPattern(ctx, this, ctx.mozCurrentTransformInverse, _pattern_helper.PathType.FILL);\n patternTransform = ctx.mozCurrentTransform;\n ctx.restore();\n ctx.fillStyle = pattern;\n }\n\n var lineWidth = current.lineWidth;\n var resetLineWidthToOne = false;\n var scale = current.textMatrixScale;\n\n if (scale === 0 || lineWidth === 0) {\n var fillStrokeMode = current.textRenderingMode & _util.TextRenderingMode.FILL_STROKE_MASK;\n\n if (fillStrokeMode === _util.TextRenderingMode.STROKE || fillStrokeMode === _util.TextRenderingMode.FILL_STROKE) {\n this._cachedGetSinglePixelWidth = null;\n lineWidth = this.getSinglePixelWidth();\n resetLineWidthToOne = lineWidth < 0;\n }\n } else {\n lineWidth /= scale;\n }\n\n if (fontSizeScale !== 1.0) {\n ctx.scale(fontSizeScale, fontSizeScale);\n lineWidth /= fontSizeScale;\n }\n\n ctx.lineWidth = lineWidth;\n var x = 0,\n i;\n\n for (i = 0; i < glyphsLength; ++i) {\n var glyph = glyphs[i];\n\n if (typeof glyph === \"number\") {\n x += spacingDir * glyph * fontSize / 1000;\n continue;\n }\n\n var restoreNeeded = false;\n var spacing = (glyph.isSpace ? wordSpacing : 0) + charSpacing;\n var character = glyph.fontChar;\n var accent = glyph.accent;\n var scaledX = void 0,\n scaledY = void 0;\n var width = glyph.width;\n\n if (vertical) {\n var vmetric = glyph.vmetric || defaultVMetrics;\n var vx = -(glyph.vmetric ? vmetric[1] : width * 0.5) * widthAdvanceScale;\n var vy = vmetric[2] * widthAdvanceScale;\n width = vmetric ? -vmetric[0] : width;\n scaledX = vx / fontSizeScale;\n scaledY = (x + vy) / fontSizeScale;\n } else {\n scaledX = x / fontSizeScale;\n scaledY = 0;\n }\n\n if (font.remeasure && width > 0) {\n var measuredWidth = ctx.measureText(character).width * 1000 / fontSize * fontSizeScale;\n\n if (width < measuredWidth && this.isFontSubpixelAAEnabled) {\n var characterScaleX = width / measuredWidth;\n restoreNeeded = true;\n ctx.save();\n ctx.scale(characterScaleX, 1);\n scaledX /= characterScaleX;\n } else if (width !== measuredWidth) {\n scaledX += (width - measuredWidth) / 2000 * fontSize / fontSizeScale;\n }\n }\n\n if (this.contentVisible && (glyph.isInFont || font.missingFile)) {\n if (simpleFillText && !accent) {\n ctx.fillText(character, scaledX, scaledY);\n } else {\n this.paintChar(character, scaledX, scaledY, patternTransform, resetLineWidthToOne);\n\n if (accent) {\n var scaledAccentX = scaledX + fontSize * accent.offset.x / fontSizeScale;\n var scaledAccentY = scaledY - fontSize * accent.offset.y / fontSizeScale;\n this.paintChar(accent.fontChar, scaledAccentX, scaledAccentY, patternTransform, resetLineWidthToOne);\n }\n }\n }\n\n var charWidth = void 0;\n\n if (vertical) {\n charWidth = width * widthAdvanceScale - spacing * fontDirection;\n } else {\n charWidth = width * widthAdvanceScale + spacing * fontDirection;\n }\n\n x += charWidth;\n\n if (restoreNeeded) {\n ctx.restore();\n }\n }\n\n if (vertical) {\n current.y -= x;\n } else {\n current.x += x * textHScale;\n }\n\n ctx.restore();\n this.compose();\n return undefined;\n }\n }, {\n key: \"showType3Text\",\n value: function showType3Text(glyphs) {\n var ctx = this.ctx;\n var current = this.current;\n var font = current.font;\n var fontSize = current.fontSize;\n var fontDirection = current.fontDirection;\n var spacingDir = font.vertical ? 1 : -1;\n var charSpacing = current.charSpacing;\n var wordSpacing = current.wordSpacing;\n var textHScale = current.textHScale * fontDirection;\n var fontMatrix = current.fontMatrix || _util.FONT_IDENTITY_MATRIX;\n var glyphsLength = glyphs.length;\n var isTextInvisible = current.textRenderingMode === _util.TextRenderingMode.INVISIBLE;\n var i, glyph, width, spacingLength;\n\n if (isTextInvisible || fontSize === 0) {\n return;\n }\n\n this._cachedGetSinglePixelWidth = null;\n ctx.save();\n ctx.transform.apply(ctx, current.textMatrix);\n ctx.translate(current.x, current.y);\n ctx.scale(textHScale, fontDirection);\n\n for (i = 0; i < glyphsLength; ++i) {\n glyph = glyphs[i];\n\n if (typeof glyph === \"number\") {\n spacingLength = spacingDir * glyph * fontSize / 1000;\n this.ctx.translate(spacingLength, 0);\n current.x += spacingLength * textHScale;\n continue;\n }\n\n var spacing = (glyph.isSpace ? wordSpacing : 0) + charSpacing;\n var operatorList = font.charProcOperatorList[glyph.operatorListId];\n\n if (!operatorList) {\n (0, _util.warn)(\"Type3 character \\\"\".concat(glyph.operatorListId, \"\\\" is not available.\"));\n continue;\n }\n\n if (this.contentVisible) {\n this.processingType3 = glyph;\n this.save();\n ctx.scale(fontSize, fontSize);\n ctx.transform.apply(ctx, fontMatrix);\n this.executeOperatorList(operatorList);\n this.restore();\n }\n\n var transformed = _util.Util.applyTransform([glyph.width, 0], fontMatrix);\n\n width = transformed[0] * fontSize + spacing;\n ctx.translate(width, 0);\n current.x += width * textHScale;\n }\n\n ctx.restore();\n this.processingType3 = null;\n }\n }, {\n key: \"setCharWidth\",\n value: function setCharWidth(xWidth, yWidth) {}\n }, {\n key: \"setCharWidthAndBounds\",\n value: function setCharWidthAndBounds(xWidth, yWidth, llx, lly, urx, ury) {\n this.ctx.rect(llx, lly, urx - llx, ury - lly);\n this.clip();\n this.endPath();\n }\n }, {\n key: \"getColorN_Pattern\",\n value: function getColorN_Pattern(IR) {\n var _this = this;\n\n var pattern;\n\n if (IR[0] === \"TilingPattern\") {\n var color = IR[1];\n var baseTransform = this.baseTransform || this.ctx.mozCurrentTransform.slice();\n var canvasGraphicsFactory = {\n createCanvasGraphics: function createCanvasGraphics(ctx) {\n return new CanvasGraphics(ctx, _this.commonObjs, _this.objs, _this.canvasFactory);\n }\n };\n pattern = new _pattern_helper.TilingPattern(IR, color, this.ctx, canvasGraphicsFactory, baseTransform);\n } else {\n pattern = this._getPattern(IR[1], IR[2]);\n }\n\n return pattern;\n }\n }, {\n key: \"setStrokeColorN\",\n value: function setStrokeColorN() {\n this.current.strokeColor = this.getColorN_Pattern(arguments);\n }\n }, {\n key: \"setFillColorN\",\n value: function setFillColorN() {\n this.current.fillColor = this.getColorN_Pattern(arguments);\n this.current.patternFill = true;\n }\n }, {\n key: \"setStrokeRGBColor\",\n value: function setStrokeRGBColor(r, g, b) {\n var color = _util.Util.makeHexColor(r, g, b);\n\n this.ctx.strokeStyle = color;\n this.current.strokeColor = color;\n }\n }, {\n key: \"setFillRGBColor\",\n value: function setFillRGBColor(r, g, b) {\n var color = _util.Util.makeHexColor(r, g, b);\n\n this.ctx.fillStyle = color;\n this.current.fillColor = color;\n this.current.patternFill = false;\n }\n }, {\n key: \"_getPattern\",\n value: function _getPattern(objId) {\n var matrix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n var pattern;\n\n if (this.cachedPatterns.has(objId)) {\n pattern = this.cachedPatterns.get(objId);\n } else {\n pattern = (0, _pattern_helper.getShadingPattern)(this.objs.get(objId));\n this.cachedPatterns.set(objId, pattern);\n }\n\n if (matrix) {\n pattern.matrix = matrix;\n }\n\n return pattern;\n }\n }, {\n key: \"shadingFill\",\n value: function shadingFill(objId) {\n if (!this.contentVisible) {\n return;\n }\n\n var ctx = this.ctx;\n this.save();\n\n var pattern = this._getPattern(objId);\n\n ctx.fillStyle = pattern.getPattern(ctx, this, ctx.mozCurrentTransformInverse, _pattern_helper.PathType.SHADING);\n var inv = ctx.mozCurrentTransformInverse;\n\n if (inv) {\n var canvas = ctx.canvas;\n var width = canvas.width;\n var height = canvas.height;\n\n var bl = _util.Util.applyTransform([0, 0], inv);\n\n var br = _util.Util.applyTransform([0, height], inv);\n\n var ul = _util.Util.applyTransform([width, 0], inv);\n\n var ur = _util.Util.applyTransform([width, height], inv);\n\n var x0 = Math.min(bl[0], br[0], ul[0], ur[0]);\n var y0 = Math.min(bl[1], br[1], ul[1], ur[1]);\n var x1 = Math.max(bl[0], br[0], ul[0], ur[0]);\n var y1 = Math.max(bl[1], br[1], ul[1], ur[1]);\n this.ctx.fillRect(x0, y0, x1 - x0, y1 - y0);\n } else {\n this.ctx.fillRect(-1e10, -1e10, 2e10, 2e10);\n }\n\n this.compose(this.current.getClippedPathBoundingBox());\n this.restore();\n }\n }, {\n key: \"beginInlineImage\",\n value: function beginInlineImage() {\n (0, _util.unreachable)(\"Should not call beginInlineImage\");\n }\n }, {\n key: \"beginImageData\",\n value: function beginImageData() {\n (0, _util.unreachable)(\"Should not call beginImageData\");\n }\n }, {\n key: \"paintFormXObjectBegin\",\n value: function paintFormXObjectBegin(matrix, bbox) {\n if (!this.contentVisible) {\n return;\n }\n\n this.save();\n this.baseTransformStack.push(this.baseTransform);\n\n if (Array.isArray(matrix) && matrix.length === 6) {\n this.transform.apply(this, matrix);\n }\n\n this.baseTransform = this.ctx.mozCurrentTransform;\n\n if (bbox) {\n var width = bbox[2] - bbox[0];\n var height = bbox[3] - bbox[1];\n this.ctx.rect(bbox[0], bbox[1], width, height);\n this.current.updatePathMinMax(this.ctx.mozCurrentTransform, bbox[0], bbox[1]);\n this.current.updatePathMinMax(this.ctx.mozCurrentTransform, bbox[2], bbox[3]);\n this.clip();\n this.endPath();\n }\n }\n }, {\n key: \"paintFormXObjectEnd\",\n value: function paintFormXObjectEnd() {\n if (!this.contentVisible) {\n return;\n }\n\n this.restore();\n this.baseTransform = this.baseTransformStack.pop();\n }\n }, {\n key: \"beginGroup\",\n value: function beginGroup(group) {\n if (!this.contentVisible) {\n return;\n }\n\n this.save();\n\n if (this.inSMaskMode) {\n this.endSMaskMode();\n this.current.activeSMask = null;\n }\n\n var currentCtx = this.ctx;\n\n if (!group.isolated) {\n (0, _util.info)(\"TODO: Support non-isolated groups.\");\n }\n\n if (group.knockout) {\n (0, _util.warn)(\"Knockout groups not supported.\");\n }\n\n var currentTransform = currentCtx.mozCurrentTransform;\n\n if (group.matrix) {\n currentCtx.transform.apply(currentCtx, group.matrix);\n }\n\n if (!group.bbox) {\n throw new Error(\"Bounding box is required.\");\n }\n\n var bounds = _util.Util.getAxialAlignedBoundingBox(group.bbox, currentCtx.mozCurrentTransform);\n\n var canvasBounds = [0, 0, currentCtx.canvas.width, currentCtx.canvas.height];\n bounds = _util.Util.intersect(bounds, canvasBounds) || [0, 0, 0, 0];\n var offsetX = Math.floor(bounds[0]);\n var offsetY = Math.floor(bounds[1]);\n var drawnWidth = Math.max(Math.ceil(bounds[2]) - offsetX, 1);\n var drawnHeight = Math.max(Math.ceil(bounds[3]) - offsetY, 1);\n var scaleX = 1,\n scaleY = 1;\n\n if (drawnWidth > MAX_GROUP_SIZE) {\n scaleX = drawnWidth / MAX_GROUP_SIZE;\n drawnWidth = MAX_GROUP_SIZE;\n }\n\n if (drawnHeight > MAX_GROUP_SIZE) {\n scaleY = drawnHeight / MAX_GROUP_SIZE;\n drawnHeight = MAX_GROUP_SIZE;\n }\n\n this.current.startNewPathAndClipBox([0, 0, drawnWidth, drawnHeight]);\n var cacheId = \"groupAt\" + this.groupLevel;\n\n if (group.smask) {\n cacheId += \"_smask_\" + this.smaskCounter++ % 2;\n }\n\n var scratchCanvas = this.cachedCanvases.getCanvas(cacheId, drawnWidth, drawnHeight, true);\n var groupCtx = scratchCanvas.context;\n groupCtx.scale(1 / scaleX, 1 / scaleY);\n groupCtx.translate(-offsetX, -offsetY);\n groupCtx.transform.apply(groupCtx, currentTransform);\n\n if (group.smask) {\n this.smaskStack.push({\n canvas: scratchCanvas.canvas,\n context: groupCtx,\n offsetX: offsetX,\n offsetY: offsetY,\n scaleX: scaleX,\n scaleY: scaleY,\n subtype: group.smask.subtype,\n backdrop: group.smask.backdrop,\n transferMap: group.smask.transferMap || null,\n startTransformInverse: null\n });\n } else {\n currentCtx.setTransform(1, 0, 0, 1, 0, 0);\n currentCtx.translate(offsetX, offsetY);\n currentCtx.scale(scaleX, scaleY);\n currentCtx.save();\n }\n\n copyCtxState(currentCtx, groupCtx);\n this.ctx = groupCtx;\n this.setGState([[\"BM\", \"source-over\"], [\"ca\", 1], [\"CA\", 1]]);\n this.groupStack.push(currentCtx);\n this.groupLevel++;\n }\n }, {\n key: \"endGroup\",\n value: function endGroup(group) {\n if (!this.contentVisible) {\n return;\n }\n\n this.groupLevel--;\n var groupCtx = this.ctx;\n var ctx = this.groupStack.pop();\n this.ctx = ctx;\n this.ctx.imageSmoothingEnabled = false;\n\n if (group.smask) {\n this.tempSMask = this.smaskStack.pop();\n this.restore();\n } else {\n this.ctx.restore();\n var currentMtx = this.ctx.mozCurrentTransform;\n this.restore();\n this.ctx.save();\n this.ctx.setTransform.apply(this.ctx, currentMtx);\n\n var dirtyBox = _util.Util.getAxialAlignedBoundingBox([0, 0, groupCtx.canvas.width, groupCtx.canvas.height], currentMtx);\n\n this.ctx.drawImage(groupCtx.canvas, 0, 0);\n this.ctx.restore();\n this.compose(dirtyBox);\n }\n }\n }, {\n key: \"beginAnnotations\",\n value: function beginAnnotations() {\n this.save();\n\n if (this.baseTransform) {\n this.ctx.setTransform.apply(this.ctx, this.baseTransform);\n }\n }\n }, {\n key: \"endAnnotations\",\n value: function endAnnotations() {\n this.restore();\n }\n }, {\n key: \"beginAnnotation\",\n value: function beginAnnotation(id, rect, transform, matrix, hasOwnCanvas) {\n this.save();\n\n if (Array.isArray(rect) && rect.length === 4) {\n var width = rect[2] - rect[0];\n var height = rect[3] - rect[1];\n\n if (hasOwnCanvas && this.annotationCanvasMap) {\n transform = transform.slice();\n transform[4] -= rect[0];\n transform[5] -= rect[1];\n rect = rect.slice();\n rect[0] = rect[1] = 0;\n rect[2] = width;\n rect[3] = height;\n\n var _Util$singularValueDe = _util.Util.singularValueDecompose2dScale(this.ctx.mozCurrentTransform),\n _Util$singularValueDe2 = _slicedToArray(_Util$singularValueDe, 2),\n scaleX = _Util$singularValueDe2[0],\n scaleY = _Util$singularValueDe2[1];\n\n var viewportScale = this.viewportScale;\n var canvasWidth = Math.ceil(width * this.outputScaleX * viewportScale);\n var canvasHeight = Math.ceil(height * this.outputScaleY * viewportScale);\n this.annotationCanvas = this.canvasFactory.create(canvasWidth, canvasHeight);\n var _this$annotationCanva = this.annotationCanvas,\n canvas = _this$annotationCanva.canvas,\n context = _this$annotationCanva.context;\n canvas.style.width = \"calc(\".concat(width, \"px * var(--viewport-scale-factor))\");\n canvas.style.height = \"calc(\".concat(height, \"px * var(--viewport-scale-factor))\");\n this.annotationCanvasMap.set(id, canvas);\n this.annotationCanvas.savedCtx = this.ctx;\n this.ctx = context;\n this.ctx.setTransform(scaleX, 0, 0, -scaleY, 0, height * scaleY);\n addContextCurrentTransform(this.ctx);\n resetCtxToDefault(this.ctx);\n } else {\n resetCtxToDefault(this.ctx);\n this.ctx.rect(rect[0], rect[1], width, height);\n this.clip();\n this.endPath();\n }\n }\n\n this.current = new CanvasExtraState(this.ctx.canvas.width, this.ctx.canvas.height);\n this.transform.apply(this, transform);\n this.transform.apply(this, matrix);\n }\n }, {\n key: \"endAnnotation\",\n value: function endAnnotation() {\n if (this.annotationCanvas) {\n this.ctx = this.annotationCanvas.savedCtx;\n delete this.annotationCanvas.savedCtx;\n delete this.annotationCanvas;\n }\n\n this.restore();\n }\n }, {\n key: \"paintImageMaskXObject\",\n value: function paintImageMaskXObject(img) {\n if (!this.contentVisible) {\n return;\n }\n\n var ctx = this.ctx;\n var width = img.width,\n height = img.height;\n var glyph = this.processingType3;\n\n if (COMPILE_TYPE3_GLYPHS && glyph && glyph.compiled === undefined) {\n if (width <= MAX_SIZE_TO_COMPILE && height <= MAX_SIZE_TO_COMPILE) {\n glyph.compiled = compileType3Glyph({\n data: img.data,\n width: width,\n height: height\n });\n } else {\n glyph.compiled = null;\n }\n }\n\n if (glyph !== null && glyph !== void 0 && glyph.compiled) {\n glyph.compiled(ctx);\n return;\n }\n\n var mask = this._createMaskCanvas(img);\n\n var maskCanvas = mask.canvas;\n ctx.save();\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.drawImage(maskCanvas, mask.offsetX, mask.offsetY);\n ctx.restore();\n this.compose();\n }\n }, {\n key: \"paintImageMaskXObjectRepeat\",\n value: function paintImageMaskXObjectRepeat(imgData, scaleX) {\n var skewX = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n var skewY = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;\n var scaleY = arguments.length > 4 ? arguments[4] : undefined;\n var positions = arguments.length > 5 ? arguments[5] : undefined;\n\n if (!this.contentVisible) {\n return;\n }\n\n var ctx = this.ctx;\n ctx.save();\n var currentTransform = ctx.mozCurrentTransform;\n ctx.transform(scaleX, skewX, skewY, scaleY, 0, 0);\n\n var mask = this._createMaskCanvas(imgData);\n\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n\n for (var i = 0, ii = positions.length; i < ii; i += 2) {\n var trans = _util.Util.transform(currentTransform, [scaleX, skewX, skewY, scaleY, positions[i], positions[i + 1]]);\n\n var _Util$applyTransform3 = _util.Util.applyTransform([0, 0], trans),\n _Util$applyTransform4 = _slicedToArray(_Util$applyTransform3, 2),\n x = _Util$applyTransform4[0],\n y = _Util$applyTransform4[1];\n\n ctx.drawImage(mask.canvas, x, y);\n }\n\n ctx.restore();\n this.compose();\n }\n }, {\n key: \"paintImageMaskXObjectGroup\",\n value: function paintImageMaskXObjectGroup(images) {\n if (!this.contentVisible) {\n return;\n }\n\n var ctx = this.ctx;\n var fillColor = this.current.fillColor;\n var isPatternFill = this.current.patternFill;\n\n for (var i = 0, ii = images.length; i < ii; i++) {\n var image = images[i];\n var width = image.width,\n height = image.height;\n var maskCanvas = this.cachedCanvases.getCanvas(\"maskCanvas\", width, height);\n var maskCtx = maskCanvas.context;\n maskCtx.save();\n putBinaryImageMask(maskCtx, image);\n maskCtx.globalCompositeOperation = \"source-in\";\n maskCtx.fillStyle = isPatternFill ? fillColor.getPattern(maskCtx, this, ctx.mozCurrentTransformInverse, _pattern_helper.PathType.FILL) : fillColor;\n maskCtx.fillRect(0, 0, width, height);\n maskCtx.restore();\n ctx.save();\n ctx.transform.apply(ctx, image.transform);\n ctx.scale(1, -1);\n ctx.drawImage(maskCanvas.canvas, 0, 0, width, height, 0, -1, 1, 1);\n ctx.restore();\n }\n\n this.compose();\n }\n }, {\n key: \"paintImageXObject\",\n value: function paintImageXObject(objId) {\n if (!this.contentVisible) {\n return;\n }\n\n var imgData = objId.startsWith(\"g_\") ? this.commonObjs.get(objId) : this.objs.get(objId);\n\n if (!imgData) {\n (0, _util.warn)(\"Dependent image isn't ready yet\");\n return;\n }\n\n this.paintInlineImageXObject(imgData);\n }\n }, {\n key: \"paintImageXObjectRepeat\",\n value: function paintImageXObjectRepeat(objId, scaleX, scaleY, positions) {\n if (!this.contentVisible) {\n return;\n }\n\n var imgData = objId.startsWith(\"g_\") ? this.commonObjs.get(objId) : this.objs.get(objId);\n\n if (!imgData) {\n (0, _util.warn)(\"Dependent image isn't ready yet\");\n return;\n }\n\n var width = imgData.width;\n var height = imgData.height;\n var map = [];\n\n for (var i = 0, ii = positions.length; i < ii; i += 2) {\n map.push({\n transform: [scaleX, 0, 0, scaleY, positions[i], positions[i + 1]],\n x: 0,\n y: 0,\n w: width,\n h: height\n });\n }\n\n this.paintInlineImageXObjectGroup(imgData, map);\n }\n }, {\n key: \"paintInlineImageXObject\",\n value: function paintInlineImageXObject(imgData) {\n if (!this.contentVisible) {\n return;\n }\n\n var width = imgData.width;\n var height = imgData.height;\n var ctx = this.ctx;\n this.save();\n ctx.scale(1 / width, -1 / height);\n var imgToPaint;\n\n if (typeof HTMLElement === \"function\" && imgData instanceof HTMLElement || !imgData.data) {\n imgToPaint = imgData;\n } else {\n var tmpCanvas = this.cachedCanvases.getCanvas(\"inlineImage\", width, height);\n var tmpCtx = tmpCanvas.context;\n putBinaryImageData(tmpCtx, imgData, this.current.transferMaps);\n imgToPaint = tmpCanvas.canvas;\n }\n\n var scaled = this._scaleImage(imgToPaint, ctx.mozCurrentTransformInverse);\n\n ctx.imageSmoothingEnabled = getImageSmoothingEnabled(ctx.mozCurrentTransform, imgData.interpolate);\n ctx.drawImage(scaled.img, 0, 0, scaled.paintWidth, scaled.paintHeight, 0, -height, width, height);\n\n if (this.imageLayer) {\n var position = this.getCanvasPosition(0, -height);\n this.imageLayer.appendImage({\n imgData: imgData,\n left: position[0],\n top: position[1],\n width: width / ctx.mozCurrentTransformInverse[0],\n height: height / ctx.mozCurrentTransformInverse[3]\n });\n }\n\n this.compose();\n this.restore();\n }\n }, {\n key: \"paintInlineImageXObjectGroup\",\n value: function paintInlineImageXObjectGroup(imgData, map) {\n if (!this.contentVisible) {\n return;\n }\n\n var ctx = this.ctx;\n var w = imgData.width;\n var h = imgData.height;\n var tmpCanvas = this.cachedCanvases.getCanvas(\"inlineImage\", w, h);\n var tmpCtx = tmpCanvas.context;\n putBinaryImageData(tmpCtx, imgData, this.current.transferMaps);\n\n for (var i = 0, ii = map.length; i < ii; i++) {\n var entry = map[i];\n ctx.save();\n ctx.transform.apply(ctx, entry.transform);\n ctx.scale(1, -1);\n ctx.drawImage(tmpCanvas.canvas, entry.x, entry.y, entry.w, entry.h, 0, -1, 1, 1);\n\n if (this.imageLayer) {\n var position = this.getCanvasPosition(entry.x, entry.y);\n this.imageLayer.appendImage({\n imgData: imgData,\n left: position[0],\n top: position[1],\n width: w,\n height: h\n });\n }\n\n ctx.restore();\n }\n\n this.compose();\n }\n }, {\n key: \"paintSolidColorImageMask\",\n value: function paintSolidColorImageMask() {\n if (!this.contentVisible) {\n return;\n }\n\n this.ctx.fillRect(0, 0, 1, 1);\n this.compose();\n }\n }, {\n key: \"markPoint\",\n value: function markPoint(tag) {}\n }, {\n key: \"markPointProps\",\n value: function markPointProps(tag, properties) {}\n }, {\n key: \"beginMarkedContent\",\n value: function beginMarkedContent(tag) {\n this.markedContentStack.push({\n visible: true\n });\n }\n }, {\n key: \"beginMarkedContentProps\",\n value: function beginMarkedContentProps(tag, properties) {\n if (tag === \"OC\") {\n this.markedContentStack.push({\n visible: this.optionalContentConfig.isVisible(properties)\n });\n } else {\n this.markedContentStack.push({\n visible: true\n });\n }\n\n this.contentVisible = this.isContentVisible();\n }\n }, {\n key: \"endMarkedContent\",\n value: function endMarkedContent() {\n this.markedContentStack.pop();\n this.contentVisible = this.isContentVisible();\n }\n }, {\n key: \"beginCompat\",\n value: function beginCompat() {}\n }, {\n key: \"endCompat\",\n value: function endCompat() {}\n }, {\n key: \"consumePath\",\n value: function consumePath(clipBox) {\n if (this.pendingClip) {\n this.current.updateClipFromPath();\n }\n\n if (!this.pendingClip) {\n this.compose(clipBox);\n }\n\n var ctx = this.ctx;\n\n if (this.pendingClip) {\n if (this.pendingClip === EO_CLIP) {\n ctx.clip(\"evenodd\");\n } else {\n ctx.clip();\n }\n\n this.pendingClip = null;\n }\n\n this.current.startNewPathAndClipBox(this.current.clipBox);\n ctx.beginPath();\n }\n }, {\n key: \"getSinglePixelWidth\",\n value: function getSinglePixelWidth() {\n if (this._cachedGetSinglePixelWidth === null) {\n var m = this.ctx.mozCurrentTransform;\n var absDet = Math.abs(m[0] * m[3] - m[2] * m[1]);\n var sqNorm1 = Math.pow(m[0], 2) + Math.pow(m[2], 2);\n var sqNorm2 = Math.pow(m[1], 2) + Math.pow(m[3], 2);\n var pixelHeight = Math.sqrt(Math.max(sqNorm1, sqNorm2)) / absDet;\n\n if (sqNorm1 !== sqNorm2 && this._combinedScaleFactor * pixelHeight > 1) {\n this._cachedGetSinglePixelWidth = -(this._combinedScaleFactor * pixelHeight);\n } else if (absDet > Number.EPSILON) {\n this._cachedGetSinglePixelWidth = pixelHeight;\n } else {\n this._cachedGetSinglePixelWidth = 1;\n }\n }\n\n return this._cachedGetSinglePixelWidth;\n }\n }, {\n key: \"getCanvasPosition\",\n value: function getCanvasPosition(x, y) {\n var transform = this.ctx.mozCurrentTransform;\n return [transform[0] * x + transform[2] * y + transform[4], transform[1] * x + transform[3] * y + transform[5]];\n }\n }, {\n key: \"isContentVisible\",\n value: function isContentVisible() {\n for (var i = this.markedContentStack.length - 1; i >= 0; i--) {\n if (!this.markedContentStack[i].visible) {\n return false;\n }\n }\n\n return true;\n }\n }]);\n\n return CanvasGraphics;\n}();\n\nexports.CanvasGraphics = CanvasGraphics;\n\nfor (var op in _util.OPS) {\n if (CanvasGraphics.prototype[op] !== undefined) {\n CanvasGraphics.prototype[_util.OPS[op]] = CanvasGraphics.prototype[op];\n }\n}\n\n/***/ }),\n/* 153 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\"use strict\";\n\n\nfunction _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); }\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.TilingPattern = exports.PathType = void 0;\nexports.getShadingPattern = getShadingPattern;\n\nvar _util = __w_pdfjs_require__(1);\n\nfunction _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; } } }; }\n\nfunction _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); }\n\nfunction _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; }\n\nfunction _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); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _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); }; }\n\nfunction _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); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _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; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nvar PathType = {\n FILL: \"Fill\",\n STROKE: \"Stroke\",\n SHADING: \"Shading\"\n};\nexports.PathType = PathType;\n\nfunction applyBoundingBox(ctx, bbox) {\n if (!bbox || typeof Path2D === \"undefined\") {\n return;\n }\n\n var width = bbox[2] - bbox[0];\n var height = bbox[3] - bbox[1];\n var region = new Path2D();\n region.rect(bbox[0], bbox[1], width, height);\n ctx.clip(region);\n}\n\nvar BaseShadingPattern = /*#__PURE__*/function () {\n function BaseShadingPattern() {\n _classCallCheck(this, BaseShadingPattern);\n\n if (this.constructor === BaseShadingPattern) {\n (0, _util.unreachable)(\"Cannot initialize BaseShadingPattern.\");\n }\n }\n\n _createClass(BaseShadingPattern, [{\n key: \"getPattern\",\n value: function getPattern() {\n (0, _util.unreachable)(\"Abstract method `getPattern` called.\");\n }\n }]);\n\n return BaseShadingPattern;\n}();\n\nvar RadialAxialShadingPattern = /*#__PURE__*/function (_BaseShadingPattern) {\n _inherits(RadialAxialShadingPattern, _BaseShadingPattern);\n\n var _super = _createSuper(RadialAxialShadingPattern);\n\n function RadialAxialShadingPattern(IR) {\n var _this;\n\n _classCallCheck(this, RadialAxialShadingPattern);\n\n _this = _super.call(this);\n _this._type = IR[1];\n _this._bbox = IR[2];\n _this._colorStops = IR[3];\n _this._p0 = IR[4];\n _this._p1 = IR[5];\n _this._r0 = IR[6];\n _this._r1 = IR[7];\n _this.matrix = null;\n return _this;\n }\n\n _createClass(RadialAxialShadingPattern, [{\n key: \"_createGradient\",\n value: function _createGradient(ctx) {\n var grad;\n\n if (this._type === \"axial\") {\n grad = ctx.createLinearGradient(this._p0[0], this._p0[1], this._p1[0], this._p1[1]);\n } else if (this._type === \"radial\") {\n grad = ctx.createRadialGradient(this._p0[0], this._p0[1], this._r0, this._p1[0], this._p1[1], this._r1);\n }\n\n var _iterator = _createForOfIteratorHelper(this._colorStops),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var colorStop = _step.value;\n grad.addColorStop(colorStop[0], colorStop[1]);\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n return grad;\n }\n }, {\n key: \"getPattern\",\n value: function getPattern(ctx, owner, inverse, pathType) {\n var pattern;\n\n if (pathType === PathType.STROKE || pathType === PathType.FILL) {\n var ownerBBox = owner.current.getClippedPathBoundingBox(pathType, ctx.mozCurrentTransform) || [0, 0, 0, 0];\n var width = Math.ceil(ownerBBox[2] - ownerBBox[0]) || 1;\n var height = Math.ceil(ownerBBox[3] - ownerBBox[1]) || 1;\n var tmpCanvas = owner.cachedCanvases.getCanvas(\"pattern\", width, height, true);\n var tmpCtx = tmpCanvas.context;\n tmpCtx.clearRect(0, 0, tmpCtx.canvas.width, tmpCtx.canvas.height);\n tmpCtx.beginPath();\n tmpCtx.rect(0, 0, tmpCtx.canvas.width, tmpCtx.canvas.height);\n tmpCtx.translate(-ownerBBox[0], -ownerBBox[1]);\n inverse = _util.Util.transform(inverse, [1, 0, 0, 1, ownerBBox[0], ownerBBox[1]]);\n tmpCtx.transform.apply(tmpCtx, owner.baseTransform);\n\n if (this.matrix) {\n tmpCtx.transform.apply(tmpCtx, this.matrix);\n }\n\n applyBoundingBox(tmpCtx, this._bbox);\n tmpCtx.fillStyle = this._createGradient(tmpCtx);\n tmpCtx.fill();\n pattern = ctx.createPattern(tmpCanvas.canvas, \"no-repeat\");\n var domMatrix = new DOMMatrix(inverse);\n\n try {\n pattern.setTransform(domMatrix);\n } catch (ex) {\n (0, _util.warn)(\"RadialAxialShadingPattern.getPattern: \\\"\".concat(ex === null || ex === void 0 ? void 0 : ex.message, \"\\\".\"));\n }\n } else {\n applyBoundingBox(ctx, this._bbox);\n pattern = this._createGradient(ctx);\n }\n\n return pattern;\n }\n }]);\n\n return RadialAxialShadingPattern;\n}(BaseShadingPattern);\n\nfunction drawTriangle(data, context, p1, p2, p3, c1, c2, c3) {\n var coords = context.coords,\n colors = context.colors;\n var bytes = data.data,\n rowSize = data.width * 4;\n var tmp;\n\n if (coords[p1 + 1] > coords[p2 + 1]) {\n tmp = p1;\n p1 = p2;\n p2 = tmp;\n tmp = c1;\n c1 = c2;\n c2 = tmp;\n }\n\n if (coords[p2 + 1] > coords[p3 + 1]) {\n tmp = p2;\n p2 = p3;\n p3 = tmp;\n tmp = c2;\n c2 = c3;\n c3 = tmp;\n }\n\n if (coords[p1 + 1] > coords[p2 + 1]) {\n tmp = p1;\n p1 = p2;\n p2 = tmp;\n tmp = c1;\n c1 = c2;\n c2 = tmp;\n }\n\n var x1 = (coords[p1] + context.offsetX) * context.scaleX;\n var y1 = (coords[p1 + 1] + context.offsetY) * context.scaleY;\n var x2 = (coords[p2] + context.offsetX) * context.scaleX;\n var y2 = (coords[p2 + 1] + context.offsetY) * context.scaleY;\n var x3 = (coords[p3] + context.offsetX) * context.scaleX;\n var y3 = (coords[p3 + 1] + context.offsetY) * context.scaleY;\n\n if (y1 >= y3) {\n return;\n }\n\n var c1r = colors[c1],\n c1g = colors[c1 + 1],\n c1b = colors[c1 + 2];\n var c2r = colors[c2],\n c2g = colors[c2 + 1],\n c2b = colors[c2 + 2];\n var c3r = colors[c3],\n c3g = colors[c3 + 1],\n c3b = colors[c3 + 2];\n var minY = Math.round(y1),\n maxY = Math.round(y3);\n var xa, car, cag, cab;\n var xb, cbr, cbg, cbb;\n\n for (var y = minY; y <= maxY; y++) {\n if (y < y2) {\n var _k = void 0;\n\n if (y < y1) {\n _k = 0;\n } else {\n _k = (y1 - y) / (y1 - y2);\n }\n\n xa = x1 - (x1 - x2) * _k;\n car = c1r - (c1r - c2r) * _k;\n cag = c1g - (c1g - c2g) * _k;\n cab = c1b - (c1b - c2b) * _k;\n } else {\n var _k2 = void 0;\n\n if (y > y3) {\n _k2 = 1;\n } else if (y2 === y3) {\n _k2 = 0;\n } else {\n _k2 = (y2 - y) / (y2 - y3);\n }\n\n xa = x2 - (x2 - x3) * _k2;\n car = c2r - (c2r - c3r) * _k2;\n cag = c2g - (c2g - c3g) * _k2;\n cab = c2b - (c2b - c3b) * _k2;\n }\n\n var k = void 0;\n\n if (y < y1) {\n k = 0;\n } else if (y > y3) {\n k = 1;\n } else {\n k = (y1 - y) / (y1 - y3);\n }\n\n xb = x1 - (x1 - x3) * k;\n cbr = c1r - (c1r - c3r) * k;\n cbg = c1g - (c1g - c3g) * k;\n cbb = c1b - (c1b - c3b) * k;\n var x1_ = Math.round(Math.min(xa, xb));\n var x2_ = Math.round(Math.max(xa, xb));\n var j = rowSize * y + x1_ * 4;\n\n for (var x = x1_; x <= x2_; x++) {\n k = (xa - x) / (xa - xb);\n\n if (k < 0) {\n k = 0;\n } else if (k > 1) {\n k = 1;\n }\n\n bytes[j++] = car - (car - cbr) * k | 0;\n bytes[j++] = cag - (cag - cbg) * k | 0;\n bytes[j++] = cab - (cab - cbb) * k | 0;\n bytes[j++] = 255;\n }\n }\n}\n\nfunction drawFigure(data, figure, context) {\n var ps = figure.coords;\n var cs = figure.colors;\n var i, ii;\n\n switch (figure.type) {\n case \"lattice\":\n var verticesPerRow = figure.verticesPerRow;\n var rows = Math.floor(ps.length / verticesPerRow) - 1;\n var cols = verticesPerRow - 1;\n\n for (i = 0; i < rows; i++) {\n var q = i * verticesPerRow;\n\n for (var j = 0; j < cols; j++, q++) {\n drawTriangle(data, context, ps[q], ps[q + 1], ps[q + verticesPerRow], cs[q], cs[q + 1], cs[q + verticesPerRow]);\n drawTriangle(data, context, ps[q + verticesPerRow + 1], ps[q + 1], ps[q + verticesPerRow], cs[q + verticesPerRow + 1], cs[q + 1], cs[q + verticesPerRow]);\n }\n }\n\n break;\n\n case \"triangles\":\n for (i = 0, ii = ps.length; i < ii; i += 3) {\n drawTriangle(data, context, ps[i], ps[i + 1], ps[i + 2], cs[i], cs[i + 1], cs[i + 2]);\n }\n\n break;\n\n default:\n throw new Error(\"illegal figure\");\n }\n}\n\nvar MeshShadingPattern = /*#__PURE__*/function (_BaseShadingPattern2) {\n _inherits(MeshShadingPattern, _BaseShadingPattern2);\n\n var _super2 = _createSuper(MeshShadingPattern);\n\n function MeshShadingPattern(IR) {\n var _this2;\n\n _classCallCheck(this, MeshShadingPattern);\n\n _this2 = _super2.call(this);\n _this2._coords = IR[2];\n _this2._colors = IR[3];\n _this2._figures = IR[4];\n _this2._bounds = IR[5];\n _this2._bbox = IR[7];\n _this2._background = IR[8];\n _this2.matrix = null;\n return _this2;\n }\n\n _createClass(MeshShadingPattern, [{\n key: \"_createMeshCanvas\",\n value: function _createMeshCanvas(combinedScale, backgroundColor, cachedCanvases) {\n var EXPECTED_SCALE = 1.1;\n var MAX_PATTERN_SIZE = 3000;\n var BORDER_SIZE = 2;\n var offsetX = Math.floor(this._bounds[0]);\n var offsetY = Math.floor(this._bounds[1]);\n var boundsWidth = Math.ceil(this._bounds[2]) - offsetX;\n var boundsHeight = Math.ceil(this._bounds[3]) - offsetY;\n var width = Math.min(Math.ceil(Math.abs(boundsWidth * combinedScale[0] * EXPECTED_SCALE)), MAX_PATTERN_SIZE);\n var height = Math.min(Math.ceil(Math.abs(boundsHeight * combinedScale[1] * EXPECTED_SCALE)), MAX_PATTERN_SIZE);\n var scaleX = boundsWidth / width;\n var scaleY = boundsHeight / height;\n var context = {\n coords: this._coords,\n colors: this._colors,\n offsetX: -offsetX,\n offsetY: -offsetY,\n scaleX: 1 / scaleX,\n scaleY: 1 / scaleY\n };\n var paddedWidth = width + BORDER_SIZE * 2;\n var paddedHeight = height + BORDER_SIZE * 2;\n var tmpCanvas = cachedCanvases.getCanvas(\"mesh\", paddedWidth, paddedHeight, false);\n var tmpCtx = tmpCanvas.context;\n var data = tmpCtx.createImageData(width, height);\n\n if (backgroundColor) {\n var bytes = data.data;\n\n for (var i = 0, ii = bytes.length; i < ii; i += 4) {\n bytes[i] = backgroundColor[0];\n bytes[i + 1] = backgroundColor[1];\n bytes[i + 2] = backgroundColor[2];\n bytes[i + 3] = 255;\n }\n }\n\n var _iterator2 = _createForOfIteratorHelper(this._figures),\n _step2;\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var figure = _step2.value;\n drawFigure(data, figure, context);\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n\n tmpCtx.putImageData(data, BORDER_SIZE, BORDER_SIZE);\n var canvas = tmpCanvas.canvas;\n return {\n canvas: canvas,\n offsetX: offsetX - BORDER_SIZE * scaleX,\n offsetY: offsetY - BORDER_SIZE * scaleY,\n scaleX: scaleX,\n scaleY: scaleY\n };\n }\n }, {\n key: \"getPattern\",\n value: function getPattern(ctx, owner, inverse, pathType) {\n applyBoundingBox(ctx, this._bbox);\n var scale;\n\n if (pathType === PathType.SHADING) {\n scale = _util.Util.singularValueDecompose2dScale(ctx.mozCurrentTransform);\n } else {\n scale = _util.Util.singularValueDecompose2dScale(owner.baseTransform);\n\n if (this.matrix) {\n var matrixScale = _util.Util.singularValueDecompose2dScale(this.matrix);\n\n scale = [scale[0] * matrixScale[0], scale[1] * matrixScale[1]];\n }\n }\n\n var temporaryPatternCanvas = this._createMeshCanvas(scale, pathType === PathType.SHADING ? null : this._background, owner.cachedCanvases);\n\n if (pathType !== PathType.SHADING) {\n ctx.setTransform.apply(ctx, owner.baseTransform);\n\n if (this.matrix) {\n ctx.transform.apply(ctx, this.matrix);\n }\n }\n\n ctx.translate(temporaryPatternCanvas.offsetX, temporaryPatternCanvas.offsetY);\n ctx.scale(temporaryPatternCanvas.scaleX, temporaryPatternCanvas.scaleY);\n return ctx.createPattern(temporaryPatternCanvas.canvas, \"no-repeat\");\n }\n }]);\n\n return MeshShadingPattern;\n}(BaseShadingPattern);\n\nvar DummyShadingPattern = /*#__PURE__*/function (_BaseShadingPattern3) {\n _inherits(DummyShadingPattern, _BaseShadingPattern3);\n\n var _super3 = _createSuper(DummyShadingPattern);\n\n function DummyShadingPattern() {\n _classCallCheck(this, DummyShadingPattern);\n\n return _super3.apply(this, arguments);\n }\n\n _createClass(DummyShadingPattern, [{\n key: \"getPattern\",\n value: function getPattern() {\n return \"hotpink\";\n }\n }]);\n\n return DummyShadingPattern;\n}(BaseShadingPattern);\n\nfunction getShadingPattern(IR) {\n switch (IR[0]) {\n case \"RadialAxial\":\n return new RadialAxialShadingPattern(IR);\n\n case \"Mesh\":\n return new MeshShadingPattern(IR);\n\n case \"Dummy\":\n return new DummyShadingPattern();\n }\n\n throw new Error(\"Unknown IR type: \".concat(IR[0]));\n}\n\nvar PaintType = {\n COLORED: 1,\n UNCOLORED: 2\n};\n\nvar TilingPattern = /*#__PURE__*/function () {\n function TilingPattern(IR, color, ctx, canvasGraphicsFactory, baseTransform) {\n _classCallCheck(this, TilingPattern);\n\n this.operatorList = IR[2];\n this.matrix = IR[3] || [1, 0, 0, 1, 0, 0];\n this.bbox = IR[4];\n this.xstep = IR[5];\n this.ystep = IR[6];\n this.paintType = IR[7];\n this.tilingType = IR[8];\n this.color = color;\n this.ctx = ctx;\n this.canvasGraphicsFactory = canvasGraphicsFactory;\n this.baseTransform = baseTransform;\n }\n\n _createClass(TilingPattern, [{\n key: \"createPatternCanvas\",\n value: function createPatternCanvas(owner) {\n var operatorList = this.operatorList;\n var bbox = this.bbox;\n var xstep = this.xstep;\n var ystep = this.ystep;\n var paintType = this.paintType;\n var tilingType = this.tilingType;\n var color = this.color;\n var canvasGraphicsFactory = this.canvasGraphicsFactory;\n (0, _util.info)(\"TilingType: \" + tilingType);\n var x0 = bbox[0],\n y0 = bbox[1],\n x1 = bbox[2],\n y1 = bbox[3];\n\n var matrixScale = _util.Util.singularValueDecompose2dScale(this.matrix);\n\n var curMatrixScale = _util.Util.singularValueDecompose2dScale(this.baseTransform);\n\n var combinedScale = [matrixScale[0] * curMatrixScale[0], matrixScale[1] * curMatrixScale[1]];\n var dimx = this.getSizeAndScale(xstep, this.ctx.canvas.width, combinedScale[0]);\n var dimy = this.getSizeAndScale(ystep, this.ctx.canvas.height, combinedScale[1]);\n var tmpCanvas = owner.cachedCanvases.getCanvas(\"pattern\", dimx.size, dimy.size, true);\n var tmpCtx = tmpCanvas.context;\n var graphics = canvasGraphicsFactory.createCanvasGraphics(tmpCtx);\n graphics.groupLevel = owner.groupLevel;\n this.setFillAndStrokeStyleToContext(graphics, paintType, color);\n var adjustedX0 = x0;\n var adjustedY0 = y0;\n var adjustedX1 = x1;\n var adjustedY1 = y1;\n\n if (x0 < 0) {\n adjustedX0 = 0;\n adjustedX1 += Math.abs(x0);\n }\n\n if (y0 < 0) {\n adjustedY0 = 0;\n adjustedY1 += Math.abs(y0);\n }\n\n tmpCtx.translate(-(dimx.scale * adjustedX0), -(dimy.scale * adjustedY0));\n graphics.transform(dimx.scale, 0, 0, dimy.scale, 0, 0);\n tmpCtx.save();\n this.clipBbox(graphics, adjustedX0, adjustedY0, adjustedX1, adjustedY1);\n graphics.baseTransform = graphics.ctx.mozCurrentTransform.slice();\n graphics.executeOperatorList(operatorList);\n graphics.endDrawing();\n return {\n canvas: tmpCanvas.canvas,\n scaleX: dimx.scale,\n scaleY: dimy.scale,\n offsetX: adjustedX0,\n offsetY: adjustedY0\n };\n }\n }, {\n key: \"getSizeAndScale\",\n value: function getSizeAndScale(step, realOutputSize, scale) {\n step = Math.abs(step);\n var maxSize = Math.max(TilingPattern.MAX_PATTERN_SIZE, realOutputSize);\n var size = Math.ceil(step * scale);\n\n if (size >= maxSize) {\n size = maxSize;\n } else {\n scale = size / step;\n }\n\n return {\n scale: scale,\n size: size\n };\n }\n }, {\n key: \"clipBbox\",\n value: function clipBbox(graphics, x0, y0, x1, y1) {\n var bboxWidth = x1 - x0;\n var bboxHeight = y1 - y0;\n graphics.ctx.rect(x0, y0, bboxWidth, bboxHeight);\n graphics.clip();\n graphics.endPath();\n }\n }, {\n key: \"setFillAndStrokeStyleToContext\",\n value: function setFillAndStrokeStyleToContext(graphics, paintType, color) {\n var context = graphics.ctx,\n current = graphics.current;\n\n switch (paintType) {\n case PaintType.COLORED:\n var ctx = this.ctx;\n context.fillStyle = ctx.fillStyle;\n context.strokeStyle = ctx.strokeStyle;\n current.fillColor = ctx.fillStyle;\n current.strokeColor = ctx.strokeStyle;\n break;\n\n case PaintType.UNCOLORED:\n var cssColor = _util.Util.makeHexColor(color[0], color[1], color[2]);\n\n context.fillStyle = cssColor;\n context.strokeStyle = cssColor;\n current.fillColor = cssColor;\n current.strokeColor = cssColor;\n break;\n\n default:\n throw new _util.FormatError(\"Unsupported paint type: \".concat(paintType));\n }\n }\n }, {\n key: \"getPattern\",\n value: function getPattern(ctx, owner, inverse, pathType) {\n var matrix = inverse;\n\n if (pathType !== PathType.SHADING) {\n matrix = _util.Util.transform(matrix, owner.baseTransform);\n\n if (this.matrix) {\n matrix = _util.Util.transform(matrix, this.matrix);\n }\n }\n\n var temporaryPatternCanvas = this.createPatternCanvas(owner);\n var domMatrix = new DOMMatrix(matrix);\n domMatrix = domMatrix.translate(temporaryPatternCanvas.offsetX, temporaryPatternCanvas.offsetY);\n domMatrix = domMatrix.scale(1 / temporaryPatternCanvas.scaleX, 1 / temporaryPatternCanvas.scaleY);\n var pattern = ctx.createPattern(temporaryPatternCanvas.canvas, \"repeat\");\n\n try {\n pattern.setTransform(domMatrix);\n } catch (ex) {\n (0, _util.warn)(\"TilingPattern.getPattern: \\\"\".concat(ex === null || ex === void 0 ? void 0 : ex.message, \"\\\".\"));\n }\n\n return pattern;\n }\n }], [{\n key: \"MAX_PATTERN_SIZE\",\n get: function get() {\n return (0, _util.shadow)(this, \"MAX_PATTERN_SIZE\", 3000);\n }\n }]);\n\n return TilingPattern;\n}();\n\nexports.TilingPattern = TilingPattern;\n\n/***/ }),\n/* 154 */\n/***/ ((__unused_webpack_module, exports) => {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.GlobalWorkerOptions = void 0;\nvar GlobalWorkerOptions = Object.create(null);\nexports.GlobalWorkerOptions = GlobalWorkerOptions;\nGlobalWorkerOptions.workerPort = GlobalWorkerOptions.workerPort === undefined ? null : GlobalWorkerOptions.workerPort;\nGlobalWorkerOptions.workerSrc = GlobalWorkerOptions.workerSrc === undefined ? \"\" : GlobalWorkerOptions.workerSrc;\n\n/***/ }),\n/* 155 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.MessageHandler = void 0;\n\nvar _regenerator = _interopRequireDefault(__w_pdfjs_require__(145));\n\nvar _util = __w_pdfjs_require__(1);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction 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); } }\n\nfunction _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); }); }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _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); }\n\nvar CallbackKind = {\n UNKNOWN: 0,\n DATA: 1,\n ERROR: 2\n};\nvar StreamKind = {\n UNKNOWN: 0,\n CANCEL: 1,\n CANCEL_COMPLETE: 2,\n CLOSE: 3,\n ENQUEUE: 4,\n ERROR: 5,\n PULL: 6,\n PULL_COMPLETE: 7,\n START_COMPLETE: 8\n};\n\nfunction wrapReason(reason) {\n if (!(reason instanceof Error || _typeof(reason) === \"object\" && reason !== null)) {\n (0, _util.unreachable)('wrapReason: Expected \"reason\" to be a (possibly cloned) Error.');\n }\n\n switch (reason.name) {\n case \"AbortException\":\n return new _util.AbortException(reason.message);\n\n case \"MissingPDFException\":\n return new _util.MissingPDFException(reason.message);\n\n case \"PasswordException\":\n return new _util.PasswordException(reason.message, reason.code);\n\n case \"UnexpectedResponseException\":\n return new _util.UnexpectedResponseException(reason.message, reason.status);\n\n case \"UnknownErrorException\":\n return new _util.UnknownErrorException(reason.message, reason.details);\n\n default:\n return new _util.UnknownErrorException(reason.message, reason.toString());\n }\n}\n\nvar MessageHandler = /*#__PURE__*/function () {\n function MessageHandler(sourceName, targetName, comObj) {\n var _this = this;\n\n _classCallCheck(this, MessageHandler);\n\n this.sourceName = sourceName;\n this.targetName = targetName;\n this.comObj = comObj;\n this.callbackId = 1;\n this.streamId = 1;\n this.streamSinks = Object.create(null);\n this.streamControllers = Object.create(null);\n this.callbackCapabilities = Object.create(null);\n this.actionHandler = Object.create(null);\n\n this._onComObjOnMessage = function (event) {\n var data = event.data;\n\n if (data.targetName !== _this.sourceName) {\n return;\n }\n\n if (data.stream) {\n _this._processStreamMessage(data);\n\n return;\n }\n\n if (data.callback) {\n var callbackId = data.callbackId;\n var capability = _this.callbackCapabilities[callbackId];\n\n if (!capability) {\n throw new Error(\"Cannot resolve callback \".concat(callbackId));\n }\n\n delete _this.callbackCapabilities[callbackId];\n\n if (data.callback === CallbackKind.DATA) {\n capability.resolve(data.data);\n } else if (data.callback === CallbackKind.ERROR) {\n capability.reject(wrapReason(data.reason));\n } else {\n throw new Error(\"Unexpected callback case\");\n }\n\n return;\n }\n\n var action = _this.actionHandler[data.action];\n\n if (!action) {\n throw new Error(\"Unknown action from worker: \".concat(data.action));\n }\n\n if (data.callbackId) {\n var cbSourceName = _this.sourceName;\n var cbTargetName = data.sourceName;\n new Promise(function (resolve) {\n resolve(action(data.data));\n }).then(function (result) {\n comObj.postMessage({\n sourceName: cbSourceName,\n targetName: cbTargetName,\n callback: CallbackKind.DATA,\n callbackId: data.callbackId,\n data: result\n });\n }, function (reason) {\n comObj.postMessage({\n sourceName: cbSourceName,\n targetName: cbTargetName,\n callback: CallbackKind.ERROR,\n callbackId: data.callbackId,\n reason: wrapReason(reason)\n });\n });\n return;\n }\n\n if (data.streamId) {\n _this._createStreamSink(data);\n\n return;\n }\n\n action(data.data);\n };\n\n comObj.addEventListener(\"message\", this._onComObjOnMessage);\n }\n\n _createClass(MessageHandler, [{\n key: \"on\",\n value: function on(actionName, handler) {\n var ah = this.actionHandler;\n\n if (ah[actionName]) {\n throw new Error(\"There is already an actionName called \\\"\".concat(actionName, \"\\\"\"));\n }\n\n ah[actionName] = handler;\n }\n }, {\n key: \"send\",\n value: function send(actionName, data, transfers) {\n this.comObj.postMessage({\n sourceName: this.sourceName,\n targetName: this.targetName,\n action: actionName,\n data: data\n }, transfers);\n }\n }, {\n key: \"sendWithPromise\",\n value: function sendWithPromise(actionName, data, transfers) {\n var callbackId = this.callbackId++;\n var capability = (0, _util.createPromiseCapability)();\n this.callbackCapabilities[callbackId] = capability;\n\n try {\n this.comObj.postMessage({\n sourceName: this.sourceName,\n targetName: this.targetName,\n action: actionName,\n callbackId: callbackId,\n data: data\n }, transfers);\n } catch (ex) {\n capability.reject(ex);\n }\n\n return capability.promise;\n }\n }, {\n key: \"sendWithStream\",\n value: function sendWithStream(actionName, data, queueingStrategy, transfers) {\n var _this2 = this;\n\n var streamId = this.streamId++,\n sourceName = this.sourceName,\n targetName = this.targetName,\n comObj = this.comObj;\n return new ReadableStream({\n start: function start(controller) {\n var startCapability = (0, _util.createPromiseCapability)();\n _this2.streamControllers[streamId] = {\n controller: controller,\n startCall: startCapability,\n pullCall: null,\n cancelCall: null,\n isClosed: false\n };\n comObj.postMessage({\n sourceName: sourceName,\n targetName: targetName,\n action: actionName,\n streamId: streamId,\n data: data,\n desiredSize: controller.desiredSize\n }, transfers);\n return startCapability.promise;\n },\n pull: function pull(controller) {\n var pullCapability = (0, _util.createPromiseCapability)();\n _this2.streamControllers[streamId].pullCall = pullCapability;\n comObj.postMessage({\n sourceName: sourceName,\n targetName: targetName,\n stream: StreamKind.PULL,\n streamId: streamId,\n desiredSize: controller.desiredSize\n });\n return pullCapability.promise;\n },\n cancel: function cancel(reason) {\n (0, _util.assert)(reason instanceof Error, \"cancel must have a valid reason\");\n var cancelCapability = (0, _util.createPromiseCapability)();\n _this2.streamControllers[streamId].cancelCall = cancelCapability;\n _this2.streamControllers[streamId].isClosed = true;\n comObj.postMessage({\n sourceName: sourceName,\n targetName: targetName,\n stream: StreamKind.CANCEL,\n streamId: streamId,\n reason: wrapReason(reason)\n });\n return cancelCapability.promise;\n }\n }, queueingStrategy);\n }\n }, {\n key: \"_createStreamSink\",\n value: function _createStreamSink(data) {\n var streamId = data.streamId,\n sourceName = this.sourceName,\n targetName = data.sourceName,\n comObj = this.comObj;\n var self = this,\n action = this.actionHandler[data.action];\n var streamSink = {\n enqueue: function enqueue(chunk) {\n var size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n var transfers = arguments.length > 2 ? arguments[2] : undefined;\n\n if (this.isCancelled) {\n return;\n }\n\n var lastDesiredSize = this.desiredSize;\n this.desiredSize -= size;\n\n if (lastDesiredSize > 0 && this.desiredSize <= 0) {\n this.sinkCapability = (0, _util.createPromiseCapability)();\n this.ready = this.sinkCapability.promise;\n }\n\n comObj.postMessage({\n sourceName: sourceName,\n targetName: targetName,\n stream: StreamKind.ENQUEUE,\n streamId: streamId,\n chunk: chunk\n }, transfers);\n },\n close: function close() {\n if (this.isCancelled) {\n return;\n }\n\n this.isCancelled = true;\n comObj.postMessage({\n sourceName: sourceName,\n targetName: targetName,\n stream: StreamKind.CLOSE,\n streamId: streamId\n });\n delete self.streamSinks[streamId];\n },\n error: function error(reason) {\n (0, _util.assert)(reason instanceof Error, \"error must have a valid reason\");\n\n if (this.isCancelled) {\n return;\n }\n\n this.isCancelled = true;\n comObj.postMessage({\n sourceName: sourceName,\n targetName: targetName,\n stream: StreamKind.ERROR,\n streamId: streamId,\n reason: wrapReason(reason)\n });\n },\n sinkCapability: (0, _util.createPromiseCapability)(),\n onPull: null,\n onCancel: null,\n isCancelled: false,\n desiredSize: data.desiredSize,\n ready: null\n };\n streamSink.sinkCapability.resolve();\n streamSink.ready = streamSink.sinkCapability.promise;\n this.streamSinks[streamId] = streamSink;\n new Promise(function (resolve) {\n resolve(action(data.data, streamSink));\n }).then(function () {\n comObj.postMessage({\n sourceName: sourceName,\n targetName: targetName,\n stream: StreamKind.START_COMPLETE,\n streamId: streamId,\n success: true\n });\n }, function (reason) {\n comObj.postMessage({\n sourceName: sourceName,\n targetName: targetName,\n stream: StreamKind.START_COMPLETE,\n streamId: streamId,\n reason: wrapReason(reason)\n });\n });\n }\n }, {\n key: \"_processStreamMessage\",\n value: function _processStreamMessage(data) {\n var streamId = data.streamId,\n sourceName = this.sourceName,\n targetName = data.sourceName,\n comObj = this.comObj;\n var streamController = this.streamControllers[streamId],\n streamSink = this.streamSinks[streamId];\n\n switch (data.stream) {\n case StreamKind.START_COMPLETE:\n if (data.success) {\n streamController.startCall.resolve();\n } else {\n streamController.startCall.reject(wrapReason(data.reason));\n }\n\n break;\n\n case StreamKind.PULL_COMPLETE:\n if (data.success) {\n streamController.pullCall.resolve();\n } else {\n streamController.pullCall.reject(wrapReason(data.reason));\n }\n\n break;\n\n case StreamKind.PULL:\n if (!streamSink) {\n comObj.postMessage({\n sourceName: sourceName,\n targetName: targetName,\n stream: StreamKind.PULL_COMPLETE,\n streamId: streamId,\n success: true\n });\n break;\n }\n\n if (streamSink.desiredSize <= 0 && data.desiredSize > 0) {\n streamSink.sinkCapability.resolve();\n }\n\n streamSink.desiredSize = data.desiredSize;\n new Promise(function (resolve) {\n resolve(streamSink.onPull && streamSink.onPull());\n }).then(function () {\n comObj.postMessage({\n sourceName: sourceName,\n targetName: targetName,\n stream: StreamKind.PULL_COMPLETE,\n streamId: streamId,\n success: true\n });\n }, function (reason) {\n comObj.postMessage({\n sourceName: sourceName,\n targetName: targetName,\n stream: StreamKind.PULL_COMPLETE,\n streamId: streamId,\n reason: wrapReason(reason)\n });\n });\n break;\n\n case StreamKind.ENQUEUE:\n (0, _util.assert)(streamController, \"enqueue should have stream controller\");\n\n if (streamController.isClosed) {\n break;\n }\n\n streamController.controller.enqueue(data.chunk);\n break;\n\n case StreamKind.CLOSE:\n (0, _util.assert)(streamController, \"close should have stream controller\");\n\n if (streamController.isClosed) {\n break;\n }\n\n streamController.isClosed = true;\n streamController.controller.close();\n\n this._deleteStreamController(streamController, streamId);\n\n break;\n\n case StreamKind.ERROR:\n (0, _util.assert)(streamController, \"error should have stream controller\");\n streamController.controller.error(wrapReason(data.reason));\n\n this._deleteStreamController(streamController, streamId);\n\n break;\n\n case StreamKind.CANCEL_COMPLETE:\n if (data.success) {\n streamController.cancelCall.resolve();\n } else {\n streamController.cancelCall.reject(wrapReason(data.reason));\n }\n\n this._deleteStreamController(streamController, streamId);\n\n break;\n\n case StreamKind.CANCEL:\n if (!streamSink) {\n break;\n }\n\n new Promise(function (resolve) {\n resolve(streamSink.onCancel && streamSink.onCancel(wrapReason(data.reason)));\n }).then(function () {\n comObj.postMessage({\n sourceName: sourceName,\n targetName: targetName,\n stream: StreamKind.CANCEL_COMPLETE,\n streamId: streamId,\n success: true\n });\n }, function (reason) {\n comObj.postMessage({\n sourceName: sourceName,\n targetName: targetName,\n stream: StreamKind.CANCEL_COMPLETE,\n streamId: streamId,\n reason: wrapReason(reason)\n });\n });\n streamSink.sinkCapability.reject(wrapReason(data.reason));\n streamSink.isCancelled = true;\n delete this.streamSinks[streamId];\n break;\n\n default:\n throw new Error(\"Unexpected stream case\");\n }\n }\n }, {\n key: \"_deleteStreamController\",\n value: function () {\n var _deleteStreamController2 = _asyncToGenerator( /*#__PURE__*/_regenerator[\"default\"].mark(function _callee(streamController, streamId) {\n return _regenerator[\"default\"].wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return Promise.allSettled([streamController.startCall && streamController.startCall.promise, streamController.pullCall && streamController.pullCall.promise, streamController.cancelCall && streamController.cancelCall.promise]);\n\n case 2:\n delete this.streamControllers[streamId];\n\n case 3:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n\n function _deleteStreamController(_x, _x2) {\n return _deleteStreamController2.apply(this, arguments);\n }\n\n return _deleteStreamController;\n }()\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.comObj.removeEventListener(\"message\", this._onComObjOnMessage);\n }\n }]);\n\n return MessageHandler;\n}();\n\nexports.MessageHandler = MessageHandler;\n\n/***/ }),\n/* 156 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.Metadata = void 0;\n\nvar _util = __w_pdfjs_require__(1);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }\n\nfunction _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError(\"Cannot initialize the same private elements twice on an object\"); } }\n\nfunction _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, \"get\"); return _classApplyDescriptorGet(receiver, descriptor); }\n\nfunction _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }\n\nfunction _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, \"set\"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }\n\nfunction _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError(\"attempted to \" + action + \" private field on non-instance\"); } return privateMap.get(receiver); }\n\nfunction _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError(\"attempted to set read only private field\"); } descriptor.value = value; } }\n\nvar _metadataMap = /*#__PURE__*/new WeakMap();\n\nvar _data = /*#__PURE__*/new WeakMap();\n\nvar Metadata = /*#__PURE__*/function () {\n function Metadata(_ref) {\n var parsedData = _ref.parsedData,\n rawData = _ref.rawData;\n\n _classCallCheck(this, Metadata);\n\n _classPrivateFieldInitSpec(this, _metadataMap, {\n writable: true,\n value: void 0\n });\n\n _classPrivateFieldInitSpec(this, _data, {\n writable: true,\n value: void 0\n });\n\n _classPrivateFieldSet(this, _metadataMap, parsedData);\n\n _classPrivateFieldSet(this, _data, rawData);\n }\n\n _createClass(Metadata, [{\n key: \"getRaw\",\n value: function getRaw() {\n return _classPrivateFieldGet(this, _data);\n }\n }, {\n key: \"get\",\n value: function get(name) {\n var _classPrivateFieldGet2;\n\n return (_classPrivateFieldGet2 = _classPrivateFieldGet(this, _metadataMap).get(name)) !== null && _classPrivateFieldGet2 !== void 0 ? _classPrivateFieldGet2 : null;\n }\n }, {\n key: \"getAll\",\n value: function getAll() {\n return (0, _util.objectFromMap)(_classPrivateFieldGet(this, _metadataMap));\n }\n }, {\n key: \"has\",\n value: function has(name) {\n return _classPrivateFieldGet(this, _metadataMap).has(name);\n }\n }]);\n\n return Metadata;\n}();\n\nexports.Metadata = Metadata;\n\n/***/ }),\n/* 157 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.OptionalContentConfig = void 0;\n\nvar _util = __w_pdfjs_require__(1);\n\nfunction _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; } } }; }\n\nfunction _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); }\n\nfunction _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; }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar OptionalContentGroup = /*#__PURE__*/_createClass(function OptionalContentGroup(name, intent) {\n _classCallCheck(this, OptionalContentGroup);\n\n this.visible = true;\n this.name = name;\n this.intent = intent;\n});\n\nvar OptionalContentConfig = /*#__PURE__*/function () {\n function OptionalContentConfig(data) {\n _classCallCheck(this, OptionalContentConfig);\n\n this.name = null;\n this.creator = null;\n this._order = null;\n this._groups = new Map();\n\n if (data === null) {\n return;\n }\n\n this.name = data.name;\n this.creator = data.creator;\n this._order = data.order;\n\n var _iterator = _createForOfIteratorHelper(data.groups),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var _group = _step.value;\n\n this._groups.set(_group.id, new OptionalContentGroup(_group.name, _group.intent));\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n if (data.baseState === \"OFF\") {\n var _iterator2 = _createForOfIteratorHelper(this._groups),\n _step2;\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var group = _step2.value;\n group.visible = false;\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n }\n\n var _iterator3 = _createForOfIteratorHelper(data.on),\n _step3;\n\n try {\n for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n var on = _step3.value;\n this._groups.get(on).visible = true;\n }\n } catch (err) {\n _iterator3.e(err);\n } finally {\n _iterator3.f();\n }\n\n var _iterator4 = _createForOfIteratorHelper(data.off),\n _step4;\n\n try {\n for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {\n var off = _step4.value;\n this._groups.get(off).visible = false;\n }\n } catch (err) {\n _iterator4.e(err);\n } finally {\n _iterator4.f();\n }\n }\n\n _createClass(OptionalContentConfig, [{\n key: \"_evaluateVisibilityExpression\",\n value: function _evaluateVisibilityExpression(array) {\n var length = array.length;\n\n if (length < 2) {\n return true;\n }\n\n var operator = array[0];\n\n for (var i = 1; i < length; i++) {\n var element = array[i];\n var state = void 0;\n\n if (Array.isArray(element)) {\n state = this._evaluateVisibilityExpression(element);\n } else if (this._groups.has(element)) {\n state = this._groups.get(element).visible;\n } else {\n (0, _util.warn)(\"Optional content group not found: \".concat(element));\n return true;\n }\n\n switch (operator) {\n case \"And\":\n if (!state) {\n return false;\n }\n\n break;\n\n case \"Or\":\n if (state) {\n return true;\n }\n\n break;\n\n case \"Not\":\n return !state;\n\n default:\n return true;\n }\n }\n\n return operator === \"And\";\n }\n }, {\n key: \"isVisible\",\n value: function isVisible(group) {\n if (this._groups.size === 0) {\n return true;\n }\n\n if (!group) {\n (0, _util.warn)(\"Optional content group not defined.\");\n return true;\n }\n\n if (group.type === \"OCG\") {\n if (!this._groups.has(group.id)) {\n (0, _util.warn)(\"Optional content group not found: \".concat(group.id));\n return true;\n }\n\n return this._groups.get(group.id).visible;\n } else if (group.type === \"OCMD\") {\n if (group.expression) {\n return this._evaluateVisibilityExpression(group.expression);\n }\n\n if (!group.policy || group.policy === \"AnyOn\") {\n var _iterator5 = _createForOfIteratorHelper(group.ids),\n _step5;\n\n try {\n for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {\n var id = _step5.value;\n\n if (!this._groups.has(id)) {\n (0, _util.warn)(\"Optional content group not found: \".concat(id));\n return true;\n }\n\n if (this._groups.get(id).visible) {\n return true;\n }\n }\n } catch (err) {\n _iterator5.e(err);\n } finally {\n _iterator5.f();\n }\n\n return false;\n } else if (group.policy === \"AllOn\") {\n var _iterator6 = _createForOfIteratorHelper(group.ids),\n _step6;\n\n try {\n for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {\n var _id = _step6.value;\n\n if (!this._groups.has(_id)) {\n (0, _util.warn)(\"Optional content group not found: \".concat(_id));\n return true;\n }\n\n if (!this._groups.get(_id).visible) {\n return false;\n }\n }\n } catch (err) {\n _iterator6.e(err);\n } finally {\n _iterator6.f();\n }\n\n return true;\n } else if (group.policy === \"AnyOff\") {\n var _iterator7 = _createForOfIteratorHelper(group.ids),\n _step7;\n\n try {\n for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {\n var _id2 = _step7.value;\n\n if (!this._groups.has(_id2)) {\n (0, _util.warn)(\"Optional content group not found: \".concat(_id2));\n return true;\n }\n\n if (!this._groups.get(_id2).visible) {\n return true;\n }\n }\n } catch (err) {\n _iterator7.e(err);\n } finally {\n _iterator7.f();\n }\n\n return false;\n } else if (group.policy === \"AllOff\") {\n var _iterator8 = _createForOfIteratorHelper(group.ids),\n _step8;\n\n try {\n for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {\n var _id3 = _step8.value;\n\n if (!this._groups.has(_id3)) {\n (0, _util.warn)(\"Optional content group not found: \".concat(_id3));\n return true;\n }\n\n if (this._groups.get(_id3).visible) {\n return false;\n }\n }\n } catch (err) {\n _iterator8.e(err);\n } finally {\n _iterator8.f();\n }\n\n return true;\n }\n\n (0, _util.warn)(\"Unknown optional content policy \".concat(group.policy, \".\"));\n return true;\n }\n\n (0, _util.warn)(\"Unknown group type \".concat(group.type, \".\"));\n return true;\n }\n }, {\n key: \"setVisibility\",\n value: function setVisibility(id) {\n var visible = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n\n if (!this._groups.has(id)) {\n (0, _util.warn)(\"Optional content group not found: \".concat(id));\n return;\n }\n\n this._groups.get(id).visible = !!visible;\n }\n }, {\n key: \"getOrder\",\n value: function getOrder() {\n if (!this._groups.size) {\n return null;\n }\n\n if (this._order) {\n return this._order.slice();\n }\n\n return Array.from(this._groups.keys());\n }\n }, {\n key: \"getGroups\",\n value: function getGroups() {\n return this._groups.size > 0 ? (0, _util.objectFromMap)(this._groups) : null;\n }\n }, {\n key: \"getGroup\",\n value: function getGroup(id) {\n return this._groups.get(id) || null;\n }\n }]);\n\n return OptionalContentConfig;\n}();\n\nexports.OptionalContentConfig = OptionalContentConfig;\n\n/***/ }),\n/* 158 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.PDFDataTransportStream = void 0;\n\nvar _regenerator = _interopRequireDefault(__w_pdfjs_require__(145));\n\nvar _util = __w_pdfjs_require__(1);\n\nvar _display_utils = __w_pdfjs_require__(147);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction 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); } }\n\nfunction _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); }); }; }\n\nfunction _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; } } }; }\n\nfunction _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); }\n\nfunction _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; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nvar PDFDataTransportStream = /*#__PURE__*/function () {\n function PDFDataTransportStream(params, pdfDataRangeTransport) {\n var _this = this;\n\n _classCallCheck(this, PDFDataTransportStream);\n\n (0, _util.assert)(pdfDataRangeTransport, 'PDFDataTransportStream - missing required \"pdfDataRangeTransport\" argument.');\n this._queuedChunks = [];\n this._progressiveDone = params.progressiveDone || false;\n this._contentDispositionFilename = params.contentDispositionFilename || null;\n var initialData = params.initialData;\n\n if ((initialData === null || initialData === void 0 ? void 0 : initialData.length) > 0) {\n var buffer = new Uint8Array(initialData).buffer;\n\n this._queuedChunks.push(buffer);\n }\n\n this._pdfDataRangeTransport = pdfDataRangeTransport;\n this._isStreamingSupported = !params.disableStream;\n this._isRangeSupported = !params.disableRange;\n this._contentLength = params.length;\n this._fullRequestReader = null;\n this._rangeReaders = [];\n\n this._pdfDataRangeTransport.addRangeListener(function (begin, chunk) {\n _this._onReceiveData({\n begin: begin,\n chunk: chunk\n });\n });\n\n this._pdfDataRangeTransport.addProgressListener(function (loaded, total) {\n _this._onProgress({\n loaded: loaded,\n total: total\n });\n });\n\n this._pdfDataRangeTransport.addProgressiveReadListener(function (chunk) {\n _this._onReceiveData({\n chunk: chunk\n });\n });\n\n this._pdfDataRangeTransport.addProgressiveDoneListener(function () {\n _this._onProgressiveDone();\n });\n\n this._pdfDataRangeTransport.transportReady();\n }\n\n _createClass(PDFDataTransportStream, [{\n key: \"_onReceiveData\",\n value: function _onReceiveData(args) {\n var buffer = new Uint8Array(args.chunk).buffer;\n\n if (args.begin === undefined) {\n if (this._fullRequestReader) {\n this._fullRequestReader._enqueue(buffer);\n } else {\n this._queuedChunks.push(buffer);\n }\n } else {\n var found = this._rangeReaders.some(function (rangeReader) {\n if (rangeReader._begin !== args.begin) {\n return false;\n }\n\n rangeReader._enqueue(buffer);\n\n return true;\n });\n\n (0, _util.assert)(found, \"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.\");\n }\n }\n }, {\n key: \"_progressiveDataLength\",\n get: function get() {\n var _this$_fullRequestRea, _this$_fullRequestRea2;\n\n 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;\n }\n }, {\n key: \"_onProgress\",\n value: function _onProgress(evt) {\n if (evt.total === undefined) {\n var firstReader = this._rangeReaders[0];\n\n if (firstReader !== null && firstReader !== void 0 && firstReader.onProgress) {\n firstReader.onProgress({\n loaded: evt.loaded\n });\n }\n } else {\n var fullReader = this._fullRequestReader;\n\n if (fullReader !== null && fullReader !== void 0 && fullReader.onProgress) {\n fullReader.onProgress({\n loaded: evt.loaded,\n total: evt.total\n });\n }\n }\n }\n }, {\n key: \"_onProgressiveDone\",\n value: function _onProgressiveDone() {\n if (this._fullRequestReader) {\n this._fullRequestReader.progressiveDone();\n }\n\n this._progressiveDone = true;\n }\n }, {\n key: \"_removeRangeReader\",\n value: function _removeRangeReader(reader) {\n var i = this._rangeReaders.indexOf(reader);\n\n if (i >= 0) {\n this._rangeReaders.splice(i, 1);\n }\n }\n }, {\n key: \"getFullReader\",\n value: function getFullReader() {\n (0, _util.assert)(!this._fullRequestReader, \"PDFDataTransportStream.getFullReader can only be called once.\");\n var queuedChunks = this._queuedChunks;\n this._queuedChunks = null;\n return new PDFDataTransportStreamReader(this, queuedChunks, this._progressiveDone, this._contentDispositionFilename);\n }\n }, {\n key: \"getRangeReader\",\n value: function getRangeReader(begin, end) {\n if (end <= this._progressiveDataLength) {\n return null;\n }\n\n var reader = new PDFDataTransportStreamRangeReader(this, begin, end);\n\n this._pdfDataRangeTransport.requestDataRange(begin, end);\n\n this._rangeReaders.push(reader);\n\n return reader;\n }\n }, {\n key: \"cancelAllRequests\",\n value: function cancelAllRequests(reason) {\n if (this._fullRequestReader) {\n this._fullRequestReader.cancel(reason);\n }\n\n var _iterator = _createForOfIteratorHelper(this._rangeReaders.slice(0)),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var reader = _step.value;\n reader.cancel(reason);\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n this._pdfDataRangeTransport.abort();\n }\n }]);\n\n return PDFDataTransportStream;\n}();\n\nexports.PDFDataTransportStream = PDFDataTransportStream;\n\nvar PDFDataTransportStreamReader = /*#__PURE__*/function () {\n function PDFDataTransportStreamReader(stream, queuedChunks) {\n var progressiveDone = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var contentDispositionFilename = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;\n\n _classCallCheck(this, PDFDataTransportStreamReader);\n\n this._stream = stream;\n this._done = progressiveDone || false;\n this._filename = (0, _display_utils.isPdfFile)(contentDispositionFilename) ? contentDispositionFilename : null;\n this._queuedChunks = queuedChunks || [];\n this._loaded = 0;\n\n var _iterator2 = _createForOfIteratorHelper(this._queuedChunks),\n _step2;\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var chunk = _step2.value;\n this._loaded += chunk.byteLength;\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n\n this._requests = [];\n this._headersReady = Promise.resolve();\n stream._fullRequestReader = this;\n this.onProgress = null;\n }\n\n _createClass(PDFDataTransportStreamReader, [{\n key: \"_enqueue\",\n value: function _enqueue(chunk) {\n if (this._done) {\n return;\n }\n\n if (this._requests.length > 0) {\n var requestCapability = this._requests.shift();\n\n requestCapability.resolve({\n value: chunk,\n done: false\n });\n } else {\n this._queuedChunks.push(chunk);\n }\n\n this._loaded += chunk.byteLength;\n }\n }, {\n key: \"headersReady\",\n get: function get() {\n return this._headersReady;\n }\n }, {\n key: \"filename\",\n get: function get() {\n return this._filename;\n }\n }, {\n key: \"isRangeSupported\",\n get: function get() {\n return this._stream._isRangeSupported;\n }\n }, {\n key: \"isStreamingSupported\",\n get: function get() {\n return this._stream._isStreamingSupported;\n }\n }, {\n key: \"contentLength\",\n get: function get() {\n return this._stream._contentLength;\n }\n }, {\n key: \"read\",\n value: function () {\n var _read = _asyncToGenerator( /*#__PURE__*/_regenerator[\"default\"].mark(function _callee() {\n var chunk, requestCapability;\n return _regenerator[\"default\"].wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n if (!(this._queuedChunks.length > 0)) {\n _context.next = 3;\n break;\n }\n\n chunk = this._queuedChunks.shift();\n return _context.abrupt(\"return\", {\n value: chunk,\n done: false\n });\n\n case 3:\n if (!this._done) {\n _context.next = 5;\n break;\n }\n\n return _context.abrupt(\"return\", {\n value: undefined,\n done: true\n });\n\n case 5:\n requestCapability = (0, _util.createPromiseCapability)();\n\n this._requests.push(requestCapability);\n\n return _context.abrupt(\"return\", requestCapability.promise);\n\n case 8:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n\n function read() {\n return _read.apply(this, arguments);\n }\n\n return read;\n }()\n }, {\n key: \"cancel\",\n value: function cancel(reason) {\n this._done = true;\n\n var _iterator3 = _createForOfIteratorHelper(this._requests),\n _step3;\n\n try {\n for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n var requestCapability = _step3.value;\n requestCapability.resolve({\n value: undefined,\n done: true\n });\n }\n } catch (err) {\n _iterator3.e(err);\n } finally {\n _iterator3.f();\n }\n\n this._requests.length = 0;\n }\n }, {\n key: \"progressiveDone\",\n value: function progressiveDone() {\n if (this._done) {\n return;\n }\n\n this._done = true;\n }\n }]);\n\n return PDFDataTransportStreamReader;\n}();\n\nvar PDFDataTransportStreamRangeReader = /*#__PURE__*/function () {\n function PDFDataTransportStreamRangeReader(stream, begin, end) {\n _classCallCheck(this, PDFDataTransportStreamRangeReader);\n\n this._stream = stream;\n this._begin = begin;\n this._end = end;\n this._queuedChunk = null;\n this._requests = [];\n this._done = false;\n this.onProgress = null;\n }\n\n _createClass(PDFDataTransportStreamRangeReader, [{\n key: \"_enqueue\",\n value: function _enqueue(chunk) {\n if (this._done) {\n return;\n }\n\n if (this._requests.length === 0) {\n this._queuedChunk = chunk;\n } else {\n var requestsCapability = this._requests.shift();\n\n requestsCapability.resolve({\n value: chunk,\n done: false\n });\n\n var _iterator4 = _createForOfIteratorHelper(this._requests),\n _step4;\n\n try {\n for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {\n var requestCapability = _step4.value;\n requestCapability.resolve({\n value: undefined,\n done: true\n });\n }\n } catch (err) {\n _iterator4.e(err);\n } finally {\n _iterator4.f();\n }\n\n this._requests.length = 0;\n }\n\n this._done = true;\n\n this._stream._removeRangeReader(this);\n }\n }, {\n key: \"isStreamingSupported\",\n get: function get() {\n return false;\n }\n }, {\n key: \"read\",\n value: function () {\n var _read2 = _asyncToGenerator( /*#__PURE__*/_regenerator[\"default\"].mark(function _callee2() {\n var chunk, requestCapability;\n return _regenerator[\"default\"].wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n if (!this._queuedChunk) {\n _context2.next = 4;\n break;\n }\n\n chunk = this._queuedChunk;\n this._queuedChunk = null;\n return _context2.abrupt(\"return\", {\n value: chunk,\n done: false\n });\n\n case 4:\n if (!this._done) {\n _context2.next = 6;\n break;\n }\n\n return _context2.abrupt(\"return\", {\n value: undefined,\n done: true\n });\n\n case 6:\n requestCapability = (0, _util.createPromiseCapability)();\n\n this._requests.push(requestCapability);\n\n return _context2.abrupt(\"return\", requestCapability.promise);\n\n case 9:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2, this);\n }));\n\n function read() {\n return _read2.apply(this, arguments);\n }\n\n return read;\n }()\n }, {\n key: \"cancel\",\n value: function cancel(reason) {\n this._done = true;\n\n var _iterator5 = _createForOfIteratorHelper(this._requests),\n _step5;\n\n try {\n for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {\n var requestCapability = _step5.value;\n requestCapability.resolve({\n value: undefined,\n done: true\n });\n }\n } catch (err) {\n _iterator5.e(err);\n } finally {\n _iterator5.f();\n }\n\n this._requests.length = 0;\n\n this._stream._removeRangeReader(this);\n }\n }]);\n\n return PDFDataTransportStreamRangeReader;\n}();\n\n/***/ }),\n/* 159 */\n/***/ ((__unused_webpack_module, exports) => {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.XfaText = void 0;\n\nfunction _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; } } }; }\n\nfunction _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); }\n\nfunction _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; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nvar XfaText = /*#__PURE__*/function () {\n function XfaText() {\n _classCallCheck(this, XfaText);\n }\n\n _createClass(XfaText, null, [{\n key: \"textContent\",\n value: function textContent(xfa) {\n var items = [];\n var output = {\n items: items,\n styles: Object.create(null)\n };\n\n function walk(node) {\n var _node$attributes;\n\n if (!node) {\n return;\n }\n\n var str = null;\n var name = node.name;\n\n if (name === \"#text\") {\n str = node.value;\n } else if (!XfaText.shouldBuildText(name)) {\n return;\n } else if (node !== null && node !== void 0 && (_node$attributes = node.attributes) !== null && _node$attributes !== void 0 && _node$attributes.textContent) {\n str = node.attributes.textContent;\n } else if (node.value) {\n str = node.value;\n }\n\n if (str !== null) {\n items.push({\n str: str\n });\n }\n\n if (!node.children) {\n return;\n }\n\n var _iterator = _createForOfIteratorHelper(node.children),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var child = _step.value;\n walk(child);\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n }\n\n walk(xfa);\n return output;\n }\n }, {\n key: \"shouldBuildText\",\n value: function shouldBuildText(name) {\n return !(name === \"textarea\" || name === \"input\" || name === \"option\" || name === \"select\");\n }\n }]);\n\n return XfaText;\n}();\n\nexports.XfaText = XfaText;\n\n/***/ }),\n/* 160 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\"use strict\";\n\n\nfunction _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); }\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.AnnotationLayer = void 0;\n\nvar _util = __w_pdfjs_require__(1);\n\nvar _display_utils = __w_pdfjs_require__(147);\n\nvar _annotation_storage = __w_pdfjs_require__(151);\n\nvar _scripting_utils = __w_pdfjs_require__(161);\n\nvar _xfa_layer = __w_pdfjs_require__(162);\n\nfunction _classStaticPrivateMethodGet(receiver, classConstructor, method) { _classCheckPrivateStaticAccess(receiver, classConstructor); return method; }\n\nfunction _classCheckPrivateStaticAccess(receiver, classConstructor) { if (receiver !== classConstructor) { throw new TypeError(\"Private static access of wrong provenance\"); } }\n\nfunction _get() { 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(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }\n\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\n\nfunction _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; }\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _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.\"); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _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); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _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); }; }\n\nfunction _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); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _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; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _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; } } }; }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _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.\"); }\n\nfunction _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); }\n\nfunction _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; }\n\nfunction _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; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nvar DEFAULT_TAB_INDEX = 1000;\nvar GetElementsByNameSet = new WeakSet();\n\nfunction getRectDims(rect) {\n return {\n width: rect[2] - rect[0],\n height: rect[3] - rect[1]\n };\n}\n\nvar AnnotationElementFactory = /*#__PURE__*/function () {\n function AnnotationElementFactory() {\n _classCallCheck(this, AnnotationElementFactory);\n }\n\n _createClass(AnnotationElementFactory, null, [{\n key: \"create\",\n value: function create(parameters) {\n var subtype = parameters.data.annotationType;\n\n switch (subtype) {\n case _util.AnnotationType.LINK:\n return new LinkAnnotationElement(parameters);\n\n case _util.AnnotationType.TEXT:\n return new TextAnnotationElement(parameters);\n\n case _util.AnnotationType.WIDGET:\n var fieldType = parameters.data.fieldType;\n\n switch (fieldType) {\n case \"Tx\":\n return new TextWidgetAnnotationElement(parameters);\n\n case \"Btn\":\n if (parameters.data.radioButton) {\n return new RadioButtonWidgetAnnotationElement(parameters);\n } else if (parameters.data.checkBox) {\n return new CheckboxWidgetAnnotationElement(parameters);\n }\n\n return new PushButtonWidgetAnnotationElement(parameters);\n\n case \"Ch\":\n return new ChoiceWidgetAnnotationElement(parameters);\n }\n\n return new WidgetAnnotationElement(parameters);\n\n case _util.AnnotationType.POPUP:\n return new PopupAnnotationElement(parameters);\n\n case _util.AnnotationType.FREETEXT:\n return new FreeTextAnnotationElement(parameters);\n\n case _util.AnnotationType.LINE:\n return new LineAnnotationElement(parameters);\n\n case _util.AnnotationType.SQUARE:\n return new SquareAnnotationElement(parameters);\n\n case _util.AnnotationType.CIRCLE:\n return new CircleAnnotationElement(parameters);\n\n case _util.AnnotationType.POLYLINE:\n return new PolylineAnnotationElement(parameters);\n\n case _util.AnnotationType.CARET:\n return new CaretAnnotationElement(parameters);\n\n case _util.AnnotationType.INK:\n return new InkAnnotationElement(parameters);\n\n case _util.AnnotationType.POLYGON:\n return new PolygonAnnotationElement(parameters);\n\n case _util.AnnotationType.HIGHLIGHT:\n return new HighlightAnnotationElement(parameters);\n\n case _util.AnnotationType.UNDERLINE:\n return new UnderlineAnnotationElement(parameters);\n\n case _util.AnnotationType.SQUIGGLY:\n return new SquigglyAnnotationElement(parameters);\n\n case _util.AnnotationType.STRIKEOUT:\n return new StrikeOutAnnotationElement(parameters);\n\n case _util.AnnotationType.STAMP:\n return new StampAnnotationElement(parameters);\n\n case _util.AnnotationType.FILEATTACHMENT:\n return new FileAttachmentAnnotationElement(parameters);\n\n default:\n return new AnnotationElement(parameters);\n }\n }\n }]);\n\n return AnnotationElementFactory;\n}();\n\nvar AnnotationElement = /*#__PURE__*/function () {\n function AnnotationElement(parameters) {\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n _ref$isRenderable = _ref.isRenderable,\n isRenderable = _ref$isRenderable === void 0 ? false : _ref$isRenderable,\n _ref$ignoreBorder = _ref.ignoreBorder,\n ignoreBorder = _ref$ignoreBorder === void 0 ? false : _ref$ignoreBorder,\n _ref$createQuadrilate = _ref.createQuadrilaterals,\n createQuadrilaterals = _ref$createQuadrilate === void 0 ? false : _ref$createQuadrilate;\n\n _classCallCheck(this, AnnotationElement);\n\n this.isRenderable = isRenderable;\n this.data = parameters.data;\n this.layer = parameters.layer;\n this.page = parameters.page;\n this.viewport = parameters.viewport;\n this.linkService = parameters.linkService;\n this.downloadManager = parameters.downloadManager;\n this.imageResourcesPath = parameters.imageResourcesPath;\n this.renderForms = parameters.renderForms;\n this.svgFactory = parameters.svgFactory;\n this.annotationStorage = parameters.annotationStorage;\n this.enableScripting = parameters.enableScripting;\n this.hasJSActions = parameters.hasJSActions;\n this._fieldObjects = parameters.fieldObjects;\n this._mouseState = parameters.mouseState;\n\n if (isRenderable) {\n this.container = this._createContainer(ignoreBorder);\n }\n\n if (createQuadrilaterals) {\n this.quadrilaterals = this._createQuadrilaterals(ignoreBorder);\n }\n }\n\n _createClass(AnnotationElement, [{\n key: \"_createContainer\",\n value: function _createContainer() {\n var ignoreBorder = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n var data = this.data,\n page = this.page,\n viewport = this.viewport;\n var container = document.createElement(\"section\");\n\n var _getRectDims = getRectDims(data.rect),\n width = _getRectDims.width,\n height = _getRectDims.height;\n\n container.setAttribute(\"data-annotation-id\", data.id);\n\n 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]]);\n\n if (data.hasOwnCanvas) {\n var transform = viewport.transform.slice();\n\n var _Util$singularValueDe = _util.Util.singularValueDecompose2dScale(transform),\n _Util$singularValueDe2 = _slicedToArray(_Util$singularValueDe, 2),\n scaleX = _Util$singularValueDe2[0],\n scaleY = _Util$singularValueDe2[1];\n\n width = Math.ceil(width * scaleX);\n height = Math.ceil(height * scaleY);\n rect[0] *= scaleX;\n rect[1] *= scaleY;\n\n for (var i = 0; i < 4; i++) {\n transform[i] = Math.sign(transform[i]);\n }\n\n container.style.transform = \"matrix(\".concat(transform.join(\",\"), \")\");\n } else {\n container.style.transform = \"matrix(\".concat(viewport.transform.join(\",\"), \")\");\n }\n\n container.style.transformOrigin = \"\".concat(-rect[0], \"px \").concat(-rect[1], \"px\");\n\n if (!ignoreBorder && data.borderStyle.width > 0) {\n container.style.borderWidth = \"\".concat(data.borderStyle.width, \"px\");\n\n if (data.borderStyle.style !== _util.AnnotationBorderStyleType.UNDERLINE) {\n width -= 2 * data.borderStyle.width;\n height -= 2 * data.borderStyle.width;\n }\n\n var horizontalRadius = data.borderStyle.horizontalCornerRadius;\n var verticalRadius = data.borderStyle.verticalCornerRadius;\n\n if (horizontalRadius > 0 || verticalRadius > 0) {\n var radius = \"\".concat(horizontalRadius, \"px / \").concat(verticalRadius, \"px\");\n container.style.borderRadius = radius;\n }\n\n switch (data.borderStyle.style) {\n case _util.AnnotationBorderStyleType.SOLID:\n container.style.borderStyle = \"solid\";\n break;\n\n case _util.AnnotationBorderStyleType.DASHED:\n container.style.borderStyle = \"dashed\";\n break;\n\n case _util.AnnotationBorderStyleType.BEVELED:\n (0, _util.warn)(\"Unimplemented border style: beveled\");\n break;\n\n case _util.AnnotationBorderStyleType.INSET:\n (0, _util.warn)(\"Unimplemented border style: inset\");\n break;\n\n case _util.AnnotationBorderStyleType.UNDERLINE:\n container.style.borderBottomStyle = \"solid\";\n break;\n\n default:\n break;\n }\n\n var borderColor = data.borderColor || data.color || null;\n\n if (borderColor) {\n container.style.borderColor = _util.Util.makeHexColor(data.color[0] | 0, data.color[1] | 0, data.color[2] | 0);\n } else {\n container.style.borderWidth = 0;\n }\n }\n\n container.style.left = \"\".concat(rect[0], \"px\");\n container.style.top = \"\".concat(rect[1], \"px\");\n\n if (data.hasOwnCanvas) {\n container.style.width = container.style.height = \"auto\";\n } else {\n container.style.width = \"\".concat(width, \"px\");\n container.style.height = \"\".concat(height, \"px\");\n }\n\n return container;\n }\n }, {\n key: \"_createQuadrilaterals\",\n value: function _createQuadrilaterals() {\n var ignoreBorder = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n if (!this.data.quadPoints) {\n return null;\n }\n\n var quadrilaterals = [];\n var savedRect = this.data.rect;\n\n var _iterator = _createForOfIteratorHelper(this.data.quadPoints),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var quadPoint = _step.value;\n this.data.rect = [quadPoint[2].x, quadPoint[2].y, quadPoint[1].x, quadPoint[1].y];\n quadrilaterals.push(this._createContainer(ignoreBorder));\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n this.data.rect = savedRect;\n return quadrilaterals;\n }\n }, {\n key: \"_createPopup\",\n value: function _createPopup(trigger, data) {\n var container = this.container;\n\n if (this.quadrilaterals) {\n trigger = trigger || this.quadrilaterals;\n container = this.quadrilaterals[0];\n }\n\n if (!trigger) {\n trigger = document.createElement(\"div\");\n trigger.style.height = container.style.height;\n trigger.style.width = container.style.width;\n container.appendChild(trigger);\n }\n\n var popupElement = new PopupElement({\n container: container,\n trigger: trigger,\n color: data.color,\n titleObj: data.titleObj,\n modificationDate: data.modificationDate,\n contentsObj: data.contentsObj,\n richText: data.richText,\n hideWrapper: true\n });\n var popup = popupElement.render();\n popup.style.left = container.style.width;\n container.appendChild(popup);\n }\n }, {\n key: \"_renderQuadrilaterals\",\n value: function _renderQuadrilaterals(className) {\n var _iterator2 = _createForOfIteratorHelper(this.quadrilaterals),\n _step2;\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var quadrilateral = _step2.value;\n quadrilateral.className = className;\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n\n return this.quadrilaterals;\n }\n }, {\n key: \"render\",\n value: function render() {\n (0, _util.unreachable)(\"Abstract method `AnnotationElement.render` called\");\n }\n }, {\n key: \"_getElementsByName\",\n value: function _getElementsByName(name) {\n var skipId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n var fields = [];\n\n if (this._fieldObjects) {\n var fieldObj = this._fieldObjects[name];\n\n if (fieldObj) {\n var _iterator3 = _createForOfIteratorHelper(fieldObj),\n _step3;\n\n try {\n for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n var _step3$value = _step3.value,\n page = _step3$value.page,\n id = _step3$value.id,\n exportValues = _step3$value.exportValues;\n\n if (page === -1) {\n continue;\n }\n\n if (id === skipId) {\n continue;\n }\n\n var exportValue = typeof exportValues === \"string\" ? exportValues : null;\n var domElement = document.getElementById(id);\n\n if (domElement && !GetElementsByNameSet.has(domElement)) {\n (0, _util.warn)(\"_getElementsByName - element not allowed: \".concat(id));\n continue;\n }\n\n fields.push({\n id: id,\n exportValue: exportValue,\n domElement: domElement\n });\n }\n } catch (err) {\n _iterator3.e(err);\n } finally {\n _iterator3.f();\n }\n }\n\n return fields;\n }\n\n var _iterator4 = _createForOfIteratorHelper(document.getElementsByName(name)),\n _step4;\n\n try {\n for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {\n var _domElement = _step4.value;\n var _id = _domElement.id,\n _exportValue = _domElement.exportValue;\n\n if (_id === skipId) {\n continue;\n }\n\n if (!GetElementsByNameSet.has(_domElement)) {\n continue;\n }\n\n fields.push({\n id: _id,\n exportValue: _exportValue,\n domElement: _domElement\n });\n }\n } catch (err) {\n _iterator4.e(err);\n } finally {\n _iterator4.f();\n }\n\n return fields;\n }\n }], [{\n key: \"platform\",\n get: function get() {\n var platform = typeof navigator !== \"undefined\" ? navigator.platform : \"\";\n return (0, _util.shadow)(this, \"platform\", {\n isWin: platform.includes(\"Win\"),\n isMac: platform.includes(\"Mac\")\n });\n }\n }]);\n\n return AnnotationElement;\n}();\n\nvar LinkAnnotationElement = /*#__PURE__*/function (_AnnotationElement) {\n _inherits(LinkAnnotationElement, _AnnotationElement);\n\n var _super = _createSuper(LinkAnnotationElement);\n\n function LinkAnnotationElement(parameters) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n _classCallCheck(this, LinkAnnotationElement);\n\n 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\"]));\n return _super.call(this, parameters, {\n isRenderable: isRenderable,\n ignoreBorder: !!(options !== null && options !== void 0 && options.ignoreBorder),\n createQuadrilaterals: true\n });\n }\n\n _createClass(LinkAnnotationElement, [{\n key: \"render\",\n value: function render() {\n var data = this.data,\n linkService = this.linkService;\n var link = document.createElement(\"a\");\n\n if (data.url) {\n var _linkService$addLinkA;\n\n if (!linkService.addLinkAttributes) {\n (0, _util.warn)(\"LinkAnnotationElement.render - missing `addLinkAttributes`-method on the `linkService`-instance.\");\n }\n\n (_linkService$addLinkA = linkService.addLinkAttributes) === null || _linkService$addLinkA === void 0 ? void 0 : _linkService$addLinkA.call(linkService, link, data.url, data.newWindow);\n } else if (data.action) {\n this._bindNamedAction(link, data.action);\n } else if (data.dest) {\n this._bindLink(link, data.dest);\n } else {\n var hasClickAction = false;\n\n if (data.actions && (data.actions.Action || data.actions[\"Mouse Up\"] || data.actions[\"Mouse Down\"]) && this.enableScripting && this.hasJSActions) {\n hasClickAction = true;\n\n this._bindJSAction(link, data);\n }\n\n if (data.resetForm) {\n this._bindResetFormAction(link, data.resetForm);\n } else if (!hasClickAction) {\n this._bindLink(link, \"\");\n }\n }\n\n if (this.quadrilaterals) {\n return this._renderQuadrilaterals(\"linkAnnotation\").map(function (quadrilateral, index) {\n var linkElement = index === 0 ? link : link.cloneNode();\n quadrilateral.appendChild(linkElement);\n return quadrilateral;\n });\n }\n\n this.container.className = \"linkAnnotation\";\n this.container.appendChild(link);\n return this.container;\n }\n }, {\n key: \"_bindLink\",\n value: function _bindLink(link, destination) {\n var _this = this;\n\n link.href = this.linkService.getDestinationHash(destination);\n\n link.onclick = function () {\n if (destination) {\n _this.linkService.goToDestination(destination);\n }\n\n return false;\n };\n\n if (destination || destination === \"\") {\n link.className = \"internalLink\";\n }\n }\n }, {\n key: \"_bindNamedAction\",\n value: function _bindNamedAction(link, action) {\n var _this2 = this;\n\n link.href = this.linkService.getAnchorUrl(\"\");\n\n link.onclick = function () {\n _this2.linkService.executeNamedAction(action);\n\n return false;\n };\n\n link.className = \"internalLink\";\n }\n }, {\n key: \"_bindJSAction\",\n value: function _bindJSAction(link, data) {\n var _this3 = this;\n\n link.href = this.linkService.getAnchorUrl(\"\");\n var map = new Map([[\"Action\", \"onclick\"], [\"Mouse Up\", \"onmouseup\"], [\"Mouse Down\", \"onmousedown\"]]);\n\n var _loop = function _loop() {\n var name = _Object$keys[_i2];\n var jsName = map.get(name);\n\n if (!jsName) {\n return \"continue\";\n }\n\n link[jsName] = function () {\n var _this3$linkService$ev;\n\n (_this3$linkService$ev = _this3.linkService.eventBus) === null || _this3$linkService$ev === void 0 ? void 0 : _this3$linkService$ev.dispatch(\"dispatcheventinsandbox\", {\n source: _this3,\n detail: {\n id: data.id,\n name: name\n }\n });\n return false;\n };\n };\n\n for (var _i2 = 0, _Object$keys = Object.keys(data.actions); _i2 < _Object$keys.length; _i2++) {\n var _ret = _loop();\n\n if (_ret === \"continue\") continue;\n }\n\n if (!link.onclick) {\n link.onclick = function () {\n return false;\n };\n }\n\n link.className = \"internalLink\";\n }\n }, {\n key: \"_bindResetFormAction\",\n value: function _bindResetFormAction(link, resetForm) {\n var _this4 = this;\n\n var otherClickAction = link.onclick;\n\n if (!otherClickAction) {\n link.href = this.linkService.getAnchorUrl(\"\");\n }\n\n link.className = \"internalLink\";\n\n if (!this._fieldObjects) {\n (0, _util.warn)(\"_bindResetFormAction - \\\"resetForm\\\" action not supported, \" + \"ensure that the `fieldObjects` parameter is provided.\");\n\n if (!otherClickAction) {\n link.onclick = function () {\n return false;\n };\n }\n\n return;\n }\n\n link.onclick = function () {\n if (otherClickAction) {\n otherClickAction();\n }\n\n var resetFormFields = resetForm.fields,\n resetFormRefs = resetForm.refs,\n include = resetForm.include;\n var allFields = [];\n\n if (resetFormFields.length !== 0 || resetFormRefs.length !== 0) {\n var fieldIds = new Set(resetFormRefs);\n\n var _iterator5 = _createForOfIteratorHelper(resetFormFields),\n _step5;\n\n try {\n for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {\n var fieldName = _step5.value;\n\n var _fields = _this4._fieldObjects[fieldName] || [];\n\n var _iterator7 = _createForOfIteratorHelper(_fields),\n _step7;\n\n try {\n for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {\n var id = _step7.value.id;\n fieldIds.add(id);\n }\n } catch (err) {\n _iterator7.e(err);\n } finally {\n _iterator7.f();\n }\n }\n } catch (err) {\n _iterator5.e(err);\n } finally {\n _iterator5.f();\n }\n\n for (var _i3 = 0, _Object$values = Object.values(_this4._fieldObjects); _i3 < _Object$values.length; _i3++) {\n var fields = _Object$values[_i3];\n\n var _iterator6 = _createForOfIteratorHelper(fields),\n _step6;\n\n try {\n for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {\n var field = _step6.value;\n\n if (fieldIds.has(field.id) === include) {\n allFields.push(field);\n }\n }\n } catch (err) {\n _iterator6.e(err);\n } finally {\n _iterator6.f();\n }\n }\n } else {\n for (var _i4 = 0, _Object$values2 = Object.values(_this4._fieldObjects); _i4 < _Object$values2.length; _i4++) {\n var _fields2 = _Object$values2[_i4];\n allFields.push.apply(allFields, _toConsumableArray(_fields2));\n }\n }\n\n var storage = _this4.annotationStorage;\n var allIds = [];\n\n for (var _i5 = 0, _allFields = allFields; _i5 < _allFields.length; _i5++) {\n var _field = _allFields[_i5];\n var _id2 = _field.id;\n allIds.push(_id2);\n\n switch (_field.type) {\n case \"text\":\n {\n var value = _field.defaultValue || \"\";\n storage.setValue(_id2, {\n value: value,\n valueAsString: value\n });\n break;\n }\n\n case \"checkbox\":\n case \"radiobutton\":\n {\n var _value = _field.defaultValue === _field.exportValues;\n\n storage.setValue(_id2, {\n value: _value\n });\n break;\n }\n\n case \"combobox\":\n case \"listbox\":\n {\n var _value2 = _field.defaultValue || \"\";\n\n storage.setValue(_id2, {\n value: _value2\n });\n break;\n }\n\n default:\n continue;\n }\n\n var domElement = document.getElementById(_id2);\n\n if (!domElement || !GetElementsByNameSet.has(domElement)) {\n continue;\n }\n\n domElement.dispatchEvent(new Event(\"resetform\"));\n }\n\n if (_this4.enableScripting) {\n var _this4$linkService$ev;\n\n (_this4$linkService$ev = _this4.linkService.eventBus) === null || _this4$linkService$ev === void 0 ? void 0 : _this4$linkService$ev.dispatch(\"dispatcheventinsandbox\", {\n source: _this4,\n detail: {\n id: \"app\",\n ids: allIds,\n name: \"ResetForm\"\n }\n });\n }\n\n return false;\n };\n }\n }]);\n\n return LinkAnnotationElement;\n}(AnnotationElement);\n\nvar TextAnnotationElement = /*#__PURE__*/function (_AnnotationElement2) {\n _inherits(TextAnnotationElement, _AnnotationElement2);\n\n var _super2 = _createSuper(TextAnnotationElement);\n\n function TextAnnotationElement(parameters) {\n var _parameters$data$titl, _parameters$data$cont, _parameters$data$rich;\n\n _classCallCheck(this, TextAnnotationElement);\n\n 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 || (_parameters$data$rich = parameters.data.richText) !== null && _parameters$data$rich !== void 0 && _parameters$data$rich.str);\n return _super2.call(this, parameters, {\n isRenderable: isRenderable\n });\n }\n\n _createClass(TextAnnotationElement, [{\n key: \"render\",\n value: function render() {\n this.container.className = \"textAnnotation\";\n var image = document.createElement(\"img\");\n image.style.height = this.container.style.height;\n image.style.width = this.container.style.width;\n image.src = this.imageResourcesPath + \"annotation-\" + this.data.name.toLowerCase() + \".svg\";\n image.alt = \"[{{type}} Annotation]\";\n image.dataset.l10nId = \"text_annotation_type\";\n image.dataset.l10nArgs = JSON.stringify({\n type: this.data.name\n });\n\n if (!this.data.hasPopup) {\n this._createPopup(image, this.data);\n }\n\n this.container.appendChild(image);\n return this.container;\n }\n }]);\n\n return TextAnnotationElement;\n}(AnnotationElement);\n\nvar WidgetAnnotationElement = /*#__PURE__*/function (_AnnotationElement3) {\n _inherits(WidgetAnnotationElement, _AnnotationElement3);\n\n var _super3 = _createSuper(WidgetAnnotationElement);\n\n function WidgetAnnotationElement() {\n _classCallCheck(this, WidgetAnnotationElement);\n\n return _super3.apply(this, arguments);\n }\n\n _createClass(WidgetAnnotationElement, [{\n key: \"render\",\n value: function render() {\n if (this.data.alternativeText) {\n this.container.title = this.data.alternativeText;\n }\n\n return this.container;\n }\n }, {\n key: \"_getKeyModifier\",\n value: function _getKeyModifier(event) {\n var _AnnotationElement$pl = AnnotationElement.platform,\n isWin = _AnnotationElement$pl.isWin,\n isMac = _AnnotationElement$pl.isMac;\n return isWin && event.ctrlKey || isMac && event.metaKey;\n }\n }, {\n key: \"_setEventListener\",\n value: function _setEventListener(element, baseName, eventName, valueGetter) {\n var _this5 = this;\n\n if (baseName.includes(\"mouse\")) {\n element.addEventListener(baseName, function (event) {\n var _this5$linkService$ev;\n\n (_this5$linkService$ev = _this5.linkService.eventBus) === null || _this5$linkService$ev === void 0 ? void 0 : _this5$linkService$ev.dispatch(\"dispatcheventinsandbox\", {\n source: _this5,\n detail: {\n id: _this5.data.id,\n name: eventName,\n value: valueGetter(event),\n shift: event.shiftKey,\n modifier: _this5._getKeyModifier(event)\n }\n });\n });\n } else {\n element.addEventListener(baseName, function (event) {\n var _this5$linkService$ev2;\n\n (_this5$linkService$ev2 = _this5.linkService.eventBus) === null || _this5$linkService$ev2 === void 0 ? void 0 : _this5$linkService$ev2.dispatch(\"dispatcheventinsandbox\", {\n source: _this5,\n detail: {\n id: _this5.data.id,\n name: eventName,\n value: valueGetter(event)\n }\n });\n });\n }\n }\n }, {\n key: \"_setEventListeners\",\n value: function _setEventListeners(element, names, getter) {\n var _iterator8 = _createForOfIteratorHelper(names),\n _step8;\n\n try {\n for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {\n var _this$data$actions;\n\n var _step8$value = _slicedToArray(_step8.value, 2),\n baseName = _step8$value[0],\n eventName = _step8$value[1];\n\n if (eventName === \"Action\" || (_this$data$actions = this.data.actions) !== null && _this$data$actions !== void 0 && _this$data$actions[eventName]) {\n this._setEventListener(element, baseName, eventName, getter);\n }\n }\n } catch (err) {\n _iterator8.e(err);\n } finally {\n _iterator8.f();\n }\n }\n }, {\n key: \"_setBackgroundColor\",\n value: function _setBackgroundColor(element) {\n var color = this.data.backgroundColor || null;\n element.style.backgroundColor = color === null ? \"transparent\" : _util.Util.makeHexColor(color[0], color[1], color[2]);\n }\n }, {\n key: \"_dispatchEventFromSandbox\",\n value: function _dispatchEventFromSandbox(actions, jsEvent) {\n var _this6 = this;\n\n var setColor = function setColor(jsName, styleName, event) {\n var color = event.detail[jsName];\n event.target.style[styleName] = _scripting_utils.ColorConverters[\"\".concat(color[0], \"_HTML\")](color.slice(1));\n };\n\n var commonActions = {\n display: function display(event) {\n var hidden = event.detail.display % 2 === 1;\n event.target.style.visibility = hidden ? \"hidden\" : \"visible\";\n\n _this6.annotationStorage.setValue(_this6.data.id, {\n hidden: hidden,\n print: event.detail.display === 0 || event.detail.display === 3\n });\n },\n print: function print(event) {\n _this6.annotationStorage.setValue(_this6.data.id, {\n print: event.detail.print\n });\n },\n hidden: function hidden(event) {\n event.target.style.visibility = event.detail.hidden ? \"hidden\" : \"visible\";\n\n _this6.annotationStorage.setValue(_this6.data.id, {\n hidden: event.detail.hidden\n });\n },\n focus: function focus(event) {\n setTimeout(function () {\n return event.target.focus({\n preventScroll: false\n });\n }, 0);\n },\n userName: function userName(event) {\n event.target.title = event.detail.userName;\n },\n readonly: function readonly(event) {\n if (event.detail.readonly) {\n event.target.setAttribute(\"readonly\", \"\");\n } else {\n event.target.removeAttribute(\"readonly\");\n }\n },\n required: function required(event) {\n if (event.detail.required) {\n event.target.setAttribute(\"required\", \"\");\n } else {\n event.target.removeAttribute(\"required\");\n }\n },\n bgColor: function bgColor(event) {\n setColor(\"bgColor\", \"backgroundColor\", event);\n },\n fillColor: function fillColor(event) {\n setColor(\"fillColor\", \"backgroundColor\", event);\n },\n fgColor: function fgColor(event) {\n setColor(\"fgColor\", \"color\", event);\n },\n textColor: function textColor(event) {\n setColor(\"textColor\", \"color\", event);\n },\n borderColor: function borderColor(event) {\n setColor(\"borderColor\", \"borderColor\", event);\n },\n strokeColor: function strokeColor(event) {\n setColor(\"strokeColor\", \"borderColor\", event);\n }\n };\n\n for (var _i6 = 0, _Object$keys2 = Object.keys(jsEvent.detail); _i6 < _Object$keys2.length; _i6++) {\n var name = _Object$keys2[_i6];\n var action = actions[name] || commonActions[name];\n\n if (action) {\n action(jsEvent);\n }\n }\n }\n }]);\n\n return WidgetAnnotationElement;\n}(AnnotationElement);\n\nvar TextWidgetAnnotationElement = /*#__PURE__*/function (_WidgetAnnotationElem) {\n _inherits(TextWidgetAnnotationElement, _WidgetAnnotationElem);\n\n var _super4 = _createSuper(TextWidgetAnnotationElement);\n\n function TextWidgetAnnotationElement(parameters) {\n _classCallCheck(this, TextWidgetAnnotationElement);\n\n var isRenderable = parameters.renderForms || !parameters.data.hasAppearance && !!parameters.data.fieldValue;\n return _super4.call(this, parameters, {\n isRenderable: isRenderable\n });\n }\n\n _createClass(TextWidgetAnnotationElement, [{\n key: \"setPropertyOnSiblings\",\n value: function setPropertyOnSiblings(base, key, value, keyInStorage) {\n var storage = this.annotationStorage;\n\n var _iterator9 = _createForOfIteratorHelper(this._getElementsByName(base.name, base.id)),\n _step9;\n\n try {\n for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {\n var element = _step9.value;\n\n if (element.domElement) {\n element.domElement[key] = value;\n }\n\n storage.setValue(element.id, _defineProperty({}, keyInStorage, value));\n }\n } catch (err) {\n _iterator9.e(err);\n } finally {\n _iterator9.f();\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this7 = this;\n\n var storage = this.annotationStorage;\n var id = this.data.id;\n this.container.className = \"textWidgetAnnotation\";\n var element = null;\n\n if (this.renderForms) {\n var storedData = storage.getValue(id, {\n value: this.data.fieldValue,\n valueAsString: this.data.fieldValue\n });\n var textContent = storedData.valueAsString || storedData.value || \"\";\n var elementData = {\n userValue: null,\n formattedValue: null\n };\n\n if (this.data.multiLine) {\n element = document.createElement(\"textarea\");\n element.textContent = textContent;\n } else {\n element = document.createElement(\"input\");\n element.type = \"text\";\n element.setAttribute(\"value\", textContent);\n }\n\n GetElementsByNameSet.add(element);\n element.disabled = this.data.readOnly;\n element.name = this.data.fieldName;\n element.tabIndex = DEFAULT_TAB_INDEX;\n elementData.userValue = textContent;\n element.setAttribute(\"id\", id);\n element.addEventListener(\"input\", function (event) {\n storage.setValue(id, {\n value: event.target.value\n });\n\n _this7.setPropertyOnSiblings(element, \"value\", event.target.value, \"value\");\n });\n element.addEventListener(\"resetform\", function (event) {\n var defaultValue = _this7.data.defaultFieldValue || \"\";\n element.value = elementData.userValue = defaultValue;\n delete elementData.formattedValue;\n });\n\n var blurListener = function blurListener(event) {\n if (elementData.formattedValue) {\n event.target.value = elementData.formattedValue;\n }\n\n event.target.scrollLeft = 0;\n };\n\n if (this.enableScripting && this.hasJSActions) {\n var _this$data$actions2;\n\n element.addEventListener(\"focus\", function (event) {\n if (elementData.userValue) {\n event.target.value = elementData.userValue;\n }\n });\n element.addEventListener(\"updatefromsandbox\", function (jsEvent) {\n var actions = {\n value: function value(event) {\n elementData.userValue = event.detail.value || \"\";\n storage.setValue(id, {\n value: elementData.userValue.toString()\n });\n\n if (!elementData.formattedValue) {\n event.target.value = elementData.userValue;\n }\n },\n valueAsString: function valueAsString(event) {\n elementData.formattedValue = event.detail.valueAsString || \"\";\n\n if (event.target !== document.activeElement) {\n event.target.value = elementData.formattedValue;\n }\n\n storage.setValue(id, {\n formattedValue: elementData.formattedValue\n });\n },\n selRange: function selRange(event) {\n var _event$detail$selRang = _slicedToArray(event.detail.selRange, 2),\n selStart = _event$detail$selRang[0],\n selEnd = _event$detail$selRang[1];\n\n if (selStart >= 0 && selEnd < event.target.value.length) {\n event.target.setSelectionRange(selStart, selEnd);\n }\n }\n };\n\n _this7._dispatchEventFromSandbox(actions, jsEvent);\n });\n element.addEventListener(\"keydown\", function (event) {\n var _this7$linkService$ev;\n\n var commitKey = -1;\n\n if (event.key === \"Escape\") {\n commitKey = 0;\n } else if (event.key === \"Enter\") {\n commitKey = 2;\n } else if (event.key === \"Tab\") {\n commitKey = 3;\n }\n\n if (commitKey === -1) {\n return;\n }\n\n elementData.userValue = event.target.value;\n (_this7$linkService$ev = _this7.linkService.eventBus) === null || _this7$linkService$ev === void 0 ? void 0 : _this7$linkService$ev.dispatch(\"dispatcheventinsandbox\", {\n source: _this7,\n detail: {\n id: id,\n name: \"Keystroke\",\n value: event.target.value,\n willCommit: true,\n commitKey: commitKey,\n selStart: event.target.selectionStart,\n selEnd: event.target.selectionEnd\n }\n });\n });\n var _blurListener = blurListener;\n blurListener = null;\n element.addEventListener(\"blur\", function (event) {\n elementData.userValue = event.target.value;\n\n if (_this7._mouseState.isDown) {\n var _this7$linkService$ev2;\n\n (_this7$linkService$ev2 = _this7.linkService.eventBus) === null || _this7$linkService$ev2 === void 0 ? void 0 : _this7$linkService$ev2.dispatch(\"dispatcheventinsandbox\", {\n source: _this7,\n detail: {\n id: id,\n name: \"Keystroke\",\n value: event.target.value,\n willCommit: true,\n commitKey: 1,\n selStart: event.target.selectionStart,\n selEnd: event.target.selectionEnd\n }\n });\n }\n\n _blurListener(event);\n });\n\n if ((_this$data$actions2 = this.data.actions) !== null && _this$data$actions2 !== void 0 && _this$data$actions2.Keystroke) {\n element.addEventListener(\"beforeinput\", function (event) {\n var _this7$linkService$ev3;\n\n elementData.formattedValue = \"\";\n var data = event.data,\n target = event.target;\n var value = target.value,\n selectionStart = target.selectionStart,\n selectionEnd = target.selectionEnd;\n (_this7$linkService$ev3 = _this7.linkService.eventBus) === null || _this7$linkService$ev3 === void 0 ? void 0 : _this7$linkService$ev3.dispatch(\"dispatcheventinsandbox\", {\n source: _this7,\n detail: {\n id: id,\n name: \"Keystroke\",\n value: value,\n change: data,\n willCommit: false,\n selStart: selectionStart,\n selEnd: selectionEnd\n }\n });\n });\n }\n\n this._setEventListeners(element, [[\"focus\", \"Focus\"], [\"blur\", \"Blur\"], [\"mousedown\", \"Mouse Down\"], [\"mouseenter\", \"Mouse Enter\"], [\"mouseleave\", \"Mouse Exit\"], [\"mouseup\", \"Mouse Up\"]], function (event) {\n return event.target.value;\n });\n }\n\n if (blurListener) {\n element.addEventListener(\"blur\", blurListener);\n }\n\n if (this.data.maxLen !== null) {\n element.maxLength = this.data.maxLen;\n }\n\n if (this.data.comb) {\n var fieldWidth = this.data.rect[2] - this.data.rect[0];\n var combWidth = fieldWidth / this.data.maxLen;\n element.classList.add(\"comb\");\n element.style.letterSpacing = \"calc(\".concat(combWidth, \"px - 1ch)\");\n }\n } else {\n element = document.createElement(\"div\");\n element.textContent = this.data.fieldValue;\n element.style.verticalAlign = \"middle\";\n element.style.display = \"table-cell\";\n }\n\n this._setTextStyle(element);\n\n this._setBackgroundColor(element);\n\n this.container.appendChild(element);\n return this.container;\n }\n }, {\n key: \"_setTextStyle\",\n value: function _setTextStyle(element) {\n var TEXT_ALIGNMENT = [\"left\", \"center\", \"right\"];\n var _this$data$defaultApp = this.data.defaultAppearanceData,\n fontSize = _this$data$defaultApp.fontSize,\n fontColor = _this$data$defaultApp.fontColor;\n var style = element.style;\n\n if (fontSize) {\n style.fontSize = \"\".concat(fontSize, \"px\");\n }\n\n style.color = _util.Util.makeHexColor(fontColor[0], fontColor[1], fontColor[2]);\n\n if (this.data.textAlignment !== null) {\n style.textAlign = TEXT_ALIGNMENT[this.data.textAlignment];\n }\n }\n }]);\n\n return TextWidgetAnnotationElement;\n}(WidgetAnnotationElement);\n\nvar CheckboxWidgetAnnotationElement = /*#__PURE__*/function (_WidgetAnnotationElem2) {\n _inherits(CheckboxWidgetAnnotationElement, _WidgetAnnotationElem2);\n\n var _super5 = _createSuper(CheckboxWidgetAnnotationElement);\n\n function CheckboxWidgetAnnotationElement(parameters) {\n _classCallCheck(this, CheckboxWidgetAnnotationElement);\n\n return _super5.call(this, parameters, {\n isRenderable: parameters.renderForms\n });\n }\n\n _createClass(CheckboxWidgetAnnotationElement, [{\n key: \"render\",\n value: function render() {\n var _this8 = this;\n\n var storage = this.annotationStorage;\n var data = this.data;\n var id = data.id;\n var value = storage.getValue(id, {\n value: data.exportValue === data.fieldValue\n }).value;\n\n if (typeof value === \"string\") {\n value = value !== \"Off\";\n storage.setValue(id, {\n value: value\n });\n }\n\n this.container.className = \"buttonWidgetAnnotation checkBox\";\n var element = document.createElement(\"input\");\n GetElementsByNameSet.add(element);\n element.disabled = data.readOnly;\n element.type = \"checkbox\";\n element.name = data.fieldName;\n\n if (value) {\n element.setAttribute(\"checked\", true);\n }\n\n element.setAttribute(\"id\", id);\n element.setAttribute(\"exportValue\", data.exportValue);\n element.tabIndex = DEFAULT_TAB_INDEX;\n element.addEventListener(\"change\", function (event) {\n var _event$target = event.target,\n name = _event$target.name,\n checked = _event$target.checked;\n\n var _iterator10 = _createForOfIteratorHelper(_this8._getElementsByName(name, id)),\n _step10;\n\n try {\n for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {\n var checkbox = _step10.value;\n var curChecked = checked && checkbox.exportValue === data.exportValue;\n\n if (checkbox.domElement) {\n checkbox.domElement.checked = curChecked;\n }\n\n storage.setValue(checkbox.id, {\n value: curChecked\n });\n }\n } catch (err) {\n _iterator10.e(err);\n } finally {\n _iterator10.f();\n }\n\n storage.setValue(id, {\n value: checked\n });\n });\n element.addEventListener(\"resetform\", function (event) {\n var defaultValue = data.defaultFieldValue || \"Off\";\n event.target.checked = defaultValue === data.exportValue;\n });\n\n if (this.enableScripting && this.hasJSActions) {\n element.addEventListener(\"updatefromsandbox\", function (jsEvent) {\n var actions = {\n value: function value(event) {\n event.target.checked = event.detail.value !== \"Off\";\n storage.setValue(id, {\n value: event.target.checked\n });\n }\n };\n\n _this8._dispatchEventFromSandbox(actions, jsEvent);\n });\n\n 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) {\n return event.target.checked;\n });\n }\n\n this._setBackgroundColor(element);\n\n this.container.appendChild(element);\n return this.container;\n }\n }]);\n\n return CheckboxWidgetAnnotationElement;\n}(WidgetAnnotationElement);\n\nvar RadioButtonWidgetAnnotationElement = /*#__PURE__*/function (_WidgetAnnotationElem3) {\n _inherits(RadioButtonWidgetAnnotationElement, _WidgetAnnotationElem3);\n\n var _super6 = _createSuper(RadioButtonWidgetAnnotationElement);\n\n function RadioButtonWidgetAnnotationElement(parameters) {\n _classCallCheck(this, RadioButtonWidgetAnnotationElement);\n\n return _super6.call(this, parameters, {\n isRenderable: parameters.renderForms\n });\n }\n\n _createClass(RadioButtonWidgetAnnotationElement, [{\n key: \"render\",\n value: function render() {\n var _this9 = this;\n\n this.container.className = \"buttonWidgetAnnotation radioButton\";\n var storage = this.annotationStorage;\n var data = this.data;\n var id = data.id;\n var value = storage.getValue(id, {\n value: data.fieldValue === data.buttonValue\n }).value;\n\n if (typeof value === \"string\") {\n value = value !== data.buttonValue;\n storage.setValue(id, {\n value: value\n });\n }\n\n var element = document.createElement(\"input\");\n GetElementsByNameSet.add(element);\n element.disabled = data.readOnly;\n element.type = \"radio\";\n element.name = data.fieldName;\n\n if (value) {\n element.setAttribute(\"checked\", true);\n }\n\n element.setAttribute(\"id\", id);\n element.tabIndex = DEFAULT_TAB_INDEX;\n element.addEventListener(\"change\", function (event) {\n var _event$target2 = event.target,\n name = _event$target2.name,\n checked = _event$target2.checked;\n\n var _iterator11 = _createForOfIteratorHelper(_this9._getElementsByName(name, id)),\n _step11;\n\n try {\n for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {\n var radio = _step11.value;\n storage.setValue(radio.id, {\n value: false\n });\n }\n } catch (err) {\n _iterator11.e(err);\n } finally {\n _iterator11.f();\n }\n\n storage.setValue(id, {\n value: checked\n });\n });\n element.addEventListener(\"resetform\", function (event) {\n var defaultValue = data.defaultFieldValue;\n event.target.checked = defaultValue !== null && defaultValue !== undefined && defaultValue === data.buttonValue;\n });\n\n if (this.enableScripting && this.hasJSActions) {\n var pdfButtonValue = data.buttonValue;\n element.addEventListener(\"updatefromsandbox\", function (jsEvent) {\n var actions = {\n value: function value(event) {\n var checked = pdfButtonValue === event.detail.value;\n\n var _iterator12 = _createForOfIteratorHelper(_this9._getElementsByName(event.target.name)),\n _step12;\n\n try {\n for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {\n var radio = _step12.value;\n var curChecked = checked && radio.id === id;\n\n if (radio.domElement) {\n radio.domElement.checked = curChecked;\n }\n\n storage.setValue(radio.id, {\n value: curChecked\n });\n }\n } catch (err) {\n _iterator12.e(err);\n } finally {\n _iterator12.f();\n }\n }\n };\n\n _this9._dispatchEventFromSandbox(actions, jsEvent);\n });\n\n 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) {\n return event.target.checked;\n });\n }\n\n this._setBackgroundColor(element);\n\n this.container.appendChild(element);\n return this.container;\n }\n }]);\n\n return RadioButtonWidgetAnnotationElement;\n}(WidgetAnnotationElement);\n\nvar PushButtonWidgetAnnotationElement = /*#__PURE__*/function (_LinkAnnotationElemen) {\n _inherits(PushButtonWidgetAnnotationElement, _LinkAnnotationElemen);\n\n var _super7 = _createSuper(PushButtonWidgetAnnotationElement);\n\n function PushButtonWidgetAnnotationElement(parameters) {\n _classCallCheck(this, PushButtonWidgetAnnotationElement);\n\n return _super7.call(this, parameters, {\n ignoreBorder: parameters.data.hasAppearance\n });\n }\n\n _createClass(PushButtonWidgetAnnotationElement, [{\n key: \"render\",\n value: function render() {\n var container = _get(_getPrototypeOf(PushButtonWidgetAnnotationElement.prototype), \"render\", this).call(this);\n\n container.className = \"buttonWidgetAnnotation pushButton\";\n\n if (this.data.alternativeText) {\n container.title = this.data.alternativeText;\n }\n\n return container;\n }\n }]);\n\n return PushButtonWidgetAnnotationElement;\n}(LinkAnnotationElement);\n\nvar ChoiceWidgetAnnotationElement = /*#__PURE__*/function (_WidgetAnnotationElem4) {\n _inherits(ChoiceWidgetAnnotationElement, _WidgetAnnotationElem4);\n\n var _super8 = _createSuper(ChoiceWidgetAnnotationElement);\n\n function ChoiceWidgetAnnotationElement(parameters) {\n _classCallCheck(this, ChoiceWidgetAnnotationElement);\n\n return _super8.call(this, parameters, {\n isRenderable: parameters.renderForms\n });\n }\n\n _createClass(ChoiceWidgetAnnotationElement, [{\n key: \"render\",\n value: function render() {\n var _this10 = this;\n\n this.container.className = \"choiceWidgetAnnotation\";\n var storage = this.annotationStorage;\n var id = this.data.id;\n storage.getValue(id, {\n value: this.data.fieldValue.length > 0 ? this.data.fieldValue[0] : undefined\n });\n var fontSize = this.data.defaultAppearanceData.fontSize;\n\n if (!fontSize) {\n fontSize = 9;\n }\n\n var fontSizeStyle = \"calc(\".concat(fontSize, \"px * var(--zoom-factor))\");\n var selectElement = document.createElement(\"select\");\n GetElementsByNameSet.add(selectElement);\n selectElement.disabled = this.data.readOnly;\n selectElement.name = this.data.fieldName;\n selectElement.setAttribute(\"id\", id);\n selectElement.tabIndex = DEFAULT_TAB_INDEX;\n selectElement.style.fontSize = \"\".concat(fontSize, \"px\");\n\n if (!this.data.combo) {\n selectElement.size = this.data.options.length;\n\n if (this.data.multiSelect) {\n selectElement.multiple = true;\n }\n }\n\n selectElement.addEventListener(\"resetform\", function (event) {\n var defaultValue = _this10.data.defaultFieldValue;\n\n var _iterator13 = _createForOfIteratorHelper(selectElement.options),\n _step13;\n\n try {\n for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {\n var option = _step13.value;\n option.selected = option.value === defaultValue;\n }\n } catch (err) {\n _iterator13.e(err);\n } finally {\n _iterator13.f();\n }\n });\n\n var _iterator14 = _createForOfIteratorHelper(this.data.options),\n _step14;\n\n try {\n for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) {\n var option = _step14.value;\n var optionElement = document.createElement(\"option\");\n optionElement.textContent = option.displayValue;\n optionElement.value = option.exportValue;\n\n if (this.data.combo) {\n optionElement.style.fontSize = fontSizeStyle;\n }\n\n if (this.data.fieldValue.includes(option.exportValue)) {\n optionElement.setAttribute(\"selected\", true);\n }\n\n selectElement.appendChild(optionElement);\n }\n } catch (err) {\n _iterator14.e(err);\n } finally {\n _iterator14.f();\n }\n\n var getValue = function getValue(event, isExport) {\n var name = isExport ? \"value\" : \"textContent\";\n var options = event.target.options;\n\n if (!event.target.multiple) {\n return options.selectedIndex === -1 ? null : options[options.selectedIndex][name];\n }\n\n return Array.prototype.filter.call(options, function (option) {\n return option.selected;\n }).map(function (option) {\n return option[name];\n });\n };\n\n var getItems = function getItems(event) {\n var options = event.target.options;\n return Array.prototype.map.call(options, function (option) {\n return {\n displayValue: option.textContent,\n exportValue: option.value\n };\n });\n };\n\n if (this.enableScripting && this.hasJSActions) {\n selectElement.addEventListener(\"updatefromsandbox\", function (jsEvent) {\n var actions = {\n value: function value(event) {\n var value = event.detail.value;\n var values = new Set(Array.isArray(value) ? value : [value]);\n\n var _iterator15 = _createForOfIteratorHelper(selectElement.options),\n _step15;\n\n try {\n for (_iterator15.s(); !(_step15 = _iterator15.n()).done;) {\n var option = _step15.value;\n option.selected = values.has(option.value);\n }\n } catch (err) {\n _iterator15.e(err);\n } finally {\n _iterator15.f();\n }\n\n storage.setValue(id, {\n value: getValue(event, true)\n });\n },\n multipleSelection: function multipleSelection(event) {\n selectElement.multiple = true;\n },\n remove: function remove(event) {\n var options = selectElement.options;\n var index = event.detail.remove;\n options[index].selected = false;\n selectElement.remove(index);\n\n if (options.length > 0) {\n var i = Array.prototype.findIndex.call(options, function (option) {\n return option.selected;\n });\n\n if (i === -1) {\n options[0].selected = true;\n }\n }\n\n storage.setValue(id, {\n value: getValue(event, true),\n items: getItems(event)\n });\n },\n clear: function clear(event) {\n while (selectElement.length !== 0) {\n selectElement.remove(0);\n }\n\n storage.setValue(id, {\n value: null,\n items: []\n });\n },\n insert: function insert(event) {\n var _event$detail$insert = event.detail.insert,\n index = _event$detail$insert.index,\n displayValue = _event$detail$insert.displayValue,\n exportValue = _event$detail$insert.exportValue;\n var optionElement = document.createElement(\"option\");\n optionElement.textContent = displayValue;\n optionElement.value = exportValue;\n selectElement.insertBefore(optionElement, selectElement.children[index]);\n storage.setValue(id, {\n value: getValue(event, true),\n items: getItems(event)\n });\n },\n items: function items(event) {\n var items = event.detail.items;\n\n while (selectElement.length !== 0) {\n selectElement.remove(0);\n }\n\n var _iterator16 = _createForOfIteratorHelper(items),\n _step16;\n\n try {\n for (_iterator16.s(); !(_step16 = _iterator16.n()).done;) {\n var item = _step16.value;\n var displayValue = item.displayValue,\n exportValue = item.exportValue;\n var optionElement = document.createElement(\"option\");\n optionElement.textContent = displayValue;\n optionElement.value = exportValue;\n selectElement.appendChild(optionElement);\n }\n } catch (err) {\n _iterator16.e(err);\n } finally {\n _iterator16.f();\n }\n\n if (selectElement.options.length > 0) {\n selectElement.options[0].selected = true;\n }\n\n storage.setValue(id, {\n value: getValue(event, true),\n items: getItems(event)\n });\n },\n indices: function indices(event) {\n var indices = new Set(event.detail.indices);\n\n var _iterator17 = _createForOfIteratorHelper(event.target.options),\n _step17;\n\n try {\n for (_iterator17.s(); !(_step17 = _iterator17.n()).done;) {\n var option = _step17.value;\n option.selected = indices.has(option.index);\n }\n } catch (err) {\n _iterator17.e(err);\n } finally {\n _iterator17.f();\n }\n\n storage.setValue(id, {\n value: getValue(event, true)\n });\n },\n editable: function editable(event) {\n event.target.disabled = !event.detail.editable;\n }\n };\n\n _this10._dispatchEventFromSandbox(actions, jsEvent);\n });\n selectElement.addEventListener(\"input\", function (event) {\n var _this10$linkService$e;\n\n var exportValue = getValue(event, true);\n var value = getValue(event, false);\n storage.setValue(id, {\n value: exportValue\n });\n (_this10$linkService$e = _this10.linkService.eventBus) === null || _this10$linkService$e === void 0 ? void 0 : _this10$linkService$e.dispatch(\"dispatcheventinsandbox\", {\n source: _this10,\n detail: {\n id: id,\n name: \"Keystroke\",\n value: value,\n changeEx: exportValue,\n willCommit: true,\n commitKey: 1,\n keyDown: false\n }\n });\n });\n\n this._setEventListeners(selectElement, [[\"focus\", \"Focus\"], [\"blur\", \"Blur\"], [\"mousedown\", \"Mouse Down\"], [\"mouseenter\", \"Mouse Enter\"], [\"mouseleave\", \"Mouse Exit\"], [\"mouseup\", \"Mouse Up\"], [\"input\", \"Action\"]], function (event) {\n return event.target.checked;\n });\n } else {\n selectElement.addEventListener(\"input\", function (event) {\n storage.setValue(id, {\n value: getValue(event)\n });\n });\n }\n\n this._setBackgroundColor(selectElement);\n\n this.container.appendChild(selectElement);\n return this.container;\n }\n }]);\n\n return ChoiceWidgetAnnotationElement;\n}(WidgetAnnotationElement);\n\nvar PopupAnnotationElement = /*#__PURE__*/function (_AnnotationElement4) {\n _inherits(PopupAnnotationElement, _AnnotationElement4);\n\n var _super9 = _createSuper(PopupAnnotationElement);\n\n function PopupAnnotationElement(parameters) {\n var _parameters$data$titl2, _parameters$data$cont2, _parameters$data$rich2;\n\n _classCallCheck(this, PopupAnnotationElement);\n\n 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 || (_parameters$data$rich2 = parameters.data.richText) !== null && _parameters$data$rich2 !== void 0 && _parameters$data$rich2.str);\n return _super9.call(this, parameters, {\n isRenderable: isRenderable\n });\n }\n\n _createClass(PopupAnnotationElement, [{\n key: \"render\",\n value: function render() {\n var IGNORE_TYPES = [\"Line\", \"Square\", \"Circle\", \"PolyLine\", \"Polygon\", \"Ink\"];\n this.container.className = \"popupAnnotation\";\n\n if (IGNORE_TYPES.includes(this.data.parentType)) {\n return this.container;\n }\n\n var selector = \"[data-annotation-id=\\\"\".concat(this.data.parentId, \"\\\"]\");\n var parentElements = this.layer.querySelectorAll(selector);\n\n if (parentElements.length === 0) {\n return this.container;\n }\n\n var popup = new PopupElement({\n container: this.container,\n trigger: Array.from(parentElements),\n color: this.data.color,\n titleObj: this.data.titleObj,\n modificationDate: this.data.modificationDate,\n contentsObj: this.data.contentsObj,\n richText: this.data.richText\n });\n var page = this.page;\n\n 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]]);\n\n var popupLeft = rect[0] + this.data.parentRect[2] - this.data.parentRect[0];\n var popupTop = rect[1];\n this.container.style.transformOrigin = \"\".concat(-popupLeft, \"px \").concat(-popupTop, \"px\");\n this.container.style.left = \"\".concat(popupLeft, \"px\");\n this.container.style.top = \"\".concat(popupTop, \"px\");\n this.container.appendChild(popup.render());\n return this.container;\n }\n }]);\n\n return PopupAnnotationElement;\n}(AnnotationElement);\n\nvar PopupElement = /*#__PURE__*/function () {\n function PopupElement(parameters) {\n _classCallCheck(this, PopupElement);\n\n this.container = parameters.container;\n this.trigger = parameters.trigger;\n this.color = parameters.color;\n this.titleObj = parameters.titleObj;\n this.modificationDate = parameters.modificationDate;\n this.contentsObj = parameters.contentsObj;\n this.richText = parameters.richText;\n this.hideWrapper = parameters.hideWrapper || false;\n this.pinned = false;\n }\n\n _createClass(PopupElement, [{\n key: \"render\",\n value: function render() {\n var _this$richText, _this$contentsObj;\n\n var BACKGROUND_ENLIGHT = 0.7;\n var wrapper = document.createElement(\"div\");\n wrapper.className = \"popupWrapper\";\n this.hideElement = this.hideWrapper ? wrapper : this.container;\n this.hideElement.hidden = true;\n var popup = document.createElement(\"div\");\n popup.className = \"popup\";\n var color = this.color;\n\n if (color) {\n var r = BACKGROUND_ENLIGHT * (255 - color[0]) + color[0];\n var g = BACKGROUND_ENLIGHT * (255 - color[1]) + color[1];\n var b = BACKGROUND_ENLIGHT * (255 - color[2]) + color[2];\n popup.style.backgroundColor = _util.Util.makeHexColor(r | 0, g | 0, b | 0);\n }\n\n var title = document.createElement(\"h1\");\n title.dir = this.titleObj.dir;\n title.textContent = this.titleObj.str;\n popup.appendChild(title);\n\n var dateObject = _display_utils.PDFDateString.toDateObject(this.modificationDate);\n\n if (dateObject) {\n var modificationDate = document.createElement(\"span\");\n modificationDate.className = \"popupDate\";\n modificationDate.textContent = \"{{date}}, {{time}}\";\n modificationDate.dataset.l10nId = \"annotation_date_string\";\n modificationDate.dataset.l10nArgs = JSON.stringify({\n date: dateObject.toLocaleDateString(),\n time: dateObject.toLocaleTimeString()\n });\n popup.appendChild(modificationDate);\n }\n\n if ((_this$richText = this.richText) !== null && _this$richText !== void 0 && _this$richText.str && (!((_this$contentsObj = this.contentsObj) !== null && _this$contentsObj !== void 0 && _this$contentsObj.str) || this.contentsObj.str === this.richText.str)) {\n _xfa_layer.XfaLayer.render({\n xfaHtml: this.richText.html,\n intent: \"richText\",\n div: popup\n });\n\n popup.lastChild.className = \"richText popupContent\";\n } else {\n var contents = this._formatContents(this.contentsObj);\n\n popup.appendChild(contents);\n }\n\n if (!Array.isArray(this.trigger)) {\n this.trigger = [this.trigger];\n }\n\n var _iterator18 = _createForOfIteratorHelper(this.trigger),\n _step18;\n\n try {\n for (_iterator18.s(); !(_step18 = _iterator18.n()).done;) {\n var element = _step18.value;\n element.addEventListener(\"click\", this._toggle.bind(this));\n element.addEventListener(\"mouseover\", this._show.bind(this, false));\n element.addEventListener(\"mouseout\", this._hide.bind(this, false));\n }\n } catch (err) {\n _iterator18.e(err);\n } finally {\n _iterator18.f();\n }\n\n popup.addEventListener(\"click\", this._hide.bind(this, true));\n wrapper.appendChild(popup);\n return wrapper;\n }\n }, {\n key: \"_formatContents\",\n value: function _formatContents(_ref2) {\n var str = _ref2.str,\n dir = _ref2.dir;\n var p = document.createElement(\"p\");\n p.className = \"popupContent\";\n p.dir = dir;\n var lines = str.split(/(?:\\r\\n?|\\n)/);\n\n for (var i = 0, ii = lines.length; i < ii; ++i) {\n var line = lines[i];\n p.appendChild(document.createTextNode(line));\n\n if (i < ii - 1) {\n p.appendChild(document.createElement(\"br\"));\n }\n }\n\n return p;\n }\n }, {\n key: \"_toggle\",\n value: function _toggle() {\n if (this.pinned) {\n this._hide(true);\n } else {\n this._show(true);\n }\n }\n }, {\n key: \"_show\",\n value: function _show() {\n var pin = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n if (pin) {\n this.pinned = true;\n }\n\n if (this.hideElement.hidden) {\n this.hideElement.hidden = false;\n this.container.style.zIndex += 1;\n }\n }\n }, {\n key: \"_hide\",\n value: function _hide() {\n var unpin = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n\n if (unpin) {\n this.pinned = false;\n }\n\n if (!this.hideElement.hidden && !this.pinned) {\n this.hideElement.hidden = true;\n this.container.style.zIndex -= 1;\n }\n }\n }]);\n\n return PopupElement;\n}();\n\nvar FreeTextAnnotationElement = /*#__PURE__*/function (_AnnotationElement5) {\n _inherits(FreeTextAnnotationElement, _AnnotationElement5);\n\n var _super10 = _createSuper(FreeTextAnnotationElement);\n\n function FreeTextAnnotationElement(parameters) {\n var _parameters$data$titl3, _parameters$data$cont3, _parameters$data$rich3;\n\n _classCallCheck(this, FreeTextAnnotationElement);\n\n 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 || (_parameters$data$rich3 = parameters.data.richText) !== null && _parameters$data$rich3 !== void 0 && _parameters$data$rich3.str);\n return _super10.call(this, parameters, {\n isRenderable: isRenderable,\n ignoreBorder: true\n });\n }\n\n _createClass(FreeTextAnnotationElement, [{\n key: \"render\",\n value: function render() {\n this.container.className = \"freeTextAnnotation\";\n\n if (!this.data.hasPopup) {\n this._createPopup(null, this.data);\n }\n\n return this.container;\n }\n }]);\n\n return FreeTextAnnotationElement;\n}(AnnotationElement);\n\nvar LineAnnotationElement = /*#__PURE__*/function (_AnnotationElement6) {\n _inherits(LineAnnotationElement, _AnnotationElement6);\n\n var _super11 = _createSuper(LineAnnotationElement);\n\n function LineAnnotationElement(parameters) {\n var _parameters$data$titl4, _parameters$data$cont4, _parameters$data$rich4;\n\n _classCallCheck(this, LineAnnotationElement);\n\n 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 || (_parameters$data$rich4 = parameters.data.richText) !== null && _parameters$data$rich4 !== void 0 && _parameters$data$rich4.str);\n return _super11.call(this, parameters, {\n isRenderable: isRenderable,\n ignoreBorder: true\n });\n }\n\n _createClass(LineAnnotationElement, [{\n key: \"render\",\n value: function render() {\n this.container.className = \"lineAnnotation\";\n var data = this.data;\n\n var _getRectDims2 = getRectDims(data.rect),\n width = _getRectDims2.width,\n height = _getRectDims2.height;\n\n var svg = this.svgFactory.create(width, height);\n var line = this.svgFactory.createElement(\"svg:line\");\n line.setAttribute(\"x1\", data.rect[2] - data.lineCoordinates[0]);\n line.setAttribute(\"y1\", data.rect[3] - data.lineCoordinates[1]);\n line.setAttribute(\"x2\", data.rect[2] - data.lineCoordinates[2]);\n line.setAttribute(\"y2\", data.rect[3] - data.lineCoordinates[3]);\n line.setAttribute(\"stroke-width\", data.borderStyle.width || 1);\n line.setAttribute(\"stroke\", \"transparent\");\n line.setAttribute(\"fill\", \"transparent\");\n svg.appendChild(line);\n this.container.append(svg);\n\n this._createPopup(line, data);\n\n return this.container;\n }\n }]);\n\n return LineAnnotationElement;\n}(AnnotationElement);\n\nvar SquareAnnotationElement = /*#__PURE__*/function (_AnnotationElement7) {\n _inherits(SquareAnnotationElement, _AnnotationElement7);\n\n var _super12 = _createSuper(SquareAnnotationElement);\n\n function SquareAnnotationElement(parameters) {\n var _parameters$data$titl5, _parameters$data$cont5, _parameters$data$rich5;\n\n _classCallCheck(this, SquareAnnotationElement);\n\n 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 || (_parameters$data$rich5 = parameters.data.richText) !== null && _parameters$data$rich5 !== void 0 && _parameters$data$rich5.str);\n return _super12.call(this, parameters, {\n isRenderable: isRenderable,\n ignoreBorder: true\n });\n }\n\n _createClass(SquareAnnotationElement, [{\n key: \"render\",\n value: function render() {\n this.container.className = \"squareAnnotation\";\n var data = this.data;\n\n var _getRectDims3 = getRectDims(data.rect),\n width = _getRectDims3.width,\n height = _getRectDims3.height;\n\n var svg = this.svgFactory.create(width, height);\n var borderWidth = data.borderStyle.width;\n var square = this.svgFactory.createElement(\"svg:rect\");\n square.setAttribute(\"x\", borderWidth / 2);\n square.setAttribute(\"y\", borderWidth / 2);\n square.setAttribute(\"width\", width - borderWidth);\n square.setAttribute(\"height\", height - borderWidth);\n square.setAttribute(\"stroke-width\", borderWidth || 1);\n square.setAttribute(\"stroke\", \"transparent\");\n square.setAttribute(\"fill\", \"transparent\");\n svg.appendChild(square);\n this.container.append(svg);\n\n this._createPopup(square, data);\n\n return this.container;\n }\n }]);\n\n return SquareAnnotationElement;\n}(AnnotationElement);\n\nvar CircleAnnotationElement = /*#__PURE__*/function (_AnnotationElement8) {\n _inherits(CircleAnnotationElement, _AnnotationElement8);\n\n var _super13 = _createSuper(CircleAnnotationElement);\n\n function CircleAnnotationElement(parameters) {\n var _parameters$data$titl6, _parameters$data$cont6, _parameters$data$rich6;\n\n _classCallCheck(this, CircleAnnotationElement);\n\n 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 || (_parameters$data$rich6 = parameters.data.richText) !== null && _parameters$data$rich6 !== void 0 && _parameters$data$rich6.str);\n return _super13.call(this, parameters, {\n isRenderable: isRenderable,\n ignoreBorder: true\n });\n }\n\n _createClass(CircleAnnotationElement, [{\n key: \"render\",\n value: function render() {\n this.container.className = \"circleAnnotation\";\n var data = this.data;\n\n var _getRectDims4 = getRectDims(data.rect),\n width = _getRectDims4.width,\n height = _getRectDims4.height;\n\n var svg = this.svgFactory.create(width, height);\n var borderWidth = data.borderStyle.width;\n var circle = this.svgFactory.createElement(\"svg:ellipse\");\n circle.setAttribute(\"cx\", width / 2);\n circle.setAttribute(\"cy\", height / 2);\n circle.setAttribute(\"rx\", width / 2 - borderWidth / 2);\n circle.setAttribute(\"ry\", height / 2 - borderWidth / 2);\n circle.setAttribute(\"stroke-width\", borderWidth || 1);\n circle.setAttribute(\"stroke\", \"transparent\");\n circle.setAttribute(\"fill\", \"transparent\");\n svg.appendChild(circle);\n this.container.append(svg);\n\n this._createPopup(circle, data);\n\n return this.container;\n }\n }]);\n\n return CircleAnnotationElement;\n}(AnnotationElement);\n\nvar PolylineAnnotationElement = /*#__PURE__*/function (_AnnotationElement9) {\n _inherits(PolylineAnnotationElement, _AnnotationElement9);\n\n var _super14 = _createSuper(PolylineAnnotationElement);\n\n function PolylineAnnotationElement(parameters) {\n var _parameters$data$titl7, _parameters$data$cont7, _parameters$data$rich7;\n\n var _this11;\n\n _classCallCheck(this, PolylineAnnotationElement);\n\n 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 || (_parameters$data$rich7 = parameters.data.richText) !== null && _parameters$data$rich7 !== void 0 && _parameters$data$rich7.str);\n _this11 = _super14.call(this, parameters, {\n isRenderable: isRenderable,\n ignoreBorder: true\n });\n _this11.containerClassName = \"polylineAnnotation\";\n _this11.svgElementName = \"svg:polyline\";\n return _this11;\n }\n\n _createClass(PolylineAnnotationElement, [{\n key: \"render\",\n value: function render() {\n this.container.className = this.containerClassName;\n var data = this.data;\n\n var _getRectDims5 = getRectDims(data.rect),\n width = _getRectDims5.width,\n height = _getRectDims5.height;\n\n var svg = this.svgFactory.create(width, height);\n var points = [];\n\n var _iterator19 = _createForOfIteratorHelper(data.vertices),\n _step19;\n\n try {\n for (_iterator19.s(); !(_step19 = _iterator19.n()).done;) {\n var coordinate = _step19.value;\n var x = coordinate.x - data.rect[0];\n var y = data.rect[3] - coordinate.y;\n points.push(x + \",\" + y);\n }\n } catch (err) {\n _iterator19.e(err);\n } finally {\n _iterator19.f();\n }\n\n points = points.join(\" \");\n var polyline = this.svgFactory.createElement(this.svgElementName);\n polyline.setAttribute(\"points\", points);\n polyline.setAttribute(\"stroke-width\", data.borderStyle.width || 1);\n polyline.setAttribute(\"stroke\", \"transparent\");\n polyline.setAttribute(\"fill\", \"transparent\");\n svg.appendChild(polyline);\n this.container.append(svg);\n\n this._createPopup(polyline, data);\n\n return this.container;\n }\n }]);\n\n return PolylineAnnotationElement;\n}(AnnotationElement);\n\nvar PolygonAnnotationElement = /*#__PURE__*/function (_PolylineAnnotationEl) {\n _inherits(PolygonAnnotationElement, _PolylineAnnotationEl);\n\n var _super15 = _createSuper(PolygonAnnotationElement);\n\n function PolygonAnnotationElement(parameters) {\n var _this12;\n\n _classCallCheck(this, PolygonAnnotationElement);\n\n _this12 = _super15.call(this, parameters);\n _this12.containerClassName = \"polygonAnnotation\";\n _this12.svgElementName = \"svg:polygon\";\n return _this12;\n }\n\n return _createClass(PolygonAnnotationElement);\n}(PolylineAnnotationElement);\n\nvar CaretAnnotationElement = /*#__PURE__*/function (_AnnotationElement10) {\n _inherits(CaretAnnotationElement, _AnnotationElement10);\n\n var _super16 = _createSuper(CaretAnnotationElement);\n\n function CaretAnnotationElement(parameters) {\n var _parameters$data$titl8, _parameters$data$cont8, _parameters$data$rich8;\n\n _classCallCheck(this, CaretAnnotationElement);\n\n 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 || (_parameters$data$rich8 = parameters.data.richText) !== null && _parameters$data$rich8 !== void 0 && _parameters$data$rich8.str);\n return _super16.call(this, parameters, {\n isRenderable: isRenderable,\n ignoreBorder: true\n });\n }\n\n _createClass(CaretAnnotationElement, [{\n key: \"render\",\n value: function render() {\n this.container.className = \"caretAnnotation\";\n\n if (!this.data.hasPopup) {\n this._createPopup(null, this.data);\n }\n\n return this.container;\n }\n }]);\n\n return CaretAnnotationElement;\n}(AnnotationElement);\n\nvar InkAnnotationElement = /*#__PURE__*/function (_AnnotationElement11) {\n _inherits(InkAnnotationElement, _AnnotationElement11);\n\n var _super17 = _createSuper(InkAnnotationElement);\n\n function InkAnnotationElement(parameters) {\n var _parameters$data$titl9, _parameters$data$cont9, _parameters$data$rich9;\n\n var _this13;\n\n _classCallCheck(this, InkAnnotationElement);\n\n 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 || (_parameters$data$rich9 = parameters.data.richText) !== null && _parameters$data$rich9 !== void 0 && _parameters$data$rich9.str);\n _this13 = _super17.call(this, parameters, {\n isRenderable: isRenderable,\n ignoreBorder: true\n });\n _this13.containerClassName = \"inkAnnotation\";\n _this13.svgElementName = \"svg:polyline\";\n return _this13;\n }\n\n _createClass(InkAnnotationElement, [{\n key: \"render\",\n value: function render() {\n this.container.className = this.containerClassName;\n var data = this.data;\n\n var _getRectDims6 = getRectDims(data.rect),\n width = _getRectDims6.width,\n height = _getRectDims6.height;\n\n var svg = this.svgFactory.create(width, height);\n\n var _iterator20 = _createForOfIteratorHelper(data.inkLists),\n _step20;\n\n try {\n for (_iterator20.s(); !(_step20 = _iterator20.n()).done;) {\n var inkList = _step20.value;\n var points = [];\n\n var _iterator21 = _createForOfIteratorHelper(inkList),\n _step21;\n\n try {\n for (_iterator21.s(); !(_step21 = _iterator21.n()).done;) {\n var coordinate = _step21.value;\n var x = coordinate.x - data.rect[0];\n var y = data.rect[3] - coordinate.y;\n points.push(\"\".concat(x, \",\").concat(y));\n }\n } catch (err) {\n _iterator21.e(err);\n } finally {\n _iterator21.f();\n }\n\n points = points.join(\" \");\n var polyline = this.svgFactory.createElement(this.svgElementName);\n polyline.setAttribute(\"points\", points);\n polyline.setAttribute(\"stroke-width\", data.borderStyle.width || 1);\n polyline.setAttribute(\"stroke\", \"transparent\");\n polyline.setAttribute(\"fill\", \"transparent\");\n\n this._createPopup(polyline, data);\n\n svg.appendChild(polyline);\n }\n } catch (err) {\n _iterator20.e(err);\n } finally {\n _iterator20.f();\n }\n\n this.container.append(svg);\n return this.container;\n }\n }]);\n\n return InkAnnotationElement;\n}(AnnotationElement);\n\nvar HighlightAnnotationElement = /*#__PURE__*/function (_AnnotationElement12) {\n _inherits(HighlightAnnotationElement, _AnnotationElement12);\n\n var _super18 = _createSuper(HighlightAnnotationElement);\n\n function HighlightAnnotationElement(parameters) {\n var _parameters$data$titl10, _parameters$data$cont10, _parameters$data$rich10;\n\n _classCallCheck(this, HighlightAnnotationElement);\n\n 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 || (_parameters$data$rich10 = parameters.data.richText) !== null && _parameters$data$rich10 !== void 0 && _parameters$data$rich10.str);\n return _super18.call(this, parameters, {\n isRenderable: isRenderable,\n ignoreBorder: true,\n createQuadrilaterals: true\n });\n }\n\n _createClass(HighlightAnnotationElement, [{\n key: \"render\",\n value: function render() {\n if (!this.data.hasPopup) {\n this._createPopup(null, this.data);\n }\n\n if (this.quadrilaterals) {\n return this._renderQuadrilaterals(\"highlightAnnotation\");\n }\n\n this.container.className = \"highlightAnnotation\";\n return this.container;\n }\n }]);\n\n return HighlightAnnotationElement;\n}(AnnotationElement);\n\nvar UnderlineAnnotationElement = /*#__PURE__*/function (_AnnotationElement13) {\n _inherits(UnderlineAnnotationElement, _AnnotationElement13);\n\n var _super19 = _createSuper(UnderlineAnnotationElement);\n\n function UnderlineAnnotationElement(parameters) {\n var _parameters$data$titl11, _parameters$data$cont11, _parameters$data$rich11;\n\n _classCallCheck(this, UnderlineAnnotationElement);\n\n 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 || (_parameters$data$rich11 = parameters.data.richText) !== null && _parameters$data$rich11 !== void 0 && _parameters$data$rich11.str);\n return _super19.call(this, parameters, {\n isRenderable: isRenderable,\n ignoreBorder: true,\n createQuadrilaterals: true\n });\n }\n\n _createClass(UnderlineAnnotationElement, [{\n key: \"render\",\n value: function render() {\n if (!this.data.hasPopup) {\n this._createPopup(null, this.data);\n }\n\n if (this.quadrilaterals) {\n return this._renderQuadrilaterals(\"underlineAnnotation\");\n }\n\n this.container.className = \"underlineAnnotation\";\n return this.container;\n }\n }]);\n\n return UnderlineAnnotationElement;\n}(AnnotationElement);\n\nvar SquigglyAnnotationElement = /*#__PURE__*/function (_AnnotationElement14) {\n _inherits(SquigglyAnnotationElement, _AnnotationElement14);\n\n var _super20 = _createSuper(SquigglyAnnotationElement);\n\n function SquigglyAnnotationElement(parameters) {\n var _parameters$data$titl12, _parameters$data$cont12, _parameters$data$rich12;\n\n _classCallCheck(this, SquigglyAnnotationElement);\n\n 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 || (_parameters$data$rich12 = parameters.data.richText) !== null && _parameters$data$rich12 !== void 0 && _parameters$data$rich12.str);\n return _super20.call(this, parameters, {\n isRenderable: isRenderable,\n ignoreBorder: true,\n createQuadrilaterals: true\n });\n }\n\n _createClass(SquigglyAnnotationElement, [{\n key: \"render\",\n value: function render() {\n if (!this.data.hasPopup) {\n this._createPopup(null, this.data);\n }\n\n if (this.quadrilaterals) {\n return this._renderQuadrilaterals(\"squigglyAnnotation\");\n }\n\n this.container.className = \"squigglyAnnotation\";\n return this.container;\n }\n }]);\n\n return SquigglyAnnotationElement;\n}(AnnotationElement);\n\nvar StrikeOutAnnotationElement = /*#__PURE__*/function (_AnnotationElement15) {\n _inherits(StrikeOutAnnotationElement, _AnnotationElement15);\n\n var _super21 = _createSuper(StrikeOutAnnotationElement);\n\n function StrikeOutAnnotationElement(parameters) {\n var _parameters$data$titl13, _parameters$data$cont13, _parameters$data$rich13;\n\n _classCallCheck(this, StrikeOutAnnotationElement);\n\n 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 || (_parameters$data$rich13 = parameters.data.richText) !== null && _parameters$data$rich13 !== void 0 && _parameters$data$rich13.str);\n return _super21.call(this, parameters, {\n isRenderable: isRenderable,\n ignoreBorder: true,\n createQuadrilaterals: true\n });\n }\n\n _createClass(StrikeOutAnnotationElement, [{\n key: \"render\",\n value: function render() {\n if (!this.data.hasPopup) {\n this._createPopup(null, this.data);\n }\n\n if (this.quadrilaterals) {\n return this._renderQuadrilaterals(\"strikeoutAnnotation\");\n }\n\n this.container.className = \"strikeoutAnnotation\";\n return this.container;\n }\n }]);\n\n return StrikeOutAnnotationElement;\n}(AnnotationElement);\n\nvar StampAnnotationElement = /*#__PURE__*/function (_AnnotationElement16) {\n _inherits(StampAnnotationElement, _AnnotationElement16);\n\n var _super22 = _createSuper(StampAnnotationElement);\n\n function StampAnnotationElement(parameters) {\n var _parameters$data$titl14, _parameters$data$cont14, _parameters$data$rich14;\n\n _classCallCheck(this, StampAnnotationElement);\n\n 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 || (_parameters$data$rich14 = parameters.data.richText) !== null && _parameters$data$rich14 !== void 0 && _parameters$data$rich14.str);\n return _super22.call(this, parameters, {\n isRenderable: isRenderable,\n ignoreBorder: true\n });\n }\n\n _createClass(StampAnnotationElement, [{\n key: \"render\",\n value: function render() {\n this.container.className = \"stampAnnotation\";\n\n if (!this.data.hasPopup) {\n this._createPopup(null, this.data);\n }\n\n return this.container;\n }\n }]);\n\n return StampAnnotationElement;\n}(AnnotationElement);\n\nvar FileAttachmentAnnotationElement = /*#__PURE__*/function (_AnnotationElement17) {\n _inherits(FileAttachmentAnnotationElement, _AnnotationElement17);\n\n var _super23 = _createSuper(FileAttachmentAnnotationElement);\n\n function FileAttachmentAnnotationElement(parameters) {\n var _this14$linkService$e;\n\n var _this14;\n\n _classCallCheck(this, FileAttachmentAnnotationElement);\n\n _this14 = _super23.call(this, parameters, {\n isRenderable: true\n });\n var _this14$data$file = _this14.data.file,\n filename = _this14$data$file.filename,\n content = _this14$data$file.content;\n _this14.filename = (0, _display_utils.getFilenameFromUrl)(filename);\n _this14.content = content;\n (_this14$linkService$e = _this14.linkService.eventBus) === null || _this14$linkService$e === void 0 ? void 0 : _this14$linkService$e.dispatch(\"fileattachmentannotation\", {\n source: _assertThisInitialized(_this14),\n id: (0, _util.stringToPDFString)(filename),\n filename: filename,\n content: content\n });\n return _this14;\n }\n\n _createClass(FileAttachmentAnnotationElement, [{\n key: \"render\",\n value: function render() {\n var _this$data$titleObj, _this$data$contentsOb;\n\n this.container.className = \"fileAttachmentAnnotation\";\n var trigger = document.createElement(\"div\");\n trigger.style.height = this.container.style.height;\n trigger.style.width = this.container.style.width;\n trigger.addEventListener(\"dblclick\", this._download.bind(this));\n\n 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.data.richText)) {\n this._createPopup(trigger, this.data);\n }\n\n this.container.appendChild(trigger);\n return this.container;\n }\n }, {\n key: \"_download\",\n value: function _download() {\n var _this$downloadManager;\n\n (_this$downloadManager = this.downloadManager) === null || _this$downloadManager === void 0 ? void 0 : _this$downloadManager.openOrDownloadData(this.container, this.content, this.filename);\n }\n }]);\n\n return FileAttachmentAnnotationElement;\n}(AnnotationElement);\n\nvar AnnotationLayer = /*#__PURE__*/function () {\n function AnnotationLayer() {\n _classCallCheck(this, AnnotationLayer);\n }\n\n _createClass(AnnotationLayer, null, [{\n key: \"render\",\n value: function render(parameters) {\n var sortedAnnotations = [],\n popupAnnotations = [];\n\n var _iterator22 = _createForOfIteratorHelper(parameters.annotations),\n _step22;\n\n try {\n for (_iterator22.s(); !(_step22 = _iterator22.n()).done;) {\n var _data = _step22.value;\n\n if (!_data) {\n continue;\n }\n\n var _getRectDims7 = getRectDims(_data.rect),\n width = _getRectDims7.width,\n height = _getRectDims7.height;\n\n if (width <= 0 || height <= 0) {\n continue;\n }\n\n if (_data.annotationType === _util.AnnotationType.POPUP) {\n popupAnnotations.push(_data);\n continue;\n }\n\n sortedAnnotations.push(_data);\n }\n } catch (err) {\n _iterator22.e(err);\n } finally {\n _iterator22.f();\n }\n\n if (popupAnnotations.length) {\n sortedAnnotations.push.apply(sortedAnnotations, popupAnnotations);\n }\n\n var div = parameters.div;\n\n for (var _i7 = 0, _sortedAnnotations = sortedAnnotations; _i7 < _sortedAnnotations.length; _i7++) {\n var data = _sortedAnnotations[_i7];\n var element = AnnotationElementFactory.create({\n data: data,\n layer: div,\n page: parameters.page,\n viewport: parameters.viewport,\n linkService: parameters.linkService,\n downloadManager: parameters.downloadManager,\n imageResourcesPath: parameters.imageResourcesPath || \"\",\n renderForms: parameters.renderForms !== false,\n svgFactory: new _display_utils.DOMSVGFactory(),\n annotationStorage: parameters.annotationStorage || new _annotation_storage.AnnotationStorage(),\n enableScripting: parameters.enableScripting,\n hasJSActions: parameters.hasJSActions,\n fieldObjects: parameters.fieldObjects,\n mouseState: parameters.mouseState || {\n isDown: false\n }\n });\n\n if (element.isRenderable) {\n var rendered = element.render();\n\n if (data.hidden) {\n rendered.style.visibility = \"hidden\";\n }\n\n if (Array.isArray(rendered)) {\n var _iterator23 = _createForOfIteratorHelper(rendered),\n _step23;\n\n try {\n for (_iterator23.s(); !(_step23 = _iterator23.n()).done;) {\n var renderedElement = _step23.value;\n div.appendChild(renderedElement);\n }\n } catch (err) {\n _iterator23.e(err);\n } finally {\n _iterator23.f();\n }\n } else {\n if (element instanceof PopupAnnotationElement) {\n div.prepend(rendered);\n } else {\n div.appendChild(rendered);\n }\n }\n }\n }\n\n _classStaticPrivateMethodGet(this, AnnotationLayer, _setAnnotationCanvasMap).call(this, div, parameters.annotationCanvasMap);\n }\n }, {\n key: \"update\",\n value: function update(parameters) {\n var page = parameters.page,\n viewport = parameters.viewport,\n annotations = parameters.annotations,\n annotationCanvasMap = parameters.annotationCanvasMap,\n div = parameters.div;\n var transform = viewport.transform;\n var matrix = \"matrix(\".concat(transform.join(\",\"), \")\");\n var scale, ownMatrix;\n\n var _iterator24 = _createForOfIteratorHelper(annotations),\n _step24;\n\n try {\n for (_iterator24.s(); !(_step24 = _iterator24.n()).done;) {\n var data = _step24.value;\n var elements = div.querySelectorAll(\"[data-annotation-id=\\\"\".concat(data.id, \"\\\"]\"));\n\n if (elements) {\n var _iterator25 = _createForOfIteratorHelper(elements),\n _step25;\n\n try {\n for (_iterator25.s(); !(_step25 = _iterator25.n()).done;) {\n var element = _step25.value;\n\n if (data.hasOwnCanvas) {\n 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]]);\n\n if (!ownMatrix) {\n scale = Math.abs(transform[0] || transform[1]);\n var ownTransform = transform.slice();\n\n for (var i = 0; i < 4; i++) {\n ownTransform[i] = Math.sign(ownTransform[i]);\n }\n\n ownMatrix = \"matrix(\".concat(ownTransform.join(\",\"), \")\");\n }\n\n var left = rect[0] * scale;\n var top = rect[1] * scale;\n element.style.left = \"\".concat(left, \"px\");\n element.style.top = \"\".concat(top, \"px\");\n element.style.transformOrigin = \"\".concat(-left, \"px \").concat(-top, \"px\");\n element.style.transform = ownMatrix;\n } else {\n element.style.transform = matrix;\n }\n }\n } catch (err) {\n _iterator25.e(err);\n } finally {\n _iterator25.f();\n }\n }\n }\n } catch (err) {\n _iterator24.e(err);\n } finally {\n _iterator24.f();\n }\n\n _classStaticPrivateMethodGet(this, AnnotationLayer, _setAnnotationCanvasMap).call(this, div, annotationCanvasMap);\n\n div.hidden = false;\n }\n }]);\n\n return AnnotationLayer;\n}();\n\nexports.AnnotationLayer = AnnotationLayer;\n\nfunction _setAnnotationCanvasMap(div, annotationCanvasMap) {\n if (!annotationCanvasMap) {\n return;\n }\n\n var _iterator26 = _createForOfIteratorHelper(annotationCanvasMap),\n _step26;\n\n try {\n for (_iterator26.s(); !(_step26 = _iterator26.n()).done;) {\n var _step26$value = _slicedToArray(_step26.value, 2),\n id = _step26$value[0],\n canvas = _step26$value[1];\n\n var element = div.querySelector(\"[data-annotation-id=\\\"\".concat(id, \"\\\"]\"));\n\n if (!element) {\n continue;\n }\n\n var firstChild = element.firstChild;\n\n if (firstChild.nodeName === \"CANVAS\") {\n element.replaceChild(canvas, firstChild);\n } else {\n element.insertBefore(canvas, firstChild);\n }\n }\n } catch (err) {\n _iterator26.e(err);\n } finally {\n _iterator26.f();\n }\n\n annotationCanvasMap.clear();\n}\n\n/***/ }),\n/* 161 */\n/***/ ((__unused_webpack_module, exports) => {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.ColorConverters = void 0;\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _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.\"); }\n\nfunction _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); }\n\nfunction _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; }\n\nfunction _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; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction makeColorComp(n) {\n return Math.floor(Math.max(0, Math.min(1, n)) * 255).toString(16).padStart(2, \"0\");\n}\n\nvar ColorConverters = /*#__PURE__*/function () {\n function ColorConverters() {\n _classCallCheck(this, ColorConverters);\n }\n\n _createClass(ColorConverters, null, [{\n key: \"CMYK_G\",\n value: function CMYK_G(_ref) {\n var _ref2 = _slicedToArray(_ref, 4),\n c = _ref2[0],\n y = _ref2[1],\n m = _ref2[2],\n k = _ref2[3];\n\n return [\"G\", 1 - Math.min(1, 0.3 * c + 0.59 * m + 0.11 * y + k)];\n }\n }, {\n key: \"G_CMYK\",\n value: function G_CMYK(_ref3) {\n var _ref4 = _slicedToArray(_ref3, 1),\n g = _ref4[0];\n\n return [\"CMYK\", 0, 0, 0, 1 - g];\n }\n }, {\n key: \"G_RGB\",\n value: function G_RGB(_ref5) {\n var _ref6 = _slicedToArray(_ref5, 1),\n g = _ref6[0];\n\n return [\"RGB\", g, g, g];\n }\n }, {\n key: \"G_HTML\",\n value: function G_HTML(_ref7) {\n var _ref8 = _slicedToArray(_ref7, 1),\n g = _ref8[0];\n\n var G = makeColorComp(g);\n return \"#\".concat(G).concat(G).concat(G);\n }\n }, {\n key: \"RGB_G\",\n value: function RGB_G(_ref9) {\n var _ref10 = _slicedToArray(_ref9, 3),\n r = _ref10[0],\n g = _ref10[1],\n b = _ref10[2];\n\n return [\"G\", 0.3 * r + 0.59 * g + 0.11 * b];\n }\n }, {\n key: \"RGB_HTML\",\n value: function RGB_HTML(_ref11) {\n var _ref12 = _slicedToArray(_ref11, 3),\n r = _ref12[0],\n g = _ref12[1],\n b = _ref12[2];\n\n var R = makeColorComp(r);\n var G = makeColorComp(g);\n var B = makeColorComp(b);\n return \"#\".concat(R).concat(G).concat(B);\n }\n }, {\n key: \"T_HTML\",\n value: function T_HTML() {\n return \"#00000000\";\n }\n }, {\n key: \"CMYK_RGB\",\n value: function CMYK_RGB(_ref13) {\n var _ref14 = _slicedToArray(_ref13, 4),\n c = _ref14[0],\n y = _ref14[1],\n m = _ref14[2],\n k = _ref14[3];\n\n return [\"RGB\", 1 - Math.min(1, c + k), 1 - Math.min(1, m + k), 1 - Math.min(1, y + k)];\n }\n }, {\n key: \"CMYK_HTML\",\n value: function CMYK_HTML(components) {\n return this.RGB_HTML(this.CMYK_RGB(components));\n }\n }, {\n key: \"RGB_CMYK\",\n value: function RGB_CMYK(_ref15) {\n var _ref16 = _slicedToArray(_ref15, 3),\n r = _ref16[0],\n g = _ref16[1],\n b = _ref16[2];\n\n var c = 1 - r;\n var m = 1 - g;\n var y = 1 - b;\n var k = Math.min(c, m, y);\n return [\"CMYK\", c, m, y, k];\n }\n }]);\n\n return ColorConverters;\n}();\n\nexports.ColorConverters = ColorConverters;\n\n/***/ }),\n/* 162 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.XfaLayer = void 0;\n\nvar _util = __w_pdfjs_require__(1);\n\nvar _xfa_text = __w_pdfjs_require__(159);\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _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.\"); }\n\nfunction _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; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _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; } } }; }\n\nfunction _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); }\n\nfunction _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; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nvar XfaLayer = /*#__PURE__*/function () {\n function XfaLayer() {\n _classCallCheck(this, XfaLayer);\n }\n\n _createClass(XfaLayer, null, [{\n key: \"setupStorage\",\n value: function setupStorage(html, id, element, storage, intent) {\n var storedData = storage.getValue(id, {\n value: null\n });\n\n switch (element.name) {\n case \"textarea\":\n if (storedData.value !== null) {\n html.textContent = storedData.value;\n }\n\n if (intent === \"print\") {\n break;\n }\n\n html.addEventListener(\"input\", function (event) {\n storage.setValue(id, {\n value: event.target.value\n });\n });\n break;\n\n case \"input\":\n if (element.attributes.type === \"radio\" || element.attributes.type === \"checkbox\") {\n if (storedData.value === element.attributes.xfaOn) {\n html.setAttribute(\"checked\", true);\n } else if (storedData.value === element.attributes.xfaOff) {\n html.removeAttribute(\"checked\");\n }\n\n if (intent === \"print\") {\n break;\n }\n\n html.addEventListener(\"change\", function (event) {\n storage.setValue(id, {\n value: event.target.checked ? event.target.getAttribute(\"xfaOn\") : event.target.getAttribute(\"xfaOff\")\n });\n });\n } else {\n if (storedData.value !== null) {\n html.setAttribute(\"value\", storedData.value);\n }\n\n if (intent === \"print\") {\n break;\n }\n\n html.addEventListener(\"input\", function (event) {\n storage.setValue(id, {\n value: event.target.value\n });\n });\n }\n\n break;\n\n case \"select\":\n if (storedData.value !== null) {\n var _iterator = _createForOfIteratorHelper(element.children),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var option = _step.value;\n\n if (option.attributes.value === storedData.value) {\n option.attributes.selected = true;\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n }\n\n html.addEventListener(\"input\", function (event) {\n var options = event.target.options;\n var value = options.selectedIndex === -1 ? \"\" : options[options.selectedIndex].value;\n storage.setValue(id, {\n value: value\n });\n });\n break;\n }\n }\n }, {\n key: \"setAttributes\",\n value: function setAttributes(_ref) {\n var html = _ref.html,\n element = _ref.element,\n _ref$storage = _ref.storage,\n storage = _ref$storage === void 0 ? null : _ref$storage,\n intent = _ref.intent,\n linkService = _ref.linkService;\n var attributes = element.attributes;\n var isHTMLAnchorElement = html instanceof HTMLAnchorElement;\n\n if (attributes.type === \"radio\") {\n attributes.name = \"\".concat(attributes.name, \"-\").concat(intent);\n }\n\n for (var _i = 0, _Object$entries = Object.entries(attributes); _i < _Object$entries.length; _i++) {\n var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),\n key = _Object$entries$_i[0],\n value = _Object$entries$_i[1];\n\n if (value === null || value === undefined || key === \"dataId\") {\n continue;\n }\n\n if (key !== \"style\") {\n if (key === \"textContent\") {\n html.textContent = value;\n } else if (key === \"class\") {\n if (value.length) {\n html.setAttribute(key, value.join(\" \"));\n }\n } else {\n if (isHTMLAnchorElement && (key === \"href\" || key === \"newWindow\")) {\n continue;\n }\n\n html.setAttribute(key, value);\n }\n } else {\n Object.assign(html.style, value);\n }\n }\n\n if (isHTMLAnchorElement) {\n var _linkService$addLinkA;\n\n if (!linkService.addLinkAttributes) {\n (0, _util.warn)(\"XfaLayer.setAttribute - missing `addLinkAttributes`-method on the `linkService`-instance.\");\n }\n\n (_linkService$addLinkA = linkService.addLinkAttributes) === null || _linkService$addLinkA === void 0 ? void 0 : _linkService$addLinkA.call(linkService, html, attributes.href, attributes.newWindow);\n }\n\n if (storage && attributes.dataId) {\n this.setupStorage(html, attributes.dataId, element, storage);\n }\n }\n }, {\n key: \"render\",\n value: function render(parameters) {\n var storage = parameters.annotationStorage;\n var linkService = parameters.linkService;\n var root = parameters.xfaHtml;\n var intent = parameters.intent || \"display\";\n var rootHtml = document.createElement(root.name);\n\n if (root.attributes) {\n this.setAttributes({\n html: rootHtml,\n element: root,\n intent: intent,\n linkService: linkService\n });\n }\n\n var stack = [[root, -1, rootHtml]];\n var rootDiv = parameters.div;\n rootDiv.appendChild(rootHtml);\n\n if (parameters.viewport) {\n var transform = \"matrix(\".concat(parameters.viewport.transform.join(\",\"), \")\");\n rootDiv.style.transform = transform;\n }\n\n if (intent !== \"richText\") {\n rootDiv.setAttribute(\"class\", \"xfaLayer xfaFont\");\n }\n\n var textDivs = [];\n\n while (stack.length > 0) {\n var _child$attributes;\n\n var _stack = _slicedToArray(stack[stack.length - 1], 3),\n parent = _stack[0],\n i = _stack[1],\n html = _stack[2];\n\n if (i + 1 === parent.children.length) {\n stack.pop();\n continue;\n }\n\n var child = parent.children[++stack[stack.length - 1][1]];\n\n if (child === null) {\n continue;\n }\n\n var name = child.name;\n\n if (name === \"#text\") {\n var node = document.createTextNode(child.value);\n textDivs.push(node);\n html.appendChild(node);\n continue;\n }\n\n var childHtml = void 0;\n\n if (child !== null && child !== void 0 && (_child$attributes = child.attributes) !== null && _child$attributes !== void 0 && _child$attributes.xmlns) {\n childHtml = document.createElementNS(child.attributes.xmlns, name);\n } else {\n childHtml = document.createElement(name);\n }\n\n html.appendChild(childHtml);\n\n if (child.attributes) {\n this.setAttributes({\n html: childHtml,\n element: child,\n storage: storage,\n intent: intent,\n linkService: linkService\n });\n }\n\n if (child.children && child.children.length > 0) {\n stack.push([child, -1, childHtml]);\n } else if (child.value) {\n var _node = document.createTextNode(child.value);\n\n if (_xfa_text.XfaText.shouldBuildText(name)) {\n textDivs.push(_node);\n }\n\n childHtml.appendChild(_node);\n }\n }\n\n var _iterator2 = _createForOfIteratorHelper(rootDiv.querySelectorAll(\".xfaNonInteractive input, .xfaNonInteractive textarea\")),\n _step2;\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var el = _step2.value;\n el.setAttribute(\"readOnly\", true);\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n\n return {\n textDivs: textDivs\n };\n }\n }, {\n key: \"update\",\n value: function update(parameters) {\n var transform = \"matrix(\".concat(parameters.viewport.transform.join(\",\"), \")\");\n parameters.div.style.transform = transform;\n parameters.div.hidden = false;\n }\n }]);\n\n return XfaLayer;\n}();\n\nexports.XfaLayer = XfaLayer;\n\n/***/ }),\n/* 163 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.renderTextLayer = renderTextLayer;\n\nvar _util = __w_pdfjs_require__(1);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _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; } } }; }\n\nfunction _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); }\n\nfunction _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; }\n\nvar MAX_TEXT_DIVS_TO_RENDER = 100000;\nvar DEFAULT_FONT_SIZE = 30;\nvar DEFAULT_FONT_ASCENT = 0.8;\nvar ascentCache = new Map();\nvar AllWhitespaceRegexp = /^\\s+$/g;\n\nfunction getAscent(fontFamily, ctx) {\n var cachedAscent = ascentCache.get(fontFamily);\n\n if (cachedAscent) {\n return cachedAscent;\n }\n\n ctx.save();\n ctx.font = \"\".concat(DEFAULT_FONT_SIZE, \"px \").concat(fontFamily);\n var metrics = ctx.measureText(\"\");\n var ascent = metrics.fontBoundingBoxAscent;\n var descent = Math.abs(metrics.fontBoundingBoxDescent);\n\n if (ascent) {\n ctx.restore();\n var ratio = ascent / (ascent + descent);\n ascentCache.set(fontFamily, ratio);\n return ratio;\n }\n\n ctx.strokeStyle = \"red\";\n ctx.clearRect(0, 0, DEFAULT_FONT_SIZE, DEFAULT_FONT_SIZE);\n ctx.strokeText(\"g\", 0, 0);\n var pixels = ctx.getImageData(0, 0, DEFAULT_FONT_SIZE, DEFAULT_FONT_SIZE).data;\n descent = 0;\n\n for (var i = pixels.length - 1 - 3; i >= 0; i -= 4) {\n if (pixels[i] > 0) {\n descent = Math.ceil(i / 4 / DEFAULT_FONT_SIZE);\n break;\n }\n }\n\n ctx.clearRect(0, 0, DEFAULT_FONT_SIZE, DEFAULT_FONT_SIZE);\n ctx.strokeText(\"A\", 0, DEFAULT_FONT_SIZE);\n pixels = ctx.getImageData(0, 0, DEFAULT_FONT_SIZE, DEFAULT_FONT_SIZE).data;\n ascent = 0;\n\n for (var _i = 0, ii = pixels.length; _i < ii; _i += 4) {\n if (pixels[_i] > 0) {\n ascent = DEFAULT_FONT_SIZE - Math.floor(_i / 4 / DEFAULT_FONT_SIZE);\n break;\n }\n }\n\n ctx.restore();\n\n if (ascent) {\n var _ratio = ascent / (ascent + descent);\n\n ascentCache.set(fontFamily, _ratio);\n return _ratio;\n }\n\n ascentCache.set(fontFamily, DEFAULT_FONT_ASCENT);\n return DEFAULT_FONT_ASCENT;\n}\n\nfunction appendText(task, geom, styles, ctx) {\n var textDiv = document.createElement(\"span\");\n var textDivProperties = task._enhanceTextSelection ? {\n angle: 0,\n canvasWidth: 0,\n hasText: geom.str !== \"\",\n hasEOL: geom.hasEOL,\n originalTransform: null,\n paddingBottom: 0,\n paddingLeft: 0,\n paddingRight: 0,\n paddingTop: 0,\n scale: 1\n } : {\n angle: 0,\n canvasWidth: 0,\n hasText: geom.str !== \"\",\n hasEOL: geom.hasEOL\n };\n\n task._textDivs.push(textDiv);\n\n var tx = _util.Util.transform(task._viewport.transform, geom.transform);\n\n var angle = Math.atan2(tx[1], tx[0]);\n var style = styles[geom.fontName];\n\n if (style.vertical) {\n angle += Math.PI / 2;\n }\n\n var fontHeight = Math.hypot(tx[2], tx[3]);\n var fontAscent = fontHeight * getAscent(style.fontFamily, ctx);\n var left, top;\n\n if (angle === 0) {\n left = tx[4];\n top = tx[5] - fontAscent;\n } else {\n left = tx[4] + fontAscent * Math.sin(angle);\n top = tx[5] - fontAscent * Math.cos(angle);\n }\n\n textDiv.style.left = \"\".concat(left, \"px\");\n textDiv.style.top = \"\".concat(top, \"px\");\n textDiv.style.fontSize = \"\".concat(fontHeight, \"px\");\n textDiv.style.fontFamily = style.fontFamily;\n textDiv.setAttribute(\"role\", \"presentation\");\n textDiv.textContent = geom.str;\n textDiv.dir = geom.dir;\n\n if (task._fontInspectorEnabled) {\n textDiv.dataset.fontName = geom.fontName;\n }\n\n if (angle !== 0) {\n textDivProperties.angle = angle * (180 / Math.PI);\n }\n\n var shouldScaleText = false;\n\n if (geom.str.length > 1 || task._enhanceTextSelection && AllWhitespaceRegexp.test(geom.str)) {\n shouldScaleText = true;\n } else if (geom.str !== \" \" && geom.transform[0] !== geom.transform[3]) {\n var absScaleX = Math.abs(geom.transform[0]),\n absScaleY = Math.abs(geom.transform[3]);\n\n if (absScaleX !== absScaleY && Math.max(absScaleX, absScaleY) / Math.min(absScaleX, absScaleY) > 1.5) {\n shouldScaleText = true;\n }\n }\n\n if (shouldScaleText) {\n if (style.vertical) {\n textDivProperties.canvasWidth = geom.height * task._viewport.scale;\n } else {\n textDivProperties.canvasWidth = geom.width * task._viewport.scale;\n }\n }\n\n task._textDivProperties.set(textDiv, textDivProperties);\n\n if (task._textContentStream) {\n task._layoutText(textDiv);\n }\n\n if (task._enhanceTextSelection && textDivProperties.hasText) {\n var angleCos = 1,\n angleSin = 0;\n\n if (angle !== 0) {\n angleCos = Math.cos(angle);\n angleSin = Math.sin(angle);\n }\n\n var divWidth = (style.vertical ? geom.height : geom.width) * task._viewport.scale;\n var divHeight = fontHeight;\n var m, b;\n\n if (angle !== 0) {\n m = [angleCos, angleSin, -angleSin, angleCos, left, top];\n b = _util.Util.getAxialAlignedBoundingBox([0, 0, divWidth, divHeight], m);\n } else {\n b = [left, top, left + divWidth, top + divHeight];\n }\n\n task._bounds.push({\n left: b[0],\n top: b[1],\n right: b[2],\n bottom: b[3],\n div: textDiv,\n size: [divWidth, divHeight],\n m: m\n });\n }\n}\n\nfunction render(task) {\n if (task._canceled) {\n return;\n }\n\n var textDivs = task._textDivs;\n var capability = task._capability;\n var textDivsLength = textDivs.length;\n\n if (textDivsLength > MAX_TEXT_DIVS_TO_RENDER) {\n task._renderingDone = true;\n capability.resolve();\n return;\n }\n\n if (!task._textContentStream) {\n for (var i = 0; i < textDivsLength; i++) {\n task._layoutText(textDivs[i]);\n }\n }\n\n task._renderingDone = true;\n capability.resolve();\n}\n\nfunction findPositiveMin(ts, offset, count) {\n var result = 0;\n\n for (var i = 0; i < count; i++) {\n var t = ts[offset++];\n\n if (t > 0) {\n result = result ? Math.min(t, result) : t;\n }\n }\n\n return result;\n}\n\nfunction expand(task) {\n var bounds = task._bounds;\n var viewport = task._viewport;\n var expanded = expandBounds(viewport.width, viewport.height, bounds);\n\n for (var i = 0; i < expanded.length; i++) {\n var div = bounds[i].div;\n\n var divProperties = task._textDivProperties.get(div);\n\n if (divProperties.angle === 0) {\n divProperties.paddingLeft = bounds[i].left - expanded[i].left;\n divProperties.paddingTop = bounds[i].top - expanded[i].top;\n divProperties.paddingRight = expanded[i].right - bounds[i].right;\n divProperties.paddingBottom = expanded[i].bottom - bounds[i].bottom;\n\n task._textDivProperties.set(div, divProperties);\n\n continue;\n }\n\n var e = expanded[i],\n b = bounds[i];\n var m = b.m,\n c = m[0],\n s = m[1];\n var points = [[0, 0], [0, b.size[1]], [b.size[0], 0], b.size];\n var ts = new Float64Array(64);\n\n for (var j = 0, jj = points.length; j < jj; j++) {\n var t = _util.Util.applyTransform(points[j], m);\n\n ts[j + 0] = c && (e.left - t[0]) / c;\n ts[j + 4] = s && (e.top - t[1]) / s;\n ts[j + 8] = c && (e.right - t[0]) / c;\n ts[j + 12] = s && (e.bottom - t[1]) / s;\n ts[j + 16] = s && (e.left - t[0]) / -s;\n ts[j + 20] = c && (e.top - t[1]) / c;\n ts[j + 24] = s && (e.right - t[0]) / -s;\n ts[j + 28] = c && (e.bottom - t[1]) / c;\n ts[j + 32] = c && (e.left - t[0]) / -c;\n ts[j + 36] = s && (e.top - t[1]) / -s;\n ts[j + 40] = c && (e.right - t[0]) / -c;\n ts[j + 44] = s && (e.bottom - t[1]) / -s;\n ts[j + 48] = s && (e.left - t[0]) / s;\n ts[j + 52] = c && (e.top - t[1]) / -c;\n ts[j + 56] = s && (e.right - t[0]) / s;\n ts[j + 60] = c && (e.bottom - t[1]) / -c;\n }\n\n var boxScale = 1 + Math.min(Math.abs(c), Math.abs(s));\n divProperties.paddingLeft = findPositiveMin(ts, 32, 16) / boxScale;\n divProperties.paddingTop = findPositiveMin(ts, 48, 16) / boxScale;\n divProperties.paddingRight = findPositiveMin(ts, 0, 16) / boxScale;\n divProperties.paddingBottom = findPositiveMin(ts, 16, 16) / boxScale;\n\n task._textDivProperties.set(div, divProperties);\n }\n}\n\nfunction expandBounds(width, height, boxes) {\n var bounds = boxes.map(function (box, i) {\n return {\n x1: box.left,\n y1: box.top,\n x2: box.right,\n y2: box.bottom,\n index: i,\n x1New: undefined,\n x2New: undefined\n };\n });\n expandBoundsLTR(width, bounds);\n var expanded = new Array(boxes.length);\n\n var _iterator = _createForOfIteratorHelper(bounds),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var b = _step.value;\n var i = b.index;\n expanded[i] = {\n left: b.x1New,\n top: 0,\n right: b.x2New,\n bottom: 0\n };\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n boxes.map(function (box, i) {\n var e = expanded[i],\n b = bounds[i];\n b.x1 = box.top;\n b.y1 = width - e.right;\n b.x2 = box.bottom;\n b.y2 = width - e.left;\n b.index = i;\n b.x1New = undefined;\n b.x2New = undefined;\n });\n expandBoundsLTR(height, bounds);\n\n var _iterator2 = _createForOfIteratorHelper(bounds),\n _step2;\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var _b = _step2.value;\n var _i2 = _b.index;\n expanded[_i2].top = _b.x1New;\n expanded[_i2].bottom = _b.x2New;\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n\n return expanded;\n}\n\nfunction expandBoundsLTR(width, bounds) {\n bounds.sort(function (a, b) {\n return a.x1 - b.x1 || a.index - b.index;\n });\n var fakeBoundary = {\n x1: -Infinity,\n y1: -Infinity,\n x2: 0,\n y2: Infinity,\n index: -1,\n x1New: 0,\n x2New: 0\n };\n var horizon = [{\n start: -Infinity,\n end: Infinity,\n boundary: fakeBoundary\n }];\n\n var _iterator3 = _createForOfIteratorHelper(bounds),\n _step3;\n\n try {\n for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n var boundary = _step3.value;\n var i = 0;\n\n while (i < horizon.length && horizon[i].end <= boundary.y1) {\n i++;\n }\n\n var j = horizon.length - 1;\n\n while (j >= 0 && horizon[j].start >= boundary.y2) {\n j--;\n }\n\n var _horizonPart = void 0,\n _affectedBoundary = void 0;\n\n var q = void 0,\n k = void 0,\n maxXNew = -Infinity;\n\n for (q = i; q <= j; q++) {\n _horizonPart = horizon[q];\n _affectedBoundary = _horizonPart.boundary;\n var xNew = void 0;\n\n if (_affectedBoundary.x2 > boundary.x1) {\n xNew = _affectedBoundary.index > boundary.index ? _affectedBoundary.x1New : boundary.x1;\n } else if (_affectedBoundary.x2New === undefined) {\n xNew = (_affectedBoundary.x2 + boundary.x1) / 2;\n } else {\n xNew = _affectedBoundary.x2New;\n }\n\n if (xNew > maxXNew) {\n maxXNew = xNew;\n }\n }\n\n boundary.x1New = maxXNew;\n\n for (q = i; q <= j; q++) {\n _horizonPart = horizon[q];\n _affectedBoundary = _horizonPart.boundary;\n\n if (_affectedBoundary.x2New === undefined) {\n if (_affectedBoundary.x2 > boundary.x1) {\n if (_affectedBoundary.index > boundary.index) {\n _affectedBoundary.x2New = _affectedBoundary.x2;\n }\n } else {\n _affectedBoundary.x2New = maxXNew;\n }\n } else if (_affectedBoundary.x2New > maxXNew) {\n _affectedBoundary.x2New = Math.max(maxXNew, _affectedBoundary.x2);\n }\n }\n\n var changedHorizon = [];\n var lastBoundary = null;\n\n for (q = i; q <= j; q++) {\n _horizonPart = horizon[q];\n _affectedBoundary = _horizonPart.boundary;\n var useBoundary = _affectedBoundary.x2 > boundary.x2 ? _affectedBoundary : boundary;\n\n if (lastBoundary === useBoundary) {\n changedHorizon[changedHorizon.length - 1].end = _horizonPart.end;\n } else {\n changedHorizon.push({\n start: _horizonPart.start,\n end: _horizonPart.end,\n boundary: useBoundary\n });\n lastBoundary = useBoundary;\n }\n }\n\n if (horizon[i].start < boundary.y1) {\n changedHorizon[0].start = boundary.y1;\n changedHorizon.unshift({\n start: horizon[i].start,\n end: boundary.y1,\n boundary: horizon[i].boundary\n });\n }\n\n if (boundary.y2 < horizon[j].end) {\n changedHorizon[changedHorizon.length - 1].end = boundary.y2;\n changedHorizon.push({\n start: boundary.y2,\n end: horizon[j].end,\n boundary: horizon[j].boundary\n });\n }\n\n for (q = i; q <= j; q++) {\n _horizonPart = horizon[q];\n _affectedBoundary = _horizonPart.boundary;\n\n if (_affectedBoundary.x2New !== undefined) {\n continue;\n }\n\n var used = false;\n\n for (k = i - 1; !used && k >= 0 && horizon[k].start >= _affectedBoundary.y1; k--) {\n used = horizon[k].boundary === _affectedBoundary;\n }\n\n for (k = j + 1; !used && k < horizon.length && horizon[k].end <= _affectedBoundary.y2; k++) {\n used = horizon[k].boundary === _affectedBoundary;\n }\n\n for (k = 0; !used && k < changedHorizon.length; k++) {\n used = changedHorizon[k].boundary === _affectedBoundary;\n }\n\n if (!used) {\n _affectedBoundary.x2New = maxXNew;\n }\n }\n\n Array.prototype.splice.apply(horizon, [i, j - i + 1].concat(changedHorizon));\n }\n } catch (err) {\n _iterator3.e(err);\n } finally {\n _iterator3.f();\n }\n\n for (var _i3 = 0, _horizon = horizon; _i3 < _horizon.length; _i3++) {\n var horizonPart = _horizon[_i3];\n var affectedBoundary = horizonPart.boundary;\n\n if (affectedBoundary.x2New === undefined) {\n affectedBoundary.x2New = Math.max(width, affectedBoundary.x2);\n }\n }\n}\n\nvar TextLayerRenderTask = /*#__PURE__*/function () {\n function TextLayerRenderTask(_ref) {\n var _globalThis$FontInspe,\n _this = this;\n\n var textContent = _ref.textContent,\n textContentStream = _ref.textContentStream,\n container = _ref.container,\n viewport = _ref.viewport,\n textDivs = _ref.textDivs,\n textContentItemsStr = _ref.textContentItemsStr,\n enhanceTextSelection = _ref.enhanceTextSelection;\n\n _classCallCheck(this, TextLayerRenderTask);\n\n this._textContent = textContent;\n this._textContentStream = textContentStream;\n this._container = container;\n this._document = container.ownerDocument;\n this._viewport = viewport;\n this._textDivs = textDivs || [];\n this._textContentItemsStr = textContentItemsStr || [];\n this._enhanceTextSelection = !!enhanceTextSelection;\n this._fontInspectorEnabled = !!((_globalThis$FontInspe = globalThis.FontInspector) !== null && _globalThis$FontInspe !== void 0 && _globalThis$FontInspe.enabled);\n this._reader = null;\n this._layoutTextLastFontSize = null;\n this._layoutTextLastFontFamily = null;\n this._layoutTextCtx = null;\n this._textDivProperties = new WeakMap();\n this._renderingDone = false;\n this._canceled = false;\n this._capability = (0, _util.createPromiseCapability)();\n this._renderTimer = null;\n this._bounds = [];\n\n this._capability.promise[\"finally\"](function () {\n if (!_this._enhanceTextSelection) {\n _this._textDivProperties = null;\n }\n\n if (_this._layoutTextCtx) {\n _this._layoutTextCtx.canvas.width = 0;\n _this._layoutTextCtx.canvas.height = 0;\n _this._layoutTextCtx = null;\n }\n })[\"catch\"](function () {});\n }\n\n _createClass(TextLayerRenderTask, [{\n key: \"promise\",\n get: function get() {\n return this._capability.promise;\n }\n }, {\n key: \"cancel\",\n value: function cancel() {\n this._canceled = true;\n\n if (this._reader) {\n this._reader.cancel(new _util.AbortException(\"TextLayer task cancelled.\"))[\"catch\"](function () {});\n\n this._reader = null;\n }\n\n if (this._renderTimer !== null) {\n clearTimeout(this._renderTimer);\n this._renderTimer = null;\n }\n\n this._capability.reject(new Error(\"TextLayer task cancelled.\"));\n }\n }, {\n key: \"_processItems\",\n value: function _processItems(items, styleCache) {\n for (var i = 0, len = items.length; i < len; i++) {\n if (items[i].str === undefined) {\n if (items[i].type === \"beginMarkedContentProps\" || items[i].type === \"beginMarkedContent\") {\n var parent = this._container;\n this._container = document.createElement(\"span\");\n\n this._container.classList.add(\"markedContent\");\n\n if (items[i].id !== null) {\n this._container.setAttribute(\"id\", \"\".concat(items[i].id));\n }\n\n parent.appendChild(this._container);\n } else if (items[i].type === \"endMarkedContent\") {\n this._container = this._container.parentNode;\n }\n\n continue;\n }\n\n this._textContentItemsStr.push(items[i].str);\n\n appendText(this, items[i], styleCache, this._layoutTextCtx);\n }\n }\n }, {\n key: \"_layoutText\",\n value: function _layoutText(textDiv) {\n var textDivProperties = this._textDivProperties.get(textDiv);\n\n var transform = \"\";\n\n if (textDivProperties.canvasWidth !== 0 && textDivProperties.hasText) {\n var _textDiv$style = textDiv.style,\n fontSize = _textDiv$style.fontSize,\n fontFamily = _textDiv$style.fontFamily;\n\n if (fontSize !== this._layoutTextLastFontSize || fontFamily !== this._layoutTextLastFontFamily) {\n this._layoutTextCtx.font = \"\".concat(fontSize, \" \").concat(fontFamily);\n this._layoutTextLastFontSize = fontSize;\n this._layoutTextLastFontFamily = fontFamily;\n }\n\n var _this$_layoutTextCtx$ = this._layoutTextCtx.measureText(textDiv.textContent),\n width = _this$_layoutTextCtx$.width;\n\n if (width > 0) {\n var scale = textDivProperties.canvasWidth / width;\n\n if (this._enhanceTextSelection) {\n textDivProperties.scale = scale;\n }\n\n transform = \"scaleX(\".concat(scale, \")\");\n }\n }\n\n if (textDivProperties.angle !== 0) {\n transform = \"rotate(\".concat(textDivProperties.angle, \"deg) \").concat(transform);\n }\n\n if (transform.length > 0) {\n if (this._enhanceTextSelection) {\n textDivProperties.originalTransform = transform;\n }\n\n textDiv.style.transform = transform;\n }\n\n if (textDivProperties.hasText) {\n this._container.appendChild(textDiv);\n }\n\n if (textDivProperties.hasEOL) {\n var br = document.createElement(\"br\");\n br.setAttribute(\"role\", \"presentation\");\n\n this._container.appendChild(br);\n }\n }\n }, {\n key: \"_render\",\n value: function _render() {\n var _this2 = this;\n\n var timeout = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var capability = (0, _util.createPromiseCapability)();\n var styleCache = Object.create(null);\n\n var canvas = this._document.createElement(\"canvas\");\n\n canvas.height = canvas.width = DEFAULT_FONT_SIZE;\n canvas.mozOpaque = true;\n this._layoutTextCtx = canvas.getContext(\"2d\", {\n alpha: false\n });\n\n if (this._textContent) {\n var textItems = this._textContent.items;\n var textStyles = this._textContent.styles;\n\n this._processItems(textItems, textStyles);\n\n capability.resolve();\n } else if (this._textContentStream) {\n var pump = function pump() {\n _this2._reader.read().then(function (_ref2) {\n var value = _ref2.value,\n done = _ref2.done;\n\n if (done) {\n capability.resolve();\n return;\n }\n\n Object.assign(styleCache, value.styles);\n\n _this2._processItems(value.items, styleCache);\n\n pump();\n }, capability.reject);\n };\n\n this._reader = this._textContentStream.getReader();\n pump();\n } else {\n throw new Error('Neither \"textContent\" nor \"textContentStream\" parameters specified.');\n }\n\n capability.promise.then(function () {\n styleCache = null;\n\n if (!timeout) {\n render(_this2);\n } else {\n _this2._renderTimer = setTimeout(function () {\n render(_this2);\n _this2._renderTimer = null;\n }, timeout);\n }\n }, this._capability.reject);\n }\n }, {\n key: \"expandTextDivs\",\n value: function expandTextDivs() {\n var expandDivs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n if (!this._enhanceTextSelection || !this._renderingDone) {\n return;\n }\n\n if (this._bounds !== null) {\n expand(this);\n this._bounds = null;\n }\n\n var transformBuf = [],\n paddingBuf = [];\n\n for (var i = 0, ii = this._textDivs.length; i < ii; i++) {\n var div = this._textDivs[i];\n\n var divProps = this._textDivProperties.get(div);\n\n if (!divProps.hasText) {\n continue;\n }\n\n if (expandDivs) {\n transformBuf.length = 0;\n paddingBuf.length = 0;\n\n if (divProps.originalTransform) {\n transformBuf.push(divProps.originalTransform);\n }\n\n if (divProps.paddingTop > 0) {\n paddingBuf.push(\"\".concat(divProps.paddingTop, \"px\"));\n transformBuf.push(\"translateY(\".concat(-divProps.paddingTop, \"px)\"));\n } else {\n paddingBuf.push(0);\n }\n\n if (divProps.paddingRight > 0) {\n paddingBuf.push(\"\".concat(divProps.paddingRight / divProps.scale, \"px\"));\n } else {\n paddingBuf.push(0);\n }\n\n if (divProps.paddingBottom > 0) {\n paddingBuf.push(\"\".concat(divProps.paddingBottom, \"px\"));\n } else {\n paddingBuf.push(0);\n }\n\n if (divProps.paddingLeft > 0) {\n paddingBuf.push(\"\".concat(divProps.paddingLeft / divProps.scale, \"px\"));\n transformBuf.push(\"translateX(\".concat(-divProps.paddingLeft / divProps.scale, \"px)\"));\n } else {\n paddingBuf.push(0);\n }\n\n div.style.padding = paddingBuf.join(\" \");\n\n if (transformBuf.length) {\n div.style.transform = transformBuf.join(\" \");\n }\n } else {\n div.style.padding = null;\n div.style.transform = divProps.originalTransform;\n }\n }\n }\n }]);\n\n return TextLayerRenderTask;\n}();\n\nfunction renderTextLayer(renderParameters) {\n var task = new TextLayerRenderTask({\n textContent: renderParameters.textContent,\n textContentStream: renderParameters.textContentStream,\n container: renderParameters.container,\n viewport: renderParameters.viewport,\n textDivs: renderParameters.textDivs,\n textContentItemsStr: renderParameters.textContentItemsStr,\n enhanceTextSelection: renderParameters.enhanceTextSelection\n });\n\n task._render(renderParameters.timeout);\n\n return task;\n}\n\n/***/ }),\n/* 164 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.SVGGraphics = void 0;\n\nvar _util = __w_pdfjs_require__(1);\n\nvar _display_utils = __w_pdfjs_require__(147);\n\nvar _is_node = __w_pdfjs_require__(3);\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _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.\"); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _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.\"); }\n\nfunction _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; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _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; } } }; }\n\nfunction _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); }\n\nfunction _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; }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar SVGGraphics = /*#__PURE__*/_createClass(function SVGGraphics() {\n _classCallCheck(this, SVGGraphics);\n\n (0, _util.unreachable)(\"Not implemented: SVGGraphics\");\n});\n\nexports.SVGGraphics = SVGGraphics;\n{\n var opListToTree = function opListToTree(opList) {\n var opTree = [];\n var tmp = [];\n\n var _iterator = _createForOfIteratorHelper(opList),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var opListElement = _step.value;\n\n if (opListElement.fn === \"save\") {\n opTree.push({\n fnId: 92,\n fn: \"group\",\n items: []\n });\n tmp.push(opTree);\n opTree = opTree[opTree.length - 1].items;\n continue;\n }\n\n if (opListElement.fn === \"restore\") {\n opTree = tmp.pop();\n } else {\n opTree.push(opListElement);\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n return opTree;\n };\n\n var pf = function pf(value) {\n if (Number.isInteger(value)) {\n return value.toString();\n }\n\n var s = value.toFixed(10);\n var i = s.length - 1;\n\n if (s[i] !== \"0\") {\n return s;\n }\n\n do {\n i--;\n } while (s[i] === \"0\");\n\n return s.substring(0, s[i] === \".\" ? i : i + 1);\n };\n\n var pm = function pm(m) {\n if (m[4] === 0 && m[5] === 0) {\n if (m[1] === 0 && m[2] === 0) {\n if (m[0] === 1 && m[3] === 1) {\n return \"\";\n }\n\n return \"scale(\".concat(pf(m[0]), \" \").concat(pf(m[3]), \")\");\n }\n\n if (m[0] === m[3] && m[1] === -m[2]) {\n var a = Math.acos(m[0]) * 180 / Math.PI;\n return \"rotate(\".concat(pf(a), \")\");\n }\n } else {\n if (m[0] === 1 && m[1] === 0 && m[2] === 0 && m[3] === 1) {\n return \"translate(\".concat(pf(m[4]), \" \").concat(pf(m[5]), \")\");\n }\n }\n\n 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]), \")\");\n };\n\n var SVG_DEFAULTS = {\n fontStyle: \"normal\",\n fontWeight: \"normal\",\n fillColor: \"#000000\"\n };\n var XML_NS = \"http://www.w3.org/XML/1998/namespace\";\n var XLINK_NS = \"http://www.w3.org/1999/xlink\";\n var LINE_CAP_STYLES = [\"butt\", \"round\", \"square\"];\n var LINE_JOIN_STYLES = [\"miter\", \"round\", \"bevel\"];\n\n var createObjectURL = function createObjectURL(data) {\n var contentType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : \"\";\n var forceDataSchema = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n if (URL.createObjectURL && typeof Blob !== \"undefined\" && !forceDataSchema) {\n return URL.createObjectURL(new Blob([data], {\n type: contentType\n }));\n }\n\n var digits = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n var buffer = \"data:\".concat(contentType, \";base64,\");\n\n for (var i = 0, ii = data.length; i < ii; i += 3) {\n var b1 = data[i] & 0xff;\n var b2 = data[i + 1] & 0xff;\n var b3 = data[i + 2] & 0xff;\n var d1 = b1 >> 2,\n d2 = (b1 & 3) << 4 | b2 >> 4;\n var d3 = i + 1 < ii ? (b2 & 0xf) << 2 | b3 >> 6 : 64;\n var d4 = i + 2 < ii ? b3 & 0x3f : 64;\n buffer += digits[d1] + digits[d2] + digits[d3] + digits[d4];\n }\n\n return buffer;\n };\n\n var convertImgDataToPng = function () {\n var PNG_HEADER = new Uint8Array([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]);\n var CHUNK_WRAPPER_SIZE = 12;\n var crcTable = new Int32Array(256);\n\n for (var i = 0; i < 256; i++) {\n var c = i;\n\n for (var h = 0; h < 8; h++) {\n if (c & 1) {\n c = 0xedb88320 ^ c >> 1 & 0x7fffffff;\n } else {\n c = c >> 1 & 0x7fffffff;\n }\n }\n\n crcTable[i] = c;\n }\n\n function crc32(data, start, end) {\n var crc = -1;\n\n for (var _i = start; _i < end; _i++) {\n var a = (crc ^ data[_i]) & 0xff;\n var b = crcTable[a];\n crc = crc >>> 8 ^ b;\n }\n\n return crc ^ -1;\n }\n\n function writePngChunk(type, body, data, offset) {\n var p = offset;\n var len = body.length;\n data[p] = len >> 24 & 0xff;\n data[p + 1] = len >> 16 & 0xff;\n data[p + 2] = len >> 8 & 0xff;\n data[p + 3] = len & 0xff;\n p += 4;\n data[p] = type.charCodeAt(0) & 0xff;\n data[p + 1] = type.charCodeAt(1) & 0xff;\n data[p + 2] = type.charCodeAt(2) & 0xff;\n data[p + 3] = type.charCodeAt(3) & 0xff;\n p += 4;\n data.set(body, p);\n p += body.length;\n var crc = crc32(data, offset + 4, p);\n data[p] = crc >> 24 & 0xff;\n data[p + 1] = crc >> 16 & 0xff;\n data[p + 2] = crc >> 8 & 0xff;\n data[p + 3] = crc & 0xff;\n }\n\n function adler32(data, start, end) {\n var a = 1;\n var b = 0;\n\n for (var _i2 = start; _i2 < end; ++_i2) {\n a = (a + (data[_i2] & 0xff)) % 65521;\n b = (b + a) % 65521;\n }\n\n return b << 16 | a;\n }\n\n function deflateSync(literals) {\n if (!_is_node.isNodeJS) {\n return deflateSyncUncompressed(literals);\n }\n\n try {\n var input;\n\n if (parseInt(process.versions.node) >= 8) {\n input = literals;\n } else {\n input = Buffer.from(literals);\n }\n\n var output = (__webpack_require__(/*! zlib */ \"?6bdd\").deflateSync)(input, {\n level: 9\n });\n\n return output instanceof Uint8Array ? output : new Uint8Array(output);\n } catch (e) {\n (0, _util.warn)(\"Not compressing PNG because zlib.deflateSync is unavailable: \" + e);\n }\n\n return deflateSyncUncompressed(literals);\n }\n\n function deflateSyncUncompressed(literals) {\n var len = literals.length;\n var maxBlockLength = 0xffff;\n var deflateBlocks = Math.ceil(len / maxBlockLength);\n var idat = new Uint8Array(2 + len + deflateBlocks * 5 + 4);\n var pi = 0;\n idat[pi++] = 0x78;\n idat[pi++] = 0x9c;\n var pos = 0;\n\n while (len > maxBlockLength) {\n idat[pi++] = 0x00;\n idat[pi++] = 0xff;\n idat[pi++] = 0xff;\n idat[pi++] = 0x00;\n idat[pi++] = 0x00;\n idat.set(literals.subarray(pos, pos + maxBlockLength), pi);\n pi += maxBlockLength;\n pos += maxBlockLength;\n len -= maxBlockLength;\n }\n\n idat[pi++] = 0x01;\n idat[pi++] = len & 0xff;\n idat[pi++] = len >> 8 & 0xff;\n idat[pi++] = ~len & 0xffff & 0xff;\n idat[pi++] = (~len & 0xffff) >> 8 & 0xff;\n idat.set(literals.subarray(pos), pi);\n pi += literals.length - pos;\n var adler = adler32(literals, 0, literals.length);\n idat[pi++] = adler >> 24 & 0xff;\n idat[pi++] = adler >> 16 & 0xff;\n idat[pi++] = adler >> 8 & 0xff;\n idat[pi++] = adler & 0xff;\n return idat;\n }\n\n function encode(imgData, kind, forceDataSchema, isMask) {\n var width = imgData.width;\n var height = imgData.height;\n var bitDepth, colorType, lineSize;\n var bytes = imgData.data;\n\n switch (kind) {\n case _util.ImageKind.GRAYSCALE_1BPP:\n colorType = 0;\n bitDepth = 1;\n lineSize = width + 7 >> 3;\n break;\n\n case _util.ImageKind.RGB_24BPP:\n colorType = 2;\n bitDepth = 8;\n lineSize = width * 3;\n break;\n\n case _util.ImageKind.RGBA_32BPP:\n colorType = 6;\n bitDepth = 8;\n lineSize = width * 4;\n break;\n\n default:\n throw new Error(\"invalid format\");\n }\n\n var literals = new Uint8Array((1 + lineSize) * height);\n var offsetLiterals = 0,\n offsetBytes = 0;\n\n for (var y = 0; y < height; ++y) {\n literals[offsetLiterals++] = 0;\n literals.set(bytes.subarray(offsetBytes, offsetBytes + lineSize), offsetLiterals);\n offsetBytes += lineSize;\n offsetLiterals += lineSize;\n }\n\n if (kind === _util.ImageKind.GRAYSCALE_1BPP && isMask) {\n offsetLiterals = 0;\n\n for (var _y = 0; _y < height; _y++) {\n offsetLiterals++;\n\n for (var _i3 = 0; _i3 < lineSize; _i3++) {\n literals[offsetLiterals++] ^= 0xff;\n }\n }\n }\n\n 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]);\n var idat = deflateSync(literals);\n var pngLength = PNG_HEADER.length + CHUNK_WRAPPER_SIZE * 3 + ihdr.length + idat.length;\n var data = new Uint8Array(pngLength);\n var offset = 0;\n data.set(PNG_HEADER, offset);\n offset += PNG_HEADER.length;\n writePngChunk(\"IHDR\", ihdr, data, offset);\n offset += CHUNK_WRAPPER_SIZE + ihdr.length;\n writePngChunk(\"IDATA\", idat, data, offset);\n offset += CHUNK_WRAPPER_SIZE + idat.length;\n writePngChunk(\"IEND\", new Uint8Array(0), data, offset);\n return createObjectURL(data, \"image/png\", forceDataSchema);\n }\n\n return function convertImgDataToPng(imgData, forceDataSchema, isMask) {\n var kind = imgData.kind === undefined ? _util.ImageKind.GRAYSCALE_1BPP : imgData.kind;\n return encode(imgData, kind, forceDataSchema, isMask);\n };\n }();\n\n var SVGExtraState = /*#__PURE__*/function () {\n function SVGExtraState() {\n _classCallCheck(this, SVGExtraState);\n\n this.fontSizeScale = 1;\n this.fontWeight = SVG_DEFAULTS.fontWeight;\n this.fontSize = 0;\n this.textMatrix = _util.IDENTITY_MATRIX;\n this.fontMatrix = _util.FONT_IDENTITY_MATRIX;\n this.leading = 0;\n this.textRenderingMode = _util.TextRenderingMode.FILL;\n this.textMatrixScale = 1;\n this.x = 0;\n this.y = 0;\n this.lineX = 0;\n this.lineY = 0;\n this.charSpacing = 0;\n this.wordSpacing = 0;\n this.textHScale = 1;\n this.textRise = 0;\n this.fillColor = SVG_DEFAULTS.fillColor;\n this.strokeColor = \"#000000\";\n this.fillAlpha = 1;\n this.strokeAlpha = 1;\n this.lineWidth = 1;\n this.lineJoin = \"\";\n this.lineCap = \"\";\n this.miterLimit = 0;\n this.dashArray = [];\n this.dashPhase = 0;\n this.dependencies = [];\n this.activeClipUrl = null;\n this.clipGroup = null;\n this.maskId = \"\";\n }\n\n _createClass(SVGExtraState, [{\n key: \"clone\",\n value: function clone() {\n return Object.create(this);\n }\n }, {\n key: \"setCurrentPoint\",\n value: function setCurrentPoint(x, y) {\n this.x = x;\n this.y = y;\n }\n }]);\n\n return SVGExtraState;\n }();\n\n var clipCount = 0;\n var maskCount = 0;\n var shadingCount = 0;\n\n exports.SVGGraphics = SVGGraphics = /*#__PURE__*/function () {\n function SVGGraphics(commonObjs, objs) {\n var forceDataSchema = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n _classCallCheck(this, SVGGraphics);\n\n this.svgFactory = new _display_utils.DOMSVGFactory();\n this.current = new SVGExtraState();\n this.transformMatrix = _util.IDENTITY_MATRIX;\n this.transformStack = [];\n this.extraStack = [];\n this.commonObjs = commonObjs;\n this.objs = objs;\n this.pendingClip = null;\n this.pendingEOFill = false;\n this.embedFonts = false;\n this.embeddedFonts = Object.create(null);\n this.cssStyle = null;\n this.forceDataSchema = !!forceDataSchema;\n this._operatorIdMapping = [];\n\n for (var op in _util.OPS) {\n this._operatorIdMapping[_util.OPS[op]] = op;\n }\n }\n\n _createClass(SVGGraphics, [{\n key: \"save\",\n value: function save() {\n this.transformStack.push(this.transformMatrix);\n var old = this.current;\n this.extraStack.push(old);\n this.current = old.clone();\n }\n }, {\n key: \"restore\",\n value: function restore() {\n this.transformMatrix = this.transformStack.pop();\n this.current = this.extraStack.pop();\n this.pendingClip = null;\n this.tgrp = null;\n }\n }, {\n key: \"group\",\n value: function group(items) {\n this.save();\n this.executeOpTree(items);\n this.restore();\n }\n }, {\n key: \"loadDependencies\",\n value: function loadDependencies(operatorList) {\n var _this = this;\n\n var fnArray = operatorList.fnArray;\n var argsArray = operatorList.argsArray;\n\n for (var i = 0, ii = fnArray.length; i < ii; i++) {\n if (fnArray[i] !== _util.OPS.dependency) {\n continue;\n }\n\n var _iterator2 = _createForOfIteratorHelper(argsArray[i]),\n _step2;\n\n try {\n var _loop = function _loop() {\n var obj = _step2.value;\n var objsPool = obj.startsWith(\"g_\") ? _this.commonObjs : _this.objs;\n var promise = new Promise(function (resolve) {\n objsPool.get(obj, resolve);\n });\n\n _this.current.dependencies.push(promise);\n };\n\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n _loop();\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n }\n\n return Promise.all(this.current.dependencies);\n }\n }, {\n key: \"transform\",\n value: function transform(a, b, c, d, e, f) {\n var transformMatrix = [a, b, c, d, e, f];\n this.transformMatrix = _util.Util.transform(this.transformMatrix, transformMatrix);\n this.tgrp = null;\n }\n }, {\n key: \"getSVG\",\n value: function getSVG(operatorList, viewport) {\n var _this2 = this;\n\n this.viewport = viewport;\n\n var svgElement = this._initialize(viewport);\n\n return this.loadDependencies(operatorList).then(function () {\n _this2.transformMatrix = _util.IDENTITY_MATRIX;\n\n _this2.executeOpTree(_this2.convertOpList(operatorList));\n\n return svgElement;\n });\n }\n }, {\n key: \"convertOpList\",\n value: function convertOpList(operatorList) {\n var operatorIdMapping = this._operatorIdMapping;\n var argsArray = operatorList.argsArray;\n var fnArray = operatorList.fnArray;\n var opList = [];\n\n for (var i = 0, ii = fnArray.length; i < ii; i++) {\n var fnId = fnArray[i];\n opList.push({\n fnId: fnId,\n fn: operatorIdMapping[fnId],\n args: argsArray[i]\n });\n }\n\n return opListToTree(opList);\n }\n }, {\n key: \"executeOpTree\",\n value: function executeOpTree(opTree) {\n var _iterator3 = _createForOfIteratorHelper(opTree),\n _step3;\n\n try {\n for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n var opTreeElement = _step3.value;\n var fn = opTreeElement.fn;\n var fnId = opTreeElement.fnId;\n var args = opTreeElement.args;\n\n switch (fnId | 0) {\n case _util.OPS.beginText:\n this.beginText();\n break;\n\n case _util.OPS.dependency:\n break;\n\n case _util.OPS.setLeading:\n this.setLeading(args);\n break;\n\n case _util.OPS.setLeadingMoveText:\n this.setLeadingMoveText(args[0], args[1]);\n break;\n\n case _util.OPS.setFont:\n this.setFont(args);\n break;\n\n case _util.OPS.showText:\n this.showText(args[0]);\n break;\n\n case _util.OPS.showSpacedText:\n this.showText(args[0]);\n break;\n\n case _util.OPS.endText:\n this.endText();\n break;\n\n case _util.OPS.moveText:\n this.moveText(args[0], args[1]);\n break;\n\n case _util.OPS.setCharSpacing:\n this.setCharSpacing(args[0]);\n break;\n\n case _util.OPS.setWordSpacing:\n this.setWordSpacing(args[0]);\n break;\n\n case _util.OPS.setHScale:\n this.setHScale(args[0]);\n break;\n\n case _util.OPS.setTextMatrix:\n this.setTextMatrix(args[0], args[1], args[2], args[3], args[4], args[5]);\n break;\n\n case _util.OPS.setTextRise:\n this.setTextRise(args[0]);\n break;\n\n case _util.OPS.setTextRenderingMode:\n this.setTextRenderingMode(args[0]);\n break;\n\n case _util.OPS.setLineWidth:\n this.setLineWidth(args[0]);\n break;\n\n case _util.OPS.setLineJoin:\n this.setLineJoin(args[0]);\n break;\n\n case _util.OPS.setLineCap:\n this.setLineCap(args[0]);\n break;\n\n case _util.OPS.setMiterLimit:\n this.setMiterLimit(args[0]);\n break;\n\n case _util.OPS.setFillRGBColor:\n this.setFillRGBColor(args[0], args[1], args[2]);\n break;\n\n case _util.OPS.setStrokeRGBColor:\n this.setStrokeRGBColor(args[0], args[1], args[2]);\n break;\n\n case _util.OPS.setStrokeColorN:\n this.setStrokeColorN(args);\n break;\n\n case _util.OPS.setFillColorN:\n this.setFillColorN(args);\n break;\n\n case _util.OPS.shadingFill:\n this.shadingFill(args[0]);\n break;\n\n case _util.OPS.setDash:\n this.setDash(args[0], args[1]);\n break;\n\n case _util.OPS.setRenderingIntent:\n this.setRenderingIntent(args[0]);\n break;\n\n case _util.OPS.setFlatness:\n this.setFlatness(args[0]);\n break;\n\n case _util.OPS.setGState:\n this.setGState(args[0]);\n break;\n\n case _util.OPS.fill:\n this.fill();\n break;\n\n case _util.OPS.eoFill:\n this.eoFill();\n break;\n\n case _util.OPS.stroke:\n this.stroke();\n break;\n\n case _util.OPS.fillStroke:\n this.fillStroke();\n break;\n\n case _util.OPS.eoFillStroke:\n this.eoFillStroke();\n break;\n\n case _util.OPS.clip:\n this.clip(\"nonzero\");\n break;\n\n case _util.OPS.eoClip:\n this.clip(\"evenodd\");\n break;\n\n case _util.OPS.paintSolidColorImageMask:\n this.paintSolidColorImageMask();\n break;\n\n case _util.OPS.paintImageXObject:\n this.paintImageXObject(args[0]);\n break;\n\n case _util.OPS.paintInlineImageXObject:\n this.paintInlineImageXObject(args[0]);\n break;\n\n case _util.OPS.paintImageMaskXObject:\n this.paintImageMaskXObject(args[0]);\n break;\n\n case _util.OPS.paintFormXObjectBegin:\n this.paintFormXObjectBegin(args[0], args[1]);\n break;\n\n case _util.OPS.paintFormXObjectEnd:\n this.paintFormXObjectEnd();\n break;\n\n case _util.OPS.closePath:\n this.closePath();\n break;\n\n case _util.OPS.closeStroke:\n this.closeStroke();\n break;\n\n case _util.OPS.closeFillStroke:\n this.closeFillStroke();\n break;\n\n case _util.OPS.closeEOFillStroke:\n this.closeEOFillStroke();\n break;\n\n case _util.OPS.nextLine:\n this.nextLine();\n break;\n\n case _util.OPS.transform:\n this.transform(args[0], args[1], args[2], args[3], args[4], args[5]);\n break;\n\n case _util.OPS.constructPath:\n this.constructPath(args[0], args[1]);\n break;\n\n case _util.OPS.endPath:\n this.endPath();\n break;\n\n case 92:\n this.group(opTreeElement.items);\n break;\n\n default:\n (0, _util.warn)(\"Unimplemented operator \".concat(fn));\n break;\n }\n }\n } catch (err) {\n _iterator3.e(err);\n } finally {\n _iterator3.f();\n }\n }\n }, {\n key: \"setWordSpacing\",\n value: function setWordSpacing(wordSpacing) {\n this.current.wordSpacing = wordSpacing;\n }\n }, {\n key: \"setCharSpacing\",\n value: function setCharSpacing(charSpacing) {\n this.current.charSpacing = charSpacing;\n }\n }, {\n key: \"nextLine\",\n value: function nextLine() {\n this.moveText(0, this.current.leading);\n }\n }, {\n key: \"setTextMatrix\",\n value: function setTextMatrix(a, b, c, d, e, f) {\n var current = this.current;\n current.textMatrix = current.lineMatrix = [a, b, c, d, e, f];\n current.textMatrixScale = Math.hypot(a, b);\n current.x = current.lineX = 0;\n current.y = current.lineY = 0;\n current.xcoords = [];\n current.ycoords = [];\n current.tspan = this.svgFactory.createElement(\"svg:tspan\");\n current.tspan.setAttributeNS(null, \"font-family\", current.fontFamily);\n current.tspan.setAttributeNS(null, \"font-size\", \"\".concat(pf(current.fontSize), \"px\"));\n current.tspan.setAttributeNS(null, \"y\", pf(-current.y));\n current.txtElement = this.svgFactory.createElement(\"svg:text\");\n current.txtElement.appendChild(current.tspan);\n }\n }, {\n key: \"beginText\",\n value: function beginText() {\n var current = this.current;\n current.x = current.lineX = 0;\n current.y = current.lineY = 0;\n current.textMatrix = _util.IDENTITY_MATRIX;\n current.lineMatrix = _util.IDENTITY_MATRIX;\n current.textMatrixScale = 1;\n current.tspan = this.svgFactory.createElement(\"svg:tspan\");\n current.txtElement = this.svgFactory.createElement(\"svg:text\");\n current.txtgrp = this.svgFactory.createElement(\"svg:g\");\n current.xcoords = [];\n current.ycoords = [];\n }\n }, {\n key: \"moveText\",\n value: function moveText(x, y) {\n var current = this.current;\n current.x = current.lineX += x;\n current.y = current.lineY += y;\n current.xcoords = [];\n current.ycoords = [];\n current.tspan = this.svgFactory.createElement(\"svg:tspan\");\n current.tspan.setAttributeNS(null, \"font-family\", current.fontFamily);\n current.tspan.setAttributeNS(null, \"font-size\", \"\".concat(pf(current.fontSize), \"px\"));\n current.tspan.setAttributeNS(null, \"y\", pf(-current.y));\n }\n }, {\n key: \"showText\",\n value: function showText(glyphs) {\n var current = this.current;\n var font = current.font;\n var fontSize = current.fontSize;\n\n if (fontSize === 0) {\n return;\n }\n\n var fontSizeScale = current.fontSizeScale;\n var charSpacing = current.charSpacing;\n var wordSpacing = current.wordSpacing;\n var fontDirection = current.fontDirection;\n var textHScale = current.textHScale * fontDirection;\n var vertical = font.vertical;\n var spacingDir = vertical ? 1 : -1;\n var defaultVMetrics = font.defaultVMetrics;\n var widthAdvanceScale = fontSize * current.fontMatrix[0];\n var x = 0;\n\n var _iterator4 = _createForOfIteratorHelper(glyphs),\n _step4;\n\n try {\n for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {\n var glyph = _step4.value;\n\n if (glyph === null) {\n x += fontDirection * wordSpacing;\n continue;\n } else if (typeof glyph === \"number\") {\n x += spacingDir * glyph * fontSize / 1000;\n continue;\n }\n\n var spacing = (glyph.isSpace ? wordSpacing : 0) + charSpacing;\n var character = glyph.fontChar;\n var scaledX = void 0,\n scaledY = void 0;\n var width = glyph.width;\n\n if (vertical) {\n var vx = void 0;\n var vmetric = glyph.vmetric || defaultVMetrics;\n vx = glyph.vmetric ? vmetric[1] : width * 0.5;\n vx = -vx * widthAdvanceScale;\n var vy = vmetric[2] * widthAdvanceScale;\n width = vmetric ? -vmetric[0] : width;\n scaledX = vx / fontSizeScale;\n scaledY = (x + vy) / fontSizeScale;\n } else {\n scaledX = x / fontSizeScale;\n scaledY = 0;\n }\n\n if (glyph.isInFont || font.missingFile) {\n current.xcoords.push(current.x + scaledX);\n\n if (vertical) {\n current.ycoords.push(-current.y + scaledY);\n }\n\n current.tspan.textContent += character;\n } else {}\n\n var charWidth = void 0;\n\n if (vertical) {\n charWidth = width * widthAdvanceScale - spacing * fontDirection;\n } else {\n charWidth = width * widthAdvanceScale + spacing * fontDirection;\n }\n\n x += charWidth;\n }\n } catch (err) {\n _iterator4.e(err);\n } finally {\n _iterator4.f();\n }\n\n current.tspan.setAttributeNS(null, \"x\", current.xcoords.map(pf).join(\" \"));\n\n if (vertical) {\n current.tspan.setAttributeNS(null, \"y\", current.ycoords.map(pf).join(\" \"));\n } else {\n current.tspan.setAttributeNS(null, \"y\", pf(-current.y));\n }\n\n if (vertical) {\n current.y -= x;\n } else {\n current.x += x * textHScale;\n }\n\n current.tspan.setAttributeNS(null, \"font-family\", current.fontFamily);\n current.tspan.setAttributeNS(null, \"font-size\", \"\".concat(pf(current.fontSize), \"px\"));\n\n if (current.fontStyle !== SVG_DEFAULTS.fontStyle) {\n current.tspan.setAttributeNS(null, \"font-style\", current.fontStyle);\n }\n\n if (current.fontWeight !== SVG_DEFAULTS.fontWeight) {\n current.tspan.setAttributeNS(null, \"font-weight\", current.fontWeight);\n }\n\n var fillStrokeMode = current.textRenderingMode & _util.TextRenderingMode.FILL_STROKE_MASK;\n\n if (fillStrokeMode === _util.TextRenderingMode.FILL || fillStrokeMode === _util.TextRenderingMode.FILL_STROKE) {\n if (current.fillColor !== SVG_DEFAULTS.fillColor) {\n current.tspan.setAttributeNS(null, \"fill\", current.fillColor);\n }\n\n if (current.fillAlpha < 1) {\n current.tspan.setAttributeNS(null, \"fill-opacity\", current.fillAlpha);\n }\n } else if (current.textRenderingMode === _util.TextRenderingMode.ADD_TO_PATH) {\n current.tspan.setAttributeNS(null, \"fill\", \"transparent\");\n } else {\n current.tspan.setAttributeNS(null, \"fill\", \"none\");\n }\n\n if (fillStrokeMode === _util.TextRenderingMode.STROKE || fillStrokeMode === _util.TextRenderingMode.FILL_STROKE) {\n var lineWidthScale = 1 / (current.textMatrixScale || 1);\n\n this._setStrokeAttributes(current.tspan, lineWidthScale);\n }\n\n var textMatrix = current.textMatrix;\n\n if (current.textRise !== 0) {\n textMatrix = textMatrix.slice();\n textMatrix[5] += current.textRise;\n }\n\n current.txtElement.setAttributeNS(null, \"transform\", \"\".concat(pm(textMatrix), \" scale(\").concat(pf(textHScale), \", -1)\"));\n current.txtElement.setAttributeNS(XML_NS, \"xml:space\", \"preserve\");\n current.txtElement.appendChild(current.tspan);\n current.txtgrp.appendChild(current.txtElement);\n\n this._ensureTransformGroup().appendChild(current.txtElement);\n }\n }, {\n key: \"setLeadingMoveText\",\n value: function setLeadingMoveText(x, y) {\n this.setLeading(-y);\n this.moveText(x, y);\n }\n }, {\n key: \"addFontStyle\",\n value: function addFontStyle(fontObj) {\n if (!fontObj.data) {\n throw new Error(\"addFontStyle: No font data available, \" + 'ensure that the \"fontExtraProperties\" API parameter is set.');\n }\n\n if (!this.cssStyle) {\n this.cssStyle = this.svgFactory.createElement(\"svg:style\");\n this.cssStyle.setAttributeNS(null, \"type\", \"text/css\");\n this.defs.appendChild(this.cssStyle);\n }\n\n var url = createObjectURL(fontObj.data, fontObj.mimetype, this.forceDataSchema);\n this.cssStyle.textContent += \"@font-face { font-family: \\\"\".concat(fontObj.loadedName, \"\\\";\") + \" src: url(\".concat(url, \"); }\\n\");\n }\n }, {\n key: \"setFont\",\n value: function setFont(details) {\n var current = this.current;\n var fontObj = this.commonObjs.get(details[0]);\n var size = details[1];\n current.font = fontObj;\n\n if (this.embedFonts && !fontObj.missingFile && !this.embeddedFonts[fontObj.loadedName]) {\n this.addFontStyle(fontObj);\n this.embeddedFonts[fontObj.loadedName] = fontObj;\n }\n\n current.fontMatrix = fontObj.fontMatrix || _util.FONT_IDENTITY_MATRIX;\n var bold = \"normal\";\n\n if (fontObj.black) {\n bold = \"900\";\n } else if (fontObj.bold) {\n bold = \"bold\";\n }\n\n var italic = fontObj.italic ? \"italic\" : \"normal\";\n\n if (size < 0) {\n size = -size;\n current.fontDirection = -1;\n } else {\n current.fontDirection = 1;\n }\n\n current.fontSize = size;\n current.fontFamily = fontObj.loadedName;\n current.fontWeight = bold;\n current.fontStyle = italic;\n current.tspan = this.svgFactory.createElement(\"svg:tspan\");\n current.tspan.setAttributeNS(null, \"y\", pf(-current.y));\n current.xcoords = [];\n current.ycoords = [];\n }\n }, {\n key: \"endText\",\n value: function endText() {\n var _current$txtElement;\n\n var current = this.current;\n\n if (current.textRenderingMode & _util.TextRenderingMode.ADD_TO_PATH_FLAG && (_current$txtElement = current.txtElement) !== null && _current$txtElement !== void 0 && _current$txtElement.hasChildNodes()) {\n current.element = current.txtElement;\n this.clip(\"nonzero\");\n this.endPath();\n }\n }\n }, {\n key: \"setLineWidth\",\n value: function setLineWidth(width) {\n if (width > 0) {\n this.current.lineWidth = width;\n }\n }\n }, {\n key: \"setLineCap\",\n value: function setLineCap(style) {\n this.current.lineCap = LINE_CAP_STYLES[style];\n }\n }, {\n key: \"setLineJoin\",\n value: function setLineJoin(style) {\n this.current.lineJoin = LINE_JOIN_STYLES[style];\n }\n }, {\n key: \"setMiterLimit\",\n value: function setMiterLimit(limit) {\n this.current.miterLimit = limit;\n }\n }, {\n key: \"setStrokeAlpha\",\n value: function setStrokeAlpha(strokeAlpha) {\n this.current.strokeAlpha = strokeAlpha;\n }\n }, {\n key: \"setStrokeRGBColor\",\n value: function setStrokeRGBColor(r, g, b) {\n this.current.strokeColor = _util.Util.makeHexColor(r, g, b);\n }\n }, {\n key: \"setFillAlpha\",\n value: function setFillAlpha(fillAlpha) {\n this.current.fillAlpha = fillAlpha;\n }\n }, {\n key: \"setFillRGBColor\",\n value: function setFillRGBColor(r, g, b) {\n this.current.fillColor = _util.Util.makeHexColor(r, g, b);\n this.current.tspan = this.svgFactory.createElement(\"svg:tspan\");\n this.current.xcoords = [];\n this.current.ycoords = [];\n }\n }, {\n key: \"setStrokeColorN\",\n value: function setStrokeColorN(args) {\n this.current.strokeColor = this._makeColorN_Pattern(args);\n }\n }, {\n key: \"setFillColorN\",\n value: function setFillColorN(args) {\n this.current.fillColor = this._makeColorN_Pattern(args);\n }\n }, {\n key: \"shadingFill\",\n value: function shadingFill(args) {\n var width = this.viewport.width;\n var height = this.viewport.height;\n\n var inv = _util.Util.inverseTransform(this.transformMatrix);\n\n var bl = _util.Util.applyTransform([0, 0], inv);\n\n var br = _util.Util.applyTransform([0, height], inv);\n\n var ul = _util.Util.applyTransform([width, 0], inv);\n\n var ur = _util.Util.applyTransform([width, height], inv);\n\n var x0 = Math.min(bl[0], br[0], ul[0], ur[0]);\n var y0 = Math.min(bl[1], br[1], ul[1], ur[1]);\n var x1 = Math.max(bl[0], br[0], ul[0], ur[0]);\n var y1 = Math.max(bl[1], br[1], ul[1], ur[1]);\n var rect = this.svgFactory.createElement(\"svg:rect\");\n rect.setAttributeNS(null, \"x\", x0);\n rect.setAttributeNS(null, \"y\", y0);\n rect.setAttributeNS(null, \"width\", x1 - x0);\n rect.setAttributeNS(null, \"height\", y1 - y0);\n rect.setAttributeNS(null, \"fill\", this._makeShadingPattern(args));\n\n if (this.current.fillAlpha < 1) {\n rect.setAttributeNS(null, \"fill-opacity\", this.current.fillAlpha);\n }\n\n this._ensureTransformGroup().appendChild(rect);\n }\n }, {\n key: \"_makeColorN_Pattern\",\n value: function _makeColorN_Pattern(args) {\n if (args[0] === \"TilingPattern\") {\n return this._makeTilingPattern(args);\n }\n\n return this._makeShadingPattern(args);\n }\n }, {\n key: \"_makeTilingPattern\",\n value: function _makeTilingPattern(args) {\n var color = args[1];\n var operatorList = args[2];\n var matrix = args[3] || _util.IDENTITY_MATRIX;\n\n var _args$ = _slicedToArray(args[4], 4),\n x0 = _args$[0],\n y0 = _args$[1],\n x1 = _args$[2],\n y1 = _args$[3];\n\n var xstep = args[5];\n var ystep = args[6];\n var paintType = args[7];\n var tilingId = \"shading\".concat(shadingCount++);\n\n var _Util$normalizeRect = _util.Util.normalizeRect([].concat(_toConsumableArray(_util.Util.applyTransform([x0, y0], matrix)), _toConsumableArray(_util.Util.applyTransform([x1, y1], matrix)))),\n _Util$normalizeRect2 = _slicedToArray(_Util$normalizeRect, 4),\n tx0 = _Util$normalizeRect2[0],\n ty0 = _Util$normalizeRect2[1],\n tx1 = _Util$normalizeRect2[2],\n ty1 = _Util$normalizeRect2[3];\n\n var _Util$singularValueDe = _util.Util.singularValueDecompose2dScale(matrix),\n _Util$singularValueDe2 = _slicedToArray(_Util$singularValueDe, 2),\n xscale = _Util$singularValueDe2[0],\n yscale = _Util$singularValueDe2[1];\n\n var txstep = xstep * xscale;\n var tystep = ystep * yscale;\n var tiling = this.svgFactory.createElement(\"svg:pattern\");\n tiling.setAttributeNS(null, \"id\", tilingId);\n tiling.setAttributeNS(null, \"patternUnits\", \"userSpaceOnUse\");\n tiling.setAttributeNS(null, \"width\", txstep);\n tiling.setAttributeNS(null, \"height\", tystep);\n tiling.setAttributeNS(null, \"x\", \"\".concat(tx0));\n tiling.setAttributeNS(null, \"y\", \"\".concat(ty0));\n var svg = this.svg;\n var transformMatrix = this.transformMatrix;\n var fillColor = this.current.fillColor;\n var strokeColor = this.current.strokeColor;\n var bbox = this.svgFactory.create(tx1 - tx0, ty1 - ty0);\n this.svg = bbox;\n this.transformMatrix = matrix;\n\n if (paintType === 2) {\n var cssColor = _util.Util.makeHexColor.apply(_util.Util, _toConsumableArray(color));\n\n this.current.fillColor = cssColor;\n this.current.strokeColor = cssColor;\n }\n\n this.executeOpTree(this.convertOpList(operatorList));\n this.svg = svg;\n this.transformMatrix = transformMatrix;\n this.current.fillColor = fillColor;\n this.current.strokeColor = strokeColor;\n tiling.appendChild(bbox.childNodes[0]);\n this.defs.appendChild(tiling);\n return \"url(#\".concat(tilingId, \")\");\n }\n }, {\n key: \"_makeShadingPattern\",\n value: function _makeShadingPattern(args) {\n if (typeof args === \"string\") {\n args = this.objs.get(args);\n }\n\n switch (args[0]) {\n case \"RadialAxial\":\n var shadingId = \"shading\".concat(shadingCount++);\n var colorStops = args[3];\n var gradient;\n\n switch (args[1]) {\n case \"axial\":\n var point0 = args[4];\n var point1 = args[5];\n gradient = this.svgFactory.createElement(\"svg:linearGradient\");\n gradient.setAttributeNS(null, \"id\", shadingId);\n gradient.setAttributeNS(null, \"gradientUnits\", \"userSpaceOnUse\");\n gradient.setAttributeNS(null, \"x1\", point0[0]);\n gradient.setAttributeNS(null, \"y1\", point0[1]);\n gradient.setAttributeNS(null, \"x2\", point1[0]);\n gradient.setAttributeNS(null, \"y2\", point1[1]);\n break;\n\n case \"radial\":\n var focalPoint = args[4];\n var circlePoint = args[5];\n var focalRadius = args[6];\n var circleRadius = args[7];\n gradient = this.svgFactory.createElement(\"svg:radialGradient\");\n gradient.setAttributeNS(null, \"id\", shadingId);\n gradient.setAttributeNS(null, \"gradientUnits\", \"userSpaceOnUse\");\n gradient.setAttributeNS(null, \"cx\", circlePoint[0]);\n gradient.setAttributeNS(null, \"cy\", circlePoint[1]);\n gradient.setAttributeNS(null, \"r\", circleRadius);\n gradient.setAttributeNS(null, \"fx\", focalPoint[0]);\n gradient.setAttributeNS(null, \"fy\", focalPoint[1]);\n gradient.setAttributeNS(null, \"fr\", focalRadius);\n break;\n\n default:\n throw new Error(\"Unknown RadialAxial type: \".concat(args[1]));\n }\n\n var _iterator5 = _createForOfIteratorHelper(colorStops),\n _step5;\n\n try {\n for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {\n var colorStop = _step5.value;\n var stop = this.svgFactory.createElement(\"svg:stop\");\n stop.setAttributeNS(null, \"offset\", colorStop[0]);\n stop.setAttributeNS(null, \"stop-color\", colorStop[1]);\n gradient.appendChild(stop);\n }\n } catch (err) {\n _iterator5.e(err);\n } finally {\n _iterator5.f();\n }\n\n this.defs.appendChild(gradient);\n return \"url(#\".concat(shadingId, \")\");\n\n case \"Mesh\":\n (0, _util.warn)(\"Unimplemented pattern Mesh\");\n return null;\n\n case \"Dummy\":\n return \"hotpink\";\n\n default:\n throw new Error(\"Unknown IR type: \".concat(args[0]));\n }\n }\n }, {\n key: \"setDash\",\n value: function setDash(dashArray, dashPhase) {\n this.current.dashArray = dashArray;\n this.current.dashPhase = dashPhase;\n }\n }, {\n key: \"constructPath\",\n value: function constructPath(ops, args) {\n var current = this.current;\n var x = current.x,\n y = current.y;\n var d = [];\n var j = 0;\n\n var _iterator6 = _createForOfIteratorHelper(ops),\n _step6;\n\n try {\n for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {\n var op = _step6.value;\n\n switch (op | 0) {\n case _util.OPS.rectangle:\n x = args[j++];\n y = args[j++];\n var width = args[j++];\n var height = args[j++];\n var xw = x + width;\n var yh = y + height;\n d.push(\"M\", pf(x), pf(y), \"L\", pf(xw), pf(y), \"L\", pf(xw), pf(yh), \"L\", pf(x), pf(yh), \"Z\");\n break;\n\n case _util.OPS.moveTo:\n x = args[j++];\n y = args[j++];\n d.push(\"M\", pf(x), pf(y));\n break;\n\n case _util.OPS.lineTo:\n x = args[j++];\n y = args[j++];\n d.push(\"L\", pf(x), pf(y));\n break;\n\n case _util.OPS.curveTo:\n x = args[j + 4];\n y = args[j + 5];\n d.push(\"C\", pf(args[j]), pf(args[j + 1]), pf(args[j + 2]), pf(args[j + 3]), pf(x), pf(y));\n j += 6;\n break;\n\n case _util.OPS.curveTo2:\n d.push(\"C\", pf(x), pf(y), pf(args[j]), pf(args[j + 1]), pf(args[j + 2]), pf(args[j + 3]));\n x = args[j + 2];\n y = args[j + 3];\n j += 4;\n break;\n\n case _util.OPS.curveTo3:\n x = args[j + 2];\n y = args[j + 3];\n d.push(\"C\", pf(args[j]), pf(args[j + 1]), pf(x), pf(y), pf(x), pf(y));\n j += 4;\n break;\n\n case _util.OPS.closePath:\n d.push(\"Z\");\n break;\n }\n }\n } catch (err) {\n _iterator6.e(err);\n } finally {\n _iterator6.f();\n }\n\n d = d.join(\" \");\n\n if (current.path && ops.length > 0 && ops[0] !== _util.OPS.rectangle && ops[0] !== _util.OPS.moveTo) {\n d = current.path.getAttributeNS(null, \"d\") + d;\n } else {\n current.path = this.svgFactory.createElement(\"svg:path\");\n\n this._ensureTransformGroup().appendChild(current.path);\n }\n\n current.path.setAttributeNS(null, \"d\", d);\n current.path.setAttributeNS(null, \"fill\", \"none\");\n current.element = current.path;\n current.setCurrentPoint(x, y);\n }\n }, {\n key: \"endPath\",\n value: function endPath() {\n var current = this.current;\n current.path = null;\n\n if (!this.pendingClip) {\n return;\n }\n\n if (!current.element) {\n this.pendingClip = null;\n return;\n }\n\n var clipId = \"clippath\".concat(clipCount++);\n var clipPath = this.svgFactory.createElement(\"svg:clipPath\");\n clipPath.setAttributeNS(null, \"id\", clipId);\n clipPath.setAttributeNS(null, \"transform\", pm(this.transformMatrix));\n var clipElement = current.element.cloneNode(true);\n\n if (this.pendingClip === \"evenodd\") {\n clipElement.setAttributeNS(null, \"clip-rule\", \"evenodd\");\n } else {\n clipElement.setAttributeNS(null, \"clip-rule\", \"nonzero\");\n }\n\n this.pendingClip = null;\n clipPath.appendChild(clipElement);\n this.defs.appendChild(clipPath);\n\n if (current.activeClipUrl) {\n current.clipGroup = null;\n\n var _iterator7 = _createForOfIteratorHelper(this.extraStack),\n _step7;\n\n try {\n for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {\n var prev = _step7.value;\n prev.clipGroup = null;\n }\n } catch (err) {\n _iterator7.e(err);\n } finally {\n _iterator7.f();\n }\n\n clipPath.setAttributeNS(null, \"clip-path\", current.activeClipUrl);\n }\n\n current.activeClipUrl = \"url(#\".concat(clipId, \")\");\n this.tgrp = null;\n }\n }, {\n key: \"clip\",\n value: function clip(type) {\n this.pendingClip = type;\n }\n }, {\n key: \"closePath\",\n value: function closePath() {\n var current = this.current;\n\n if (current.path) {\n var d = \"\".concat(current.path.getAttributeNS(null, \"d\"), \"Z\");\n current.path.setAttributeNS(null, \"d\", d);\n }\n }\n }, {\n key: \"setLeading\",\n value: function setLeading(leading) {\n this.current.leading = -leading;\n }\n }, {\n key: \"setTextRise\",\n value: function setTextRise(textRise) {\n this.current.textRise = textRise;\n }\n }, {\n key: \"setTextRenderingMode\",\n value: function setTextRenderingMode(textRenderingMode) {\n this.current.textRenderingMode = textRenderingMode;\n }\n }, {\n key: \"setHScale\",\n value: function setHScale(scale) {\n this.current.textHScale = scale / 100;\n }\n }, {\n key: \"setRenderingIntent\",\n value: function setRenderingIntent(intent) {}\n }, {\n key: \"setFlatness\",\n value: function setFlatness(flatness) {}\n }, {\n key: \"setGState\",\n value: function setGState(states) {\n var _iterator8 = _createForOfIteratorHelper(states),\n _step8;\n\n try {\n for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {\n var _step8$value = _slicedToArray(_step8.value, 2),\n key = _step8$value[0],\n value = _step8$value[1];\n\n switch (key) {\n case \"LW\":\n this.setLineWidth(value);\n break;\n\n case \"LC\":\n this.setLineCap(value);\n break;\n\n case \"LJ\":\n this.setLineJoin(value);\n break;\n\n case \"ML\":\n this.setMiterLimit(value);\n break;\n\n case \"D\":\n this.setDash(value[0], value[1]);\n break;\n\n case \"RI\":\n this.setRenderingIntent(value);\n break;\n\n case \"FL\":\n this.setFlatness(value);\n break;\n\n case \"Font\":\n this.setFont(value);\n break;\n\n case \"CA\":\n this.setStrokeAlpha(value);\n break;\n\n case \"ca\":\n this.setFillAlpha(value);\n break;\n\n default:\n (0, _util.warn)(\"Unimplemented graphic state operator \".concat(key));\n break;\n }\n }\n } catch (err) {\n _iterator8.e(err);\n } finally {\n _iterator8.f();\n }\n }\n }, {\n key: \"fill\",\n value: function fill() {\n var current = this.current;\n\n if (current.element) {\n current.element.setAttributeNS(null, \"fill\", current.fillColor);\n current.element.setAttributeNS(null, \"fill-opacity\", current.fillAlpha);\n this.endPath();\n }\n }\n }, {\n key: \"stroke\",\n value: function stroke() {\n var current = this.current;\n\n if (current.element) {\n this._setStrokeAttributes(current.element);\n\n current.element.setAttributeNS(null, \"fill\", \"none\");\n this.endPath();\n }\n }\n }, {\n key: \"_setStrokeAttributes\",\n value: function _setStrokeAttributes(element) {\n var lineWidthScale = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n var current = this.current;\n var dashArray = current.dashArray;\n\n if (lineWidthScale !== 1 && dashArray.length > 0) {\n dashArray = dashArray.map(function (value) {\n return lineWidthScale * value;\n });\n }\n\n element.setAttributeNS(null, \"stroke\", current.strokeColor);\n element.setAttributeNS(null, \"stroke-opacity\", current.strokeAlpha);\n element.setAttributeNS(null, \"stroke-miterlimit\", pf(current.miterLimit));\n element.setAttributeNS(null, \"stroke-linecap\", current.lineCap);\n element.setAttributeNS(null, \"stroke-linejoin\", current.lineJoin);\n element.setAttributeNS(null, \"stroke-width\", pf(lineWidthScale * current.lineWidth) + \"px\");\n element.setAttributeNS(null, \"stroke-dasharray\", dashArray.map(pf).join(\" \"));\n element.setAttributeNS(null, \"stroke-dashoffset\", pf(lineWidthScale * current.dashPhase) + \"px\");\n }\n }, {\n key: \"eoFill\",\n value: function eoFill() {\n if (this.current.element) {\n this.current.element.setAttributeNS(null, \"fill-rule\", \"evenodd\");\n }\n\n this.fill();\n }\n }, {\n key: \"fillStroke\",\n value: function fillStroke() {\n this.stroke();\n this.fill();\n }\n }, {\n key: \"eoFillStroke\",\n value: function eoFillStroke() {\n if (this.current.element) {\n this.current.element.setAttributeNS(null, \"fill-rule\", \"evenodd\");\n }\n\n this.fillStroke();\n }\n }, {\n key: \"closeStroke\",\n value: function closeStroke() {\n this.closePath();\n this.stroke();\n }\n }, {\n key: \"closeFillStroke\",\n value: function closeFillStroke() {\n this.closePath();\n this.fillStroke();\n }\n }, {\n key: \"closeEOFillStroke\",\n value: function closeEOFillStroke() {\n this.closePath();\n this.eoFillStroke();\n }\n }, {\n key: \"paintSolidColorImageMask\",\n value: function paintSolidColorImageMask() {\n var rect = this.svgFactory.createElement(\"svg:rect\");\n rect.setAttributeNS(null, \"x\", \"0\");\n rect.setAttributeNS(null, \"y\", \"0\");\n rect.setAttributeNS(null, \"width\", \"1px\");\n rect.setAttributeNS(null, \"height\", \"1px\");\n rect.setAttributeNS(null, \"fill\", this.current.fillColor);\n\n this._ensureTransformGroup().appendChild(rect);\n }\n }, {\n key: \"paintImageXObject\",\n value: function paintImageXObject(objId) {\n var imgData = objId.startsWith(\"g_\") ? this.commonObjs.get(objId) : this.objs.get(objId);\n\n if (!imgData) {\n (0, _util.warn)(\"Dependent image with object ID \".concat(objId, \" is not ready yet\"));\n return;\n }\n\n this.paintInlineImageXObject(imgData);\n }\n }, {\n key: \"paintInlineImageXObject\",\n value: function paintInlineImageXObject(imgData, mask) {\n var width = imgData.width;\n var height = imgData.height;\n var imgSrc = convertImgDataToPng(imgData, this.forceDataSchema, !!mask);\n var cliprect = this.svgFactory.createElement(\"svg:rect\");\n cliprect.setAttributeNS(null, \"x\", \"0\");\n cliprect.setAttributeNS(null, \"y\", \"0\");\n cliprect.setAttributeNS(null, \"width\", pf(width));\n cliprect.setAttributeNS(null, \"height\", pf(height));\n this.current.element = cliprect;\n this.clip(\"nonzero\");\n var imgEl = this.svgFactory.createElement(\"svg:image\");\n imgEl.setAttributeNS(XLINK_NS, \"xlink:href\", imgSrc);\n imgEl.setAttributeNS(null, \"x\", \"0\");\n imgEl.setAttributeNS(null, \"y\", pf(-height));\n imgEl.setAttributeNS(null, \"width\", pf(width) + \"px\");\n imgEl.setAttributeNS(null, \"height\", pf(height) + \"px\");\n imgEl.setAttributeNS(null, \"transform\", \"scale(\".concat(pf(1 / width), \" \").concat(pf(-1 / height), \")\"));\n\n if (mask) {\n mask.appendChild(imgEl);\n } else {\n this._ensureTransformGroup().appendChild(imgEl);\n }\n }\n }, {\n key: \"paintImageMaskXObject\",\n value: function paintImageMaskXObject(imgData) {\n var current = this.current;\n var width = imgData.width;\n var height = imgData.height;\n var fillColor = current.fillColor;\n current.maskId = \"mask\".concat(maskCount++);\n var mask = this.svgFactory.createElement(\"svg:mask\");\n mask.setAttributeNS(null, \"id\", current.maskId);\n var rect = this.svgFactory.createElement(\"svg:rect\");\n rect.setAttributeNS(null, \"x\", \"0\");\n rect.setAttributeNS(null, \"y\", \"0\");\n rect.setAttributeNS(null, \"width\", pf(width));\n rect.setAttributeNS(null, \"height\", pf(height));\n rect.setAttributeNS(null, \"fill\", fillColor);\n rect.setAttributeNS(null, \"mask\", \"url(#\".concat(current.maskId, \")\"));\n this.defs.appendChild(mask);\n\n this._ensureTransformGroup().appendChild(rect);\n\n this.paintInlineImageXObject(imgData, mask);\n }\n }, {\n key: \"paintFormXObjectBegin\",\n value: function paintFormXObjectBegin(matrix, bbox) {\n if (Array.isArray(matrix) && matrix.length === 6) {\n this.transform(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]);\n }\n\n if (bbox) {\n var width = bbox[2] - bbox[0];\n var height = bbox[3] - bbox[1];\n var cliprect = this.svgFactory.createElement(\"svg:rect\");\n cliprect.setAttributeNS(null, \"x\", bbox[0]);\n cliprect.setAttributeNS(null, \"y\", bbox[1]);\n cliprect.setAttributeNS(null, \"width\", pf(width));\n cliprect.setAttributeNS(null, \"height\", pf(height));\n this.current.element = cliprect;\n this.clip(\"nonzero\");\n this.endPath();\n }\n }\n }, {\n key: \"paintFormXObjectEnd\",\n value: function paintFormXObjectEnd() {}\n }, {\n key: \"_initialize\",\n value: function _initialize(viewport) {\n var svg = this.svgFactory.create(viewport.width, viewport.height);\n var definitions = this.svgFactory.createElement(\"svg:defs\");\n svg.appendChild(definitions);\n this.defs = definitions;\n var rootGroup = this.svgFactory.createElement(\"svg:g\");\n rootGroup.setAttributeNS(null, \"transform\", pm(viewport.transform));\n svg.appendChild(rootGroup);\n this.svg = rootGroup;\n return svg;\n }\n }, {\n key: \"_ensureClipGroup\",\n value: function _ensureClipGroup() {\n if (!this.current.clipGroup) {\n var clipGroup = this.svgFactory.createElement(\"svg:g\");\n clipGroup.setAttributeNS(null, \"clip-path\", this.current.activeClipUrl);\n this.svg.appendChild(clipGroup);\n this.current.clipGroup = clipGroup;\n }\n\n return this.current.clipGroup;\n }\n }, {\n key: \"_ensureTransformGroup\",\n value: function _ensureTransformGroup() {\n if (!this.tgrp) {\n this.tgrp = this.svgFactory.createElement(\"svg:g\");\n this.tgrp.setAttributeNS(null, \"transform\", pm(this.transformMatrix));\n\n if (this.current.activeClipUrl) {\n this._ensureClipGroup().appendChild(this.tgrp);\n } else {\n this.svg.appendChild(this.tgrp);\n }\n }\n\n return this.tgrp;\n }\n }]);\n\n return SVGGraphics;\n }();\n}\n\n/***/ }),\n/* 165 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\"use strict\";\n\n\nfunction _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); }\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.PDFNodeStream = void 0;\n\nvar _regenerator = _interopRequireDefault(__w_pdfjs_require__(145));\n\nvar _util = __w_pdfjs_require__(1);\n\nvar _network_utils = __w_pdfjs_require__(166);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction _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); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _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); }; }\n\nfunction _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); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _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; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction 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); } }\n\nfunction _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); }); }; }\n\nfunction _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; } } }; }\n\nfunction _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); }\n\nfunction _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; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\n;\n\nvar fs = __webpack_require__(/*! fs */ \"?0f9d\");\n\nvar http = __webpack_require__(/*! http */ \"?239a\");\n\nvar https = __webpack_require__(/*! https */ \"?c0f2\");\n\nvar url = __webpack_require__(/*! url */ \"?7812\");\n\nvar fileUriRegex = /^file:\\/\\/\\/[a-zA-Z]:\\//;\n\nfunction parseUrl(sourceUrl) {\n var parsedUrl = url.parse(sourceUrl);\n\n if (parsedUrl.protocol === \"file:\" || parsedUrl.host) {\n return parsedUrl;\n }\n\n if (/^[a-z]:[/\\\\]/i.test(sourceUrl)) {\n return url.parse(\"file:///\".concat(sourceUrl));\n }\n\n if (!parsedUrl.host) {\n parsedUrl.protocol = \"file:\";\n }\n\n return parsedUrl;\n}\n\nvar PDFNodeStream = /*#__PURE__*/function () {\n function PDFNodeStream(source) {\n _classCallCheck(this, PDFNodeStream);\n\n this.source = source;\n this.url = parseUrl(source.url);\n this.isHttp = this.url.protocol === \"http:\" || this.url.protocol === \"https:\";\n this.isFsUrl = this.url.protocol === \"file:\";\n this.httpHeaders = this.isHttp && source.httpHeaders || {};\n this._fullRequestReader = null;\n this._rangeRequestReaders = [];\n }\n\n _createClass(PDFNodeStream, [{\n key: \"_progressiveDataLength\",\n get: function get() {\n var _this$_fullRequestRea, _this$_fullRequestRea2;\n\n 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;\n }\n }, {\n key: \"getFullReader\",\n value: function getFullReader() {\n (0, _util.assert)(!this._fullRequestReader, \"PDFNodeStream.getFullReader can only be called once.\");\n this._fullRequestReader = this.isFsUrl ? new PDFNodeStreamFsFullReader(this) : new PDFNodeStreamFullReader(this);\n return this._fullRequestReader;\n }\n }, {\n key: \"getRangeReader\",\n value: function getRangeReader(start, end) {\n if (end <= this._progressiveDataLength) {\n return null;\n }\n\n var rangeReader = this.isFsUrl ? new PDFNodeStreamFsRangeReader(this, start, end) : new PDFNodeStreamRangeReader(this, start, end);\n\n this._rangeRequestReaders.push(rangeReader);\n\n return rangeReader;\n }\n }, {\n key: \"cancelAllRequests\",\n value: function cancelAllRequests(reason) {\n if (this._fullRequestReader) {\n this._fullRequestReader.cancel(reason);\n }\n\n var _iterator = _createForOfIteratorHelper(this._rangeRequestReaders.slice(0)),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var reader = _step.value;\n reader.cancel(reason);\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n }\n }]);\n\n return PDFNodeStream;\n}();\n\nexports.PDFNodeStream = PDFNodeStream;\n\nvar BaseFullReader = /*#__PURE__*/function () {\n function BaseFullReader(stream) {\n _classCallCheck(this, BaseFullReader);\n\n this._url = stream.url;\n this._done = false;\n this._storedError = null;\n this.onProgress = null;\n var source = stream.source;\n this._contentLength = source.length;\n this._loaded = 0;\n this._filename = null;\n this._disableRange = source.disableRange || false;\n this._rangeChunkSize = source.rangeChunkSize;\n\n if (!this._rangeChunkSize && !this._disableRange) {\n this._disableRange = true;\n }\n\n this._isStreamingSupported = !source.disableStream;\n this._isRangeSupported = !source.disableRange;\n this._readableStream = null;\n this._readCapability = (0, _util.createPromiseCapability)();\n this._headersCapability = (0, _util.createPromiseCapability)();\n }\n\n _createClass(BaseFullReader, [{\n key: \"headersReady\",\n get: function get() {\n return this._headersCapability.promise;\n }\n }, {\n key: \"filename\",\n get: function get() {\n return this._filename;\n }\n }, {\n key: \"contentLength\",\n get: function get() {\n return this._contentLength;\n }\n }, {\n key: \"isRangeSupported\",\n get: function get() {\n return this._isRangeSupported;\n }\n }, {\n key: \"isStreamingSupported\",\n get: function get() {\n return this._isStreamingSupported;\n }\n }, {\n key: \"read\",\n value: function () {\n var _read = _asyncToGenerator( /*#__PURE__*/_regenerator[\"default\"].mark(function _callee() {\n var chunk, buffer;\n return _regenerator[\"default\"].wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return this._readCapability.promise;\n\n case 2:\n if (!this._done) {\n _context.next = 4;\n break;\n }\n\n return _context.abrupt(\"return\", {\n value: undefined,\n done: true\n });\n\n case 4:\n if (!this._storedError) {\n _context.next = 6;\n break;\n }\n\n throw this._storedError;\n\n case 6:\n chunk = this._readableStream.read();\n\n if (!(chunk === null)) {\n _context.next = 10;\n break;\n }\n\n this._readCapability = (0, _util.createPromiseCapability)();\n return _context.abrupt(\"return\", this.read());\n\n case 10:\n this._loaded += chunk.length;\n\n if (this.onProgress) {\n this.onProgress({\n loaded: this._loaded,\n total: this._contentLength\n });\n }\n\n buffer = new Uint8Array(chunk).buffer;\n return _context.abrupt(\"return\", {\n value: buffer,\n done: false\n });\n\n case 14:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n\n function read() {\n return _read.apply(this, arguments);\n }\n\n return read;\n }()\n }, {\n key: \"cancel\",\n value: function cancel(reason) {\n if (!this._readableStream) {\n this._error(reason);\n\n return;\n }\n\n this._readableStream.destroy(reason);\n }\n }, {\n key: \"_error\",\n value: function _error(reason) {\n this._storedError = reason;\n\n this._readCapability.resolve();\n }\n }, {\n key: \"_setReadableStream\",\n value: function _setReadableStream(readableStream) {\n var _this = this;\n\n this._readableStream = readableStream;\n readableStream.on(\"readable\", function () {\n _this._readCapability.resolve();\n });\n readableStream.on(\"end\", function () {\n readableStream.destroy();\n _this._done = true;\n\n _this._readCapability.resolve();\n });\n readableStream.on(\"error\", function (reason) {\n _this._error(reason);\n });\n\n if (!this._isStreamingSupported && this._isRangeSupported) {\n this._error(new _util.AbortException(\"streaming is disabled\"));\n }\n\n if (this._storedError) {\n this._readableStream.destroy(this._storedError);\n }\n }\n }]);\n\n return BaseFullReader;\n}();\n\nvar BaseRangeReader = /*#__PURE__*/function () {\n function BaseRangeReader(stream) {\n _classCallCheck(this, BaseRangeReader);\n\n this._url = stream.url;\n this._done = false;\n this._storedError = null;\n this.onProgress = null;\n this._loaded = 0;\n this._readableStream = null;\n this._readCapability = (0, _util.createPromiseCapability)();\n var source = stream.source;\n this._isStreamingSupported = !source.disableStream;\n }\n\n _createClass(BaseRangeReader, [{\n key: \"isStreamingSupported\",\n get: function get() {\n return this._isStreamingSupported;\n }\n }, {\n key: \"read\",\n value: function () {\n var _read2 = _asyncToGenerator( /*#__PURE__*/_regenerator[\"default\"].mark(function _callee2() {\n var chunk, buffer;\n return _regenerator[\"default\"].wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return this._readCapability.promise;\n\n case 2:\n if (!this._done) {\n _context2.next = 4;\n break;\n }\n\n return _context2.abrupt(\"return\", {\n value: undefined,\n done: true\n });\n\n case 4:\n if (!this._storedError) {\n _context2.next = 6;\n break;\n }\n\n throw this._storedError;\n\n case 6:\n chunk = this._readableStream.read();\n\n if (!(chunk === null)) {\n _context2.next = 10;\n break;\n }\n\n this._readCapability = (0, _util.createPromiseCapability)();\n return _context2.abrupt(\"return\", this.read());\n\n case 10:\n this._loaded += chunk.length;\n\n if (this.onProgress) {\n this.onProgress({\n loaded: this._loaded\n });\n }\n\n buffer = new Uint8Array(chunk).buffer;\n return _context2.abrupt(\"return\", {\n value: buffer,\n done: false\n });\n\n case 14:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2, this);\n }));\n\n function read() {\n return _read2.apply(this, arguments);\n }\n\n return read;\n }()\n }, {\n key: \"cancel\",\n value: function cancel(reason) {\n if (!this._readableStream) {\n this._error(reason);\n\n return;\n }\n\n this._readableStream.destroy(reason);\n }\n }, {\n key: \"_error\",\n value: function _error(reason) {\n this._storedError = reason;\n\n this._readCapability.resolve();\n }\n }, {\n key: \"_setReadableStream\",\n value: function _setReadableStream(readableStream) {\n var _this2 = this;\n\n this._readableStream = readableStream;\n readableStream.on(\"readable\", function () {\n _this2._readCapability.resolve();\n });\n readableStream.on(\"end\", function () {\n readableStream.destroy();\n _this2._done = true;\n\n _this2._readCapability.resolve();\n });\n readableStream.on(\"error\", function (reason) {\n _this2._error(reason);\n });\n\n if (this._storedError) {\n this._readableStream.destroy(this._storedError);\n }\n }\n }]);\n\n return BaseRangeReader;\n}();\n\nfunction createRequestOptions(parsedUrl, headers) {\n return {\n protocol: parsedUrl.protocol,\n auth: parsedUrl.auth,\n host: parsedUrl.hostname,\n port: parsedUrl.port,\n path: parsedUrl.path,\n method: \"GET\",\n headers: headers\n };\n}\n\nvar PDFNodeStreamFullReader = /*#__PURE__*/function (_BaseFullReader) {\n _inherits(PDFNodeStreamFullReader, _BaseFullReader);\n\n var _super = _createSuper(PDFNodeStreamFullReader);\n\n function PDFNodeStreamFullReader(stream) {\n var _this3;\n\n _classCallCheck(this, PDFNodeStreamFullReader);\n\n _this3 = _super.call(this, stream);\n\n var handleResponse = function handleResponse(response) {\n if (response.statusCode === 404) {\n var error = new _util.MissingPDFException(\"Missing PDF \\\"\".concat(_this3._url, \"\\\".\"));\n _this3._storedError = error;\n\n _this3._headersCapability.reject(error);\n\n return;\n }\n\n _this3._headersCapability.resolve();\n\n _this3._setReadableStream(response);\n\n var getResponseHeader = function getResponseHeader(name) {\n return _this3._readableStream.headers[name.toLowerCase()];\n };\n\n var _validateRangeRequest = (0, _network_utils.validateRangeRequestCapabilities)({\n getResponseHeader: getResponseHeader,\n isHttp: stream.isHttp,\n rangeChunkSize: _this3._rangeChunkSize,\n disableRange: _this3._disableRange\n }),\n allowRangeRequests = _validateRangeRequest.allowRangeRequests,\n suggestedLength = _validateRangeRequest.suggestedLength;\n\n _this3._isRangeSupported = allowRangeRequests;\n _this3._contentLength = suggestedLength || _this3._contentLength;\n _this3._filename = (0, _network_utils.extractFilenameFromHeader)(getResponseHeader);\n };\n\n _this3._request = null;\n\n if (_this3._url.protocol === \"http:\") {\n _this3._request = http.request(createRequestOptions(_this3._url, stream.httpHeaders), handleResponse);\n } else {\n _this3._request = https.request(createRequestOptions(_this3._url, stream.httpHeaders), handleResponse);\n }\n\n _this3._request.on(\"error\", function (reason) {\n _this3._storedError = reason;\n\n _this3._headersCapability.reject(reason);\n });\n\n _this3._request.end();\n\n return _this3;\n }\n\n return _createClass(PDFNodeStreamFullReader);\n}(BaseFullReader);\n\nvar PDFNodeStreamRangeReader = /*#__PURE__*/function (_BaseRangeReader) {\n _inherits(PDFNodeStreamRangeReader, _BaseRangeReader);\n\n var _super2 = _createSuper(PDFNodeStreamRangeReader);\n\n function PDFNodeStreamRangeReader(stream, start, end) {\n var _this4;\n\n _classCallCheck(this, PDFNodeStreamRangeReader);\n\n _this4 = _super2.call(this, stream);\n _this4._httpHeaders = {};\n\n for (var property in stream.httpHeaders) {\n var value = stream.httpHeaders[property];\n\n if (typeof value === \"undefined\") {\n continue;\n }\n\n _this4._httpHeaders[property] = value;\n }\n\n _this4._httpHeaders.Range = \"bytes=\".concat(start, \"-\").concat(end - 1);\n\n var handleResponse = function handleResponse(response) {\n if (response.statusCode === 404) {\n var error = new _util.MissingPDFException(\"Missing PDF \\\"\".concat(_this4._url, \"\\\".\"));\n _this4._storedError = error;\n return;\n }\n\n _this4._setReadableStream(response);\n };\n\n _this4._request = null;\n\n if (_this4._url.protocol === \"http:\") {\n _this4._request = http.request(createRequestOptions(_this4._url, _this4._httpHeaders), handleResponse);\n } else {\n _this4._request = https.request(createRequestOptions(_this4._url, _this4._httpHeaders), handleResponse);\n }\n\n _this4._request.on(\"error\", function (reason) {\n _this4._storedError = reason;\n });\n\n _this4._request.end();\n\n return _this4;\n }\n\n return _createClass(PDFNodeStreamRangeReader);\n}(BaseRangeReader);\n\nvar PDFNodeStreamFsFullReader = /*#__PURE__*/function (_BaseFullReader2) {\n _inherits(PDFNodeStreamFsFullReader, _BaseFullReader2);\n\n var _super3 = _createSuper(PDFNodeStreamFsFullReader);\n\n function PDFNodeStreamFsFullReader(stream) {\n var _this5;\n\n _classCallCheck(this, PDFNodeStreamFsFullReader);\n\n _this5 = _super3.call(this, stream);\n var path = decodeURIComponent(_this5._url.path);\n\n if (fileUriRegex.test(_this5._url.href)) {\n path = path.replace(/^\\//, \"\");\n }\n\n fs.lstat(path, function (error, stat) {\n if (error) {\n if (error.code === \"ENOENT\") {\n error = new _util.MissingPDFException(\"Missing PDF \\\"\".concat(path, \"\\\".\"));\n }\n\n _this5._storedError = error;\n\n _this5._headersCapability.reject(error);\n\n return;\n }\n\n _this5._contentLength = stat.size;\n\n _this5._setReadableStream(fs.createReadStream(path));\n\n _this5._headersCapability.resolve();\n });\n return _this5;\n }\n\n return _createClass(PDFNodeStreamFsFullReader);\n}(BaseFullReader);\n\nvar PDFNodeStreamFsRangeReader = /*#__PURE__*/function (_BaseRangeReader2) {\n _inherits(PDFNodeStreamFsRangeReader, _BaseRangeReader2);\n\n var _super4 = _createSuper(PDFNodeStreamFsRangeReader);\n\n function PDFNodeStreamFsRangeReader(stream, start, end) {\n var _this6;\n\n _classCallCheck(this, PDFNodeStreamFsRangeReader);\n\n _this6 = _super4.call(this, stream);\n var path = decodeURIComponent(_this6._url.path);\n\n if (fileUriRegex.test(_this6._url.href)) {\n path = path.replace(/^\\//, \"\");\n }\n\n _this6._setReadableStream(fs.createReadStream(path, {\n start: start,\n end: end - 1\n }));\n\n return _this6;\n }\n\n return _createClass(PDFNodeStreamFsRangeReader);\n}(BaseRangeReader);\n\n/***/ }),\n/* 166 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.createResponseStatusError = createResponseStatusError;\nexports.extractFilenameFromHeader = extractFilenameFromHeader;\nexports.validateRangeRequestCapabilities = validateRangeRequestCapabilities;\nexports.validateResponseStatus = validateResponseStatus;\n\nvar _util = __w_pdfjs_require__(1);\n\nvar _content_disposition = __w_pdfjs_require__(167);\n\nvar _display_utils = __w_pdfjs_require__(147);\n\nfunction validateRangeRequestCapabilities(_ref) {\n var getResponseHeader = _ref.getResponseHeader,\n isHttp = _ref.isHttp,\n rangeChunkSize = _ref.rangeChunkSize,\n disableRange = _ref.disableRange;\n (0, _util.assert)(rangeChunkSize > 0, \"Range chunk size must be larger than zero\");\n var returnValues = {\n allowRangeRequests: false,\n suggestedLength: undefined\n };\n var length = parseInt(getResponseHeader(\"Content-Length\"), 10);\n\n if (!Number.isInteger(length)) {\n return returnValues;\n }\n\n returnValues.suggestedLength = length;\n\n if (length <= 2 * rangeChunkSize) {\n return returnValues;\n }\n\n if (disableRange || !isHttp) {\n return returnValues;\n }\n\n if (getResponseHeader(\"Accept-Ranges\") !== \"bytes\") {\n return returnValues;\n }\n\n var contentEncoding = getResponseHeader(\"Content-Encoding\") || \"identity\";\n\n if (contentEncoding !== \"identity\") {\n return returnValues;\n }\n\n returnValues.allowRangeRequests = true;\n return returnValues;\n}\n\nfunction extractFilenameFromHeader(getResponseHeader) {\n var contentDisposition = getResponseHeader(\"Content-Disposition\");\n\n if (contentDisposition) {\n var filename = (0, _content_disposition.getFilenameFromContentDispositionHeader)(contentDisposition);\n\n if (filename.includes(\"%\")) {\n try {\n filename = decodeURIComponent(filename);\n } catch (ex) {}\n }\n\n if ((0, _display_utils.isPdfFile)(filename)) {\n return filename;\n }\n }\n\n return null;\n}\n\nfunction createResponseStatusError(status, url) {\n if (status === 404 || status === 0 && url.startsWith(\"file:\")) {\n return new _util.MissingPDFException('Missing PDF \"' + url + '\".');\n }\n\n return new _util.UnexpectedResponseException(\"Unexpected server response (\".concat(status, \") while retrieving PDF \\\"\").concat(url, \"\\\".\"), status);\n}\n\nfunction validateResponseStatus(status) {\n return status === 200 || status === 206;\n}\n\n/***/ }),\n/* 167 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.getFilenameFromContentDispositionHeader = getFilenameFromContentDispositionHeader;\n\nvar _util = __w_pdfjs_require__(1);\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _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.\"); }\n\nfunction _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); }\n\nfunction _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; }\n\nfunction _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; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction getFilenameFromContentDispositionHeader(contentDisposition) {\n var needsEncodingFixup = true;\n var tmp = toParamRegExp(\"filename\\\\*\", \"i\").exec(contentDisposition);\n\n if (tmp) {\n tmp = tmp[1];\n var filename = rfc2616unquote(tmp);\n filename = unescape(filename);\n filename = rfc5987decode(filename);\n filename = rfc2047decode(filename);\n return fixupEncoding(filename);\n }\n\n tmp = rfc2231getparam(contentDisposition);\n\n if (tmp) {\n var _filename = rfc2047decode(tmp);\n\n return fixupEncoding(_filename);\n }\n\n tmp = toParamRegExp(\"filename\", \"i\").exec(contentDisposition);\n\n if (tmp) {\n tmp = tmp[1];\n\n var _filename2 = rfc2616unquote(tmp);\n\n _filename2 = rfc2047decode(_filename2);\n return fixupEncoding(_filename2);\n }\n\n function toParamRegExp(attributePattern, flags) {\n return new RegExp(\"(?:^|;)\\\\s*\" + attributePattern + \"\\\\s*=\\\\s*\" + \"(\" + '[^\";\\\\s][^;\\\\s]*' + \"|\" + '\"(?:[^\"\\\\\\\\]|\\\\\\\\\"?)+\"?' + \")\", flags);\n }\n\n function textdecode(encoding, value) {\n if (encoding) {\n if (!/^[\\x00-\\xFF]+$/.test(value)) {\n return value;\n }\n\n try {\n var decoder = new TextDecoder(encoding, {\n fatal: true\n });\n var buffer = (0, _util.stringToBytes)(value);\n value = decoder.decode(buffer);\n needsEncodingFixup = false;\n } catch (e) {}\n }\n\n return value;\n }\n\n function fixupEncoding(value) {\n if (needsEncodingFixup && /[\\x80-\\xff]/.test(value)) {\n value = textdecode(\"utf-8\", value);\n\n if (needsEncodingFixup) {\n value = textdecode(\"iso-8859-1\", value);\n }\n }\n\n return value;\n }\n\n function rfc2231getparam(contentDispositionStr) {\n var matches = [];\n var match;\n var iter = toParamRegExp(\"filename\\\\*((?!0\\\\d)\\\\d+)(\\\\*?)\", \"ig\");\n\n while ((match = iter.exec(contentDispositionStr)) !== null) {\n var _match = match,\n _match2 = _slicedToArray(_match, 4),\n n = _match2[1],\n quot = _match2[2],\n part = _match2[3];\n\n n = parseInt(n, 10);\n\n if (n in matches) {\n if (n === 0) {\n break;\n }\n\n continue;\n }\n\n matches[n] = [quot, part];\n }\n\n var parts = [];\n\n for (var _n2 = 0; _n2 < matches.length; ++_n2) {\n if (!(_n2 in matches)) {\n break;\n }\n\n var _matches$_n = _slicedToArray(matches[_n2], 2),\n _quot = _matches$_n[0],\n _part = _matches$_n[1];\n\n _part = rfc2616unquote(_part);\n\n if (_quot) {\n _part = unescape(_part);\n\n if (_n2 === 0) {\n _part = rfc5987decode(_part);\n }\n }\n\n parts.push(_part);\n }\n\n return parts.join(\"\");\n }\n\n function rfc2616unquote(value) {\n if (value.startsWith('\"')) {\n var parts = value.slice(1).split('\\\\\"');\n\n for (var i = 0; i < parts.length; ++i) {\n var quotindex = parts[i].indexOf('\"');\n\n if (quotindex !== -1) {\n parts[i] = parts[i].slice(0, quotindex);\n parts.length = i + 1;\n }\n\n parts[i] = parts[i].replace(/\\\\(.)/g, \"$1\");\n }\n\n value = parts.join('\"');\n }\n\n return value;\n }\n\n function rfc5987decode(extvalue) {\n var encodingend = extvalue.indexOf(\"'\");\n\n if (encodingend === -1) {\n return extvalue;\n }\n\n var encoding = extvalue.slice(0, encodingend);\n var langvalue = extvalue.slice(encodingend + 1);\n var value = langvalue.replace(/^[^']*'/, \"\");\n return textdecode(encoding, value);\n }\n\n function rfc2047decode(value) {\n if (!value.startsWith(\"=?\") || /[\\x00-\\x19\\x80-\\xff]/.test(value)) {\n return value;\n }\n\n return value.replace(/=\\?([\\w-]*)\\?([QqBb])\\?((?:[^?]|\\?(?!=))*)\\?=/g, function (matches, charset, encoding, text) {\n if (encoding === \"q\" || encoding === \"Q\") {\n text = text.replace(/_/g, \" \");\n text = text.replace(/=([0-9a-fA-F]{2})/g, function (match, hex) {\n return String.fromCharCode(parseInt(hex, 16));\n });\n return textdecode(charset, text);\n }\n\n try {\n text = atob(text);\n } catch (e) {}\n\n return textdecode(charset, text);\n });\n }\n\n return \"\";\n}\n\n/***/ }),\n/* 168 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.PDFNetworkStream = void 0;\n\nvar _regenerator = _interopRequireDefault(__w_pdfjs_require__(145));\n\nvar _util = __w_pdfjs_require__(1);\n\nvar _network_utils = __w_pdfjs_require__(166);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction 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); } }\n\nfunction _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); }); }; }\n\nfunction _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; } } }; }\n\nfunction _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); }\n\nfunction _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; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\n;\nvar OK_RESPONSE = 200;\nvar PARTIAL_CONTENT_RESPONSE = 206;\n\nfunction getArrayBuffer(xhr) {\n var data = xhr.response;\n\n if (typeof data !== \"string\") {\n return data;\n }\n\n var array = (0, _util.stringToBytes)(data);\n return array.buffer;\n}\n\nvar NetworkManager = /*#__PURE__*/function () {\n function NetworkManager(url) {\n var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, NetworkManager);\n\n this.url = url;\n this.isHttp = /^https?:/i.test(url);\n this.httpHeaders = this.isHttp && args.httpHeaders || Object.create(null);\n this.withCredentials = args.withCredentials || false;\n\n this.getXhr = args.getXhr || function NetworkManager_getXhr() {\n return new XMLHttpRequest();\n };\n\n this.currXhrId = 0;\n this.pendingRequests = Object.create(null);\n }\n\n _createClass(NetworkManager, [{\n key: \"requestRange\",\n value: function requestRange(begin, end, listeners) {\n var args = {\n begin: begin,\n end: end\n };\n\n for (var prop in listeners) {\n args[prop] = listeners[prop];\n }\n\n return this.request(args);\n }\n }, {\n key: \"requestFull\",\n value: function requestFull(listeners) {\n return this.request(listeners);\n }\n }, {\n key: \"request\",\n value: function request(args) {\n var xhr = this.getXhr();\n var xhrId = this.currXhrId++;\n var pendingRequest = this.pendingRequests[xhrId] = {\n xhr: xhr\n };\n xhr.open(\"GET\", this.url);\n xhr.withCredentials = this.withCredentials;\n\n for (var property in this.httpHeaders) {\n var value = this.httpHeaders[property];\n\n if (typeof value === \"undefined\") {\n continue;\n }\n\n xhr.setRequestHeader(property, value);\n }\n\n if (this.isHttp && \"begin\" in args && \"end\" in args) {\n xhr.setRequestHeader(\"Range\", \"bytes=\".concat(args.begin, \"-\").concat(args.end - 1));\n pendingRequest.expectedStatus = PARTIAL_CONTENT_RESPONSE;\n } else {\n pendingRequest.expectedStatus = OK_RESPONSE;\n }\n\n xhr.responseType = \"arraybuffer\";\n\n if (args.onError) {\n xhr.onerror = function (evt) {\n args.onError(xhr.status);\n };\n }\n\n xhr.onreadystatechange = this.onStateChange.bind(this, xhrId);\n xhr.onprogress = this.onProgress.bind(this, xhrId);\n pendingRequest.onHeadersReceived = args.onHeadersReceived;\n pendingRequest.onDone = args.onDone;\n pendingRequest.onError = args.onError;\n pendingRequest.onProgress = args.onProgress;\n xhr.send(null);\n return xhrId;\n }\n }, {\n key: \"onProgress\",\n value: function onProgress(xhrId, evt) {\n var _pendingRequest$onPro;\n\n var pendingRequest = this.pendingRequests[xhrId];\n\n if (!pendingRequest) {\n return;\n }\n\n (_pendingRequest$onPro = pendingRequest.onProgress) === null || _pendingRequest$onPro === void 0 ? void 0 : _pendingRequest$onPro.call(pendingRequest, evt);\n }\n }, {\n key: \"onStateChange\",\n value: function onStateChange(xhrId, evt) {\n var pendingRequest = this.pendingRequests[xhrId];\n\n if (!pendingRequest) {\n return;\n }\n\n var xhr = pendingRequest.xhr;\n\n if (xhr.readyState >= 2 && pendingRequest.onHeadersReceived) {\n pendingRequest.onHeadersReceived();\n delete pendingRequest.onHeadersReceived;\n }\n\n if (xhr.readyState !== 4) {\n return;\n }\n\n if (!(xhrId in this.pendingRequests)) {\n return;\n }\n\n delete this.pendingRequests[xhrId];\n\n if (xhr.status === 0 && this.isHttp) {\n var _pendingRequest$onErr;\n\n (_pendingRequest$onErr = pendingRequest.onError) === null || _pendingRequest$onErr === void 0 ? void 0 : _pendingRequest$onErr.call(pendingRequest, xhr.status);\n return;\n }\n\n var xhrStatus = xhr.status || OK_RESPONSE;\n var ok_response_on_range_request = xhrStatus === OK_RESPONSE && pendingRequest.expectedStatus === PARTIAL_CONTENT_RESPONSE;\n\n if (!ok_response_on_range_request && xhrStatus !== pendingRequest.expectedStatus) {\n var _pendingRequest$onErr2;\n\n (_pendingRequest$onErr2 = pendingRequest.onError) === null || _pendingRequest$onErr2 === void 0 ? void 0 : _pendingRequest$onErr2.call(pendingRequest, xhr.status);\n return;\n }\n\n var chunk = getArrayBuffer(xhr);\n\n if (xhrStatus === PARTIAL_CONTENT_RESPONSE) {\n var rangeHeader = xhr.getResponseHeader(\"Content-Range\");\n var matches = /bytes (\\d+)-(\\d+)\\/(\\d+)/.exec(rangeHeader);\n pendingRequest.onDone({\n begin: parseInt(matches[1], 10),\n chunk: chunk\n });\n } else if (chunk) {\n pendingRequest.onDone({\n begin: 0,\n chunk: chunk\n });\n } else {\n var _pendingRequest$onErr3;\n\n (_pendingRequest$onErr3 = pendingRequest.onError) === null || _pendingRequest$onErr3 === void 0 ? void 0 : _pendingRequest$onErr3.call(pendingRequest, xhr.status);\n }\n }\n }, {\n key: \"getRequestXhr\",\n value: function getRequestXhr(xhrId) {\n return this.pendingRequests[xhrId].xhr;\n }\n }, {\n key: \"isPendingRequest\",\n value: function isPendingRequest(xhrId) {\n return xhrId in this.pendingRequests;\n }\n }, {\n key: \"abortRequest\",\n value: function abortRequest(xhrId) {\n var xhr = this.pendingRequests[xhrId].xhr;\n delete this.pendingRequests[xhrId];\n xhr.abort();\n }\n }]);\n\n return NetworkManager;\n}();\n\nvar PDFNetworkStream = /*#__PURE__*/function () {\n function PDFNetworkStream(source) {\n _classCallCheck(this, PDFNetworkStream);\n\n this._source = source;\n this._manager = new NetworkManager(source.url, {\n httpHeaders: source.httpHeaders,\n withCredentials: source.withCredentials\n });\n this._rangeChunkSize = source.rangeChunkSize;\n this._fullRequestReader = null;\n this._rangeRequestReaders = [];\n }\n\n _createClass(PDFNetworkStream, [{\n key: \"_onRangeRequestReaderClosed\",\n value: function _onRangeRequestReaderClosed(reader) {\n var i = this._rangeRequestReaders.indexOf(reader);\n\n if (i >= 0) {\n this._rangeRequestReaders.splice(i, 1);\n }\n }\n }, {\n key: \"getFullReader\",\n value: function getFullReader() {\n (0, _util.assert)(!this._fullRequestReader, \"PDFNetworkStream.getFullReader can only be called once.\");\n this._fullRequestReader = new PDFNetworkStreamFullRequestReader(this._manager, this._source);\n return this._fullRequestReader;\n }\n }, {\n key: \"getRangeReader\",\n value: function getRangeReader(begin, end) {\n var reader = new PDFNetworkStreamRangeRequestReader(this._manager, begin, end);\n reader.onClosed = this._onRangeRequestReaderClosed.bind(this);\n\n this._rangeRequestReaders.push(reader);\n\n return reader;\n }\n }, {\n key: \"cancelAllRequests\",\n value: function cancelAllRequests(reason) {\n var _this$_fullRequestRea;\n\n (_this$_fullRequestRea = this._fullRequestReader) === null || _this$_fullRequestRea === void 0 ? void 0 : _this$_fullRequestRea.cancel(reason);\n\n var _iterator = _createForOfIteratorHelper(this._rangeRequestReaders.slice(0)),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var reader = _step.value;\n reader.cancel(reason);\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n }\n }]);\n\n return PDFNetworkStream;\n}();\n\nexports.PDFNetworkStream = PDFNetworkStream;\n\nvar PDFNetworkStreamFullRequestReader = /*#__PURE__*/function () {\n function PDFNetworkStreamFullRequestReader(manager, source) {\n _classCallCheck(this, PDFNetworkStreamFullRequestReader);\n\n this._manager = manager;\n var args = {\n onHeadersReceived: this._onHeadersReceived.bind(this),\n onDone: this._onDone.bind(this),\n onError: this._onError.bind(this),\n onProgress: this._onProgress.bind(this)\n };\n this._url = source.url;\n this._fullRequestId = manager.requestFull(args);\n this._headersReceivedCapability = (0, _util.createPromiseCapability)();\n this._disableRange = source.disableRange || false;\n this._contentLength = source.length;\n this._rangeChunkSize = source.rangeChunkSize;\n\n if (!this._rangeChunkSize && !this._disableRange) {\n this._disableRange = true;\n }\n\n this._isStreamingSupported = false;\n this._isRangeSupported = false;\n this._cachedChunks = [];\n this._requests = [];\n this._done = false;\n this._storedError = undefined;\n this._filename = null;\n this.onProgress = null;\n }\n\n _createClass(PDFNetworkStreamFullRequestReader, [{\n key: \"_onHeadersReceived\",\n value: function _onHeadersReceived() {\n var fullRequestXhrId = this._fullRequestId;\n\n var fullRequestXhr = this._manager.getRequestXhr(fullRequestXhrId);\n\n var getResponseHeader = function getResponseHeader(name) {\n return fullRequestXhr.getResponseHeader(name);\n };\n\n var _validateRangeRequest = (0, _network_utils.validateRangeRequestCapabilities)({\n getResponseHeader: getResponseHeader,\n isHttp: this._manager.isHttp,\n rangeChunkSize: this._rangeChunkSize,\n disableRange: this._disableRange\n }),\n allowRangeRequests = _validateRangeRequest.allowRangeRequests,\n suggestedLength = _validateRangeRequest.suggestedLength;\n\n if (allowRangeRequests) {\n this._isRangeSupported = true;\n }\n\n this._contentLength = suggestedLength || this._contentLength;\n this._filename = (0, _network_utils.extractFilenameFromHeader)(getResponseHeader);\n\n if (this._isRangeSupported) {\n this._manager.abortRequest(fullRequestXhrId);\n }\n\n this._headersReceivedCapability.resolve();\n }\n }, {\n key: \"_onDone\",\n value: function _onDone(data) {\n if (data) {\n if (this._requests.length > 0) {\n var requestCapability = this._requests.shift();\n\n requestCapability.resolve({\n value: data.chunk,\n done: false\n });\n } else {\n this._cachedChunks.push(data.chunk);\n }\n }\n\n this._done = true;\n\n if (this._cachedChunks.length > 0) {\n return;\n }\n\n var _iterator2 = _createForOfIteratorHelper(this._requests),\n _step2;\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var _requestCapability = _step2.value;\n\n _requestCapability.resolve({\n value: undefined,\n done: true\n });\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n\n this._requests.length = 0;\n }\n }, {\n key: \"_onError\",\n value: function _onError(status) {\n this._storedError = (0, _network_utils.createResponseStatusError)(status, this._url);\n\n this._headersReceivedCapability.reject(this._storedError);\n\n var _iterator3 = _createForOfIteratorHelper(this._requests),\n _step3;\n\n try {\n for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n var requestCapability = _step3.value;\n requestCapability.reject(this._storedError);\n }\n } catch (err) {\n _iterator3.e(err);\n } finally {\n _iterator3.f();\n }\n\n this._requests.length = 0;\n this._cachedChunks.length = 0;\n }\n }, {\n key: \"_onProgress\",\n value: function _onProgress(evt) {\n var _this$onProgress;\n\n (_this$onProgress = this.onProgress) === null || _this$onProgress === void 0 ? void 0 : _this$onProgress.call(this, {\n loaded: evt.loaded,\n total: evt.lengthComputable ? evt.total : this._contentLength\n });\n }\n }, {\n key: \"filename\",\n get: function get() {\n return this._filename;\n }\n }, {\n key: \"isRangeSupported\",\n get: function get() {\n return this._isRangeSupported;\n }\n }, {\n key: \"isStreamingSupported\",\n get: function get() {\n return this._isStreamingSupported;\n }\n }, {\n key: \"contentLength\",\n get: function get() {\n return this._contentLength;\n }\n }, {\n key: \"headersReady\",\n get: function get() {\n return this._headersReceivedCapability.promise;\n }\n }, {\n key: \"read\",\n value: function () {\n var _read = _asyncToGenerator( /*#__PURE__*/_regenerator[\"default\"].mark(function _callee() {\n var chunk, requestCapability;\n return _regenerator[\"default\"].wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n if (!this._storedError) {\n _context.next = 2;\n break;\n }\n\n throw this._storedError;\n\n case 2:\n if (!(this._cachedChunks.length > 0)) {\n _context.next = 5;\n break;\n }\n\n chunk = this._cachedChunks.shift();\n return _context.abrupt(\"return\", {\n value: chunk,\n done: false\n });\n\n case 5:\n if (!this._done) {\n _context.next = 7;\n break;\n }\n\n return _context.abrupt(\"return\", {\n value: undefined,\n done: true\n });\n\n case 7:\n requestCapability = (0, _util.createPromiseCapability)();\n\n this._requests.push(requestCapability);\n\n return _context.abrupt(\"return\", requestCapability.promise);\n\n case 10:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n\n function read() {\n return _read.apply(this, arguments);\n }\n\n return read;\n }()\n }, {\n key: \"cancel\",\n value: function cancel(reason) {\n this._done = true;\n\n this._headersReceivedCapability.reject(reason);\n\n var _iterator4 = _createForOfIteratorHelper(this._requests),\n _step4;\n\n try {\n for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {\n var requestCapability = _step4.value;\n requestCapability.resolve({\n value: undefined,\n done: true\n });\n }\n } catch (err) {\n _iterator4.e(err);\n } finally {\n _iterator4.f();\n }\n\n this._requests.length = 0;\n\n if (this._manager.isPendingRequest(this._fullRequestId)) {\n this._manager.abortRequest(this._fullRequestId);\n }\n\n this._fullRequestReader = null;\n }\n }]);\n\n return PDFNetworkStreamFullRequestReader;\n}();\n\nvar PDFNetworkStreamRangeRequestReader = /*#__PURE__*/function () {\n function PDFNetworkStreamRangeRequestReader(manager, begin, end) {\n _classCallCheck(this, PDFNetworkStreamRangeRequestReader);\n\n this._manager = manager;\n var args = {\n onDone: this._onDone.bind(this),\n onError: this._onError.bind(this),\n onProgress: this._onProgress.bind(this)\n };\n this._url = manager.url;\n this._requestId = manager.requestRange(begin, end, args);\n this._requests = [];\n this._queuedChunk = null;\n this._done = false;\n this._storedError = undefined;\n this.onProgress = null;\n this.onClosed = null;\n }\n\n _createClass(PDFNetworkStreamRangeRequestReader, [{\n key: \"_close\",\n value: function _close() {\n var _this$onClosed;\n\n (_this$onClosed = this.onClosed) === null || _this$onClosed === void 0 ? void 0 : _this$onClosed.call(this, this);\n }\n }, {\n key: \"_onDone\",\n value: function _onDone(data) {\n var chunk = data.chunk;\n\n if (this._requests.length > 0) {\n var requestCapability = this._requests.shift();\n\n requestCapability.resolve({\n value: chunk,\n done: false\n });\n } else {\n this._queuedChunk = chunk;\n }\n\n this._done = true;\n\n var _iterator5 = _createForOfIteratorHelper(this._requests),\n _step5;\n\n try {\n for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {\n var _requestCapability2 = _step5.value;\n\n _requestCapability2.resolve({\n value: undefined,\n done: true\n });\n }\n } catch (err) {\n _iterator5.e(err);\n } finally {\n _iterator5.f();\n }\n\n this._requests.length = 0;\n\n this._close();\n }\n }, {\n key: \"_onError\",\n value: function _onError(status) {\n this._storedError = (0, _network_utils.createResponseStatusError)(status, this._url);\n\n var _iterator6 = _createForOfIteratorHelper(this._requests),\n _step6;\n\n try {\n for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {\n var requestCapability = _step6.value;\n requestCapability.reject(this._storedError);\n }\n } catch (err) {\n _iterator6.e(err);\n } finally {\n _iterator6.f();\n }\n\n this._requests.length = 0;\n this._queuedChunk = null;\n }\n }, {\n key: \"_onProgress\",\n value: function _onProgress(evt) {\n if (!this.isStreamingSupported) {\n var _this$onProgress2;\n\n (_this$onProgress2 = this.onProgress) === null || _this$onProgress2 === void 0 ? void 0 : _this$onProgress2.call(this, {\n loaded: evt.loaded\n });\n }\n }\n }, {\n key: \"isStreamingSupported\",\n get: function get() {\n return false;\n }\n }, {\n key: \"read\",\n value: function () {\n var _read2 = _asyncToGenerator( /*#__PURE__*/_regenerator[\"default\"].mark(function _callee2() {\n var chunk, requestCapability;\n return _regenerator[\"default\"].wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n if (!this._storedError) {\n _context2.next = 2;\n break;\n }\n\n throw this._storedError;\n\n case 2:\n if (!(this._queuedChunk !== null)) {\n _context2.next = 6;\n break;\n }\n\n chunk = this._queuedChunk;\n this._queuedChunk = null;\n return _context2.abrupt(\"return\", {\n value: chunk,\n done: false\n });\n\n case 6:\n if (!this._done) {\n _context2.next = 8;\n break;\n }\n\n return _context2.abrupt(\"return\", {\n value: undefined,\n done: true\n });\n\n case 8:\n requestCapability = (0, _util.createPromiseCapability)();\n\n this._requests.push(requestCapability);\n\n return _context2.abrupt(\"return\", requestCapability.promise);\n\n case 11:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2, this);\n }));\n\n function read() {\n return _read2.apply(this, arguments);\n }\n\n return read;\n }()\n }, {\n key: \"cancel\",\n value: function cancel(reason) {\n this._done = true;\n\n var _iterator7 = _createForOfIteratorHelper(this._requests),\n _step7;\n\n try {\n for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {\n var requestCapability = _step7.value;\n requestCapability.resolve({\n value: undefined,\n done: true\n });\n }\n } catch (err) {\n _iterator7.e(err);\n } finally {\n _iterator7.f();\n }\n\n this._requests.length = 0;\n\n if (this._manager.isPendingRequest(this._requestId)) {\n this._manager.abortRequest(this._requestId);\n }\n\n this._close();\n }\n }]);\n\n return PDFNetworkStreamRangeRequestReader;\n}();\n\n/***/ }),\n/* 169 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.PDFFetchStream = void 0;\n\nvar _regenerator = _interopRequireDefault(__w_pdfjs_require__(145));\n\nvar _util = __w_pdfjs_require__(1);\n\nvar _network_utils = __w_pdfjs_require__(166);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction 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); } }\n\nfunction _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); }); }; }\n\nfunction _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; } } }; }\n\nfunction _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); }\n\nfunction _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; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\n;\n\nfunction createFetchOptions(headers, withCredentials, abortController) {\n return {\n method: \"GET\",\n headers: headers,\n signal: abortController === null || abortController === void 0 ? void 0 : abortController.signal,\n mode: \"cors\",\n credentials: withCredentials ? \"include\" : \"same-origin\",\n redirect: \"follow\"\n };\n}\n\nfunction createHeaders(httpHeaders) {\n var headers = new Headers();\n\n for (var property in httpHeaders) {\n var value = httpHeaders[property];\n\n if (typeof value === \"undefined\") {\n continue;\n }\n\n headers.append(property, value);\n }\n\n return headers;\n}\n\nvar PDFFetchStream = /*#__PURE__*/function () {\n function PDFFetchStream(source) {\n _classCallCheck(this, PDFFetchStream);\n\n this.source = source;\n this.isHttp = /^https?:/i.test(source.url);\n this.httpHeaders = this.isHttp && source.httpHeaders || {};\n this._fullRequestReader = null;\n this._rangeRequestReaders = [];\n }\n\n _createClass(PDFFetchStream, [{\n key: \"_progressiveDataLength\",\n get: function get() {\n var _this$_fullRequestRea, _this$_fullRequestRea2;\n\n 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;\n }\n }, {\n key: \"getFullReader\",\n value: function getFullReader() {\n (0, _util.assert)(!this._fullRequestReader, \"PDFFetchStream.getFullReader can only be called once.\");\n this._fullRequestReader = new PDFFetchStreamReader(this);\n return this._fullRequestReader;\n }\n }, {\n key: \"getRangeReader\",\n value: function getRangeReader(begin, end) {\n if (end <= this._progressiveDataLength) {\n return null;\n }\n\n var reader = new PDFFetchStreamRangeReader(this, begin, end);\n\n this._rangeRequestReaders.push(reader);\n\n return reader;\n }\n }, {\n key: \"cancelAllRequests\",\n value: function cancelAllRequests(reason) {\n if (this._fullRequestReader) {\n this._fullRequestReader.cancel(reason);\n }\n\n var _iterator = _createForOfIteratorHelper(this._rangeRequestReaders.slice(0)),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var reader = _step.value;\n reader.cancel(reason);\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n }\n }]);\n\n return PDFFetchStream;\n}();\n\nexports.PDFFetchStream = PDFFetchStream;\n\nvar PDFFetchStreamReader = /*#__PURE__*/function () {\n function PDFFetchStreamReader(stream) {\n var _this = this;\n\n _classCallCheck(this, PDFFetchStreamReader);\n\n this._stream = stream;\n this._reader = null;\n this._loaded = 0;\n this._filename = null;\n var source = stream.source;\n this._withCredentials = source.withCredentials || false;\n this._contentLength = source.length;\n this._headersCapability = (0, _util.createPromiseCapability)();\n this._disableRange = source.disableRange || false;\n this._rangeChunkSize = source.rangeChunkSize;\n\n if (!this._rangeChunkSize && !this._disableRange) {\n this._disableRange = true;\n }\n\n if (typeof AbortController !== \"undefined\") {\n this._abortController = new AbortController();\n }\n\n this._isStreamingSupported = !source.disableStream;\n this._isRangeSupported = !source.disableRange;\n this._headers = createHeaders(this._stream.httpHeaders);\n var url = source.url;\n fetch(url, createFetchOptions(this._headers, this._withCredentials, this._abortController)).then(function (response) {\n if (!(0, _network_utils.validateResponseStatus)(response.status)) {\n throw (0, _network_utils.createResponseStatusError)(response.status, url);\n }\n\n _this._reader = response.body.getReader();\n\n _this._headersCapability.resolve();\n\n var getResponseHeader = function getResponseHeader(name) {\n return response.headers.get(name);\n };\n\n var _validateRangeRequest = (0, _network_utils.validateRangeRequestCapabilities)({\n getResponseHeader: getResponseHeader,\n isHttp: _this._stream.isHttp,\n rangeChunkSize: _this._rangeChunkSize,\n disableRange: _this._disableRange\n }),\n allowRangeRequests = _validateRangeRequest.allowRangeRequests,\n suggestedLength = _validateRangeRequest.suggestedLength;\n\n _this._isRangeSupported = allowRangeRequests;\n _this._contentLength = suggestedLength || _this._contentLength;\n _this._filename = (0, _network_utils.extractFilenameFromHeader)(getResponseHeader);\n\n if (!_this._isStreamingSupported && _this._isRangeSupported) {\n _this.cancel(new _util.AbortException(\"Streaming is disabled.\"));\n }\n })[\"catch\"](this._headersCapability.reject);\n this.onProgress = null;\n }\n\n _createClass(PDFFetchStreamReader, [{\n key: \"headersReady\",\n get: function get() {\n return this._headersCapability.promise;\n }\n }, {\n key: \"filename\",\n get: function get() {\n return this._filename;\n }\n }, {\n key: \"contentLength\",\n get: function get() {\n return this._contentLength;\n }\n }, {\n key: \"isRangeSupported\",\n get: function get() {\n return this._isRangeSupported;\n }\n }, {\n key: \"isStreamingSupported\",\n get: function get() {\n return this._isStreamingSupported;\n }\n }, {\n key: \"read\",\n value: function () {\n var _read = _asyncToGenerator( /*#__PURE__*/_regenerator[\"default\"].mark(function _callee() {\n var _yield$this$_reader$r, value, done, buffer;\n\n return _regenerator[\"default\"].wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return this._headersCapability.promise;\n\n case 2:\n _context.next = 4;\n return this._reader.read();\n\n case 4:\n _yield$this$_reader$r = _context.sent;\n value = _yield$this$_reader$r.value;\n done = _yield$this$_reader$r.done;\n\n if (!done) {\n _context.next = 9;\n break;\n }\n\n return _context.abrupt(\"return\", {\n value: value,\n done: done\n });\n\n case 9:\n this._loaded += value.byteLength;\n\n if (this.onProgress) {\n this.onProgress({\n loaded: this._loaded,\n total: this._contentLength\n });\n }\n\n buffer = new Uint8Array(value).buffer;\n return _context.abrupt(\"return\", {\n value: buffer,\n done: false\n });\n\n case 13:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n\n function read() {\n return _read.apply(this, arguments);\n }\n\n return read;\n }()\n }, {\n key: \"cancel\",\n value: function cancel(reason) {\n if (this._reader) {\n this._reader.cancel(reason);\n }\n\n if (this._abortController) {\n this._abortController.abort();\n }\n }\n }]);\n\n return PDFFetchStreamReader;\n}();\n\nvar PDFFetchStreamRangeReader = /*#__PURE__*/function () {\n function PDFFetchStreamRangeReader(stream, begin, end) {\n var _this2 = this;\n\n _classCallCheck(this, PDFFetchStreamRangeReader);\n\n this._stream = stream;\n this._reader = null;\n this._loaded = 0;\n var source = stream.source;\n this._withCredentials = source.withCredentials || false;\n this._readCapability = (0, _util.createPromiseCapability)();\n this._isStreamingSupported = !source.disableStream;\n\n if (typeof AbortController !== \"undefined\") {\n this._abortController = new AbortController();\n }\n\n this._headers = createHeaders(this._stream.httpHeaders);\n\n this._headers.append(\"Range\", \"bytes=\".concat(begin, \"-\").concat(end - 1));\n\n var url = source.url;\n fetch(url, createFetchOptions(this._headers, this._withCredentials, this._abortController)).then(function (response) {\n if (!(0, _network_utils.validateResponseStatus)(response.status)) {\n throw (0, _network_utils.createResponseStatusError)(response.status, url);\n }\n\n _this2._readCapability.resolve();\n\n _this2._reader = response.body.getReader();\n })[\"catch\"](this._readCapability.reject);\n this.onProgress = null;\n }\n\n _createClass(PDFFetchStreamRangeReader, [{\n key: \"isStreamingSupported\",\n get: function get() {\n return this._isStreamingSupported;\n }\n }, {\n key: \"read\",\n value: function () {\n var _read2 = _asyncToGenerator( /*#__PURE__*/_regenerator[\"default\"].mark(function _callee2() {\n var _yield$this$_reader$r2, value, done, buffer;\n\n return _regenerator[\"default\"].wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return this._readCapability.promise;\n\n case 2:\n _context2.next = 4;\n return this._reader.read();\n\n case 4:\n _yield$this$_reader$r2 = _context2.sent;\n value = _yield$this$_reader$r2.value;\n done = _yield$this$_reader$r2.done;\n\n if (!done) {\n _context2.next = 9;\n break;\n }\n\n return _context2.abrupt(\"return\", {\n value: value,\n done: done\n });\n\n case 9:\n this._loaded += value.byteLength;\n\n if (this.onProgress) {\n this.onProgress({\n loaded: this._loaded\n });\n }\n\n buffer = new Uint8Array(value).buffer;\n return _context2.abrupt(\"return\", {\n value: buffer,\n done: false\n });\n\n case 13:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2, this);\n }));\n\n function read() {\n return _read2.apply(this, arguments);\n }\n\n return read;\n }()\n }, {\n key: \"cancel\",\n value: function cancel(reason) {\n if (this._reader) {\n this._reader.cancel(reason);\n }\n\n if (this._abortController) {\n this._abortController.abort();\n }\n }\n }]);\n\n return PDFFetchStreamRangeReader;\n}();\n\n/***/ })\n/******/ \t]);\n/************************************************************************/\n/******/ \t// The module cache\n/******/ \tvar __webpack_module_cache__ = {};\n/******/ \t\n/******/ \t// The require function\n/******/ \tfunction __w_pdfjs_require__(moduleId) {\n/******/ \t\t// Check if module is in cache\n/******/ \t\tvar cachedModule = __webpack_module_cache__[moduleId];\n/******/ \t\tif (cachedModule !== undefined) {\n/******/ \t\t\treturn cachedModule.exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = __webpack_module_cache__[moduleId] = {\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/ \t\n/******/ \t\t// Execute the module function\n/******/ \t\t__webpack_modules__[moduleId](module, module.exports, __w_pdfjs_require__);\n/******/ \t\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/ \t\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/ \t\n/************************************************************************/\n/******/ \t/* webpack/runtime/node module decorator */\n/******/ \t(() => {\n/******/ \t\t__w_pdfjs_require__.nmd = (module) => {\n/******/ \t\t\tmodule.paths = [];\n/******/ \t\t\tif (!module.children) module.children = [];\n/******/ \t\t\treturn module;\n/******/ \t\t};\n/******/ \t})();\n/******/ \t\n/************************************************************************/\nvar __nested_webpack_exports__ = {};\n// This entry need to be wrapped in an IIFE because it need to be in strict mode.\n(() => {\n\"use strict\";\nvar exports = __nested_webpack_exports__;\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nObject.defineProperty(exports, \"AnnotationLayer\", ({\n enumerable: true,\n get: function get() {\n return _annotation_layer.AnnotationLayer;\n }\n}));\nObject.defineProperty(exports, \"AnnotationMode\", ({\n enumerable: true,\n get: function get() {\n return _util.AnnotationMode;\n }\n}));\nObject.defineProperty(exports, \"CMapCompressionType\", ({\n enumerable: true,\n get: function get() {\n return _util.CMapCompressionType;\n }\n}));\nObject.defineProperty(exports, \"GlobalWorkerOptions\", ({\n enumerable: true,\n get: function get() {\n return _worker_options.GlobalWorkerOptions;\n }\n}));\nObject.defineProperty(exports, \"InvalidPDFException\", ({\n enumerable: true,\n get: function get() {\n return _util.InvalidPDFException;\n }\n}));\nObject.defineProperty(exports, \"LoopbackPort\", ({\n enumerable: true,\n get: function get() {\n return _api.LoopbackPort;\n }\n}));\nObject.defineProperty(exports, \"MissingPDFException\", ({\n enumerable: true,\n get: function get() {\n return _util.MissingPDFException;\n }\n}));\nObject.defineProperty(exports, \"OPS\", ({\n enumerable: true,\n get: function get() {\n return _util.OPS;\n }\n}));\nObject.defineProperty(exports, \"PDFDataRangeTransport\", ({\n enumerable: true,\n get: function get() {\n return _api.PDFDataRangeTransport;\n }\n}));\nObject.defineProperty(exports, \"PDFDateString\", ({\n enumerable: true,\n get: function get() {\n return _display_utils.PDFDateString;\n }\n}));\nObject.defineProperty(exports, \"PDFWorker\", ({\n enumerable: true,\n get: function get() {\n return _api.PDFWorker;\n }\n}));\nObject.defineProperty(exports, \"PasswordResponses\", ({\n enumerable: true,\n get: function get() {\n return _util.PasswordResponses;\n }\n}));\nObject.defineProperty(exports, \"PermissionFlag\", ({\n enumerable: true,\n get: function get() {\n return _util.PermissionFlag;\n }\n}));\nObject.defineProperty(exports, \"PixelsPerInch\", ({\n enumerable: true,\n get: function get() {\n return _display_utils.PixelsPerInch;\n }\n}));\nObject.defineProperty(exports, \"RenderingCancelledException\", ({\n enumerable: true,\n get: function get() {\n return _display_utils.RenderingCancelledException;\n }\n}));\nObject.defineProperty(exports, \"SVGGraphics\", ({\n enumerable: true,\n get: function get() {\n return _svg.SVGGraphics;\n }\n}));\nObject.defineProperty(exports, \"UNSUPPORTED_FEATURES\", ({\n enumerable: true,\n get: function get() {\n return _util.UNSUPPORTED_FEATURES;\n }\n}));\nObject.defineProperty(exports, \"UnexpectedResponseException\", ({\n enumerable: true,\n get: function get() {\n return _util.UnexpectedResponseException;\n }\n}));\nObject.defineProperty(exports, \"Util\", ({\n enumerable: true,\n get: function get() {\n return _util.Util;\n }\n}));\nObject.defineProperty(exports, \"VerbosityLevel\", ({\n enumerable: true,\n get: function get() {\n return _util.VerbosityLevel;\n }\n}));\nObject.defineProperty(exports, \"XfaLayer\", ({\n enumerable: true,\n get: function get() {\n return _xfa_layer.XfaLayer;\n }\n}));\nObject.defineProperty(exports, \"build\", ({\n enumerable: true,\n get: function get() {\n return _api.build;\n }\n}));\nObject.defineProperty(exports, \"createPromiseCapability\", ({\n enumerable: true,\n get: function get() {\n return _util.createPromiseCapability;\n }\n}));\nObject.defineProperty(exports, \"createValidAbsoluteUrl\", ({\n enumerable: true,\n get: function get() {\n return _util.createValidAbsoluteUrl;\n }\n}));\nObject.defineProperty(exports, \"getDocument\", ({\n enumerable: true,\n get: function get() {\n return _api.getDocument;\n }\n}));\nObject.defineProperty(exports, \"getFilenameFromUrl\", ({\n enumerable: true,\n get: function get() {\n return _display_utils.getFilenameFromUrl;\n }\n}));\nObject.defineProperty(exports, \"getPdfFilenameFromUrl\", ({\n enumerable: true,\n get: function get() {\n return _display_utils.getPdfFilenameFromUrl;\n }\n}));\nObject.defineProperty(exports, \"getXfaPageViewport\", ({\n enumerable: true,\n get: function get() {\n return _display_utils.getXfaPageViewport;\n }\n}));\nObject.defineProperty(exports, \"isPdfFile\", ({\n enumerable: true,\n get: function get() {\n return _display_utils.isPdfFile;\n }\n}));\nObject.defineProperty(exports, \"loadScript\", ({\n enumerable: true,\n get: function get() {\n return _display_utils.loadScript;\n }\n}));\nObject.defineProperty(exports, \"renderTextLayer\", ({\n enumerable: true,\n get: function get() {\n return _text_layer.renderTextLayer;\n }\n}));\nObject.defineProperty(exports, \"shadow\", ({\n enumerable: true,\n get: function get() {\n return _util.shadow;\n }\n}));\nObject.defineProperty(exports, \"version\", ({\n enumerable: true,\n get: function get() {\n return _api.version;\n }\n}));\n\nvar _util = __w_pdfjs_require__(1);\n\nvar _api = __w_pdfjs_require__(144);\n\nvar _display_utils = __w_pdfjs_require__(147);\n\nvar _annotation_layer = __w_pdfjs_require__(160);\n\nvar _worker_options = __w_pdfjs_require__(154);\n\nvar _is_node = __w_pdfjs_require__(3);\n\nvar _text_layer = __w_pdfjs_require__(163);\n\nvar _svg = __w_pdfjs_require__(164);\n\nvar _xfa_layer = __w_pdfjs_require__(162);\n\nvar pdfjsVersion = '2.13.216';\nvar pdfjsBuild = '399a0ec60';\n{\n if (_is_node.isNodeJS) {\n var _require = __w_pdfjs_require__(165),\n PDFNodeStream = _require.PDFNodeStream;\n\n (0, _api.setPDFNetworkStreamFactory)(function (params) {\n return new PDFNodeStream(params);\n });\n } else {\n var _require2 = __w_pdfjs_require__(168),\n PDFNetworkStream = _require2.PDFNetworkStream;\n\n var _require3 = __w_pdfjs_require__(169),\n PDFFetchStream = _require3.PDFFetchStream;\n\n (0, _api.setPDFNetworkStreamFactory)(function (params) {\n if ((0, _display_utils.isValidFetchUrl)(params.url)) {\n return new PDFFetchStream(params);\n }\n\n return new PDFNetworkStream(params);\n });\n }\n}\n})();\n\n/******/ \treturn __nested_webpack_exports__;\n/******/ })()\n;\n});\n//# sourceMappingURL=pdf.js.map\n\n//# sourceURL=webpack://hsu-utils/./node_modules/pdfjs-dist/legacy/build/pdf.js?");
58
+
59
+ /***/ }),
60
+
52
61
  /***/ "./tools/ConsoleTable/index.ts":
53
62
  /*!*************************************!*\
54
63
  !*** ./tools/ConsoleTable/index.ts ***!
55
64
  \*************************************/
56
65
  /***/ ((__unused_webpack_module, exports) => {
57
66
 
67
+ "use strict";
58
68
  eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nvar NODE = '+';\nvar EDGE = '-';\nvar HIGH = '|';\nvar SPACE = ' ';\nvar EMPTY = '';\nfunction get_string_width(str) {\n var width = 0;\n for (var _i = 0, str_1 = str; _i < str_1.length; _i++) {\n var char = str_1[_i];\n width += char.charCodeAt(0) < 128 && char.charCodeAt(0) >= 0 ? 1 : 2;\n }\n return width;\n}\nfunction get_egde(width) {\n var edge = '';\n for (var i = 0; i <= width; i++) {\n edge += EDGE;\n }\n return edge;\n}\nfunction get_edge(widths, no_line_break) {\n if (no_line_break === void 0) { no_line_break = false; }\n var col_num = widths.length;\n var border = '';\n widths.forEach(function (width, col) {\n border += NODE + get_egde(width + 1);\n if (col === col_num - 1) {\n border += NODE + (no_line_break ? EMPTY : '\\n');\n }\n else {\n border += EMPTY;\n }\n });\n return border;\n}\nfunction get_space(width) {\n var space = '';\n for (var i = 0; i <= width; i++) {\n space += SPACE;\n }\n return space;\n}\nfunction wirte_data(widths, data) {\n var col_num = widths.length;\n var content = '';\n widths.forEach(function (width, col) {\n var col_data = data[col];\n var _content = '';\n if (!isNaN(+col_data)) {\n _content += get_space(width - get_string_width(col_data.toString())) + col_data + SPACE;\n }\n else {\n _content += SPACE + (col_data !== null && col_data !== void 0 ? col_data : '') + get_space(width - get_string_width((col_data !== null && col_data !== void 0 ? col_data : '').toString()));\n }\n content += HIGH + _content;\n if (col === col_num - 1) {\n content += HIGH + '\\n';\n }\n else {\n content += EMPTY;\n }\n });\n return content;\n}\nfunction get_max_widths(data) {\n var max_widths = Object.keys(data[0]).map(function (v) { return +v; });\n for (var _i = 0, data_1 = data; _i < data_1.length; _i++) {\n var row_data = data_1[_i];\n row_data.forEach(function (col_data, idx) {\n var width = get_string_width(col_data.toString());\n max_widths[idx] = Math.max(width, max_widths[idx]);\n });\n }\n return max_widths;\n}\nfunction console_table(data, callBack) {\n var row_num = data.length;\n var max_widths = get_max_widths(data);\n var table = '';\n data.forEach(function (row_data, row) {\n if (row <= 1) {\n table += get_edge(max_widths);\n }\n table += wirte_data(max_widths, row_data);\n if (row === row_num - 1) {\n table += get_edge(max_widths, true);\n }\n });\n console.log(table);\n if (callBack) {\n callBack(table);\n }\n}\nexports[\"default\"] = console_table;\n\n\n//# sourceURL=webpack://hsu-utils/./tools/ConsoleTable/index.ts?");
59
69
 
60
70
  /***/ }),
@@ -65,6 +75,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nvar
65
75
  \***************************************/
66
76
  /***/ ((__unused_webpack_module, exports) => {
67
77
 
78
+ "use strict";
68
79
  eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.toChineseNum = void 0;\nfunction toChineseNum(num, options) {\n if (options === void 0) { options = {}; }\n var benchmark = options.benchmark, _a = options.textType, textType = _a === void 0 ? 'lowercase' : _a;\n var cnNums = {\n lowercase: ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九'],\n uppercase: ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖']\n };\n var cnIntRadice = {\n lowercase: ['', '十', '百', '千'],\n uppercase: ['', '拾', '佰', '仟']\n };\n var cnIntUnits = {\n lowercase: ['', '万', '亿', '兆'],\n uppercase: ['', '万', '亿', '兆']\n };\n var maxNum = 9999999999999999.9999999999999999;\n var integerNum = undefined;\n var decimalNum = undefined;\n var chineseStr = '';\n if (benchmark) {\n num *= benchmark;\n num = +num.toFixed(4);\n }\n if (num > maxNum) {\n return '超出转换范围';\n }\n var moneyStr = num.toString();\n integerNum = moneyStr.split('.')[0];\n decimalNum = moneyStr.split('.')[1];\n if (integerNum) {\n var zeroCount = 0;\n for (var i = 0; i < integerNum.length; i++) {\n var index = integerNum.length - i - 1;\n var num_1 = +integerNum[i];\n var units = Math.floor(index / 4);\n var radice = index % (4 * (units === 0 ? 1 : units));\n if (+integerNum[i] === 0) {\n zeroCount++;\n }\n else {\n if (zeroCount > 0) {\n chineseStr += cnNums[textType][0];\n zeroCount = 0;\n }\n chineseStr += \"\".concat(cnNums[textType][num_1] + cnIntRadice[textType][radice]);\n if (index % 4 === 0) {\n chineseStr += cnIntUnits[textType][units];\n }\n }\n }\n }\n if (decimalNum) {\n chineseStr += '点';\n for (var i = 0; i < decimalNum.length; i++) {\n var num_2 = +decimalNum[i];\n if (+decimalNum[i] === 0) {\n chineseStr += \"\".concat(cnNums[textType][0]);\n }\n else {\n chineseStr += \"\".concat(cnNums[textType][num_2]);\n }\n }\n }\n if (chineseStr === '') {\n chineseStr += cnNums[textType][0];\n }\n return chineseStr;\n}\nexports.toChineseNum = toChineseNum;\nvar ConvertNumbers = {\n toChineseNum: toChineseNum\n};\nexports[\"default\"] = ConvertNumbers;\n\n\n//# sourceURL=webpack://hsu-utils/./tools/ConvertNumbers/index.ts?");
69
80
 
70
81
  /***/ }),
@@ -75,7 +86,19 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
75
86
  \*********************************/
76
87
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
77
88
 
78
- eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nvar __1 = __webpack_require__(/*! .. */ \"./tools/index.ts\");\nfunction deepCopy(data) {\n if ((0, __1.Typeof)(data) === 'date') {\n return new Date(data.toISOString());\n }\n else if ((0, __1.Typeof)(data) === 'formdata') {\n var _data = data;\n var _formData_1 = new FormData();\n _data.forEach(function (value, key) {\n _formData_1.append(key, value);\n });\n return _formData_1;\n }\n else if (Array.isArray(data)) {\n var newData = data.map(function (item) {\n if (typeof item === 'object') {\n return deepCopy(item);\n }\n else {\n return item;\n }\n });\n return newData;\n }\n else if (data && (0, __1.Typeof)(data) === 'object') {\n var _data_1 = data;\n var newData_1 = {};\n Object.keys(_data_1).forEach(function (key) {\n var _item = _data_1[key];\n if (typeof _item === 'object') {\n newData_1[key] = deepCopy(_item);\n }\n else {\n newData_1[key] = _item;\n }\n });\n return newData_1;\n }\n return data;\n}\nexports[\"default\"] = deepCopy;\n\n\n//# sourceURL=webpack://hsu-utils/./tools/DeepCopy/index.ts?");
89
+ "use strict";
90
+ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nvar __1 = __webpack_require__(/*! .. */ \"./tools/index.ts\");\nfunction deepCopy(data) {\n if ((0, __1.Typeof)(data) === 'date') {\n return new Date(data.toISOString());\n }\n if ((0, __1.Typeof)(data) === 'formdata') {\n var _data = data;\n var _formData_1 = new FormData();\n _data.forEach(function (value, key) {\n _formData_1.append(key, value);\n });\n return _formData_1;\n }\n if ((0, __1.Typeof)(data) === 'map') {\n var _data = data;\n var map_1 = new Map();\n _data.forEach(function (value, key) {\n map_1.set(key, value);\n });\n return map_1;\n }\n if ((0, __1.Typeof)(data) === 'set') {\n var _data = data;\n var set_1 = new Set();\n _data.forEach(function (value) {\n set_1.add(value);\n });\n return set_1;\n }\n if (Array.isArray(data)) {\n var newData = data.map(function (item) {\n if (typeof item === 'object') {\n return deepCopy(item);\n }\n else {\n return item;\n }\n });\n return newData;\n }\n else if (data && (0, __1.Typeof)(data) === 'object') {\n var _data_1 = data;\n var newData_1 = {};\n Object.keys(_data_1).forEach(function (key) {\n var _item = _data_1[key];\n if (typeof _item === 'object') {\n newData_1[key] = deepCopy(_item);\n }\n else {\n newData_1[key] = _item;\n }\n });\n return newData_1;\n }\n return data;\n}\nexports[\"default\"] = deepCopy;\n\n\n//# sourceURL=webpack://hsu-utils/./tools/DeepCopy/index.ts?");
91
+
92
+ /***/ }),
93
+
94
+ /***/ "./tools/DownloadFile/index.ts":
95
+ /*!*************************************!*\
96
+ !*** ./tools/DownloadFile/index.ts ***!
97
+ \*************************************/
98
+ /***/ ((__unused_webpack_module, exports) => {
99
+
100
+ "use strict";
101
+ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nfunction downloadFileByLocalPath(path, fileName) {\n fetch(path)\n .then(function (response) { return response.arrayBuffer(); })\n .then(function (arrayBuffer) {\n downloadFile(arrayBuffer, fileName);\n });\n}\nfunction downloadFileByUrl(url, fileName) {\n if (!url.startsWith('http')) {\n downloadFileByLocalPath(url, fileName);\n return;\n }\n var downloadElement = document.createElement('a');\n downloadElement.href = url;\n downloadElement.download = decodeURI(fileName || '');\n document.body.appendChild(downloadElement);\n downloadElement.click();\n document.body.removeChild(downloadElement);\n}\nfunction downloadFile(file, fileName) {\n if (typeof file === 'string') {\n downloadFileByUrl(file, fileName);\n return;\n }\n var blob = new Blob([file]);\n var downloadElement = document.createElement('a');\n var href = window.URL.createObjectURL(blob);\n downloadElement.href = href;\n downloadElement.download = decodeURI(fileName || '');\n document.body.appendChild(downloadElement);\n downloadElement.click();\n document.body.removeChild(downloadElement);\n window.URL.revokeObjectURL(href);\n}\nexports[\"default\"] = downloadFile;\n\n\n//# sourceURL=webpack://hsu-utils/./tools/DownloadFile/index.ts?");
79
102
 
80
103
  /***/ }),
81
104
 
@@ -85,6 +108,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nvar
85
108
  \******************************/
86
109
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
87
110
 
111
+ "use strict";
88
112
  eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.ObjEqual = exports.ValEqual = exports.TypeEqual = void 0;\nvar __1 = __webpack_require__(/*! .. */ \"./tools/index.ts\");\nfunction TypeEqual(obj1, obj2) {\n var isEqual = false;\n if ((0, __1.Typeof)(obj1) !== (0, __1.Typeof)(obj2)) {\n isEqual = false;\n }\n else {\n isEqual = true;\n }\n return isEqual;\n}\nexports.TypeEqual = TypeEqual;\nfunction ValEqual(obj1, obj2) {\n var isEqual = false;\n if ((obj1 === null && obj2 === undefined) || (obj1 === undefined && obj2 === null)) {\n isEqual = true;\n }\n else {\n if (typeof obj1 === 'object' && typeof obj2 === 'object') {\n isEqual = ObjEqual(obj1, obj2);\n }\n else if (typeof obj1 === 'function' && typeof obj2 === 'function') {\n isEqual = JSON.stringify(obj1) === JSON.stringify(obj2);\n }\n else {\n isEqual = obj1 === obj2;\n }\n }\n return isEqual;\n}\nexports.ValEqual = ValEqual;\nfunction ObjEqual(obj1, obj2) {\n var isEqual = false;\n var _obj1 = (0, __1.deepCopy)(obj1);\n var _obj2 = (0, __1.deepCopy)(obj2);\n if (_obj1 !== null && _obj2 !== null) {\n if (Array.isArray(_obj1) && Array.isArray(_obj2)) {\n _obj1.sort();\n _obj2.sort();\n if (_obj1.length !== _obj2.length) {\n isEqual = false;\n }\n else {\n isEqual = true;\n for (var i = 0; i < _obj1.length; i++) {\n isEqual = ValEqual(_obj1[i], _obj2[i]);\n if (!isEqual)\n break;\n }\n }\n }\n else if (typeof _obj1 === 'object' && typeof _obj2 === 'object') {\n if (Object.keys(_obj1).length !== Object.keys(_obj2).length) {\n isEqual = false;\n }\n else {\n isEqual = true;\n for (var key in _obj1) {\n isEqual = ValEqual(_obj1[key], _obj2[key]);\n if (!isEqual)\n break;\n }\n }\n }\n }\n else if (_obj1 === null && _obj2 === null) {\n isEqual = true;\n }\n return isEqual;\n}\nexports.ObjEqual = ObjEqual;\nvar Equal = {\n ValEqual: ValEqual,\n TypeEqual: TypeEqual,\n ObjEqual: ObjEqual\n};\nexports[\"default\"] = Equal;\n\n\n//# sourceURL=webpack://hsu-utils/./tools/Equal/index.ts?");
89
113
 
90
114
  /***/ }),
@@ -95,6 +119,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
95
119
  \************************************/
96
120
  /***/ ((__unused_webpack_module, exports) => {
97
121
 
122
+ "use strict";
98
123
  eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nfunction get_string_width(str, font) {\n if (font === void 0) { font = {}; }\n var _a = font.style, style = _a === void 0 ? 'normal' : _a, _b = font.variant, variant = _b === void 0 ? 'normal' : _b, _c = font.weight, weight = _c === void 0 ? 'normal' : _c, _d = font.size, size = _d === void 0 ? 12 : _d, _e = font.lineHeight, lineHeight = _e === void 0 ? 1 : _e, _f = font.family, fontFamily = _f === void 0 ? '微软雅黑' : _f;\n var canvas = document.createElement('canvas');\n var ctx = canvas.getContext('2d');\n ctx.font = \"\".concat(style, \" \").concat(variant, \" \").concat(weight, \" \").concat(size, \"px/\").concat(lineHeight, \" \").concat(fontFamily);\n var metrics = ctx.measureText(str);\n var width = +(+metrics.width.toFixed(2) + 0.01).toFixed(2);\n return width;\n}\nexports[\"default\"] = get_string_width;\n\n\n//# sourceURL=webpack://hsu-utils/./tools/GetStrWidth/index.ts?");
99
124
 
100
125
  /***/ }),
@@ -105,17 +130,30 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nfunc
105
130
  \**********************************/
106
131
  /***/ (function(__unused_webpack_module, exports) {
107
132
 
133
+ "use strict";
108
134
  eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nvar imagePromiseCache = {};\nvar imageCache = {};\nfunction loadImage(url) {\n return __awaiter(this, void 0, void 0, function () {\n var imagePromise;\n return __generator(this, function (_a) {\n if (imageCache[url])\n return [2, imageCache[url]];\n if (imagePromiseCache[url])\n return [2, imagePromiseCache[url]];\n imagePromise = new Promise(function (resolve, reject) {\n var image = new Image();\n image.src = url;\n image.onload = function () {\n resolve(image);\n imageCache[url] = image;\n };\n image.onerror = function () {\n reject();\n };\n });\n imagePromiseCache[url] = imagePromise;\n return [2, imagePromise];\n });\n });\n}\nexports[\"default\"] = loadImage;\n\n\n//# sourceURL=webpack://hsu-utils/./tools/LoadImage/index.ts?");
109
135
 
110
136
  /***/ }),
111
137
 
138
+ /***/ "./tools/RenderPDF/index.ts":
139
+ /*!**********************************!*\
140
+ !*** ./tools/RenderPDF/index.ts ***!
141
+ \**********************************/
142
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
143
+
144
+ "use strict";
145
+ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nvar pdf_js_1 = __webpack_require__(/*! pdfjs-dist/legacy/build/pdf.js */ \"./node_modules/pdfjs-dist/legacy/build/pdf.js\");\npdf_js_1.GlobalWorkerOptions.workerSrc = 'https://cdn.bootcss.com/pdf.js/2.13.216/pdf.worker.js';\nfunction clear(containerId) {\n var container = document.getElementById(containerId);\n var pages = document.querySelectorAll(\"[id^=\\\"\".concat(containerId, \"-page-\\\"]\"));\n pages === null || pages === void 0 ? void 0 : pages.forEach(function (item) {\n container === null || container === void 0 ? void 0 : container.removeChild(item);\n });\n}\nfunction render(pdf, container, num) {\n pdf.getPage(num).then(function (page) {\n var pageDiv = document.createElement('div');\n pageDiv.setAttribute('id', \"\".concat(container.id, \"-page-\").concat(num));\n pageDiv.setAttribute('style', 'position: relative; ');\n container.appendChild(pageDiv);\n var canvas = document.createElement('canvas');\n pageDiv.appendChild(canvas);\n var ctx = canvas.getContext('2d');\n var scale = 1;\n var devicePixelRatio = window.devicePixelRatio * 2;\n var viewport = page.getViewport({ scale: scale * devicePixelRatio });\n canvas.style.width = '100%';\n canvas.style.height = '100%';\n canvas.width = viewport.width;\n canvas.height = viewport.height;\n var renderContext = {\n canvasContext: ctx,\n viewport: viewport\n };\n page.render(renderContext);\n });\n}\nfunction renderPDF(_a) {\n var pdfUrl = _a.pdfUrl, containerId = _a.containerId, startPageNum = _a.startPageNum, endPageNum = _a.endPageNum;\n return __awaiter(this, void 0, void 0, function () {\n var loadingTask, pdf, container, start, end, i;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n clear(containerId);\n loadingTask = (0, pdf_js_1.getDocument)({\n url: pdfUrl,\n cMapUrl: 'https://unpkg.com/browse/pdfjs-dist@2.13.216/cmaps/',\n cMapPacked: true\n });\n return [4, loadingTask.promise];\n case 1:\n pdf = _b.sent();\n container = document.getElementById(containerId);\n if (!container)\n return [2];\n start = startPageNum !== null && startPageNum !== void 0 ? startPageNum : 1;\n end = endPageNum !== null && endPageNum !== void 0 ? endPageNum : pdf.numPages;\n for (i = start; i <= end; i++) {\n render(pdf, container, i);\n }\n return [2];\n }\n });\n });\n}\nexports[\"default\"] = renderPDF;\n\n\n//# sourceURL=webpack://hsu-utils/./tools/RenderPDF/index.ts?");
146
+
147
+ /***/ }),
148
+
112
149
  /***/ "./tools/Typeof/index.ts":
113
150
  /*!*******************************!*\
114
151
  !*** ./tools/Typeof/index.ts ***!
115
152
  \*******************************/
116
153
  /***/ ((__unused_webpack_module, exports) => {
117
154
 
118
- eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nfunction Typeof(value) {\n var object_type = Object.prototype.toString.call(value);\n var reg = new RegExp(' (.+?)]');\n var type = object_type.match(reg)[1];\n return type.toLowerCase();\n}\nexports[\"default\"] = Typeof;\n\n\n//# sourceURL=webpack://hsu-utils/./tools/Typeof/index.ts?");
155
+ "use strict";
156
+ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nfunction Typeof(value, isType) {\n var object_type = Object.prototype.toString.call(value);\n var reg = new RegExp(' (.+?)]');\n var type = object_type.match(reg)[1].toLowerCase();\n if (!isType) {\n return type;\n }\n if (typeof value !== 'object') {\n return typeof value === isType;\n }\n else {\n return type === isType;\n }\n}\nexports[\"default\"] = Typeof;\n\n\n//# sourceURL=webpack://hsu-utils/./tools/Typeof/index.ts?");
119
157
 
120
158
  /***/ }),
121
159
 
@@ -125,7 +163,78 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nfunc
125
163
  \************************/
126
164
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
127
165
 
128
- eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.loadImage = exports.ConvertNumbers = exports.get_string_width = exports.Typeof = exports.Equal = exports.deepCopy = exports.console_table = void 0;\nvar ConsoleTable_1 = __importDefault(__webpack_require__(/*! ./ConsoleTable */ \"./tools/ConsoleTable/index.ts\"));\nexports.console_table = ConsoleTable_1.default;\nvar DeepCopy_1 = __importDefault(__webpack_require__(/*! ./DeepCopy */ \"./tools/DeepCopy/index.ts\"));\nexports.deepCopy = DeepCopy_1.default;\nvar Equal_1 = __importDefault(__webpack_require__(/*! ./Equal */ \"./tools/Equal/index.ts\"));\nexports.Equal = Equal_1.default;\nvar Typeof_1 = __importDefault(__webpack_require__(/*! ./Typeof */ \"./tools/Typeof/index.ts\"));\nexports.Typeof = Typeof_1.default;\nvar GetStrWidth_1 = __importDefault(__webpack_require__(/*! ./GetStrWidth */ \"./tools/GetStrWidth/index.ts\"));\nexports.get_string_width = GetStrWidth_1.default;\nvar ConvertNumbers_1 = __importDefault(__webpack_require__(/*! ./ConvertNumbers */ \"./tools/ConvertNumbers/index.ts\"));\nexports.ConvertNumbers = ConvertNumbers_1.default;\nvar LoadImage_1 = __importDefault(__webpack_require__(/*! ./LoadImage */ \"./tools/LoadImage/index.ts\"));\nexports.loadImage = LoadImage_1.default;\n\n\n//# sourceURL=webpack://hsu-utils/./tools/index.ts?");
166
+ "use strict";
167
+ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.downloadFile = exports.renderPDF = exports.loadImage = exports.ConvertNumbers = exports.get_string_width = exports.Typeof = exports.Equal = exports.deepCopy = exports.console_table = void 0;\nvar ConsoleTable_1 = __importDefault(__webpack_require__(/*! ./ConsoleTable */ \"./tools/ConsoleTable/index.ts\"));\nexports.console_table = ConsoleTable_1.default;\nvar DeepCopy_1 = __importDefault(__webpack_require__(/*! ./DeepCopy */ \"./tools/DeepCopy/index.ts\"));\nexports.deepCopy = DeepCopy_1.default;\nvar Equal_1 = __importDefault(__webpack_require__(/*! ./Equal */ \"./tools/Equal/index.ts\"));\nexports.Equal = Equal_1.default;\nvar Typeof_1 = __importDefault(__webpack_require__(/*! ./Typeof */ \"./tools/Typeof/index.ts\"));\nexports.Typeof = Typeof_1.default;\nvar GetStrWidth_1 = __importDefault(__webpack_require__(/*! ./GetStrWidth */ \"./tools/GetStrWidth/index.ts\"));\nexports.get_string_width = GetStrWidth_1.default;\nvar ConvertNumbers_1 = __importDefault(__webpack_require__(/*! ./ConvertNumbers */ \"./tools/ConvertNumbers/index.ts\"));\nexports.ConvertNumbers = ConvertNumbers_1.default;\nvar LoadImage_1 = __importDefault(__webpack_require__(/*! ./LoadImage */ \"./tools/LoadImage/index.ts\"));\nexports.loadImage = LoadImage_1.default;\nvar RenderPDF_1 = __importDefault(__webpack_require__(/*! ./RenderPDF */ \"./tools/RenderPDF/index.ts\"));\nexports.renderPDF = RenderPDF_1.default;\nvar DownloadFile_1 = __importDefault(__webpack_require__(/*! ./DownloadFile */ \"./tools/DownloadFile/index.ts\"));\nexports.downloadFile = DownloadFile_1.default;\n\n\n//# sourceURL=webpack://hsu-utils/./tools/index.ts?");
168
+
169
+ /***/ }),
170
+
171
+ /***/ "./node_modules/web-streams-polyfill/dist/ponyfill.js":
172
+ /*!************************************************************!*\
173
+ !*** ./node_modules/web-streams-polyfill/dist/ponyfill.js ***!
174
+ \************************************************************/
175
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
176
+
177
+ eval("/**\n * @license\n * web-streams-polyfill v3.3.3\n * Copyright 2024 Mattias Buelens, Diwank Singh Tomer and other contributors.\n * This code is released under the MIT license.\n * SPDX-License-Identifier: MIT\n */\n(function (global, factory) {\n true ? factory(exports) :\n 0;\n})(this, (function (exports) { 'use strict';\n\n /// <reference lib=\"es2015.symbol\" />\n var SymbolPolyfill = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ?\n Symbol :\n function (description) { return \"Symbol(\".concat(description, \")\"); };\n\n /******************************************************************************\r\n Copyright (c) Microsoft Corporation.\r\n\r\n Permission to use, copy, modify, and/or distribute this software for any\r\n purpose with or without fee is hereby granted.\r\n\r\n THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\n REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\n AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\n INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\n LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\n OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\n PERFORMANCE OF THIS SOFTWARE.\r\n ***************************************************************************** */\r\n /* global Reflect, Promise, SuppressedError, Symbol */\r\n\r\n\r\n function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n }\r\n\r\n function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n }\r\n\r\n function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n }\r\n\r\n function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n }\r\n\r\n function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n }\r\n\r\n function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n }\r\n\r\n typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n };\n\n function noop() {\n return undefined;\n }\n\n function typeIsObject(x) {\n return (typeof x === 'object' && x !== null) || typeof x === 'function';\n }\n var rethrowAssertionErrorRejection = noop;\n function setFunctionName(fn, name) {\n try {\n Object.defineProperty(fn, 'name', {\n value: name,\n configurable: true\n });\n }\n catch (_a) {\n // This property is non-configurable in older browsers, so ignore if this throws.\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name#browser_compatibility\n }\n }\n\n var originalPromise = Promise;\n var originalPromiseThen = Promise.prototype.then;\n var originalPromiseReject = Promise.reject.bind(originalPromise);\n // https://webidl.spec.whatwg.org/#a-new-promise\n function newPromise(executor) {\n return new originalPromise(executor);\n }\n // https://webidl.spec.whatwg.org/#a-promise-resolved-with\n function promiseResolvedWith(value) {\n return newPromise(function (resolve) { return resolve(value); });\n }\n // https://webidl.spec.whatwg.org/#a-promise-rejected-with\n function promiseRejectedWith(reason) {\n return originalPromiseReject(reason);\n }\n function PerformPromiseThen(promise, onFulfilled, onRejected) {\n // There doesn't appear to be any way to correctly emulate the behaviour from JavaScript, so this is just an\n // approximation.\n return originalPromiseThen.call(promise, onFulfilled, onRejected);\n }\n // Bluebird logs a warning when a promise is created within a fulfillment handler, but then isn't returned\n // from that handler. To prevent this, return null instead of void from all handlers.\n // http://bluebirdjs.com/docs/warning-explanations.html#warning-a-promise-was-created-in-a-handler-but-was-not-returned-from-it\n function uponPromise(promise, onFulfilled, onRejected) {\n PerformPromiseThen(PerformPromiseThen(promise, onFulfilled, onRejected), undefined, rethrowAssertionErrorRejection);\n }\n function uponFulfillment(promise, onFulfilled) {\n uponPromise(promise, onFulfilled);\n }\n function uponRejection(promise, onRejected) {\n uponPromise(promise, undefined, onRejected);\n }\n function transformPromiseWith(promise, fulfillmentHandler, rejectionHandler) {\n return PerformPromiseThen(promise, fulfillmentHandler, rejectionHandler);\n }\n function setPromiseIsHandledToTrue(promise) {\n PerformPromiseThen(promise, undefined, rethrowAssertionErrorRejection);\n }\n var _queueMicrotask = function (callback) {\n if (typeof queueMicrotask === 'function') {\n _queueMicrotask = queueMicrotask;\n }\n else {\n var resolvedPromise_1 = promiseResolvedWith(undefined);\n _queueMicrotask = function (cb) { return PerformPromiseThen(resolvedPromise_1, cb); };\n }\n return _queueMicrotask(callback);\n };\n function reflectCall(F, V, args) {\n if (typeof F !== 'function') {\n throw new TypeError('Argument is not a function');\n }\n return Function.prototype.apply.call(F, V, args);\n }\n function promiseCall(F, V, args) {\n try {\n return promiseResolvedWith(reflectCall(F, V, args));\n }\n catch (value) {\n return promiseRejectedWith(value);\n }\n }\n\n // Original from Chromium\n // https://chromium.googlesource.com/chromium/src/+/0aee4434a4dba42a42abaea9bfbc0cd196a63bc1/third_party/blink/renderer/core/streams/SimpleQueue.js\n var QUEUE_MAX_ARRAY_SIZE = 16384;\n /**\n * Simple queue structure.\n *\n * Avoids scalability issues with using a packed array directly by using\n * multiple arrays in a linked list and keeping the array size bounded.\n */\n var SimpleQueue = /** @class */ (function () {\n function SimpleQueue() {\n this._cursor = 0;\n this._size = 0;\n // _front and _back are always defined.\n this._front = {\n _elements: [],\n _next: undefined\n };\n this._back = this._front;\n // The cursor is used to avoid calling Array.shift().\n // It contains the index of the front element of the array inside the\n // front-most node. It is always in the range [0, QUEUE_MAX_ARRAY_SIZE).\n this._cursor = 0;\n // When there is only one node, size === elements.length - cursor.\n this._size = 0;\n }\n Object.defineProperty(SimpleQueue.prototype, \"length\", {\n get: function () {\n return this._size;\n },\n enumerable: false,\n configurable: true\n });\n // For exception safety, this method is structured in order:\n // 1. Read state\n // 2. Calculate required state mutations\n // 3. Perform state mutations\n SimpleQueue.prototype.push = function (element) {\n var oldBack = this._back;\n var newBack = oldBack;\n if (oldBack._elements.length === QUEUE_MAX_ARRAY_SIZE - 1) {\n newBack = {\n _elements: [],\n _next: undefined\n };\n }\n // push() is the mutation most likely to throw an exception, so it\n // goes first.\n oldBack._elements.push(element);\n if (newBack !== oldBack) {\n this._back = newBack;\n oldBack._next = newBack;\n }\n ++this._size;\n };\n // Like push(), shift() follows the read -> calculate -> mutate pattern for\n // exception safety.\n SimpleQueue.prototype.shift = function () { // must not be called on an empty queue\n var oldFront = this._front;\n var newFront = oldFront;\n var oldCursor = this._cursor;\n var newCursor = oldCursor + 1;\n var elements = oldFront._elements;\n var element = elements[oldCursor];\n if (newCursor === QUEUE_MAX_ARRAY_SIZE) {\n newFront = oldFront._next;\n newCursor = 0;\n }\n // No mutations before this point.\n --this._size;\n this._cursor = newCursor;\n if (oldFront !== newFront) {\n this._front = newFront;\n }\n // Permit shifted element to be garbage collected.\n elements[oldCursor] = undefined;\n return element;\n };\n // The tricky thing about forEach() is that it can be called\n // re-entrantly. The queue may be mutated inside the callback. It is easy to\n // see that push() within the callback has no negative effects since the end\n // of the queue is checked for on every iteration. If shift() is called\n // repeatedly within the callback then the next iteration may return an\n // element that has been removed. In this case the callback will be called\n // with undefined values until we either \"catch up\" with elements that still\n // exist or reach the back of the queue.\n SimpleQueue.prototype.forEach = function (callback) {\n var i = this._cursor;\n var node = this._front;\n var elements = node._elements;\n while (i !== elements.length || node._next !== undefined) {\n if (i === elements.length) {\n node = node._next;\n elements = node._elements;\n i = 0;\n if (elements.length === 0) {\n break;\n }\n }\n callback(elements[i]);\n ++i;\n }\n };\n // Return the element that would be returned if shift() was called now,\n // without modifying the queue.\n SimpleQueue.prototype.peek = function () { // must not be called on an empty queue\n var front = this._front;\n var cursor = this._cursor;\n return front._elements[cursor];\n };\n return SimpleQueue;\n }());\n\n var AbortSteps = SymbolPolyfill('[[AbortSteps]]');\n var ErrorSteps = SymbolPolyfill('[[ErrorSteps]]');\n var CancelSteps = SymbolPolyfill('[[CancelSteps]]');\n var PullSteps = SymbolPolyfill('[[PullSteps]]');\n var ReleaseSteps = SymbolPolyfill('[[ReleaseSteps]]');\n\n function ReadableStreamReaderGenericInitialize(reader, stream) {\n reader._ownerReadableStream = stream;\n stream._reader = reader;\n if (stream._state === 'readable') {\n defaultReaderClosedPromiseInitialize(reader);\n }\n else if (stream._state === 'closed') {\n defaultReaderClosedPromiseInitializeAsResolved(reader);\n }\n else {\n defaultReaderClosedPromiseInitializeAsRejected(reader, stream._storedError);\n }\n }\n // A client of ReadableStreamDefaultReader and ReadableStreamBYOBReader may use these functions directly to bypass state\n // check.\n function ReadableStreamReaderGenericCancel(reader, reason) {\n var stream = reader._ownerReadableStream;\n return ReadableStreamCancel(stream, reason);\n }\n function ReadableStreamReaderGenericRelease(reader) {\n var stream = reader._ownerReadableStream;\n if (stream._state === 'readable') {\n defaultReaderClosedPromiseReject(reader, new TypeError(\"Reader was released and can no longer be used to monitor the stream's closedness\"));\n }\n else {\n defaultReaderClosedPromiseResetToRejected(reader, new TypeError(\"Reader was released and can no longer be used to monitor the stream's closedness\"));\n }\n stream._readableStreamController[ReleaseSteps]();\n stream._reader = undefined;\n reader._ownerReadableStream = undefined;\n }\n // Helper functions for the readers.\n function readerLockException(name) {\n return new TypeError('Cannot ' + name + ' a stream using a released reader');\n }\n // Helper functions for the ReadableStreamDefaultReader.\n function defaultReaderClosedPromiseInitialize(reader) {\n reader._closedPromise = newPromise(function (resolve, reject) {\n reader._closedPromise_resolve = resolve;\n reader._closedPromise_reject = reject;\n });\n }\n function defaultReaderClosedPromiseInitializeAsRejected(reader, reason) {\n defaultReaderClosedPromiseInitialize(reader);\n defaultReaderClosedPromiseReject(reader, reason);\n }\n function defaultReaderClosedPromiseInitializeAsResolved(reader) {\n defaultReaderClosedPromiseInitialize(reader);\n defaultReaderClosedPromiseResolve(reader);\n }\n function defaultReaderClosedPromiseReject(reader, reason) {\n if (reader._closedPromise_reject === undefined) {\n return;\n }\n setPromiseIsHandledToTrue(reader._closedPromise);\n reader._closedPromise_reject(reason);\n reader._closedPromise_resolve = undefined;\n reader._closedPromise_reject = undefined;\n }\n function defaultReaderClosedPromiseResetToRejected(reader, reason) {\n defaultReaderClosedPromiseInitializeAsRejected(reader, reason);\n }\n function defaultReaderClosedPromiseResolve(reader) {\n if (reader._closedPromise_resolve === undefined) {\n return;\n }\n reader._closedPromise_resolve(undefined);\n reader._closedPromise_resolve = undefined;\n reader._closedPromise_reject = undefined;\n }\n\n /// <reference lib=\"es2015.core\" />\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinite#Polyfill\n var NumberIsFinite = Number.isFinite || function (x) {\n return typeof x === 'number' && isFinite(x);\n };\n\n /// <reference lib=\"es2015.core\" />\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc#Polyfill\n var MathTrunc = Math.trunc || function (v) {\n return v < 0 ? Math.ceil(v) : Math.floor(v);\n };\n\n // https://heycam.github.io/webidl/#idl-dictionaries\n function isDictionary(x) {\n return typeof x === 'object' || typeof x === 'function';\n }\n function assertDictionary(obj, context) {\n if (obj !== undefined && !isDictionary(obj)) {\n throw new TypeError(\"\".concat(context, \" is not an object.\"));\n }\n }\n // https://heycam.github.io/webidl/#idl-callback-functions\n function assertFunction(x, context) {\n if (typeof x !== 'function') {\n throw new TypeError(\"\".concat(context, \" is not a function.\"));\n }\n }\n // https://heycam.github.io/webidl/#idl-object\n function isObject(x) {\n return (typeof x === 'object' && x !== null) || typeof x === 'function';\n }\n function assertObject(x, context) {\n if (!isObject(x)) {\n throw new TypeError(\"\".concat(context, \" is not an object.\"));\n }\n }\n function assertRequiredArgument(x, position, context) {\n if (x === undefined) {\n throw new TypeError(\"Parameter \".concat(position, \" is required in '\").concat(context, \"'.\"));\n }\n }\n function assertRequiredField(x, field, context) {\n if (x === undefined) {\n throw new TypeError(\"\".concat(field, \" is required in '\").concat(context, \"'.\"));\n }\n }\n // https://heycam.github.io/webidl/#idl-unrestricted-double\n function convertUnrestrictedDouble(value) {\n return Number(value);\n }\n function censorNegativeZero(x) {\n return x === 0 ? 0 : x;\n }\n function integerPart(x) {\n return censorNegativeZero(MathTrunc(x));\n }\n // https://heycam.github.io/webidl/#idl-unsigned-long-long\n function convertUnsignedLongLongWithEnforceRange(value, context) {\n var lowerBound = 0;\n var upperBound = Number.MAX_SAFE_INTEGER;\n var x = Number(value);\n x = censorNegativeZero(x);\n if (!NumberIsFinite(x)) {\n throw new TypeError(\"\".concat(context, \" is not a finite number\"));\n }\n x = integerPart(x);\n if (x < lowerBound || x > upperBound) {\n throw new TypeError(\"\".concat(context, \" is outside the accepted range of \").concat(lowerBound, \" to \").concat(upperBound, \", inclusive\"));\n }\n if (!NumberIsFinite(x) || x === 0) {\n return 0;\n }\n // TODO Use BigInt if supported?\n // let xBigInt = BigInt(integerPart(x));\n // xBigInt = BigInt.asUintN(64, xBigInt);\n // return Number(xBigInt);\n return x;\n }\n\n function assertReadableStream(x, context) {\n if (!IsReadableStream(x)) {\n throw new TypeError(\"\".concat(context, \" is not a ReadableStream.\"));\n }\n }\n\n // Abstract operations for the ReadableStream.\n function AcquireReadableStreamDefaultReader(stream) {\n return new ReadableStreamDefaultReader(stream);\n }\n // ReadableStream API exposed for controllers.\n function ReadableStreamAddReadRequest(stream, readRequest) {\n stream._reader._readRequests.push(readRequest);\n }\n function ReadableStreamFulfillReadRequest(stream, chunk, done) {\n var reader = stream._reader;\n var readRequest = reader._readRequests.shift();\n if (done) {\n readRequest._closeSteps();\n }\n else {\n readRequest._chunkSteps(chunk);\n }\n }\n function ReadableStreamGetNumReadRequests(stream) {\n return stream._reader._readRequests.length;\n }\n function ReadableStreamHasDefaultReader(stream) {\n var reader = stream._reader;\n if (reader === undefined) {\n return false;\n }\n if (!IsReadableStreamDefaultReader(reader)) {\n return false;\n }\n return true;\n }\n /**\n * A default reader vended by a {@link ReadableStream}.\n *\n * @public\n */\n var ReadableStreamDefaultReader = /** @class */ (function () {\n function ReadableStreamDefaultReader(stream) {\n assertRequiredArgument(stream, 1, 'ReadableStreamDefaultReader');\n assertReadableStream(stream, 'First parameter');\n if (IsReadableStreamLocked(stream)) {\n throw new TypeError('This stream has already been locked for exclusive reading by another reader');\n }\n ReadableStreamReaderGenericInitialize(this, stream);\n this._readRequests = new SimpleQueue();\n }\n Object.defineProperty(ReadableStreamDefaultReader.prototype, \"closed\", {\n /**\n * Returns a promise that will be fulfilled when the stream becomes closed,\n * or rejected if the stream ever errors or the reader's lock is released before the stream finishes closing.\n */\n get: function () {\n if (!IsReadableStreamDefaultReader(this)) {\n return promiseRejectedWith(defaultReaderBrandCheckException('closed'));\n }\n return this._closedPromise;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * If the reader is active, behaves the same as {@link ReadableStream.cancel | stream.cancel(reason)}.\n */\n ReadableStreamDefaultReader.prototype.cancel = function (reason) {\n if (reason === void 0) { reason = undefined; }\n if (!IsReadableStreamDefaultReader(this)) {\n return promiseRejectedWith(defaultReaderBrandCheckException('cancel'));\n }\n if (this._ownerReadableStream === undefined) {\n return promiseRejectedWith(readerLockException('cancel'));\n }\n return ReadableStreamReaderGenericCancel(this, reason);\n };\n /**\n * Returns a promise that allows access to the next chunk from the stream's internal queue, if available.\n *\n * If reading a chunk causes the queue to become empty, more data will be pulled from the underlying source.\n */\n ReadableStreamDefaultReader.prototype.read = function () {\n if (!IsReadableStreamDefaultReader(this)) {\n return promiseRejectedWith(defaultReaderBrandCheckException('read'));\n }\n if (this._ownerReadableStream === undefined) {\n return promiseRejectedWith(readerLockException('read from'));\n }\n var resolvePromise;\n var rejectPromise;\n var promise = newPromise(function (resolve, reject) {\n resolvePromise = resolve;\n rejectPromise = reject;\n });\n var readRequest = {\n _chunkSteps: function (chunk) { return resolvePromise({ value: chunk, done: false }); },\n _closeSteps: function () { return resolvePromise({ value: undefined, done: true }); },\n _errorSteps: function (e) { return rejectPromise(e); }\n };\n ReadableStreamDefaultReaderRead(this, readRequest);\n return promise;\n };\n /**\n * Releases the reader's lock on the corresponding stream. After the lock is released, the reader is no longer active.\n * If the associated stream is errored when the lock is released, the reader will appear errored in the same way\n * from now on; otherwise, the reader will appear closed.\n *\n * A reader's lock cannot be released while it still has a pending read request, i.e., if a promise returned by\n * the reader's {@link ReadableStreamDefaultReader.read | read()} method has not yet been settled. Attempting to\n * do so will throw a `TypeError` and leave the reader locked to the stream.\n */\n ReadableStreamDefaultReader.prototype.releaseLock = function () {\n if (!IsReadableStreamDefaultReader(this)) {\n throw defaultReaderBrandCheckException('releaseLock');\n }\n if (this._ownerReadableStream === undefined) {\n return;\n }\n ReadableStreamDefaultReaderRelease(this);\n };\n return ReadableStreamDefaultReader;\n }());\n Object.defineProperties(ReadableStreamDefaultReader.prototype, {\n cancel: { enumerable: true },\n read: { enumerable: true },\n releaseLock: { enumerable: true },\n closed: { enumerable: true }\n });\n setFunctionName(ReadableStreamDefaultReader.prototype.cancel, 'cancel');\n setFunctionName(ReadableStreamDefaultReader.prototype.read, 'read');\n setFunctionName(ReadableStreamDefaultReader.prototype.releaseLock, 'releaseLock');\n if (typeof SymbolPolyfill.toStringTag === 'symbol') {\n Object.defineProperty(ReadableStreamDefaultReader.prototype, SymbolPolyfill.toStringTag, {\n value: 'ReadableStreamDefaultReader',\n configurable: true\n });\n }\n // Abstract operations for the readers.\n function IsReadableStreamDefaultReader(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_readRequests')) {\n return false;\n }\n return x instanceof ReadableStreamDefaultReader;\n }\n function ReadableStreamDefaultReaderRead(reader, readRequest) {\n var stream = reader._ownerReadableStream;\n stream._disturbed = true;\n if (stream._state === 'closed') {\n readRequest._closeSteps();\n }\n else if (stream._state === 'errored') {\n readRequest._errorSteps(stream._storedError);\n }\n else {\n stream._readableStreamController[PullSteps](readRequest);\n }\n }\n function ReadableStreamDefaultReaderRelease(reader) {\n ReadableStreamReaderGenericRelease(reader);\n var e = new TypeError('Reader was released');\n ReadableStreamDefaultReaderErrorReadRequests(reader, e);\n }\n function ReadableStreamDefaultReaderErrorReadRequests(reader, e) {\n var readRequests = reader._readRequests;\n reader._readRequests = new SimpleQueue();\n readRequests.forEach(function (readRequest) {\n readRequest._errorSteps(e);\n });\n }\n // Helper functions for the ReadableStreamDefaultReader.\n function defaultReaderBrandCheckException(name) {\n return new TypeError(\"ReadableStreamDefaultReader.prototype.\".concat(name, \" can only be used on a ReadableStreamDefaultReader\"));\n }\n\n var _a$1, _b, _c;\n function CreateArrayFromList(elements) {\n // We use arrays to represent lists, so this is basically a no-op.\n // Do a slice though just in case we happen to depend on the unique-ness.\n return elements.slice();\n }\n function CopyDataBlockBytes(dest, destOffset, src, srcOffset, n) {\n new Uint8Array(dest).set(new Uint8Array(src, srcOffset, n), destOffset);\n }\n var TransferArrayBuffer = function (O) {\n if (typeof O.transfer === 'function') {\n TransferArrayBuffer = function (buffer) { return buffer.transfer(); };\n }\n else if (typeof structuredClone === 'function') {\n TransferArrayBuffer = function (buffer) { return structuredClone(buffer, { transfer: [buffer] }); };\n }\n else {\n // Not implemented correctly\n TransferArrayBuffer = function (buffer) { return buffer; };\n }\n return TransferArrayBuffer(O);\n };\n var IsDetachedBuffer = function (O) {\n if (typeof O.detached === 'boolean') {\n IsDetachedBuffer = function (buffer) { return buffer.detached; };\n }\n else {\n // Not implemented correctly\n IsDetachedBuffer = function (buffer) { return buffer.byteLength === 0; };\n }\n return IsDetachedBuffer(O);\n };\n function ArrayBufferSlice(buffer, begin, end) {\n // ArrayBuffer.prototype.slice is not available on IE10\n // https://www.caniuse.com/mdn-javascript_builtins_arraybuffer_slice\n if (buffer.slice) {\n return buffer.slice(begin, end);\n }\n var length = end - begin;\n var slice = new ArrayBuffer(length);\n CopyDataBlockBytes(slice, 0, buffer, begin, length);\n return slice;\n }\n function GetMethod(receiver, prop) {\n var func = receiver[prop];\n if (func === undefined || func === null) {\n return undefined;\n }\n if (typeof func !== 'function') {\n throw new TypeError(\"\".concat(String(prop), \" is not a function\"));\n }\n return func;\n }\n function CreateAsyncFromSyncIterator(syncIteratorRecord) {\n // Instead of re-implementing CreateAsyncFromSyncIterator and %AsyncFromSyncIteratorPrototype%,\n // we use yield* inside an async generator function to achieve the same result.\n var _a;\n // Wrap the sync iterator inside a sync iterable, so we can use it with yield*.\n var syncIterable = (_a = {},\n _a[SymbolPolyfill.iterator] = function () { return syncIteratorRecord.iterator; },\n _a);\n // Create an async generator function and immediately invoke it.\n var asyncIterator = (function () {\n return __asyncGenerator(this, arguments, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [5 /*yield**/, __values(__asyncDelegator(__asyncValues(syncIterable)))];\n case 1: return [4 /*yield*/, __await.apply(void 0, [_a.sent()])];\n case 2: return [4 /*yield*/, __await.apply(void 0, [_a.sent()])];\n case 3: return [2 /*return*/, _a.sent()];\n }\n });\n });\n }());\n // Return as an async iterator record.\n var nextMethod = asyncIterator.next;\n return { iterator: asyncIterator, nextMethod: nextMethod, done: false };\n }\n // Aligns with core-js/modules/es.symbol.async-iterator.js\n var SymbolAsyncIterator = (_c = (_a$1 = SymbolPolyfill.asyncIterator) !== null && _a$1 !== void 0 ? _a$1 : (_b = SymbolPolyfill.for) === null || _b === void 0 ? void 0 : _b.call(SymbolPolyfill, 'Symbol.asyncIterator')) !== null && _c !== void 0 ? _c : '@@asyncIterator';\n function GetIterator(obj, hint, method) {\n if (hint === void 0) { hint = 'sync'; }\n if (method === undefined) {\n if (hint === 'async') {\n method = GetMethod(obj, SymbolAsyncIterator);\n if (method === undefined) {\n var syncMethod = GetMethod(obj, SymbolPolyfill.iterator);\n var syncIteratorRecord = GetIterator(obj, 'sync', syncMethod);\n return CreateAsyncFromSyncIterator(syncIteratorRecord);\n }\n }\n else {\n method = GetMethod(obj, SymbolPolyfill.iterator);\n }\n }\n if (method === undefined) {\n throw new TypeError('The object is not iterable');\n }\n var iterator = reflectCall(method, obj, []);\n if (!typeIsObject(iterator)) {\n throw new TypeError('The iterator method must return an object');\n }\n var nextMethod = iterator.next;\n return { iterator: iterator, nextMethod: nextMethod, done: false };\n }\n function IteratorNext(iteratorRecord) {\n var result = reflectCall(iteratorRecord.nextMethod, iteratorRecord.iterator, []);\n if (!typeIsObject(result)) {\n throw new TypeError('The iterator.next() method must return an object');\n }\n return result;\n }\n function IteratorComplete(iterResult) {\n return Boolean(iterResult.done);\n }\n function IteratorValue(iterResult) {\n return iterResult.value;\n }\n\n /// <reference lib=\"es2018.asynciterable\" />\n var _a;\n // We cannot access %AsyncIteratorPrototype% without non-ES2018 syntax, but we can re-create it.\n var AsyncIteratorPrototype = (_a = {},\n // 25.1.3.1 %AsyncIteratorPrototype% [ @@asyncIterator ] ( )\n // https://tc39.github.io/ecma262/#sec-asynciteratorprototype-asynciterator\n _a[SymbolAsyncIterator] = function () {\n return this;\n },\n _a);\n Object.defineProperty(AsyncIteratorPrototype, SymbolAsyncIterator, { enumerable: false });\n\n /// <reference lib=\"es2018.asynciterable\" />\n var ReadableStreamAsyncIteratorImpl = /** @class */ (function () {\n function ReadableStreamAsyncIteratorImpl(reader, preventCancel) {\n this._ongoingPromise = undefined;\n this._isFinished = false;\n this._reader = reader;\n this._preventCancel = preventCancel;\n }\n ReadableStreamAsyncIteratorImpl.prototype.next = function () {\n var _this = this;\n var nextSteps = function () { return _this._nextSteps(); };\n this._ongoingPromise = this._ongoingPromise ?\n transformPromiseWith(this._ongoingPromise, nextSteps, nextSteps) :\n nextSteps();\n return this._ongoingPromise;\n };\n ReadableStreamAsyncIteratorImpl.prototype.return = function (value) {\n var _this = this;\n var returnSteps = function () { return _this._returnSteps(value); };\n return this._ongoingPromise ?\n transformPromiseWith(this._ongoingPromise, returnSteps, returnSteps) :\n returnSteps();\n };\n ReadableStreamAsyncIteratorImpl.prototype._nextSteps = function () {\n var _this = this;\n if (this._isFinished) {\n return Promise.resolve({ value: undefined, done: true });\n }\n var reader = this._reader;\n var resolvePromise;\n var rejectPromise;\n var promise = newPromise(function (resolve, reject) {\n resolvePromise = resolve;\n rejectPromise = reject;\n });\n var readRequest = {\n _chunkSteps: function (chunk) {\n _this._ongoingPromise = undefined;\n // This needs to be delayed by one microtask, otherwise we stop pulling too early which breaks a test.\n // FIXME Is this a bug in the specification, or in the test?\n _queueMicrotask(function () { return resolvePromise({ value: chunk, done: false }); });\n },\n _closeSteps: function () {\n _this._ongoingPromise = undefined;\n _this._isFinished = true;\n ReadableStreamReaderGenericRelease(reader);\n resolvePromise({ value: undefined, done: true });\n },\n _errorSteps: function (reason) {\n _this._ongoingPromise = undefined;\n _this._isFinished = true;\n ReadableStreamReaderGenericRelease(reader);\n rejectPromise(reason);\n }\n };\n ReadableStreamDefaultReaderRead(reader, readRequest);\n return promise;\n };\n ReadableStreamAsyncIteratorImpl.prototype._returnSteps = function (value) {\n if (this._isFinished) {\n return Promise.resolve({ value: value, done: true });\n }\n this._isFinished = true;\n var reader = this._reader;\n if (!this._preventCancel) {\n var result = ReadableStreamReaderGenericCancel(reader, value);\n ReadableStreamReaderGenericRelease(reader);\n return transformPromiseWith(result, function () { return ({ value: value, done: true }); });\n }\n ReadableStreamReaderGenericRelease(reader);\n return promiseResolvedWith({ value: value, done: true });\n };\n return ReadableStreamAsyncIteratorImpl;\n }());\n var ReadableStreamAsyncIteratorPrototype = {\n next: function () {\n if (!IsReadableStreamAsyncIterator(this)) {\n return promiseRejectedWith(streamAsyncIteratorBrandCheckException('next'));\n }\n return this._asyncIteratorImpl.next();\n },\n return: function (value) {\n if (!IsReadableStreamAsyncIterator(this)) {\n return promiseRejectedWith(streamAsyncIteratorBrandCheckException('return'));\n }\n return this._asyncIteratorImpl.return(value);\n }\n };\n Object.setPrototypeOf(ReadableStreamAsyncIteratorPrototype, AsyncIteratorPrototype);\n // Abstract operations for the ReadableStream.\n function AcquireReadableStreamAsyncIterator(stream, preventCancel) {\n var reader = AcquireReadableStreamDefaultReader(stream);\n var impl = new ReadableStreamAsyncIteratorImpl(reader, preventCancel);\n var iterator = Object.create(ReadableStreamAsyncIteratorPrototype);\n iterator._asyncIteratorImpl = impl;\n return iterator;\n }\n function IsReadableStreamAsyncIterator(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_asyncIteratorImpl')) {\n return false;\n }\n try {\n // noinspection SuspiciousTypeOfGuard\n return x._asyncIteratorImpl instanceof\n ReadableStreamAsyncIteratorImpl;\n }\n catch (_a) {\n return false;\n }\n }\n // Helper functions for the ReadableStream.\n function streamAsyncIteratorBrandCheckException(name) {\n return new TypeError(\"ReadableStreamAsyncIterator.\".concat(name, \" can only be used on a ReadableSteamAsyncIterator\"));\n }\n\n /// <reference lib=\"es2015.core\" />\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN#Polyfill\n var NumberIsNaN = Number.isNaN || function (x) {\n // eslint-disable-next-line no-self-compare\n return x !== x;\n };\n\n function IsNonNegativeNumber(v) {\n if (typeof v !== 'number') {\n return false;\n }\n if (NumberIsNaN(v)) {\n return false;\n }\n if (v < 0) {\n return false;\n }\n return true;\n }\n function CloneAsUint8Array(O) {\n var buffer = ArrayBufferSlice(O.buffer, O.byteOffset, O.byteOffset + O.byteLength);\n return new Uint8Array(buffer);\n }\n\n function DequeueValue(container) {\n var pair = container._queue.shift();\n container._queueTotalSize -= pair.size;\n if (container._queueTotalSize < 0) {\n container._queueTotalSize = 0;\n }\n return pair.value;\n }\n function EnqueueValueWithSize(container, value, size) {\n if (!IsNonNegativeNumber(size) || size === Infinity) {\n throw new RangeError('Size must be a finite, non-NaN, non-negative number.');\n }\n container._queue.push({ value: value, size: size });\n container._queueTotalSize += size;\n }\n function PeekQueueValue(container) {\n var pair = container._queue.peek();\n return pair.value;\n }\n function ResetQueue(container) {\n container._queue = new SimpleQueue();\n container._queueTotalSize = 0;\n }\n\n function isDataViewConstructor(ctor) {\n return ctor === DataView;\n }\n function isDataView(view) {\n return isDataViewConstructor(view.constructor);\n }\n function arrayBufferViewElementSize(ctor) {\n if (isDataViewConstructor(ctor)) {\n return 1;\n }\n return ctor.BYTES_PER_ELEMENT;\n }\n\n /**\n * A pull-into request in a {@link ReadableByteStreamController}.\n *\n * @public\n */\n var ReadableStreamBYOBRequest = /** @class */ (function () {\n function ReadableStreamBYOBRequest() {\n throw new TypeError('Illegal constructor');\n }\n Object.defineProperty(ReadableStreamBYOBRequest.prototype, \"view\", {\n /**\n * Returns the view for writing in to, or `null` if the BYOB request has already been responded to.\n */\n get: function () {\n if (!IsReadableStreamBYOBRequest(this)) {\n throw byobRequestBrandCheckException('view');\n }\n return this._view;\n },\n enumerable: false,\n configurable: true\n });\n ReadableStreamBYOBRequest.prototype.respond = function (bytesWritten) {\n if (!IsReadableStreamBYOBRequest(this)) {\n throw byobRequestBrandCheckException('respond');\n }\n assertRequiredArgument(bytesWritten, 1, 'respond');\n bytesWritten = convertUnsignedLongLongWithEnforceRange(bytesWritten, 'First parameter');\n if (this._associatedReadableByteStreamController === undefined) {\n throw new TypeError('This BYOB request has been invalidated');\n }\n if (IsDetachedBuffer(this._view.buffer)) {\n throw new TypeError(\"The BYOB request's buffer has been detached and so cannot be used as a response\");\n }\n ReadableByteStreamControllerRespond(this._associatedReadableByteStreamController, bytesWritten);\n };\n ReadableStreamBYOBRequest.prototype.respondWithNewView = function (view) {\n if (!IsReadableStreamBYOBRequest(this)) {\n throw byobRequestBrandCheckException('respondWithNewView');\n }\n assertRequiredArgument(view, 1, 'respondWithNewView');\n if (!ArrayBuffer.isView(view)) {\n throw new TypeError('You can only respond with array buffer views');\n }\n if (this._associatedReadableByteStreamController === undefined) {\n throw new TypeError('This BYOB request has been invalidated');\n }\n if (IsDetachedBuffer(view.buffer)) {\n throw new TypeError('The given view\\'s buffer has been detached and so cannot be used as a response');\n }\n ReadableByteStreamControllerRespondWithNewView(this._associatedReadableByteStreamController, view);\n };\n return ReadableStreamBYOBRequest;\n }());\n Object.defineProperties(ReadableStreamBYOBRequest.prototype, {\n respond: { enumerable: true },\n respondWithNewView: { enumerable: true },\n view: { enumerable: true }\n });\n setFunctionName(ReadableStreamBYOBRequest.prototype.respond, 'respond');\n setFunctionName(ReadableStreamBYOBRequest.prototype.respondWithNewView, 'respondWithNewView');\n if (typeof SymbolPolyfill.toStringTag === 'symbol') {\n Object.defineProperty(ReadableStreamBYOBRequest.prototype, SymbolPolyfill.toStringTag, {\n value: 'ReadableStreamBYOBRequest',\n configurable: true\n });\n }\n /**\n * Allows control of a {@link ReadableStream | readable byte stream}'s state and internal queue.\n *\n * @public\n */\n var ReadableByteStreamController = /** @class */ (function () {\n function ReadableByteStreamController() {\n throw new TypeError('Illegal constructor');\n }\n Object.defineProperty(ReadableByteStreamController.prototype, \"byobRequest\", {\n /**\n * Returns the current BYOB pull request, or `null` if there isn't one.\n */\n get: function () {\n if (!IsReadableByteStreamController(this)) {\n throw byteStreamControllerBrandCheckException('byobRequest');\n }\n return ReadableByteStreamControllerGetBYOBRequest(this);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ReadableByteStreamController.prototype, \"desiredSize\", {\n /**\n * Returns the desired size to fill the controlled stream's internal queue. It can be negative, if the queue is\n * over-full. An underlying byte source ought to use this information to determine when and how to apply backpressure.\n */\n get: function () {\n if (!IsReadableByteStreamController(this)) {\n throw byteStreamControllerBrandCheckException('desiredSize');\n }\n return ReadableByteStreamControllerGetDesiredSize(this);\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Closes the controlled readable stream. Consumers will still be able to read any previously-enqueued chunks from\n * the stream, but once those are read, the stream will become closed.\n */\n ReadableByteStreamController.prototype.close = function () {\n if (!IsReadableByteStreamController(this)) {\n throw byteStreamControllerBrandCheckException('close');\n }\n if (this._closeRequested) {\n throw new TypeError('The stream has already been closed; do not close it again!');\n }\n var state = this._controlledReadableByteStream._state;\n if (state !== 'readable') {\n throw new TypeError(\"The stream (in \".concat(state, \" state) is not in the readable state and cannot be closed\"));\n }\n ReadableByteStreamControllerClose(this);\n };\n ReadableByteStreamController.prototype.enqueue = function (chunk) {\n if (!IsReadableByteStreamController(this)) {\n throw byteStreamControllerBrandCheckException('enqueue');\n }\n assertRequiredArgument(chunk, 1, 'enqueue');\n if (!ArrayBuffer.isView(chunk)) {\n throw new TypeError('chunk must be an array buffer view');\n }\n if (chunk.byteLength === 0) {\n throw new TypeError('chunk must have non-zero byteLength');\n }\n if (chunk.buffer.byteLength === 0) {\n throw new TypeError(\"chunk's buffer must have non-zero byteLength\");\n }\n if (this._closeRequested) {\n throw new TypeError('stream is closed or draining');\n }\n var state = this._controlledReadableByteStream._state;\n if (state !== 'readable') {\n throw new TypeError(\"The stream (in \".concat(state, \" state) is not in the readable state and cannot be enqueued to\"));\n }\n ReadableByteStreamControllerEnqueue(this, chunk);\n };\n /**\n * Errors the controlled readable stream, making all future interactions with it fail with the given error `e`.\n */\n ReadableByteStreamController.prototype.error = function (e) {\n if (e === void 0) { e = undefined; }\n if (!IsReadableByteStreamController(this)) {\n throw byteStreamControllerBrandCheckException('error');\n }\n ReadableByteStreamControllerError(this, e);\n };\n /** @internal */\n ReadableByteStreamController.prototype[CancelSteps] = function (reason) {\n ReadableByteStreamControllerClearPendingPullIntos(this);\n ResetQueue(this);\n var result = this._cancelAlgorithm(reason);\n ReadableByteStreamControllerClearAlgorithms(this);\n return result;\n };\n /** @internal */\n ReadableByteStreamController.prototype[PullSteps] = function (readRequest) {\n var stream = this._controlledReadableByteStream;\n if (this._queueTotalSize > 0) {\n ReadableByteStreamControllerFillReadRequestFromQueue(this, readRequest);\n return;\n }\n var autoAllocateChunkSize = this._autoAllocateChunkSize;\n if (autoAllocateChunkSize !== undefined) {\n var buffer = void 0;\n try {\n buffer = new ArrayBuffer(autoAllocateChunkSize);\n }\n catch (bufferE) {\n readRequest._errorSteps(bufferE);\n return;\n }\n var pullIntoDescriptor = {\n buffer: buffer,\n bufferByteLength: autoAllocateChunkSize,\n byteOffset: 0,\n byteLength: autoAllocateChunkSize,\n bytesFilled: 0,\n minimumFill: 1,\n elementSize: 1,\n viewConstructor: Uint8Array,\n readerType: 'default'\n };\n this._pendingPullIntos.push(pullIntoDescriptor);\n }\n ReadableStreamAddReadRequest(stream, readRequest);\n ReadableByteStreamControllerCallPullIfNeeded(this);\n };\n /** @internal */\n ReadableByteStreamController.prototype[ReleaseSteps] = function () {\n if (this._pendingPullIntos.length > 0) {\n var firstPullInto = this._pendingPullIntos.peek();\n firstPullInto.readerType = 'none';\n this._pendingPullIntos = new SimpleQueue();\n this._pendingPullIntos.push(firstPullInto);\n }\n };\n return ReadableByteStreamController;\n }());\n Object.defineProperties(ReadableByteStreamController.prototype, {\n close: { enumerable: true },\n enqueue: { enumerable: true },\n error: { enumerable: true },\n byobRequest: { enumerable: true },\n desiredSize: { enumerable: true }\n });\n setFunctionName(ReadableByteStreamController.prototype.close, 'close');\n setFunctionName(ReadableByteStreamController.prototype.enqueue, 'enqueue');\n setFunctionName(ReadableByteStreamController.prototype.error, 'error');\n if (typeof SymbolPolyfill.toStringTag === 'symbol') {\n Object.defineProperty(ReadableByteStreamController.prototype, SymbolPolyfill.toStringTag, {\n value: 'ReadableByteStreamController',\n configurable: true\n });\n }\n // Abstract operations for the ReadableByteStreamController.\n function IsReadableByteStreamController(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_controlledReadableByteStream')) {\n return false;\n }\n return x instanceof ReadableByteStreamController;\n }\n function IsReadableStreamBYOBRequest(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_associatedReadableByteStreamController')) {\n return false;\n }\n return x instanceof ReadableStreamBYOBRequest;\n }\n function ReadableByteStreamControllerCallPullIfNeeded(controller) {\n var shouldPull = ReadableByteStreamControllerShouldCallPull(controller);\n if (!shouldPull) {\n return;\n }\n if (controller._pulling) {\n controller._pullAgain = true;\n return;\n }\n controller._pulling = true;\n // TODO: Test controller argument\n var pullPromise = controller._pullAlgorithm();\n uponPromise(pullPromise, function () {\n controller._pulling = false;\n if (controller._pullAgain) {\n controller._pullAgain = false;\n ReadableByteStreamControllerCallPullIfNeeded(controller);\n }\n return null;\n }, function (e) {\n ReadableByteStreamControllerError(controller, e);\n return null;\n });\n }\n function ReadableByteStreamControllerClearPendingPullIntos(controller) {\n ReadableByteStreamControllerInvalidateBYOBRequest(controller);\n controller._pendingPullIntos = new SimpleQueue();\n }\n function ReadableByteStreamControllerCommitPullIntoDescriptor(stream, pullIntoDescriptor) {\n var done = false;\n if (stream._state === 'closed') {\n done = true;\n }\n var filledView = ReadableByteStreamControllerConvertPullIntoDescriptor(pullIntoDescriptor);\n if (pullIntoDescriptor.readerType === 'default') {\n ReadableStreamFulfillReadRequest(stream, filledView, done);\n }\n else {\n ReadableStreamFulfillReadIntoRequest(stream, filledView, done);\n }\n }\n function ReadableByteStreamControllerConvertPullIntoDescriptor(pullIntoDescriptor) {\n var bytesFilled = pullIntoDescriptor.bytesFilled;\n var elementSize = pullIntoDescriptor.elementSize;\n return new pullIntoDescriptor.viewConstructor(pullIntoDescriptor.buffer, pullIntoDescriptor.byteOffset, bytesFilled / elementSize);\n }\n function ReadableByteStreamControllerEnqueueChunkToQueue(controller, buffer, byteOffset, byteLength) {\n controller._queue.push({ buffer: buffer, byteOffset: byteOffset, byteLength: byteLength });\n controller._queueTotalSize += byteLength;\n }\n function ReadableByteStreamControllerEnqueueClonedChunkToQueue(controller, buffer, byteOffset, byteLength) {\n var clonedChunk;\n try {\n clonedChunk = ArrayBufferSlice(buffer, byteOffset, byteOffset + byteLength);\n }\n catch (cloneE) {\n ReadableByteStreamControllerError(controller, cloneE);\n throw cloneE;\n }\n ReadableByteStreamControllerEnqueueChunkToQueue(controller, clonedChunk, 0, byteLength);\n }\n function ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue(controller, firstDescriptor) {\n if (firstDescriptor.bytesFilled > 0) {\n ReadableByteStreamControllerEnqueueClonedChunkToQueue(controller, firstDescriptor.buffer, firstDescriptor.byteOffset, firstDescriptor.bytesFilled);\n }\n ReadableByteStreamControllerShiftPendingPullInto(controller);\n }\n function ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller, pullIntoDescriptor) {\n var maxBytesToCopy = Math.min(controller._queueTotalSize, pullIntoDescriptor.byteLength - pullIntoDescriptor.bytesFilled);\n var maxBytesFilled = pullIntoDescriptor.bytesFilled + maxBytesToCopy;\n var totalBytesToCopyRemaining = maxBytesToCopy;\n var ready = false;\n var remainderBytes = maxBytesFilled % pullIntoDescriptor.elementSize;\n var maxAlignedBytes = maxBytesFilled - remainderBytes;\n // A descriptor for a read() request that is not yet filled up to its minimum length will stay at the head\n // of the queue, so the underlying source can keep filling it.\n if (maxAlignedBytes >= pullIntoDescriptor.minimumFill) {\n totalBytesToCopyRemaining = maxAlignedBytes - pullIntoDescriptor.bytesFilled;\n ready = true;\n }\n var queue = controller._queue;\n while (totalBytesToCopyRemaining > 0) {\n var headOfQueue = queue.peek();\n var bytesToCopy = Math.min(totalBytesToCopyRemaining, headOfQueue.byteLength);\n var destStart = pullIntoDescriptor.byteOffset + pullIntoDescriptor.bytesFilled;\n CopyDataBlockBytes(pullIntoDescriptor.buffer, destStart, headOfQueue.buffer, headOfQueue.byteOffset, bytesToCopy);\n if (headOfQueue.byteLength === bytesToCopy) {\n queue.shift();\n }\n else {\n headOfQueue.byteOffset += bytesToCopy;\n headOfQueue.byteLength -= bytesToCopy;\n }\n controller._queueTotalSize -= bytesToCopy;\n ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, bytesToCopy, pullIntoDescriptor);\n totalBytesToCopyRemaining -= bytesToCopy;\n }\n return ready;\n }\n function ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, size, pullIntoDescriptor) {\n pullIntoDescriptor.bytesFilled += size;\n }\n function ReadableByteStreamControllerHandleQueueDrain(controller) {\n if (controller._queueTotalSize === 0 && controller._closeRequested) {\n ReadableByteStreamControllerClearAlgorithms(controller);\n ReadableStreamClose(controller._controlledReadableByteStream);\n }\n else {\n ReadableByteStreamControllerCallPullIfNeeded(controller);\n }\n }\n function ReadableByteStreamControllerInvalidateBYOBRequest(controller) {\n if (controller._byobRequest === null) {\n return;\n }\n controller._byobRequest._associatedReadableByteStreamController = undefined;\n controller._byobRequest._view = null;\n controller._byobRequest = null;\n }\n function ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller) {\n while (controller._pendingPullIntos.length > 0) {\n if (controller._queueTotalSize === 0) {\n return;\n }\n var pullIntoDescriptor = controller._pendingPullIntos.peek();\n if (ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller, pullIntoDescriptor)) {\n ReadableByteStreamControllerShiftPendingPullInto(controller);\n ReadableByteStreamControllerCommitPullIntoDescriptor(controller._controlledReadableByteStream, pullIntoDescriptor);\n }\n }\n }\n function ReadableByteStreamControllerProcessReadRequestsUsingQueue(controller) {\n var reader = controller._controlledReadableByteStream._reader;\n while (reader._readRequests.length > 0) {\n if (controller._queueTotalSize === 0) {\n return;\n }\n var readRequest = reader._readRequests.shift();\n ReadableByteStreamControllerFillReadRequestFromQueue(controller, readRequest);\n }\n }\n function ReadableByteStreamControllerPullInto(controller, view, min, readIntoRequest) {\n var stream = controller._controlledReadableByteStream;\n var ctor = view.constructor;\n var elementSize = arrayBufferViewElementSize(ctor);\n var byteOffset = view.byteOffset, byteLength = view.byteLength;\n var minimumFill = min * elementSize;\n var buffer;\n try {\n buffer = TransferArrayBuffer(view.buffer);\n }\n catch (e) {\n readIntoRequest._errorSteps(e);\n return;\n }\n var pullIntoDescriptor = {\n buffer: buffer,\n bufferByteLength: buffer.byteLength,\n byteOffset: byteOffset,\n byteLength: byteLength,\n bytesFilled: 0,\n minimumFill: minimumFill,\n elementSize: elementSize,\n viewConstructor: ctor,\n readerType: 'byob'\n };\n if (controller._pendingPullIntos.length > 0) {\n controller._pendingPullIntos.push(pullIntoDescriptor);\n // No ReadableByteStreamControllerCallPullIfNeeded() call since:\n // - No change happens on desiredSize\n // - The source has already been notified of that there's at least 1 pending read(view)\n ReadableStreamAddReadIntoRequest(stream, readIntoRequest);\n return;\n }\n if (stream._state === 'closed') {\n var emptyView = new ctor(pullIntoDescriptor.buffer, pullIntoDescriptor.byteOffset, 0);\n readIntoRequest._closeSteps(emptyView);\n return;\n }\n if (controller._queueTotalSize > 0) {\n if (ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller, pullIntoDescriptor)) {\n var filledView = ReadableByteStreamControllerConvertPullIntoDescriptor(pullIntoDescriptor);\n ReadableByteStreamControllerHandleQueueDrain(controller);\n readIntoRequest._chunkSteps(filledView);\n return;\n }\n if (controller._closeRequested) {\n var e = new TypeError('Insufficient bytes to fill elements in the given buffer');\n ReadableByteStreamControllerError(controller, e);\n readIntoRequest._errorSteps(e);\n return;\n }\n }\n controller._pendingPullIntos.push(pullIntoDescriptor);\n ReadableStreamAddReadIntoRequest(stream, readIntoRequest);\n ReadableByteStreamControllerCallPullIfNeeded(controller);\n }\n function ReadableByteStreamControllerRespondInClosedState(controller, firstDescriptor) {\n if (firstDescriptor.readerType === 'none') {\n ReadableByteStreamControllerShiftPendingPullInto(controller);\n }\n var stream = controller._controlledReadableByteStream;\n if (ReadableStreamHasBYOBReader(stream)) {\n while (ReadableStreamGetNumReadIntoRequests(stream) > 0) {\n var pullIntoDescriptor = ReadableByteStreamControllerShiftPendingPullInto(controller);\n ReadableByteStreamControllerCommitPullIntoDescriptor(stream, pullIntoDescriptor);\n }\n }\n }\n function ReadableByteStreamControllerRespondInReadableState(controller, bytesWritten, pullIntoDescriptor) {\n ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, bytesWritten, pullIntoDescriptor);\n if (pullIntoDescriptor.readerType === 'none') {\n ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue(controller, pullIntoDescriptor);\n ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller);\n return;\n }\n if (pullIntoDescriptor.bytesFilled < pullIntoDescriptor.minimumFill) {\n // A descriptor for a read() request that is not yet filled up to its minimum length will stay at the head\n // of the queue, so the underlying source can keep filling it.\n return;\n }\n ReadableByteStreamControllerShiftPendingPullInto(controller);\n var remainderSize = pullIntoDescriptor.bytesFilled % pullIntoDescriptor.elementSize;\n if (remainderSize > 0) {\n var end = pullIntoDescriptor.byteOffset + pullIntoDescriptor.bytesFilled;\n ReadableByteStreamControllerEnqueueClonedChunkToQueue(controller, pullIntoDescriptor.buffer, end - remainderSize, remainderSize);\n }\n pullIntoDescriptor.bytesFilled -= remainderSize;\n ReadableByteStreamControllerCommitPullIntoDescriptor(controller._controlledReadableByteStream, pullIntoDescriptor);\n ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller);\n }\n function ReadableByteStreamControllerRespondInternal(controller, bytesWritten) {\n var firstDescriptor = controller._pendingPullIntos.peek();\n ReadableByteStreamControllerInvalidateBYOBRequest(controller);\n var state = controller._controlledReadableByteStream._state;\n if (state === 'closed') {\n ReadableByteStreamControllerRespondInClosedState(controller, firstDescriptor);\n }\n else {\n ReadableByteStreamControllerRespondInReadableState(controller, bytesWritten, firstDescriptor);\n }\n ReadableByteStreamControllerCallPullIfNeeded(controller);\n }\n function ReadableByteStreamControllerShiftPendingPullInto(controller) {\n var descriptor = controller._pendingPullIntos.shift();\n return descriptor;\n }\n function ReadableByteStreamControllerShouldCallPull(controller) {\n var stream = controller._controlledReadableByteStream;\n if (stream._state !== 'readable') {\n return false;\n }\n if (controller._closeRequested) {\n return false;\n }\n if (!controller._started) {\n return false;\n }\n if (ReadableStreamHasDefaultReader(stream) && ReadableStreamGetNumReadRequests(stream) > 0) {\n return true;\n }\n if (ReadableStreamHasBYOBReader(stream) && ReadableStreamGetNumReadIntoRequests(stream) > 0) {\n return true;\n }\n var desiredSize = ReadableByteStreamControllerGetDesiredSize(controller);\n if (desiredSize > 0) {\n return true;\n }\n return false;\n }\n function ReadableByteStreamControllerClearAlgorithms(controller) {\n controller._pullAlgorithm = undefined;\n controller._cancelAlgorithm = undefined;\n }\n // A client of ReadableByteStreamController may use these functions directly to bypass state check.\n function ReadableByteStreamControllerClose(controller) {\n var stream = controller._controlledReadableByteStream;\n if (controller._closeRequested || stream._state !== 'readable') {\n return;\n }\n if (controller._queueTotalSize > 0) {\n controller._closeRequested = true;\n return;\n }\n if (controller._pendingPullIntos.length > 0) {\n var firstPendingPullInto = controller._pendingPullIntos.peek();\n if (firstPendingPullInto.bytesFilled % firstPendingPullInto.elementSize !== 0) {\n var e = new TypeError('Insufficient bytes to fill elements in the given buffer');\n ReadableByteStreamControllerError(controller, e);\n throw e;\n }\n }\n ReadableByteStreamControllerClearAlgorithms(controller);\n ReadableStreamClose(stream);\n }\n function ReadableByteStreamControllerEnqueue(controller, chunk) {\n var stream = controller._controlledReadableByteStream;\n if (controller._closeRequested || stream._state !== 'readable') {\n return;\n }\n var buffer = chunk.buffer, byteOffset = chunk.byteOffset, byteLength = chunk.byteLength;\n if (IsDetachedBuffer(buffer)) {\n throw new TypeError('chunk\\'s buffer is detached and so cannot be enqueued');\n }\n var transferredBuffer = TransferArrayBuffer(buffer);\n if (controller._pendingPullIntos.length > 0) {\n var firstPendingPullInto = controller._pendingPullIntos.peek();\n if (IsDetachedBuffer(firstPendingPullInto.buffer)) {\n throw new TypeError('The BYOB request\\'s buffer has been detached and so cannot be filled with an enqueued chunk');\n }\n ReadableByteStreamControllerInvalidateBYOBRequest(controller);\n firstPendingPullInto.buffer = TransferArrayBuffer(firstPendingPullInto.buffer);\n if (firstPendingPullInto.readerType === 'none') {\n ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue(controller, firstPendingPullInto);\n }\n }\n if (ReadableStreamHasDefaultReader(stream)) {\n ReadableByteStreamControllerProcessReadRequestsUsingQueue(controller);\n if (ReadableStreamGetNumReadRequests(stream) === 0) {\n ReadableByteStreamControllerEnqueueChunkToQueue(controller, transferredBuffer, byteOffset, byteLength);\n }\n else {\n if (controller._pendingPullIntos.length > 0) {\n ReadableByteStreamControllerShiftPendingPullInto(controller);\n }\n var transferredView = new Uint8Array(transferredBuffer, byteOffset, byteLength);\n ReadableStreamFulfillReadRequest(stream, transferredView, false);\n }\n }\n else if (ReadableStreamHasBYOBReader(stream)) {\n // TODO: Ideally in this branch detaching should happen only if the buffer is not consumed fully.\n ReadableByteStreamControllerEnqueueChunkToQueue(controller, transferredBuffer, byteOffset, byteLength);\n ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller);\n }\n else {\n ReadableByteStreamControllerEnqueueChunkToQueue(controller, transferredBuffer, byteOffset, byteLength);\n }\n ReadableByteStreamControllerCallPullIfNeeded(controller);\n }\n function ReadableByteStreamControllerError(controller, e) {\n var stream = controller._controlledReadableByteStream;\n if (stream._state !== 'readable') {\n return;\n }\n ReadableByteStreamControllerClearPendingPullIntos(controller);\n ResetQueue(controller);\n ReadableByteStreamControllerClearAlgorithms(controller);\n ReadableStreamError(stream, e);\n }\n function ReadableByteStreamControllerFillReadRequestFromQueue(controller, readRequest) {\n var entry = controller._queue.shift();\n controller._queueTotalSize -= entry.byteLength;\n ReadableByteStreamControllerHandleQueueDrain(controller);\n var view = new Uint8Array(entry.buffer, entry.byteOffset, entry.byteLength);\n readRequest._chunkSteps(view);\n }\n function ReadableByteStreamControllerGetBYOBRequest(controller) {\n if (controller._byobRequest === null && controller._pendingPullIntos.length > 0) {\n var firstDescriptor = controller._pendingPullIntos.peek();\n var view = new Uint8Array(firstDescriptor.buffer, firstDescriptor.byteOffset + firstDescriptor.bytesFilled, firstDescriptor.byteLength - firstDescriptor.bytesFilled);\n var byobRequest = Object.create(ReadableStreamBYOBRequest.prototype);\n SetUpReadableStreamBYOBRequest(byobRequest, controller, view);\n controller._byobRequest = byobRequest;\n }\n return controller._byobRequest;\n }\n function ReadableByteStreamControllerGetDesiredSize(controller) {\n var state = controller._controlledReadableByteStream._state;\n if (state === 'errored') {\n return null;\n }\n if (state === 'closed') {\n return 0;\n }\n return controller._strategyHWM - controller._queueTotalSize;\n }\n function ReadableByteStreamControllerRespond(controller, bytesWritten) {\n var firstDescriptor = controller._pendingPullIntos.peek();\n var state = controller._controlledReadableByteStream._state;\n if (state === 'closed') {\n if (bytesWritten !== 0) {\n throw new TypeError('bytesWritten must be 0 when calling respond() on a closed stream');\n }\n }\n else {\n if (bytesWritten === 0) {\n throw new TypeError('bytesWritten must be greater than 0 when calling respond() on a readable stream');\n }\n if (firstDescriptor.bytesFilled + bytesWritten > firstDescriptor.byteLength) {\n throw new RangeError('bytesWritten out of range');\n }\n }\n firstDescriptor.buffer = TransferArrayBuffer(firstDescriptor.buffer);\n ReadableByteStreamControllerRespondInternal(controller, bytesWritten);\n }\n function ReadableByteStreamControllerRespondWithNewView(controller, view) {\n var firstDescriptor = controller._pendingPullIntos.peek();\n var state = controller._controlledReadableByteStream._state;\n if (state === 'closed') {\n if (view.byteLength !== 0) {\n throw new TypeError('The view\\'s length must be 0 when calling respondWithNewView() on a closed stream');\n }\n }\n else {\n if (view.byteLength === 0) {\n throw new TypeError('The view\\'s length must be greater than 0 when calling respondWithNewView() on a readable stream');\n }\n }\n if (firstDescriptor.byteOffset + firstDescriptor.bytesFilled !== view.byteOffset) {\n throw new RangeError('The region specified by view does not match byobRequest');\n }\n if (firstDescriptor.bufferByteLength !== view.buffer.byteLength) {\n throw new RangeError('The buffer of view has different capacity than byobRequest');\n }\n if (firstDescriptor.bytesFilled + view.byteLength > firstDescriptor.byteLength) {\n throw new RangeError('The region specified by view is larger than byobRequest');\n }\n var viewByteLength = view.byteLength;\n firstDescriptor.buffer = TransferArrayBuffer(view.buffer);\n ReadableByteStreamControllerRespondInternal(controller, viewByteLength);\n }\n function SetUpReadableByteStreamController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, autoAllocateChunkSize) {\n controller._controlledReadableByteStream = stream;\n controller._pullAgain = false;\n controller._pulling = false;\n controller._byobRequest = null;\n // Need to set the slots so that the assert doesn't fire. In the spec the slots already exist implicitly.\n controller._queue = controller._queueTotalSize = undefined;\n ResetQueue(controller);\n controller._closeRequested = false;\n controller._started = false;\n controller._strategyHWM = highWaterMark;\n controller._pullAlgorithm = pullAlgorithm;\n controller._cancelAlgorithm = cancelAlgorithm;\n controller._autoAllocateChunkSize = autoAllocateChunkSize;\n controller._pendingPullIntos = new SimpleQueue();\n stream._readableStreamController = controller;\n var startResult = startAlgorithm();\n uponPromise(promiseResolvedWith(startResult), function () {\n controller._started = true;\n ReadableByteStreamControllerCallPullIfNeeded(controller);\n return null;\n }, function (r) {\n ReadableByteStreamControllerError(controller, r);\n return null;\n });\n }\n function SetUpReadableByteStreamControllerFromUnderlyingSource(stream, underlyingByteSource, highWaterMark) {\n var controller = Object.create(ReadableByteStreamController.prototype);\n var startAlgorithm;\n var pullAlgorithm;\n var cancelAlgorithm;\n if (underlyingByteSource.start !== undefined) {\n startAlgorithm = function () { return underlyingByteSource.start(controller); };\n }\n else {\n startAlgorithm = function () { return undefined; };\n }\n if (underlyingByteSource.pull !== undefined) {\n pullAlgorithm = function () { return underlyingByteSource.pull(controller); };\n }\n else {\n pullAlgorithm = function () { return promiseResolvedWith(undefined); };\n }\n if (underlyingByteSource.cancel !== undefined) {\n cancelAlgorithm = function (reason) { return underlyingByteSource.cancel(reason); };\n }\n else {\n cancelAlgorithm = function () { return promiseResolvedWith(undefined); };\n }\n var autoAllocateChunkSize = underlyingByteSource.autoAllocateChunkSize;\n if (autoAllocateChunkSize === 0) {\n throw new TypeError('autoAllocateChunkSize must be greater than 0');\n }\n SetUpReadableByteStreamController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, autoAllocateChunkSize);\n }\n function SetUpReadableStreamBYOBRequest(request, controller, view) {\n request._associatedReadableByteStreamController = controller;\n request._view = view;\n }\n // Helper functions for the ReadableStreamBYOBRequest.\n function byobRequestBrandCheckException(name) {\n return new TypeError(\"ReadableStreamBYOBRequest.prototype.\".concat(name, \" can only be used on a ReadableStreamBYOBRequest\"));\n }\n // Helper functions for the ReadableByteStreamController.\n function byteStreamControllerBrandCheckException(name) {\n return new TypeError(\"ReadableByteStreamController.prototype.\".concat(name, \" can only be used on a ReadableByteStreamController\"));\n }\n\n function convertReaderOptions(options, context) {\n assertDictionary(options, context);\n var mode = options === null || options === void 0 ? void 0 : options.mode;\n return {\n mode: mode === undefined ? undefined : convertReadableStreamReaderMode(mode, \"\".concat(context, \" has member 'mode' that\"))\n };\n }\n function convertReadableStreamReaderMode(mode, context) {\n mode = \"\".concat(mode);\n if (mode !== 'byob') {\n throw new TypeError(\"\".concat(context, \" '\").concat(mode, \"' is not a valid enumeration value for ReadableStreamReaderMode\"));\n }\n return mode;\n }\n function convertByobReadOptions(options, context) {\n var _a;\n assertDictionary(options, context);\n var min = (_a = options === null || options === void 0 ? void 0 : options.min) !== null && _a !== void 0 ? _a : 1;\n return {\n min: convertUnsignedLongLongWithEnforceRange(min, \"\".concat(context, \" has member 'min' that\"))\n };\n }\n\n // Abstract operations for the ReadableStream.\n function AcquireReadableStreamBYOBReader(stream) {\n return new ReadableStreamBYOBReader(stream);\n }\n // ReadableStream API exposed for controllers.\n function ReadableStreamAddReadIntoRequest(stream, readIntoRequest) {\n stream._reader._readIntoRequests.push(readIntoRequest);\n }\n function ReadableStreamFulfillReadIntoRequest(stream, chunk, done) {\n var reader = stream._reader;\n var readIntoRequest = reader._readIntoRequests.shift();\n if (done) {\n readIntoRequest._closeSteps(chunk);\n }\n else {\n readIntoRequest._chunkSteps(chunk);\n }\n }\n function ReadableStreamGetNumReadIntoRequests(stream) {\n return stream._reader._readIntoRequests.length;\n }\n function ReadableStreamHasBYOBReader(stream) {\n var reader = stream._reader;\n if (reader === undefined) {\n return false;\n }\n if (!IsReadableStreamBYOBReader(reader)) {\n return false;\n }\n return true;\n }\n /**\n * A BYOB reader vended by a {@link ReadableStream}.\n *\n * @public\n */\n var ReadableStreamBYOBReader = /** @class */ (function () {\n function ReadableStreamBYOBReader(stream) {\n assertRequiredArgument(stream, 1, 'ReadableStreamBYOBReader');\n assertReadableStream(stream, 'First parameter');\n if (IsReadableStreamLocked(stream)) {\n throw new TypeError('This stream has already been locked for exclusive reading by another reader');\n }\n if (!IsReadableByteStreamController(stream._readableStreamController)) {\n throw new TypeError('Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte ' +\n 'source');\n }\n ReadableStreamReaderGenericInitialize(this, stream);\n this._readIntoRequests = new SimpleQueue();\n }\n Object.defineProperty(ReadableStreamBYOBReader.prototype, \"closed\", {\n /**\n * Returns a promise that will be fulfilled when the stream becomes closed, or rejected if the stream ever errors or\n * the reader's lock is released before the stream finishes closing.\n */\n get: function () {\n if (!IsReadableStreamBYOBReader(this)) {\n return promiseRejectedWith(byobReaderBrandCheckException('closed'));\n }\n return this._closedPromise;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * If the reader is active, behaves the same as {@link ReadableStream.cancel | stream.cancel(reason)}.\n */\n ReadableStreamBYOBReader.prototype.cancel = function (reason) {\n if (reason === void 0) { reason = undefined; }\n if (!IsReadableStreamBYOBReader(this)) {\n return promiseRejectedWith(byobReaderBrandCheckException('cancel'));\n }\n if (this._ownerReadableStream === undefined) {\n return promiseRejectedWith(readerLockException('cancel'));\n }\n return ReadableStreamReaderGenericCancel(this, reason);\n };\n ReadableStreamBYOBReader.prototype.read = function (view, rawOptions) {\n if (rawOptions === void 0) { rawOptions = {}; }\n if (!IsReadableStreamBYOBReader(this)) {\n return promiseRejectedWith(byobReaderBrandCheckException('read'));\n }\n if (!ArrayBuffer.isView(view)) {\n return promiseRejectedWith(new TypeError('view must be an array buffer view'));\n }\n if (view.byteLength === 0) {\n return promiseRejectedWith(new TypeError('view must have non-zero byteLength'));\n }\n if (view.buffer.byteLength === 0) {\n return promiseRejectedWith(new TypeError(\"view's buffer must have non-zero byteLength\"));\n }\n if (IsDetachedBuffer(view.buffer)) {\n return promiseRejectedWith(new TypeError('view\\'s buffer has been detached'));\n }\n var options;\n try {\n options = convertByobReadOptions(rawOptions, 'options');\n }\n catch (e) {\n return promiseRejectedWith(e);\n }\n var min = options.min;\n if (min === 0) {\n return promiseRejectedWith(new TypeError('options.min must be greater than 0'));\n }\n if (!isDataView(view)) {\n if (min > view.length) {\n return promiseRejectedWith(new RangeError('options.min must be less than or equal to view\\'s length'));\n }\n }\n else if (min > view.byteLength) {\n return promiseRejectedWith(new RangeError('options.min must be less than or equal to view\\'s byteLength'));\n }\n if (this._ownerReadableStream === undefined) {\n return promiseRejectedWith(readerLockException('read from'));\n }\n var resolvePromise;\n var rejectPromise;\n var promise = newPromise(function (resolve, reject) {\n resolvePromise = resolve;\n rejectPromise = reject;\n });\n var readIntoRequest = {\n _chunkSteps: function (chunk) { return resolvePromise({ value: chunk, done: false }); },\n _closeSteps: function (chunk) { return resolvePromise({ value: chunk, done: true }); },\n _errorSteps: function (e) { return rejectPromise(e); }\n };\n ReadableStreamBYOBReaderRead(this, view, min, readIntoRequest);\n return promise;\n };\n /**\n * Releases the reader's lock on the corresponding stream. After the lock is released, the reader is no longer active.\n * If the associated stream is errored when the lock is released, the reader will appear errored in the same way\n * from now on; otherwise, the reader will appear closed.\n *\n * A reader's lock cannot be released while it still has a pending read request, i.e., if a promise returned by\n * the reader's {@link ReadableStreamBYOBReader.read | read()} method has not yet been settled. Attempting to\n * do so will throw a `TypeError` and leave the reader locked to the stream.\n */\n ReadableStreamBYOBReader.prototype.releaseLock = function () {\n if (!IsReadableStreamBYOBReader(this)) {\n throw byobReaderBrandCheckException('releaseLock');\n }\n if (this._ownerReadableStream === undefined) {\n return;\n }\n ReadableStreamBYOBReaderRelease(this);\n };\n return ReadableStreamBYOBReader;\n }());\n Object.defineProperties(ReadableStreamBYOBReader.prototype, {\n cancel: { enumerable: true },\n read: { enumerable: true },\n releaseLock: { enumerable: true },\n closed: { enumerable: true }\n });\n setFunctionName(ReadableStreamBYOBReader.prototype.cancel, 'cancel');\n setFunctionName(ReadableStreamBYOBReader.prototype.read, 'read');\n setFunctionName(ReadableStreamBYOBReader.prototype.releaseLock, 'releaseLock');\n if (typeof SymbolPolyfill.toStringTag === 'symbol') {\n Object.defineProperty(ReadableStreamBYOBReader.prototype, SymbolPolyfill.toStringTag, {\n value: 'ReadableStreamBYOBReader',\n configurable: true\n });\n }\n // Abstract operations for the readers.\n function IsReadableStreamBYOBReader(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_readIntoRequests')) {\n return false;\n }\n return x instanceof ReadableStreamBYOBReader;\n }\n function ReadableStreamBYOBReaderRead(reader, view, min, readIntoRequest) {\n var stream = reader._ownerReadableStream;\n stream._disturbed = true;\n if (stream._state === 'errored') {\n readIntoRequest._errorSteps(stream._storedError);\n }\n else {\n ReadableByteStreamControllerPullInto(stream._readableStreamController, view, min, readIntoRequest);\n }\n }\n function ReadableStreamBYOBReaderRelease(reader) {\n ReadableStreamReaderGenericRelease(reader);\n var e = new TypeError('Reader was released');\n ReadableStreamBYOBReaderErrorReadIntoRequests(reader, e);\n }\n function ReadableStreamBYOBReaderErrorReadIntoRequests(reader, e) {\n var readIntoRequests = reader._readIntoRequests;\n reader._readIntoRequests = new SimpleQueue();\n readIntoRequests.forEach(function (readIntoRequest) {\n readIntoRequest._errorSteps(e);\n });\n }\n // Helper functions for the ReadableStreamBYOBReader.\n function byobReaderBrandCheckException(name) {\n return new TypeError(\"ReadableStreamBYOBReader.prototype.\".concat(name, \" can only be used on a ReadableStreamBYOBReader\"));\n }\n\n function ExtractHighWaterMark(strategy, defaultHWM) {\n var highWaterMark = strategy.highWaterMark;\n if (highWaterMark === undefined) {\n return defaultHWM;\n }\n if (NumberIsNaN(highWaterMark) || highWaterMark < 0) {\n throw new RangeError('Invalid highWaterMark');\n }\n return highWaterMark;\n }\n function ExtractSizeAlgorithm(strategy) {\n var size = strategy.size;\n if (!size) {\n return function () { return 1; };\n }\n return size;\n }\n\n function convertQueuingStrategy(init, context) {\n assertDictionary(init, context);\n var highWaterMark = init === null || init === void 0 ? void 0 : init.highWaterMark;\n var size = init === null || init === void 0 ? void 0 : init.size;\n return {\n highWaterMark: highWaterMark === undefined ? undefined : convertUnrestrictedDouble(highWaterMark),\n size: size === undefined ? undefined : convertQueuingStrategySize(size, \"\".concat(context, \" has member 'size' that\"))\n };\n }\n function convertQueuingStrategySize(fn, context) {\n assertFunction(fn, context);\n return function (chunk) { return convertUnrestrictedDouble(fn(chunk)); };\n }\n\n function convertUnderlyingSink(original, context) {\n assertDictionary(original, context);\n var abort = original === null || original === void 0 ? void 0 : original.abort;\n var close = original === null || original === void 0 ? void 0 : original.close;\n var start = original === null || original === void 0 ? void 0 : original.start;\n var type = original === null || original === void 0 ? void 0 : original.type;\n var write = original === null || original === void 0 ? void 0 : original.write;\n return {\n abort: abort === undefined ?\n undefined :\n convertUnderlyingSinkAbortCallback(abort, original, \"\".concat(context, \" has member 'abort' that\")),\n close: close === undefined ?\n undefined :\n convertUnderlyingSinkCloseCallback(close, original, \"\".concat(context, \" has member 'close' that\")),\n start: start === undefined ?\n undefined :\n convertUnderlyingSinkStartCallback(start, original, \"\".concat(context, \" has member 'start' that\")),\n write: write === undefined ?\n undefined :\n convertUnderlyingSinkWriteCallback(write, original, \"\".concat(context, \" has member 'write' that\")),\n type: type\n };\n }\n function convertUnderlyingSinkAbortCallback(fn, original, context) {\n assertFunction(fn, context);\n return function (reason) { return promiseCall(fn, original, [reason]); };\n }\n function convertUnderlyingSinkCloseCallback(fn, original, context) {\n assertFunction(fn, context);\n return function () { return promiseCall(fn, original, []); };\n }\n function convertUnderlyingSinkStartCallback(fn, original, context) {\n assertFunction(fn, context);\n return function (controller) { return reflectCall(fn, original, [controller]); };\n }\n function convertUnderlyingSinkWriteCallback(fn, original, context) {\n assertFunction(fn, context);\n return function (chunk, controller) { return promiseCall(fn, original, [chunk, controller]); };\n }\n\n function assertWritableStream(x, context) {\n if (!IsWritableStream(x)) {\n throw new TypeError(\"\".concat(context, \" is not a WritableStream.\"));\n }\n }\n\n function isAbortSignal(value) {\n if (typeof value !== 'object' || value === null) {\n return false;\n }\n try {\n return typeof value.aborted === 'boolean';\n }\n catch (_a) {\n // AbortSignal.prototype.aborted throws if its brand check fails\n return false;\n }\n }\n var supportsAbortController = typeof AbortController === 'function';\n /**\n * Construct a new AbortController, if supported by the platform.\n *\n * @internal\n */\n function createAbortController() {\n if (supportsAbortController) {\n return new AbortController();\n }\n return undefined;\n }\n\n /**\n * A writable stream represents a destination for data, into which you can write.\n *\n * @public\n */\n var WritableStream = /** @class */ (function () {\n function WritableStream(rawUnderlyingSink, rawStrategy) {\n if (rawUnderlyingSink === void 0) { rawUnderlyingSink = {}; }\n if (rawStrategy === void 0) { rawStrategy = {}; }\n if (rawUnderlyingSink === undefined) {\n rawUnderlyingSink = null;\n }\n else {\n assertObject(rawUnderlyingSink, 'First parameter');\n }\n var strategy = convertQueuingStrategy(rawStrategy, 'Second parameter');\n var underlyingSink = convertUnderlyingSink(rawUnderlyingSink, 'First parameter');\n InitializeWritableStream(this);\n var type = underlyingSink.type;\n if (type !== undefined) {\n throw new RangeError('Invalid type is specified');\n }\n var sizeAlgorithm = ExtractSizeAlgorithm(strategy);\n var highWaterMark = ExtractHighWaterMark(strategy, 1);\n SetUpWritableStreamDefaultControllerFromUnderlyingSink(this, underlyingSink, highWaterMark, sizeAlgorithm);\n }\n Object.defineProperty(WritableStream.prototype, \"locked\", {\n /**\n * Returns whether or not the writable stream is locked to a writer.\n */\n get: function () {\n if (!IsWritableStream(this)) {\n throw streamBrandCheckException$2('locked');\n }\n return IsWritableStreamLocked(this);\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be\n * immediately moved to an errored state, with any queued-up writes discarded. This will also execute any abort\n * mechanism of the underlying sink.\n *\n * The returned promise will fulfill if the stream shuts down successfully, or reject if the underlying sink signaled\n * that there was an error doing so. Additionally, it will reject with a `TypeError` (without attempting to cancel\n * the stream) if the stream is currently locked.\n */\n WritableStream.prototype.abort = function (reason) {\n if (reason === void 0) { reason = undefined; }\n if (!IsWritableStream(this)) {\n return promiseRejectedWith(streamBrandCheckException$2('abort'));\n }\n if (IsWritableStreamLocked(this)) {\n return promiseRejectedWith(new TypeError('Cannot abort a stream that already has a writer'));\n }\n return WritableStreamAbort(this, reason);\n };\n /**\n * Closes the stream. The underlying sink will finish processing any previously-written chunks, before invoking its\n * close behavior. During this time any further attempts to write will fail (without erroring the stream).\n *\n * The method returns a promise that will fulfill if all remaining chunks are successfully written and the stream\n * successfully closes, or rejects if an error is encountered during this process. Additionally, it will reject with\n * a `TypeError` (without attempting to cancel the stream) if the stream is currently locked.\n */\n WritableStream.prototype.close = function () {\n if (!IsWritableStream(this)) {\n return promiseRejectedWith(streamBrandCheckException$2('close'));\n }\n if (IsWritableStreamLocked(this)) {\n return promiseRejectedWith(new TypeError('Cannot close a stream that already has a writer'));\n }\n if (WritableStreamCloseQueuedOrInFlight(this)) {\n return promiseRejectedWith(new TypeError('Cannot close an already-closing stream'));\n }\n return WritableStreamClose(this);\n };\n /**\n * Creates a {@link WritableStreamDefaultWriter | writer} and locks the stream to the new writer. While the stream\n * is locked, no other writer can be acquired until this one is released.\n *\n * This functionality is especially useful for creating abstractions that desire the ability to write to a stream\n * without interruption or interleaving. By getting a writer for the stream, you can ensure nobody else can write at\n * the same time, which would cause the resulting written data to be unpredictable and probably useless.\n */\n WritableStream.prototype.getWriter = function () {\n if (!IsWritableStream(this)) {\n throw streamBrandCheckException$2('getWriter');\n }\n return AcquireWritableStreamDefaultWriter(this);\n };\n return WritableStream;\n }());\n Object.defineProperties(WritableStream.prototype, {\n abort: { enumerable: true },\n close: { enumerable: true },\n getWriter: { enumerable: true },\n locked: { enumerable: true }\n });\n setFunctionName(WritableStream.prototype.abort, 'abort');\n setFunctionName(WritableStream.prototype.close, 'close');\n setFunctionName(WritableStream.prototype.getWriter, 'getWriter');\n if (typeof SymbolPolyfill.toStringTag === 'symbol') {\n Object.defineProperty(WritableStream.prototype, SymbolPolyfill.toStringTag, {\n value: 'WritableStream',\n configurable: true\n });\n }\n // Abstract operations for the WritableStream.\n function AcquireWritableStreamDefaultWriter(stream) {\n return new WritableStreamDefaultWriter(stream);\n }\n // Throws if and only if startAlgorithm throws.\n function CreateWritableStream(startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm) {\n if (highWaterMark === void 0) { highWaterMark = 1; }\n if (sizeAlgorithm === void 0) { sizeAlgorithm = function () { return 1; }; }\n var stream = Object.create(WritableStream.prototype);\n InitializeWritableStream(stream);\n var controller = Object.create(WritableStreamDefaultController.prototype);\n SetUpWritableStreamDefaultController(stream, controller, startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm);\n return stream;\n }\n function InitializeWritableStream(stream) {\n stream._state = 'writable';\n // The error that will be reported by new method calls once the state becomes errored. Only set when [[state]] is\n // 'erroring' or 'errored'. May be set to an undefined value.\n stream._storedError = undefined;\n stream._writer = undefined;\n // Initialize to undefined first because the constructor of the controller checks this\n // variable to validate the caller.\n stream._writableStreamController = undefined;\n // This queue is placed here instead of the writer class in order to allow for passing a writer to the next data\n // producer without waiting for the queued writes to finish.\n stream._writeRequests = new SimpleQueue();\n // Write requests are removed from _writeRequests when write() is called on the underlying sink. This prevents\n // them from being erroneously rejected on error. If a write() call is in-flight, the request is stored here.\n stream._inFlightWriteRequest = undefined;\n // The promise that was returned from writer.close(). Stored here because it may be fulfilled after the writer\n // has been detached.\n stream._closeRequest = undefined;\n // Close request is removed from _closeRequest when close() is called on the underlying sink. This prevents it\n // from being erroneously rejected on error. If a close() call is in-flight, the request is stored here.\n stream._inFlightCloseRequest = undefined;\n // The promise that was returned from writer.abort(). This may also be fulfilled after the writer has detached.\n stream._pendingAbortRequest = undefined;\n // The backpressure signal set by the controller.\n stream._backpressure = false;\n }\n function IsWritableStream(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_writableStreamController')) {\n return false;\n }\n return x instanceof WritableStream;\n }\n function IsWritableStreamLocked(stream) {\n if (stream._writer === undefined) {\n return false;\n }\n return true;\n }\n function WritableStreamAbort(stream, reason) {\n var _a;\n if (stream._state === 'closed' || stream._state === 'errored') {\n return promiseResolvedWith(undefined);\n }\n stream._writableStreamController._abortReason = reason;\n (_a = stream._writableStreamController._abortController) === null || _a === void 0 ? void 0 : _a.abort(reason);\n // TypeScript narrows the type of `stream._state` down to 'writable' | 'erroring',\n // but it doesn't know that signaling abort runs author code that might have changed the state.\n // Widen the type again by casting to WritableStreamState.\n var state = stream._state;\n if (state === 'closed' || state === 'errored') {\n return promiseResolvedWith(undefined);\n }\n if (stream._pendingAbortRequest !== undefined) {\n return stream._pendingAbortRequest._promise;\n }\n var wasAlreadyErroring = false;\n if (state === 'erroring') {\n wasAlreadyErroring = true;\n // reason will not be used, so don't keep a reference to it.\n reason = undefined;\n }\n var promise = newPromise(function (resolve, reject) {\n stream._pendingAbortRequest = {\n _promise: undefined,\n _resolve: resolve,\n _reject: reject,\n _reason: reason,\n _wasAlreadyErroring: wasAlreadyErroring\n };\n });\n stream._pendingAbortRequest._promise = promise;\n if (!wasAlreadyErroring) {\n WritableStreamStartErroring(stream, reason);\n }\n return promise;\n }\n function WritableStreamClose(stream) {\n var state = stream._state;\n if (state === 'closed' || state === 'errored') {\n return promiseRejectedWith(new TypeError(\"The stream (in \".concat(state, \" state) is not in the writable state and cannot be closed\")));\n }\n var promise = newPromise(function (resolve, reject) {\n var closeRequest = {\n _resolve: resolve,\n _reject: reject\n };\n stream._closeRequest = closeRequest;\n });\n var writer = stream._writer;\n if (writer !== undefined && stream._backpressure && state === 'writable') {\n defaultWriterReadyPromiseResolve(writer);\n }\n WritableStreamDefaultControllerClose(stream._writableStreamController);\n return promise;\n }\n // WritableStream API exposed for controllers.\n function WritableStreamAddWriteRequest(stream) {\n var promise = newPromise(function (resolve, reject) {\n var writeRequest = {\n _resolve: resolve,\n _reject: reject\n };\n stream._writeRequests.push(writeRequest);\n });\n return promise;\n }\n function WritableStreamDealWithRejection(stream, error) {\n var state = stream._state;\n if (state === 'writable') {\n WritableStreamStartErroring(stream, error);\n return;\n }\n WritableStreamFinishErroring(stream);\n }\n function WritableStreamStartErroring(stream, reason) {\n var controller = stream._writableStreamController;\n stream._state = 'erroring';\n stream._storedError = reason;\n var writer = stream._writer;\n if (writer !== undefined) {\n WritableStreamDefaultWriterEnsureReadyPromiseRejected(writer, reason);\n }\n if (!WritableStreamHasOperationMarkedInFlight(stream) && controller._started) {\n WritableStreamFinishErroring(stream);\n }\n }\n function WritableStreamFinishErroring(stream) {\n stream._state = 'errored';\n stream._writableStreamController[ErrorSteps]();\n var storedError = stream._storedError;\n stream._writeRequests.forEach(function (writeRequest) {\n writeRequest._reject(storedError);\n });\n stream._writeRequests = new SimpleQueue();\n if (stream._pendingAbortRequest === undefined) {\n WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream);\n return;\n }\n var abortRequest = stream._pendingAbortRequest;\n stream._pendingAbortRequest = undefined;\n if (abortRequest._wasAlreadyErroring) {\n abortRequest._reject(storedError);\n WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream);\n return;\n }\n var promise = stream._writableStreamController[AbortSteps](abortRequest._reason);\n uponPromise(promise, function () {\n abortRequest._resolve();\n WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream);\n return null;\n }, function (reason) {\n abortRequest._reject(reason);\n WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream);\n return null;\n });\n }\n function WritableStreamFinishInFlightWrite(stream) {\n stream._inFlightWriteRequest._resolve(undefined);\n stream._inFlightWriteRequest = undefined;\n }\n function WritableStreamFinishInFlightWriteWithError(stream, error) {\n stream._inFlightWriteRequest._reject(error);\n stream._inFlightWriteRequest = undefined;\n WritableStreamDealWithRejection(stream, error);\n }\n function WritableStreamFinishInFlightClose(stream) {\n stream._inFlightCloseRequest._resolve(undefined);\n stream._inFlightCloseRequest = undefined;\n var state = stream._state;\n if (state === 'erroring') {\n // The error was too late to do anything, so it is ignored.\n stream._storedError = undefined;\n if (stream._pendingAbortRequest !== undefined) {\n stream._pendingAbortRequest._resolve();\n stream._pendingAbortRequest = undefined;\n }\n }\n stream._state = 'closed';\n var writer = stream._writer;\n if (writer !== undefined) {\n defaultWriterClosedPromiseResolve(writer);\n }\n }\n function WritableStreamFinishInFlightCloseWithError(stream, error) {\n stream._inFlightCloseRequest._reject(error);\n stream._inFlightCloseRequest = undefined;\n // Never execute sink abort() after sink close().\n if (stream._pendingAbortRequest !== undefined) {\n stream._pendingAbortRequest._reject(error);\n stream._pendingAbortRequest = undefined;\n }\n WritableStreamDealWithRejection(stream, error);\n }\n // TODO(ricea): Fix alphabetical order.\n function WritableStreamCloseQueuedOrInFlight(stream) {\n if (stream._closeRequest === undefined && stream._inFlightCloseRequest === undefined) {\n return false;\n }\n return true;\n }\n function WritableStreamHasOperationMarkedInFlight(stream) {\n if (stream._inFlightWriteRequest === undefined && stream._inFlightCloseRequest === undefined) {\n return false;\n }\n return true;\n }\n function WritableStreamMarkCloseRequestInFlight(stream) {\n stream._inFlightCloseRequest = stream._closeRequest;\n stream._closeRequest = undefined;\n }\n function WritableStreamMarkFirstWriteRequestInFlight(stream) {\n stream._inFlightWriteRequest = stream._writeRequests.shift();\n }\n function WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream) {\n if (stream._closeRequest !== undefined) {\n stream._closeRequest._reject(stream._storedError);\n stream._closeRequest = undefined;\n }\n var writer = stream._writer;\n if (writer !== undefined) {\n defaultWriterClosedPromiseReject(writer, stream._storedError);\n }\n }\n function WritableStreamUpdateBackpressure(stream, backpressure) {\n var writer = stream._writer;\n if (writer !== undefined && backpressure !== stream._backpressure) {\n if (backpressure) {\n defaultWriterReadyPromiseReset(writer);\n }\n else {\n defaultWriterReadyPromiseResolve(writer);\n }\n }\n stream._backpressure = backpressure;\n }\n /**\n * A default writer vended by a {@link WritableStream}.\n *\n * @public\n */\n var WritableStreamDefaultWriter = /** @class */ (function () {\n function WritableStreamDefaultWriter(stream) {\n assertRequiredArgument(stream, 1, 'WritableStreamDefaultWriter');\n assertWritableStream(stream, 'First parameter');\n if (IsWritableStreamLocked(stream)) {\n throw new TypeError('This stream has already been locked for exclusive writing by another writer');\n }\n this._ownerWritableStream = stream;\n stream._writer = this;\n var state = stream._state;\n if (state === 'writable') {\n if (!WritableStreamCloseQueuedOrInFlight(stream) && stream._backpressure) {\n defaultWriterReadyPromiseInitialize(this);\n }\n else {\n defaultWriterReadyPromiseInitializeAsResolved(this);\n }\n defaultWriterClosedPromiseInitialize(this);\n }\n else if (state === 'erroring') {\n defaultWriterReadyPromiseInitializeAsRejected(this, stream._storedError);\n defaultWriterClosedPromiseInitialize(this);\n }\n else if (state === 'closed') {\n defaultWriterReadyPromiseInitializeAsResolved(this);\n defaultWriterClosedPromiseInitializeAsResolved(this);\n }\n else {\n var storedError = stream._storedError;\n defaultWriterReadyPromiseInitializeAsRejected(this, storedError);\n defaultWriterClosedPromiseInitializeAsRejected(this, storedError);\n }\n }\n Object.defineProperty(WritableStreamDefaultWriter.prototype, \"closed\", {\n /**\n * Returns a promise that will be fulfilled when the stream becomes closed, or rejected if the stream ever errors or\n * the writer’s lock is released before the stream finishes closing.\n */\n get: function () {\n if (!IsWritableStreamDefaultWriter(this)) {\n return promiseRejectedWith(defaultWriterBrandCheckException('closed'));\n }\n return this._closedPromise;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(WritableStreamDefaultWriter.prototype, \"desiredSize\", {\n /**\n * Returns the desired size to fill the stream’s internal queue. It can be negative, if the queue is over-full.\n * A producer can use this information to determine the right amount of data to write.\n *\n * It will be `null` if the stream cannot be successfully written to (due to either being errored, or having an abort\n * queued up). It will return zero if the stream is closed. And the getter will throw an exception if invoked when\n * the writer’s lock is released.\n */\n get: function () {\n if (!IsWritableStreamDefaultWriter(this)) {\n throw defaultWriterBrandCheckException('desiredSize');\n }\n if (this._ownerWritableStream === undefined) {\n throw defaultWriterLockException('desiredSize');\n }\n return WritableStreamDefaultWriterGetDesiredSize(this);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(WritableStreamDefaultWriter.prototype, \"ready\", {\n /**\n * Returns a promise that will be fulfilled when the desired size to fill the stream’s internal queue transitions\n * from non-positive to positive, signaling that it is no longer applying backpressure. Once the desired size dips\n * back to zero or below, the getter will return a new promise that stays pending until the next transition.\n *\n * If the stream becomes errored or aborted, or the writer’s lock is released, the returned promise will become\n * rejected.\n */\n get: function () {\n if (!IsWritableStreamDefaultWriter(this)) {\n return promiseRejectedWith(defaultWriterBrandCheckException('ready'));\n }\n return this._readyPromise;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * If the reader is active, behaves the same as {@link WritableStream.abort | stream.abort(reason)}.\n */\n WritableStreamDefaultWriter.prototype.abort = function (reason) {\n if (reason === void 0) { reason = undefined; }\n if (!IsWritableStreamDefaultWriter(this)) {\n return promiseRejectedWith(defaultWriterBrandCheckException('abort'));\n }\n if (this._ownerWritableStream === undefined) {\n return promiseRejectedWith(defaultWriterLockException('abort'));\n }\n return WritableStreamDefaultWriterAbort(this, reason);\n };\n /**\n * If the reader is active, behaves the same as {@link WritableStream.close | stream.close()}.\n */\n WritableStreamDefaultWriter.prototype.close = function () {\n if (!IsWritableStreamDefaultWriter(this)) {\n return promiseRejectedWith(defaultWriterBrandCheckException('close'));\n }\n var stream = this._ownerWritableStream;\n if (stream === undefined) {\n return promiseRejectedWith(defaultWriterLockException('close'));\n }\n if (WritableStreamCloseQueuedOrInFlight(stream)) {\n return promiseRejectedWith(new TypeError('Cannot close an already-closing stream'));\n }\n return WritableStreamDefaultWriterClose(this);\n };\n /**\n * Releases the writer’s lock on the corresponding stream. After the lock is released, the writer is no longer active.\n * If the associated stream is errored when the lock is released, the writer will appear errored in the same way from\n * now on; otherwise, the writer will appear closed.\n *\n * Note that the lock can still be released even if some ongoing writes have not yet finished (i.e. even if the\n * promises returned from previous calls to {@link WritableStreamDefaultWriter.write | write()} have not yet settled).\n * It’s not necessary to hold the lock on the writer for the duration of the write; the lock instead simply prevents\n * other producers from writing in an interleaved manner.\n */\n WritableStreamDefaultWriter.prototype.releaseLock = function () {\n if (!IsWritableStreamDefaultWriter(this)) {\n throw defaultWriterBrandCheckException('releaseLock');\n }\n var stream = this._ownerWritableStream;\n if (stream === undefined) {\n return;\n }\n WritableStreamDefaultWriterRelease(this);\n };\n WritableStreamDefaultWriter.prototype.write = function (chunk) {\n if (chunk === void 0) { chunk = undefined; }\n if (!IsWritableStreamDefaultWriter(this)) {\n return promiseRejectedWith(defaultWriterBrandCheckException('write'));\n }\n if (this._ownerWritableStream === undefined) {\n return promiseRejectedWith(defaultWriterLockException('write to'));\n }\n return WritableStreamDefaultWriterWrite(this, chunk);\n };\n return WritableStreamDefaultWriter;\n }());\n Object.defineProperties(WritableStreamDefaultWriter.prototype, {\n abort: { enumerable: true },\n close: { enumerable: true },\n releaseLock: { enumerable: true },\n write: { enumerable: true },\n closed: { enumerable: true },\n desiredSize: { enumerable: true },\n ready: { enumerable: true }\n });\n setFunctionName(WritableStreamDefaultWriter.prototype.abort, 'abort');\n setFunctionName(WritableStreamDefaultWriter.prototype.close, 'close');\n setFunctionName(WritableStreamDefaultWriter.prototype.releaseLock, 'releaseLock');\n setFunctionName(WritableStreamDefaultWriter.prototype.write, 'write');\n if (typeof SymbolPolyfill.toStringTag === 'symbol') {\n Object.defineProperty(WritableStreamDefaultWriter.prototype, SymbolPolyfill.toStringTag, {\n value: 'WritableStreamDefaultWriter',\n configurable: true\n });\n }\n // Abstract operations for the WritableStreamDefaultWriter.\n function IsWritableStreamDefaultWriter(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_ownerWritableStream')) {\n return false;\n }\n return x instanceof WritableStreamDefaultWriter;\n }\n // A client of WritableStreamDefaultWriter may use these functions directly to bypass state check.\n function WritableStreamDefaultWriterAbort(writer, reason) {\n var stream = writer._ownerWritableStream;\n return WritableStreamAbort(stream, reason);\n }\n function WritableStreamDefaultWriterClose(writer) {\n var stream = writer._ownerWritableStream;\n return WritableStreamClose(stream);\n }\n function WritableStreamDefaultWriterCloseWithErrorPropagation(writer) {\n var stream = writer._ownerWritableStream;\n var state = stream._state;\n if (WritableStreamCloseQueuedOrInFlight(stream) || state === 'closed') {\n return promiseResolvedWith(undefined);\n }\n if (state === 'errored') {\n return promiseRejectedWith(stream._storedError);\n }\n return WritableStreamDefaultWriterClose(writer);\n }\n function WritableStreamDefaultWriterEnsureClosedPromiseRejected(writer, error) {\n if (writer._closedPromiseState === 'pending') {\n defaultWriterClosedPromiseReject(writer, error);\n }\n else {\n defaultWriterClosedPromiseResetToRejected(writer, error);\n }\n }\n function WritableStreamDefaultWriterEnsureReadyPromiseRejected(writer, error) {\n if (writer._readyPromiseState === 'pending') {\n defaultWriterReadyPromiseReject(writer, error);\n }\n else {\n defaultWriterReadyPromiseResetToRejected(writer, error);\n }\n }\n function WritableStreamDefaultWriterGetDesiredSize(writer) {\n var stream = writer._ownerWritableStream;\n var state = stream._state;\n if (state === 'errored' || state === 'erroring') {\n return null;\n }\n if (state === 'closed') {\n return 0;\n }\n return WritableStreamDefaultControllerGetDesiredSize(stream._writableStreamController);\n }\n function WritableStreamDefaultWriterRelease(writer) {\n var stream = writer._ownerWritableStream;\n var releasedError = new TypeError(\"Writer was released and can no longer be used to monitor the stream's closedness\");\n WritableStreamDefaultWriterEnsureReadyPromiseRejected(writer, releasedError);\n // The state transitions to \"errored\" before the sink abort() method runs, but the writer.closed promise is not\n // rejected until afterwards. This means that simply testing state will not work.\n WritableStreamDefaultWriterEnsureClosedPromiseRejected(writer, releasedError);\n stream._writer = undefined;\n writer._ownerWritableStream = undefined;\n }\n function WritableStreamDefaultWriterWrite(writer, chunk) {\n var stream = writer._ownerWritableStream;\n var controller = stream._writableStreamController;\n var chunkSize = WritableStreamDefaultControllerGetChunkSize(controller, chunk);\n if (stream !== writer._ownerWritableStream) {\n return promiseRejectedWith(defaultWriterLockException('write to'));\n }\n var state = stream._state;\n if (state === 'errored') {\n return promiseRejectedWith(stream._storedError);\n }\n if (WritableStreamCloseQueuedOrInFlight(stream) || state === 'closed') {\n return promiseRejectedWith(new TypeError('The stream is closing or closed and cannot be written to'));\n }\n if (state === 'erroring') {\n return promiseRejectedWith(stream._storedError);\n }\n var promise = WritableStreamAddWriteRequest(stream);\n WritableStreamDefaultControllerWrite(controller, chunk, chunkSize);\n return promise;\n }\n var closeSentinel = {};\n /**\n * Allows control of a {@link WritableStream | writable stream}'s state and internal queue.\n *\n * @public\n */\n var WritableStreamDefaultController = /** @class */ (function () {\n function WritableStreamDefaultController() {\n throw new TypeError('Illegal constructor');\n }\n Object.defineProperty(WritableStreamDefaultController.prototype, \"abortReason\", {\n /**\n * The reason which was passed to `WritableStream.abort(reason)` when the stream was aborted.\n *\n * @deprecated\n * This property has been removed from the specification, see https://github.com/whatwg/streams/pull/1177.\n * Use {@link WritableStreamDefaultController.signal}'s `reason` instead.\n */\n get: function () {\n if (!IsWritableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException$2('abortReason');\n }\n return this._abortReason;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(WritableStreamDefaultController.prototype, \"signal\", {\n /**\n * An `AbortSignal` that can be used to abort the pending write or close operation when the stream is aborted.\n */\n get: function () {\n if (!IsWritableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException$2('signal');\n }\n if (this._abortController === undefined) {\n // Older browsers or older Node versions may not support `AbortController` or `AbortSignal`.\n // We don't want to bundle and ship an `AbortController` polyfill together with our polyfill,\n // so instead we only implement support for `signal` if we find a global `AbortController` constructor.\n throw new TypeError('WritableStreamDefaultController.prototype.signal is not supported');\n }\n return this._abortController.signal;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Closes the controlled writable stream, making all future interactions with it fail with the given error `e`.\n *\n * This method is rarely used, since usually it suffices to return a rejected promise from one of the underlying\n * sink's methods. However, it can be useful for suddenly shutting down a stream in response to an event outside the\n * normal lifecycle of interactions with the underlying sink.\n */\n WritableStreamDefaultController.prototype.error = function (e) {\n if (e === void 0) { e = undefined; }\n if (!IsWritableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException$2('error');\n }\n var state = this._controlledWritableStream._state;\n if (state !== 'writable') {\n // The stream is closed, errored or will be soon. The sink can't do anything useful if it gets an error here, so\n // just treat it as a no-op.\n return;\n }\n WritableStreamDefaultControllerError(this, e);\n };\n /** @internal */\n WritableStreamDefaultController.prototype[AbortSteps] = function (reason) {\n var result = this._abortAlgorithm(reason);\n WritableStreamDefaultControllerClearAlgorithms(this);\n return result;\n };\n /** @internal */\n WritableStreamDefaultController.prototype[ErrorSteps] = function () {\n ResetQueue(this);\n };\n return WritableStreamDefaultController;\n }());\n Object.defineProperties(WritableStreamDefaultController.prototype, {\n abortReason: { enumerable: true },\n signal: { enumerable: true },\n error: { enumerable: true }\n });\n if (typeof SymbolPolyfill.toStringTag === 'symbol') {\n Object.defineProperty(WritableStreamDefaultController.prototype, SymbolPolyfill.toStringTag, {\n value: 'WritableStreamDefaultController',\n configurable: true\n });\n }\n // Abstract operations implementing interface required by the WritableStream.\n function IsWritableStreamDefaultController(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_controlledWritableStream')) {\n return false;\n }\n return x instanceof WritableStreamDefaultController;\n }\n function SetUpWritableStreamDefaultController(stream, controller, startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm) {\n controller._controlledWritableStream = stream;\n stream._writableStreamController = controller;\n // Need to set the slots so that the assert doesn't fire. In the spec the slots already exist implicitly.\n controller._queue = undefined;\n controller._queueTotalSize = undefined;\n ResetQueue(controller);\n controller._abortReason = undefined;\n controller._abortController = createAbortController();\n controller._started = false;\n controller._strategySizeAlgorithm = sizeAlgorithm;\n controller._strategyHWM = highWaterMark;\n controller._writeAlgorithm = writeAlgorithm;\n controller._closeAlgorithm = closeAlgorithm;\n controller._abortAlgorithm = abortAlgorithm;\n var backpressure = WritableStreamDefaultControllerGetBackpressure(controller);\n WritableStreamUpdateBackpressure(stream, backpressure);\n var startResult = startAlgorithm();\n var startPromise = promiseResolvedWith(startResult);\n uponPromise(startPromise, function () {\n controller._started = true;\n WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller);\n return null;\n }, function (r) {\n controller._started = true;\n WritableStreamDealWithRejection(stream, r);\n return null;\n });\n }\n function SetUpWritableStreamDefaultControllerFromUnderlyingSink(stream, underlyingSink, highWaterMark, sizeAlgorithm) {\n var controller = Object.create(WritableStreamDefaultController.prototype);\n var startAlgorithm;\n var writeAlgorithm;\n var closeAlgorithm;\n var abortAlgorithm;\n if (underlyingSink.start !== undefined) {\n startAlgorithm = function () { return underlyingSink.start(controller); };\n }\n else {\n startAlgorithm = function () { return undefined; };\n }\n if (underlyingSink.write !== undefined) {\n writeAlgorithm = function (chunk) { return underlyingSink.write(chunk, controller); };\n }\n else {\n writeAlgorithm = function () { return promiseResolvedWith(undefined); };\n }\n if (underlyingSink.close !== undefined) {\n closeAlgorithm = function () { return underlyingSink.close(); };\n }\n else {\n closeAlgorithm = function () { return promiseResolvedWith(undefined); };\n }\n if (underlyingSink.abort !== undefined) {\n abortAlgorithm = function (reason) { return underlyingSink.abort(reason); };\n }\n else {\n abortAlgorithm = function () { return promiseResolvedWith(undefined); };\n }\n SetUpWritableStreamDefaultController(stream, controller, startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm);\n }\n // ClearAlgorithms may be called twice. Erroring the same stream in multiple ways will often result in redundant calls.\n function WritableStreamDefaultControllerClearAlgorithms(controller) {\n controller._writeAlgorithm = undefined;\n controller._closeAlgorithm = undefined;\n controller._abortAlgorithm = undefined;\n controller._strategySizeAlgorithm = undefined;\n }\n function WritableStreamDefaultControllerClose(controller) {\n EnqueueValueWithSize(controller, closeSentinel, 0);\n WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller);\n }\n function WritableStreamDefaultControllerGetChunkSize(controller, chunk) {\n try {\n return controller._strategySizeAlgorithm(chunk);\n }\n catch (chunkSizeE) {\n WritableStreamDefaultControllerErrorIfNeeded(controller, chunkSizeE);\n return 1;\n }\n }\n function WritableStreamDefaultControllerGetDesiredSize(controller) {\n return controller._strategyHWM - controller._queueTotalSize;\n }\n function WritableStreamDefaultControllerWrite(controller, chunk, chunkSize) {\n try {\n EnqueueValueWithSize(controller, chunk, chunkSize);\n }\n catch (enqueueE) {\n WritableStreamDefaultControllerErrorIfNeeded(controller, enqueueE);\n return;\n }\n var stream = controller._controlledWritableStream;\n if (!WritableStreamCloseQueuedOrInFlight(stream) && stream._state === 'writable') {\n var backpressure = WritableStreamDefaultControllerGetBackpressure(controller);\n WritableStreamUpdateBackpressure(stream, backpressure);\n }\n WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller);\n }\n // Abstract operations for the WritableStreamDefaultController.\n function WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller) {\n var stream = controller._controlledWritableStream;\n if (!controller._started) {\n return;\n }\n if (stream._inFlightWriteRequest !== undefined) {\n return;\n }\n var state = stream._state;\n if (state === 'erroring') {\n WritableStreamFinishErroring(stream);\n return;\n }\n if (controller._queue.length === 0) {\n return;\n }\n var value = PeekQueueValue(controller);\n if (value === closeSentinel) {\n WritableStreamDefaultControllerProcessClose(controller);\n }\n else {\n WritableStreamDefaultControllerProcessWrite(controller, value);\n }\n }\n function WritableStreamDefaultControllerErrorIfNeeded(controller, error) {\n if (controller._controlledWritableStream._state === 'writable') {\n WritableStreamDefaultControllerError(controller, error);\n }\n }\n function WritableStreamDefaultControllerProcessClose(controller) {\n var stream = controller._controlledWritableStream;\n WritableStreamMarkCloseRequestInFlight(stream);\n DequeueValue(controller);\n var sinkClosePromise = controller._closeAlgorithm();\n WritableStreamDefaultControllerClearAlgorithms(controller);\n uponPromise(sinkClosePromise, function () {\n WritableStreamFinishInFlightClose(stream);\n return null;\n }, function (reason) {\n WritableStreamFinishInFlightCloseWithError(stream, reason);\n return null;\n });\n }\n function WritableStreamDefaultControllerProcessWrite(controller, chunk) {\n var stream = controller._controlledWritableStream;\n WritableStreamMarkFirstWriteRequestInFlight(stream);\n var sinkWritePromise = controller._writeAlgorithm(chunk);\n uponPromise(sinkWritePromise, function () {\n WritableStreamFinishInFlightWrite(stream);\n var state = stream._state;\n DequeueValue(controller);\n if (!WritableStreamCloseQueuedOrInFlight(stream) && state === 'writable') {\n var backpressure = WritableStreamDefaultControllerGetBackpressure(controller);\n WritableStreamUpdateBackpressure(stream, backpressure);\n }\n WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller);\n return null;\n }, function (reason) {\n if (stream._state === 'writable') {\n WritableStreamDefaultControllerClearAlgorithms(controller);\n }\n WritableStreamFinishInFlightWriteWithError(stream, reason);\n return null;\n });\n }\n function WritableStreamDefaultControllerGetBackpressure(controller) {\n var desiredSize = WritableStreamDefaultControllerGetDesiredSize(controller);\n return desiredSize <= 0;\n }\n // A client of WritableStreamDefaultController may use these functions directly to bypass state check.\n function WritableStreamDefaultControllerError(controller, error) {\n var stream = controller._controlledWritableStream;\n WritableStreamDefaultControllerClearAlgorithms(controller);\n WritableStreamStartErroring(stream, error);\n }\n // Helper functions for the WritableStream.\n function streamBrandCheckException$2(name) {\n return new TypeError(\"WritableStream.prototype.\".concat(name, \" can only be used on a WritableStream\"));\n }\n // Helper functions for the WritableStreamDefaultController.\n function defaultControllerBrandCheckException$2(name) {\n return new TypeError(\"WritableStreamDefaultController.prototype.\".concat(name, \" can only be used on a WritableStreamDefaultController\"));\n }\n // Helper functions for the WritableStreamDefaultWriter.\n function defaultWriterBrandCheckException(name) {\n return new TypeError(\"WritableStreamDefaultWriter.prototype.\".concat(name, \" can only be used on a WritableStreamDefaultWriter\"));\n }\n function defaultWriterLockException(name) {\n return new TypeError('Cannot ' + name + ' a stream using a released writer');\n }\n function defaultWriterClosedPromiseInitialize(writer) {\n writer._closedPromise = newPromise(function (resolve, reject) {\n writer._closedPromise_resolve = resolve;\n writer._closedPromise_reject = reject;\n writer._closedPromiseState = 'pending';\n });\n }\n function defaultWriterClosedPromiseInitializeAsRejected(writer, reason) {\n defaultWriterClosedPromiseInitialize(writer);\n defaultWriterClosedPromiseReject(writer, reason);\n }\n function defaultWriterClosedPromiseInitializeAsResolved(writer) {\n defaultWriterClosedPromiseInitialize(writer);\n defaultWriterClosedPromiseResolve(writer);\n }\n function defaultWriterClosedPromiseReject(writer, reason) {\n if (writer._closedPromise_reject === undefined) {\n return;\n }\n setPromiseIsHandledToTrue(writer._closedPromise);\n writer._closedPromise_reject(reason);\n writer._closedPromise_resolve = undefined;\n writer._closedPromise_reject = undefined;\n writer._closedPromiseState = 'rejected';\n }\n function defaultWriterClosedPromiseResetToRejected(writer, reason) {\n defaultWriterClosedPromiseInitializeAsRejected(writer, reason);\n }\n function defaultWriterClosedPromiseResolve(writer) {\n if (writer._closedPromise_resolve === undefined) {\n return;\n }\n writer._closedPromise_resolve(undefined);\n writer._closedPromise_resolve = undefined;\n writer._closedPromise_reject = undefined;\n writer._closedPromiseState = 'resolved';\n }\n function defaultWriterReadyPromiseInitialize(writer) {\n writer._readyPromise = newPromise(function (resolve, reject) {\n writer._readyPromise_resolve = resolve;\n writer._readyPromise_reject = reject;\n });\n writer._readyPromiseState = 'pending';\n }\n function defaultWriterReadyPromiseInitializeAsRejected(writer, reason) {\n defaultWriterReadyPromiseInitialize(writer);\n defaultWriterReadyPromiseReject(writer, reason);\n }\n function defaultWriterReadyPromiseInitializeAsResolved(writer) {\n defaultWriterReadyPromiseInitialize(writer);\n defaultWriterReadyPromiseResolve(writer);\n }\n function defaultWriterReadyPromiseReject(writer, reason) {\n if (writer._readyPromise_reject === undefined) {\n return;\n }\n setPromiseIsHandledToTrue(writer._readyPromise);\n writer._readyPromise_reject(reason);\n writer._readyPromise_resolve = undefined;\n writer._readyPromise_reject = undefined;\n writer._readyPromiseState = 'rejected';\n }\n function defaultWriterReadyPromiseReset(writer) {\n defaultWriterReadyPromiseInitialize(writer);\n }\n function defaultWriterReadyPromiseResetToRejected(writer, reason) {\n defaultWriterReadyPromiseInitializeAsRejected(writer, reason);\n }\n function defaultWriterReadyPromiseResolve(writer) {\n if (writer._readyPromise_resolve === undefined) {\n return;\n }\n writer._readyPromise_resolve(undefined);\n writer._readyPromise_resolve = undefined;\n writer._readyPromise_reject = undefined;\n writer._readyPromiseState = 'fulfilled';\n }\n\n /// <reference lib=\"dom\" />\n function getGlobals() {\n if (typeof globalThis !== 'undefined') {\n return globalThis;\n }\n else if (typeof self !== 'undefined') {\n return self;\n }\n else if (typeof __webpack_require__.g !== 'undefined') {\n return __webpack_require__.g;\n }\n return undefined;\n }\n var globals = getGlobals();\n\n /// <reference types=\"node\" />\n function isDOMExceptionConstructor(ctor) {\n if (!(typeof ctor === 'function' || typeof ctor === 'object')) {\n return false;\n }\n if (ctor.name !== 'DOMException') {\n return false;\n }\n try {\n new ctor();\n return true;\n }\n catch (_a) {\n return false;\n }\n }\n /**\n * Support:\n * - Web browsers\n * - Node 18 and higher (https://github.com/nodejs/node/commit/e4b1fb5e6422c1ff151234bb9de792d45dd88d87)\n */\n function getFromGlobal() {\n var ctor = globals === null || globals === void 0 ? void 0 : globals.DOMException;\n return isDOMExceptionConstructor(ctor) ? ctor : undefined;\n }\n /**\n * Support:\n * - All platforms\n */\n function createPolyfill() {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n var ctor = function DOMException(message, name) {\n this.message = message || '';\n this.name = name || 'Error';\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n };\n setFunctionName(ctor, 'DOMException');\n ctor.prototype = Object.create(Error.prototype);\n Object.defineProperty(ctor.prototype, 'constructor', { value: ctor, writable: true, configurable: true });\n return ctor;\n }\n // eslint-disable-next-line @typescript-eslint/no-redeclare\n var DOMException = getFromGlobal() || createPolyfill();\n\n function ReadableStreamPipeTo(source, dest, preventClose, preventAbort, preventCancel, signal) {\n var reader = AcquireReadableStreamDefaultReader(source);\n var writer = AcquireWritableStreamDefaultWriter(dest);\n source._disturbed = true;\n var shuttingDown = false;\n // This is used to keep track of the spec's requirement that we wait for ongoing writes during shutdown.\n var currentWrite = promiseResolvedWith(undefined);\n return newPromise(function (resolve, reject) {\n var abortAlgorithm;\n if (signal !== undefined) {\n abortAlgorithm = function () {\n var error = signal.reason !== undefined ? signal.reason : new DOMException('Aborted', 'AbortError');\n var actions = [];\n if (!preventAbort) {\n actions.push(function () {\n if (dest._state === 'writable') {\n return WritableStreamAbort(dest, error);\n }\n return promiseResolvedWith(undefined);\n });\n }\n if (!preventCancel) {\n actions.push(function () {\n if (source._state === 'readable') {\n return ReadableStreamCancel(source, error);\n }\n return promiseResolvedWith(undefined);\n });\n }\n shutdownWithAction(function () { return Promise.all(actions.map(function (action) { return action(); })); }, true, error);\n };\n if (signal.aborted) {\n abortAlgorithm();\n return;\n }\n signal.addEventListener('abort', abortAlgorithm);\n }\n // Using reader and writer, read all chunks from this and write them to dest\n // - Backpressure must be enforced\n // - Shutdown must stop all activity\n function pipeLoop() {\n return newPromise(function (resolveLoop, rejectLoop) {\n function next(done) {\n if (done) {\n resolveLoop();\n }\n else {\n // Use `PerformPromiseThen` instead of `uponPromise` to avoid\n // adding unnecessary `.catch(rethrowAssertionErrorRejection)` handlers\n PerformPromiseThen(pipeStep(), next, rejectLoop);\n }\n }\n next(false);\n });\n }\n function pipeStep() {\n if (shuttingDown) {\n return promiseResolvedWith(true);\n }\n return PerformPromiseThen(writer._readyPromise, function () {\n return newPromise(function (resolveRead, rejectRead) {\n ReadableStreamDefaultReaderRead(reader, {\n _chunkSteps: function (chunk) {\n currentWrite = PerformPromiseThen(WritableStreamDefaultWriterWrite(writer, chunk), undefined, noop);\n resolveRead(false);\n },\n _closeSteps: function () { return resolveRead(true); },\n _errorSteps: rejectRead\n });\n });\n });\n }\n // Errors must be propagated forward\n isOrBecomesErrored(source, reader._closedPromise, function (storedError) {\n if (!preventAbort) {\n shutdownWithAction(function () { return WritableStreamAbort(dest, storedError); }, true, storedError);\n }\n else {\n shutdown(true, storedError);\n }\n return null;\n });\n // Errors must be propagated backward\n isOrBecomesErrored(dest, writer._closedPromise, function (storedError) {\n if (!preventCancel) {\n shutdownWithAction(function () { return ReadableStreamCancel(source, storedError); }, true, storedError);\n }\n else {\n shutdown(true, storedError);\n }\n return null;\n });\n // Closing must be propagated forward\n isOrBecomesClosed(source, reader._closedPromise, function () {\n if (!preventClose) {\n shutdownWithAction(function () { return WritableStreamDefaultWriterCloseWithErrorPropagation(writer); });\n }\n else {\n shutdown();\n }\n return null;\n });\n // Closing must be propagated backward\n if (WritableStreamCloseQueuedOrInFlight(dest) || dest._state === 'closed') {\n var destClosed_1 = new TypeError('the destination writable stream closed before all data could be piped to it');\n if (!preventCancel) {\n shutdownWithAction(function () { return ReadableStreamCancel(source, destClosed_1); }, true, destClosed_1);\n }\n else {\n shutdown(true, destClosed_1);\n }\n }\n setPromiseIsHandledToTrue(pipeLoop());\n function waitForWritesToFinish() {\n // Another write may have started while we were waiting on this currentWrite, so we have to be sure to wait\n // for that too.\n var oldCurrentWrite = currentWrite;\n return PerformPromiseThen(currentWrite, function () { return oldCurrentWrite !== currentWrite ? waitForWritesToFinish() : undefined; });\n }\n function isOrBecomesErrored(stream, promise, action) {\n if (stream._state === 'errored') {\n action(stream._storedError);\n }\n else {\n uponRejection(promise, action);\n }\n }\n function isOrBecomesClosed(stream, promise, action) {\n if (stream._state === 'closed') {\n action();\n }\n else {\n uponFulfillment(promise, action);\n }\n }\n function shutdownWithAction(action, originalIsError, originalError) {\n if (shuttingDown) {\n return;\n }\n shuttingDown = true;\n if (dest._state === 'writable' && !WritableStreamCloseQueuedOrInFlight(dest)) {\n uponFulfillment(waitForWritesToFinish(), doTheRest);\n }\n else {\n doTheRest();\n }\n function doTheRest() {\n uponPromise(action(), function () { return finalize(originalIsError, originalError); }, function (newError) { return finalize(true, newError); });\n return null;\n }\n }\n function shutdown(isError, error) {\n if (shuttingDown) {\n return;\n }\n shuttingDown = true;\n if (dest._state === 'writable' && !WritableStreamCloseQueuedOrInFlight(dest)) {\n uponFulfillment(waitForWritesToFinish(), function () { return finalize(isError, error); });\n }\n else {\n finalize(isError, error);\n }\n }\n function finalize(isError, error) {\n WritableStreamDefaultWriterRelease(writer);\n ReadableStreamReaderGenericRelease(reader);\n if (signal !== undefined) {\n signal.removeEventListener('abort', abortAlgorithm);\n }\n if (isError) {\n reject(error);\n }\n else {\n resolve(undefined);\n }\n return null;\n }\n });\n }\n\n /**\n * Allows control of a {@link ReadableStream | readable stream}'s state and internal queue.\n *\n * @public\n */\n var ReadableStreamDefaultController = /** @class */ (function () {\n function ReadableStreamDefaultController() {\n throw new TypeError('Illegal constructor');\n }\n Object.defineProperty(ReadableStreamDefaultController.prototype, \"desiredSize\", {\n /**\n * Returns the desired size to fill the controlled stream's internal queue. It can be negative, if the queue is\n * over-full. An underlying source ought to use this information to determine when and how to apply backpressure.\n */\n get: function () {\n if (!IsReadableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException$1('desiredSize');\n }\n return ReadableStreamDefaultControllerGetDesiredSize(this);\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Closes the controlled readable stream. Consumers will still be able to read any previously-enqueued chunks from\n * the stream, but once those are read, the stream will become closed.\n */\n ReadableStreamDefaultController.prototype.close = function () {\n if (!IsReadableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException$1('close');\n }\n if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(this)) {\n throw new TypeError('The stream is not in a state that permits close');\n }\n ReadableStreamDefaultControllerClose(this);\n };\n ReadableStreamDefaultController.prototype.enqueue = function (chunk) {\n if (chunk === void 0) { chunk = undefined; }\n if (!IsReadableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException$1('enqueue');\n }\n if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(this)) {\n throw new TypeError('The stream is not in a state that permits enqueue');\n }\n return ReadableStreamDefaultControllerEnqueue(this, chunk);\n };\n /**\n * Errors the controlled readable stream, making all future interactions with it fail with the given error `e`.\n */\n ReadableStreamDefaultController.prototype.error = function (e) {\n if (e === void 0) { e = undefined; }\n if (!IsReadableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException$1('error');\n }\n ReadableStreamDefaultControllerError(this, e);\n };\n /** @internal */\n ReadableStreamDefaultController.prototype[CancelSteps] = function (reason) {\n ResetQueue(this);\n var result = this._cancelAlgorithm(reason);\n ReadableStreamDefaultControllerClearAlgorithms(this);\n return result;\n };\n /** @internal */\n ReadableStreamDefaultController.prototype[PullSteps] = function (readRequest) {\n var stream = this._controlledReadableStream;\n if (this._queue.length > 0) {\n var chunk = DequeueValue(this);\n if (this._closeRequested && this._queue.length === 0) {\n ReadableStreamDefaultControllerClearAlgorithms(this);\n ReadableStreamClose(stream);\n }\n else {\n ReadableStreamDefaultControllerCallPullIfNeeded(this);\n }\n readRequest._chunkSteps(chunk);\n }\n else {\n ReadableStreamAddReadRequest(stream, readRequest);\n ReadableStreamDefaultControllerCallPullIfNeeded(this);\n }\n };\n /** @internal */\n ReadableStreamDefaultController.prototype[ReleaseSteps] = function () {\n // Do nothing.\n };\n return ReadableStreamDefaultController;\n }());\n Object.defineProperties(ReadableStreamDefaultController.prototype, {\n close: { enumerable: true },\n enqueue: { enumerable: true },\n error: { enumerable: true },\n desiredSize: { enumerable: true }\n });\n setFunctionName(ReadableStreamDefaultController.prototype.close, 'close');\n setFunctionName(ReadableStreamDefaultController.prototype.enqueue, 'enqueue');\n setFunctionName(ReadableStreamDefaultController.prototype.error, 'error');\n if (typeof SymbolPolyfill.toStringTag === 'symbol') {\n Object.defineProperty(ReadableStreamDefaultController.prototype, SymbolPolyfill.toStringTag, {\n value: 'ReadableStreamDefaultController',\n configurable: true\n });\n }\n // Abstract operations for the ReadableStreamDefaultController.\n function IsReadableStreamDefaultController(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_controlledReadableStream')) {\n return false;\n }\n return x instanceof ReadableStreamDefaultController;\n }\n function ReadableStreamDefaultControllerCallPullIfNeeded(controller) {\n var shouldPull = ReadableStreamDefaultControllerShouldCallPull(controller);\n if (!shouldPull) {\n return;\n }\n if (controller._pulling) {\n controller._pullAgain = true;\n return;\n }\n controller._pulling = true;\n var pullPromise = controller._pullAlgorithm();\n uponPromise(pullPromise, function () {\n controller._pulling = false;\n if (controller._pullAgain) {\n controller._pullAgain = false;\n ReadableStreamDefaultControllerCallPullIfNeeded(controller);\n }\n return null;\n }, function (e) {\n ReadableStreamDefaultControllerError(controller, e);\n return null;\n });\n }\n function ReadableStreamDefaultControllerShouldCallPull(controller) {\n var stream = controller._controlledReadableStream;\n if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(controller)) {\n return false;\n }\n if (!controller._started) {\n return false;\n }\n if (IsReadableStreamLocked(stream) && ReadableStreamGetNumReadRequests(stream) > 0) {\n return true;\n }\n var desiredSize = ReadableStreamDefaultControllerGetDesiredSize(controller);\n if (desiredSize > 0) {\n return true;\n }\n return false;\n }\n function ReadableStreamDefaultControllerClearAlgorithms(controller) {\n controller._pullAlgorithm = undefined;\n controller._cancelAlgorithm = undefined;\n controller._strategySizeAlgorithm = undefined;\n }\n // A client of ReadableStreamDefaultController may use these functions directly to bypass state check.\n function ReadableStreamDefaultControllerClose(controller) {\n if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(controller)) {\n return;\n }\n var stream = controller._controlledReadableStream;\n controller._closeRequested = true;\n if (controller._queue.length === 0) {\n ReadableStreamDefaultControllerClearAlgorithms(controller);\n ReadableStreamClose(stream);\n }\n }\n function ReadableStreamDefaultControllerEnqueue(controller, chunk) {\n if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(controller)) {\n return;\n }\n var stream = controller._controlledReadableStream;\n if (IsReadableStreamLocked(stream) && ReadableStreamGetNumReadRequests(stream) > 0) {\n ReadableStreamFulfillReadRequest(stream, chunk, false);\n }\n else {\n var chunkSize = void 0;\n try {\n chunkSize = controller._strategySizeAlgorithm(chunk);\n }\n catch (chunkSizeE) {\n ReadableStreamDefaultControllerError(controller, chunkSizeE);\n throw chunkSizeE;\n }\n try {\n EnqueueValueWithSize(controller, chunk, chunkSize);\n }\n catch (enqueueE) {\n ReadableStreamDefaultControllerError(controller, enqueueE);\n throw enqueueE;\n }\n }\n ReadableStreamDefaultControllerCallPullIfNeeded(controller);\n }\n function ReadableStreamDefaultControllerError(controller, e) {\n var stream = controller._controlledReadableStream;\n if (stream._state !== 'readable') {\n return;\n }\n ResetQueue(controller);\n ReadableStreamDefaultControllerClearAlgorithms(controller);\n ReadableStreamError(stream, e);\n }\n function ReadableStreamDefaultControllerGetDesiredSize(controller) {\n var state = controller._controlledReadableStream._state;\n if (state === 'errored') {\n return null;\n }\n if (state === 'closed') {\n return 0;\n }\n return controller._strategyHWM - controller._queueTotalSize;\n }\n // This is used in the implementation of TransformStream.\n function ReadableStreamDefaultControllerHasBackpressure(controller) {\n if (ReadableStreamDefaultControllerShouldCallPull(controller)) {\n return false;\n }\n return true;\n }\n function ReadableStreamDefaultControllerCanCloseOrEnqueue(controller) {\n var state = controller._controlledReadableStream._state;\n if (!controller._closeRequested && state === 'readable') {\n return true;\n }\n return false;\n }\n function SetUpReadableStreamDefaultController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm) {\n controller._controlledReadableStream = stream;\n controller._queue = undefined;\n controller._queueTotalSize = undefined;\n ResetQueue(controller);\n controller._started = false;\n controller._closeRequested = false;\n controller._pullAgain = false;\n controller._pulling = false;\n controller._strategySizeAlgorithm = sizeAlgorithm;\n controller._strategyHWM = highWaterMark;\n controller._pullAlgorithm = pullAlgorithm;\n controller._cancelAlgorithm = cancelAlgorithm;\n stream._readableStreamController = controller;\n var startResult = startAlgorithm();\n uponPromise(promiseResolvedWith(startResult), function () {\n controller._started = true;\n ReadableStreamDefaultControllerCallPullIfNeeded(controller);\n return null;\n }, function (r) {\n ReadableStreamDefaultControllerError(controller, r);\n return null;\n });\n }\n function SetUpReadableStreamDefaultControllerFromUnderlyingSource(stream, underlyingSource, highWaterMark, sizeAlgorithm) {\n var controller = Object.create(ReadableStreamDefaultController.prototype);\n var startAlgorithm;\n var pullAlgorithm;\n var cancelAlgorithm;\n if (underlyingSource.start !== undefined) {\n startAlgorithm = function () { return underlyingSource.start(controller); };\n }\n else {\n startAlgorithm = function () { return undefined; };\n }\n if (underlyingSource.pull !== undefined) {\n pullAlgorithm = function () { return underlyingSource.pull(controller); };\n }\n else {\n pullAlgorithm = function () { return promiseResolvedWith(undefined); };\n }\n if (underlyingSource.cancel !== undefined) {\n cancelAlgorithm = function (reason) { return underlyingSource.cancel(reason); };\n }\n else {\n cancelAlgorithm = function () { return promiseResolvedWith(undefined); };\n }\n SetUpReadableStreamDefaultController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm);\n }\n // Helper functions for the ReadableStreamDefaultController.\n function defaultControllerBrandCheckException$1(name) {\n return new TypeError(\"ReadableStreamDefaultController.prototype.\".concat(name, \" can only be used on a ReadableStreamDefaultController\"));\n }\n\n function ReadableStreamTee(stream, cloneForBranch2) {\n if (IsReadableByteStreamController(stream._readableStreamController)) {\n return ReadableByteStreamTee(stream);\n }\n return ReadableStreamDefaultTee(stream);\n }\n function ReadableStreamDefaultTee(stream, cloneForBranch2) {\n var reader = AcquireReadableStreamDefaultReader(stream);\n var reading = false;\n var readAgain = false;\n var canceled1 = false;\n var canceled2 = false;\n var reason1;\n var reason2;\n var branch1;\n var branch2;\n var resolveCancelPromise;\n var cancelPromise = newPromise(function (resolve) {\n resolveCancelPromise = resolve;\n });\n function pullAlgorithm() {\n if (reading) {\n readAgain = true;\n return promiseResolvedWith(undefined);\n }\n reading = true;\n var readRequest = {\n _chunkSteps: function (chunk) {\n // This needs to be delayed a microtask because it takes at least a microtask to detect errors (using\n // reader._closedPromise below), and we want errors in stream to error both branches immediately. We cannot let\n // successful synchronously-available reads get ahead of asynchronously-available errors.\n _queueMicrotask(function () {\n readAgain = false;\n var chunk1 = chunk;\n var chunk2 = chunk;\n // There is no way to access the cloning code right now in the reference implementation.\n // If we add one then we'll need an implementation for serializable objects.\n // if (!canceled2 && cloneForBranch2) {\n // chunk2 = StructuredDeserialize(StructuredSerialize(chunk2));\n // }\n if (!canceled1) {\n ReadableStreamDefaultControllerEnqueue(branch1._readableStreamController, chunk1);\n }\n if (!canceled2) {\n ReadableStreamDefaultControllerEnqueue(branch2._readableStreamController, chunk2);\n }\n reading = false;\n if (readAgain) {\n pullAlgorithm();\n }\n });\n },\n _closeSteps: function () {\n reading = false;\n if (!canceled1) {\n ReadableStreamDefaultControllerClose(branch1._readableStreamController);\n }\n if (!canceled2) {\n ReadableStreamDefaultControllerClose(branch2._readableStreamController);\n }\n if (!canceled1 || !canceled2) {\n resolveCancelPromise(undefined);\n }\n },\n _errorSteps: function () {\n reading = false;\n }\n };\n ReadableStreamDefaultReaderRead(reader, readRequest);\n return promiseResolvedWith(undefined);\n }\n function cancel1Algorithm(reason) {\n canceled1 = true;\n reason1 = reason;\n if (canceled2) {\n var compositeReason = CreateArrayFromList([reason1, reason2]);\n var cancelResult = ReadableStreamCancel(stream, compositeReason);\n resolveCancelPromise(cancelResult);\n }\n return cancelPromise;\n }\n function cancel2Algorithm(reason) {\n canceled2 = true;\n reason2 = reason;\n if (canceled1) {\n var compositeReason = CreateArrayFromList([reason1, reason2]);\n var cancelResult = ReadableStreamCancel(stream, compositeReason);\n resolveCancelPromise(cancelResult);\n }\n return cancelPromise;\n }\n function startAlgorithm() {\n // do nothing\n }\n branch1 = CreateReadableStream(startAlgorithm, pullAlgorithm, cancel1Algorithm);\n branch2 = CreateReadableStream(startAlgorithm, pullAlgorithm, cancel2Algorithm);\n uponRejection(reader._closedPromise, function (r) {\n ReadableStreamDefaultControllerError(branch1._readableStreamController, r);\n ReadableStreamDefaultControllerError(branch2._readableStreamController, r);\n if (!canceled1 || !canceled2) {\n resolveCancelPromise(undefined);\n }\n return null;\n });\n return [branch1, branch2];\n }\n function ReadableByteStreamTee(stream) {\n var reader = AcquireReadableStreamDefaultReader(stream);\n var reading = false;\n var readAgainForBranch1 = false;\n var readAgainForBranch2 = false;\n var canceled1 = false;\n var canceled2 = false;\n var reason1;\n var reason2;\n var branch1;\n var branch2;\n var resolveCancelPromise;\n var cancelPromise = newPromise(function (resolve) {\n resolveCancelPromise = resolve;\n });\n function forwardReaderError(thisReader) {\n uponRejection(thisReader._closedPromise, function (r) {\n if (thisReader !== reader) {\n return null;\n }\n ReadableByteStreamControllerError(branch1._readableStreamController, r);\n ReadableByteStreamControllerError(branch2._readableStreamController, r);\n if (!canceled1 || !canceled2) {\n resolveCancelPromise(undefined);\n }\n return null;\n });\n }\n function pullWithDefaultReader() {\n if (IsReadableStreamBYOBReader(reader)) {\n ReadableStreamReaderGenericRelease(reader);\n reader = AcquireReadableStreamDefaultReader(stream);\n forwardReaderError(reader);\n }\n var readRequest = {\n _chunkSteps: function (chunk) {\n // This needs to be delayed a microtask because it takes at least a microtask to detect errors (using\n // reader._closedPromise below), and we want errors in stream to error both branches immediately. We cannot let\n // successful synchronously-available reads get ahead of asynchronously-available errors.\n _queueMicrotask(function () {\n readAgainForBranch1 = false;\n readAgainForBranch2 = false;\n var chunk1 = chunk;\n var chunk2 = chunk;\n if (!canceled1 && !canceled2) {\n try {\n chunk2 = CloneAsUint8Array(chunk);\n }\n catch (cloneE) {\n ReadableByteStreamControllerError(branch1._readableStreamController, cloneE);\n ReadableByteStreamControllerError(branch2._readableStreamController, cloneE);\n resolveCancelPromise(ReadableStreamCancel(stream, cloneE));\n return;\n }\n }\n if (!canceled1) {\n ReadableByteStreamControllerEnqueue(branch1._readableStreamController, chunk1);\n }\n if (!canceled2) {\n ReadableByteStreamControllerEnqueue(branch2._readableStreamController, chunk2);\n }\n reading = false;\n if (readAgainForBranch1) {\n pull1Algorithm();\n }\n else if (readAgainForBranch2) {\n pull2Algorithm();\n }\n });\n },\n _closeSteps: function () {\n reading = false;\n if (!canceled1) {\n ReadableByteStreamControllerClose(branch1._readableStreamController);\n }\n if (!canceled2) {\n ReadableByteStreamControllerClose(branch2._readableStreamController);\n }\n if (branch1._readableStreamController._pendingPullIntos.length > 0) {\n ReadableByteStreamControllerRespond(branch1._readableStreamController, 0);\n }\n if (branch2._readableStreamController._pendingPullIntos.length > 0) {\n ReadableByteStreamControllerRespond(branch2._readableStreamController, 0);\n }\n if (!canceled1 || !canceled2) {\n resolveCancelPromise(undefined);\n }\n },\n _errorSteps: function () {\n reading = false;\n }\n };\n ReadableStreamDefaultReaderRead(reader, readRequest);\n }\n function pullWithBYOBReader(view, forBranch2) {\n if (IsReadableStreamDefaultReader(reader)) {\n ReadableStreamReaderGenericRelease(reader);\n reader = AcquireReadableStreamBYOBReader(stream);\n forwardReaderError(reader);\n }\n var byobBranch = forBranch2 ? branch2 : branch1;\n var otherBranch = forBranch2 ? branch1 : branch2;\n var readIntoRequest = {\n _chunkSteps: function (chunk) {\n // This needs to be delayed a microtask because it takes at least a microtask to detect errors (using\n // reader._closedPromise below), and we want errors in stream to error both branches immediately. We cannot let\n // successful synchronously-available reads get ahead of asynchronously-available errors.\n _queueMicrotask(function () {\n readAgainForBranch1 = false;\n readAgainForBranch2 = false;\n var byobCanceled = forBranch2 ? canceled2 : canceled1;\n var otherCanceled = forBranch2 ? canceled1 : canceled2;\n if (!otherCanceled) {\n var clonedChunk = void 0;\n try {\n clonedChunk = CloneAsUint8Array(chunk);\n }\n catch (cloneE) {\n ReadableByteStreamControllerError(byobBranch._readableStreamController, cloneE);\n ReadableByteStreamControllerError(otherBranch._readableStreamController, cloneE);\n resolveCancelPromise(ReadableStreamCancel(stream, cloneE));\n return;\n }\n if (!byobCanceled) {\n ReadableByteStreamControllerRespondWithNewView(byobBranch._readableStreamController, chunk);\n }\n ReadableByteStreamControllerEnqueue(otherBranch._readableStreamController, clonedChunk);\n }\n else if (!byobCanceled) {\n ReadableByteStreamControllerRespondWithNewView(byobBranch._readableStreamController, chunk);\n }\n reading = false;\n if (readAgainForBranch1) {\n pull1Algorithm();\n }\n else if (readAgainForBranch2) {\n pull2Algorithm();\n }\n });\n },\n _closeSteps: function (chunk) {\n reading = false;\n var byobCanceled = forBranch2 ? canceled2 : canceled1;\n var otherCanceled = forBranch2 ? canceled1 : canceled2;\n if (!byobCanceled) {\n ReadableByteStreamControllerClose(byobBranch._readableStreamController);\n }\n if (!otherCanceled) {\n ReadableByteStreamControllerClose(otherBranch._readableStreamController);\n }\n if (chunk !== undefined) {\n if (!byobCanceled) {\n ReadableByteStreamControllerRespondWithNewView(byobBranch._readableStreamController, chunk);\n }\n if (!otherCanceled && otherBranch._readableStreamController._pendingPullIntos.length > 0) {\n ReadableByteStreamControllerRespond(otherBranch._readableStreamController, 0);\n }\n }\n if (!byobCanceled || !otherCanceled) {\n resolveCancelPromise(undefined);\n }\n },\n _errorSteps: function () {\n reading = false;\n }\n };\n ReadableStreamBYOBReaderRead(reader, view, 1, readIntoRequest);\n }\n function pull1Algorithm() {\n if (reading) {\n readAgainForBranch1 = true;\n return promiseResolvedWith(undefined);\n }\n reading = true;\n var byobRequest = ReadableByteStreamControllerGetBYOBRequest(branch1._readableStreamController);\n if (byobRequest === null) {\n pullWithDefaultReader();\n }\n else {\n pullWithBYOBReader(byobRequest._view, false);\n }\n return promiseResolvedWith(undefined);\n }\n function pull2Algorithm() {\n if (reading) {\n readAgainForBranch2 = true;\n return promiseResolvedWith(undefined);\n }\n reading = true;\n var byobRequest = ReadableByteStreamControllerGetBYOBRequest(branch2._readableStreamController);\n if (byobRequest === null) {\n pullWithDefaultReader();\n }\n else {\n pullWithBYOBReader(byobRequest._view, true);\n }\n return promiseResolvedWith(undefined);\n }\n function cancel1Algorithm(reason) {\n canceled1 = true;\n reason1 = reason;\n if (canceled2) {\n var compositeReason = CreateArrayFromList([reason1, reason2]);\n var cancelResult = ReadableStreamCancel(stream, compositeReason);\n resolveCancelPromise(cancelResult);\n }\n return cancelPromise;\n }\n function cancel2Algorithm(reason) {\n canceled2 = true;\n reason2 = reason;\n if (canceled1) {\n var compositeReason = CreateArrayFromList([reason1, reason2]);\n var cancelResult = ReadableStreamCancel(stream, compositeReason);\n resolveCancelPromise(cancelResult);\n }\n return cancelPromise;\n }\n function startAlgorithm() {\n return;\n }\n branch1 = CreateReadableByteStream(startAlgorithm, pull1Algorithm, cancel1Algorithm);\n branch2 = CreateReadableByteStream(startAlgorithm, pull2Algorithm, cancel2Algorithm);\n forwardReaderError(reader);\n return [branch1, branch2];\n }\n\n function isReadableStreamLike(stream) {\n return typeIsObject(stream) && typeof stream.getReader !== 'undefined';\n }\n\n function ReadableStreamFrom(source) {\n if (isReadableStreamLike(source)) {\n return ReadableStreamFromDefaultReader(source.getReader());\n }\n return ReadableStreamFromIterable(source);\n }\n function ReadableStreamFromIterable(asyncIterable) {\n var stream;\n var iteratorRecord = GetIterator(asyncIterable, 'async');\n var startAlgorithm = noop;\n function pullAlgorithm() {\n var nextResult;\n try {\n nextResult = IteratorNext(iteratorRecord);\n }\n catch (e) {\n return promiseRejectedWith(e);\n }\n var nextPromise = promiseResolvedWith(nextResult);\n return transformPromiseWith(nextPromise, function (iterResult) {\n if (!typeIsObject(iterResult)) {\n throw new TypeError('The promise returned by the iterator.next() method must fulfill with an object');\n }\n var done = IteratorComplete(iterResult);\n if (done) {\n ReadableStreamDefaultControllerClose(stream._readableStreamController);\n }\n else {\n var value = IteratorValue(iterResult);\n ReadableStreamDefaultControllerEnqueue(stream._readableStreamController, value);\n }\n });\n }\n function cancelAlgorithm(reason) {\n var iterator = iteratorRecord.iterator;\n var returnMethod;\n try {\n returnMethod = GetMethod(iterator, 'return');\n }\n catch (e) {\n return promiseRejectedWith(e);\n }\n if (returnMethod === undefined) {\n return promiseResolvedWith(undefined);\n }\n var returnResult;\n try {\n returnResult = reflectCall(returnMethod, iterator, [reason]);\n }\n catch (e) {\n return promiseRejectedWith(e);\n }\n var returnPromise = promiseResolvedWith(returnResult);\n return transformPromiseWith(returnPromise, function (iterResult) {\n if (!typeIsObject(iterResult)) {\n throw new TypeError('The promise returned by the iterator.return() method must fulfill with an object');\n }\n return undefined;\n });\n }\n stream = CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, 0);\n return stream;\n }\n function ReadableStreamFromDefaultReader(reader) {\n var stream;\n var startAlgorithm = noop;\n function pullAlgorithm() {\n var readPromise;\n try {\n readPromise = reader.read();\n }\n catch (e) {\n return promiseRejectedWith(e);\n }\n return transformPromiseWith(readPromise, function (readResult) {\n if (!typeIsObject(readResult)) {\n throw new TypeError('The promise returned by the reader.read() method must fulfill with an object');\n }\n if (readResult.done) {\n ReadableStreamDefaultControllerClose(stream._readableStreamController);\n }\n else {\n var value = readResult.value;\n ReadableStreamDefaultControllerEnqueue(stream._readableStreamController, value);\n }\n });\n }\n function cancelAlgorithm(reason) {\n try {\n return promiseResolvedWith(reader.cancel(reason));\n }\n catch (e) {\n return promiseRejectedWith(e);\n }\n }\n stream = CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, 0);\n return stream;\n }\n\n function convertUnderlyingDefaultOrByteSource(source, context) {\n assertDictionary(source, context);\n var original = source;\n var autoAllocateChunkSize = original === null || original === void 0 ? void 0 : original.autoAllocateChunkSize;\n var cancel = original === null || original === void 0 ? void 0 : original.cancel;\n var pull = original === null || original === void 0 ? void 0 : original.pull;\n var start = original === null || original === void 0 ? void 0 : original.start;\n var type = original === null || original === void 0 ? void 0 : original.type;\n return {\n autoAllocateChunkSize: autoAllocateChunkSize === undefined ?\n undefined :\n convertUnsignedLongLongWithEnforceRange(autoAllocateChunkSize, \"\".concat(context, \" has member 'autoAllocateChunkSize' that\")),\n cancel: cancel === undefined ?\n undefined :\n convertUnderlyingSourceCancelCallback(cancel, original, \"\".concat(context, \" has member 'cancel' that\")),\n pull: pull === undefined ?\n undefined :\n convertUnderlyingSourcePullCallback(pull, original, \"\".concat(context, \" has member 'pull' that\")),\n start: start === undefined ?\n undefined :\n convertUnderlyingSourceStartCallback(start, original, \"\".concat(context, \" has member 'start' that\")),\n type: type === undefined ? undefined : convertReadableStreamType(type, \"\".concat(context, \" has member 'type' that\"))\n };\n }\n function convertUnderlyingSourceCancelCallback(fn, original, context) {\n assertFunction(fn, context);\n return function (reason) { return promiseCall(fn, original, [reason]); };\n }\n function convertUnderlyingSourcePullCallback(fn, original, context) {\n assertFunction(fn, context);\n return function (controller) { return promiseCall(fn, original, [controller]); };\n }\n function convertUnderlyingSourceStartCallback(fn, original, context) {\n assertFunction(fn, context);\n return function (controller) { return reflectCall(fn, original, [controller]); };\n }\n function convertReadableStreamType(type, context) {\n type = \"\".concat(type);\n if (type !== 'bytes') {\n throw new TypeError(\"\".concat(context, \" '\").concat(type, \"' is not a valid enumeration value for ReadableStreamType\"));\n }\n return type;\n }\n\n function convertIteratorOptions(options, context) {\n assertDictionary(options, context);\n var preventCancel = options === null || options === void 0 ? void 0 : options.preventCancel;\n return { preventCancel: Boolean(preventCancel) };\n }\n\n function convertPipeOptions(options, context) {\n assertDictionary(options, context);\n var preventAbort = options === null || options === void 0 ? void 0 : options.preventAbort;\n var preventCancel = options === null || options === void 0 ? void 0 : options.preventCancel;\n var preventClose = options === null || options === void 0 ? void 0 : options.preventClose;\n var signal = options === null || options === void 0 ? void 0 : options.signal;\n if (signal !== undefined) {\n assertAbortSignal(signal, \"\".concat(context, \" has member 'signal' that\"));\n }\n return {\n preventAbort: Boolean(preventAbort),\n preventCancel: Boolean(preventCancel),\n preventClose: Boolean(preventClose),\n signal: signal\n };\n }\n function assertAbortSignal(signal, context) {\n if (!isAbortSignal(signal)) {\n throw new TypeError(\"\".concat(context, \" is not an AbortSignal.\"));\n }\n }\n\n function convertReadableWritablePair(pair, context) {\n assertDictionary(pair, context);\n var readable = pair === null || pair === void 0 ? void 0 : pair.readable;\n assertRequiredField(readable, 'readable', 'ReadableWritablePair');\n assertReadableStream(readable, \"\".concat(context, \" has member 'readable' that\"));\n var writable = pair === null || pair === void 0 ? void 0 : pair.writable;\n assertRequiredField(writable, 'writable', 'ReadableWritablePair');\n assertWritableStream(writable, \"\".concat(context, \" has member 'writable' that\"));\n return { readable: readable, writable: writable };\n }\n\n /**\n * A readable stream represents a source of data, from which you can read.\n *\n * @public\n */\n var ReadableStream = /** @class */ (function () {\n function ReadableStream(rawUnderlyingSource, rawStrategy) {\n if (rawUnderlyingSource === void 0) { rawUnderlyingSource = {}; }\n if (rawStrategy === void 0) { rawStrategy = {}; }\n if (rawUnderlyingSource === undefined) {\n rawUnderlyingSource = null;\n }\n else {\n assertObject(rawUnderlyingSource, 'First parameter');\n }\n var strategy = convertQueuingStrategy(rawStrategy, 'Second parameter');\n var underlyingSource = convertUnderlyingDefaultOrByteSource(rawUnderlyingSource, 'First parameter');\n InitializeReadableStream(this);\n if (underlyingSource.type === 'bytes') {\n if (strategy.size !== undefined) {\n throw new RangeError('The strategy for a byte stream cannot have a size function');\n }\n var highWaterMark = ExtractHighWaterMark(strategy, 0);\n SetUpReadableByteStreamControllerFromUnderlyingSource(this, underlyingSource, highWaterMark);\n }\n else {\n var sizeAlgorithm = ExtractSizeAlgorithm(strategy);\n var highWaterMark = ExtractHighWaterMark(strategy, 1);\n SetUpReadableStreamDefaultControllerFromUnderlyingSource(this, underlyingSource, highWaterMark, sizeAlgorithm);\n }\n }\n Object.defineProperty(ReadableStream.prototype, \"locked\", {\n /**\n * Whether or not the readable stream is locked to a {@link ReadableStreamDefaultReader | reader}.\n */\n get: function () {\n if (!IsReadableStream(this)) {\n throw streamBrandCheckException$1('locked');\n }\n return IsReadableStreamLocked(this);\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Cancels the stream, signaling a loss of interest in the stream by a consumer.\n *\n * The supplied `reason` argument will be given to the underlying source's {@link UnderlyingSource.cancel | cancel()}\n * method, which might or might not use it.\n */\n ReadableStream.prototype.cancel = function (reason) {\n if (reason === void 0) { reason = undefined; }\n if (!IsReadableStream(this)) {\n return promiseRejectedWith(streamBrandCheckException$1('cancel'));\n }\n if (IsReadableStreamLocked(this)) {\n return promiseRejectedWith(new TypeError('Cannot cancel a stream that already has a reader'));\n }\n return ReadableStreamCancel(this, reason);\n };\n ReadableStream.prototype.getReader = function (rawOptions) {\n if (rawOptions === void 0) { rawOptions = undefined; }\n if (!IsReadableStream(this)) {\n throw streamBrandCheckException$1('getReader');\n }\n var options = convertReaderOptions(rawOptions, 'First parameter');\n if (options.mode === undefined) {\n return AcquireReadableStreamDefaultReader(this);\n }\n return AcquireReadableStreamBYOBReader(this);\n };\n ReadableStream.prototype.pipeThrough = function (rawTransform, rawOptions) {\n if (rawOptions === void 0) { rawOptions = {}; }\n if (!IsReadableStream(this)) {\n throw streamBrandCheckException$1('pipeThrough');\n }\n assertRequiredArgument(rawTransform, 1, 'pipeThrough');\n var transform = convertReadableWritablePair(rawTransform, 'First parameter');\n var options = convertPipeOptions(rawOptions, 'Second parameter');\n if (IsReadableStreamLocked(this)) {\n throw new TypeError('ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream');\n }\n if (IsWritableStreamLocked(transform.writable)) {\n throw new TypeError('ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream');\n }\n var promise = ReadableStreamPipeTo(this, transform.writable, options.preventClose, options.preventAbort, options.preventCancel, options.signal);\n setPromiseIsHandledToTrue(promise);\n return transform.readable;\n };\n ReadableStream.prototype.pipeTo = function (destination, rawOptions) {\n if (rawOptions === void 0) { rawOptions = {}; }\n if (!IsReadableStream(this)) {\n return promiseRejectedWith(streamBrandCheckException$1('pipeTo'));\n }\n if (destination === undefined) {\n return promiseRejectedWith(\"Parameter 1 is required in 'pipeTo'.\");\n }\n if (!IsWritableStream(destination)) {\n return promiseRejectedWith(new TypeError(\"ReadableStream.prototype.pipeTo's first argument must be a WritableStream\"));\n }\n var options;\n try {\n options = convertPipeOptions(rawOptions, 'Second parameter');\n }\n catch (e) {\n return promiseRejectedWith(e);\n }\n if (IsReadableStreamLocked(this)) {\n return promiseRejectedWith(new TypeError('ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream'));\n }\n if (IsWritableStreamLocked(destination)) {\n return promiseRejectedWith(new TypeError('ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream'));\n }\n return ReadableStreamPipeTo(this, destination, options.preventClose, options.preventAbort, options.preventCancel, options.signal);\n };\n /**\n * Tees this readable stream, returning a two-element array containing the two resulting branches as\n * new {@link ReadableStream} instances.\n *\n * Teeing a stream will lock it, preventing any other consumer from acquiring a reader.\n * To cancel the stream, cancel both of the resulting branches; a composite cancellation reason will then be\n * propagated to the stream's underlying source.\n *\n * Note that the chunks seen in each branch will be the same object. If the chunks are not immutable,\n * this could allow interference between the two branches.\n */\n ReadableStream.prototype.tee = function () {\n if (!IsReadableStream(this)) {\n throw streamBrandCheckException$1('tee');\n }\n var branches = ReadableStreamTee(this);\n return CreateArrayFromList(branches);\n };\n ReadableStream.prototype.values = function (rawOptions) {\n if (rawOptions === void 0) { rawOptions = undefined; }\n if (!IsReadableStream(this)) {\n throw streamBrandCheckException$1('values');\n }\n var options = convertIteratorOptions(rawOptions, 'First parameter');\n return AcquireReadableStreamAsyncIterator(this, options.preventCancel);\n };\n ReadableStream.prototype[SymbolAsyncIterator] = function (options) {\n // Stub implementation, overridden below\n return this.values(options);\n };\n /**\n * Creates a new ReadableStream wrapping the provided iterable or async iterable.\n *\n * This can be used to adapt various kinds of objects into a readable stream,\n * such as an array, an async generator, or a Node.js readable stream.\n */\n ReadableStream.from = function (asyncIterable) {\n return ReadableStreamFrom(asyncIterable);\n };\n return ReadableStream;\n }());\n Object.defineProperties(ReadableStream, {\n from: { enumerable: true }\n });\n Object.defineProperties(ReadableStream.prototype, {\n cancel: { enumerable: true },\n getReader: { enumerable: true },\n pipeThrough: { enumerable: true },\n pipeTo: { enumerable: true },\n tee: { enumerable: true },\n values: { enumerable: true },\n locked: { enumerable: true }\n });\n setFunctionName(ReadableStream.from, 'from');\n setFunctionName(ReadableStream.prototype.cancel, 'cancel');\n setFunctionName(ReadableStream.prototype.getReader, 'getReader');\n setFunctionName(ReadableStream.prototype.pipeThrough, 'pipeThrough');\n setFunctionName(ReadableStream.prototype.pipeTo, 'pipeTo');\n setFunctionName(ReadableStream.prototype.tee, 'tee');\n setFunctionName(ReadableStream.prototype.values, 'values');\n if (typeof SymbolPolyfill.toStringTag === 'symbol') {\n Object.defineProperty(ReadableStream.prototype, SymbolPolyfill.toStringTag, {\n value: 'ReadableStream',\n configurable: true\n });\n }\n Object.defineProperty(ReadableStream.prototype, SymbolAsyncIterator, {\n value: ReadableStream.prototype.values,\n writable: true,\n configurable: true\n });\n // Abstract operations for the ReadableStream.\n // Throws if and only if startAlgorithm throws.\n function CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm) {\n if (highWaterMark === void 0) { highWaterMark = 1; }\n if (sizeAlgorithm === void 0) { sizeAlgorithm = function () { return 1; }; }\n var stream = Object.create(ReadableStream.prototype);\n InitializeReadableStream(stream);\n var controller = Object.create(ReadableStreamDefaultController.prototype);\n SetUpReadableStreamDefaultController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm);\n return stream;\n }\n // Throws if and only if startAlgorithm throws.\n function CreateReadableByteStream(startAlgorithm, pullAlgorithm, cancelAlgorithm) {\n var stream = Object.create(ReadableStream.prototype);\n InitializeReadableStream(stream);\n var controller = Object.create(ReadableByteStreamController.prototype);\n SetUpReadableByteStreamController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, 0, undefined);\n return stream;\n }\n function InitializeReadableStream(stream) {\n stream._state = 'readable';\n stream._reader = undefined;\n stream._storedError = undefined;\n stream._disturbed = false;\n }\n function IsReadableStream(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_readableStreamController')) {\n return false;\n }\n return x instanceof ReadableStream;\n }\n function IsReadableStreamLocked(stream) {\n if (stream._reader === undefined) {\n return false;\n }\n return true;\n }\n // ReadableStream API exposed for controllers.\n function ReadableStreamCancel(stream, reason) {\n stream._disturbed = true;\n if (stream._state === 'closed') {\n return promiseResolvedWith(undefined);\n }\n if (stream._state === 'errored') {\n return promiseRejectedWith(stream._storedError);\n }\n ReadableStreamClose(stream);\n var reader = stream._reader;\n if (reader !== undefined && IsReadableStreamBYOBReader(reader)) {\n var readIntoRequests = reader._readIntoRequests;\n reader._readIntoRequests = new SimpleQueue();\n readIntoRequests.forEach(function (readIntoRequest) {\n readIntoRequest._closeSteps(undefined);\n });\n }\n var sourceCancelPromise = stream._readableStreamController[CancelSteps](reason);\n return transformPromiseWith(sourceCancelPromise, noop);\n }\n function ReadableStreamClose(stream) {\n stream._state = 'closed';\n var reader = stream._reader;\n if (reader === undefined) {\n return;\n }\n defaultReaderClosedPromiseResolve(reader);\n if (IsReadableStreamDefaultReader(reader)) {\n var readRequests = reader._readRequests;\n reader._readRequests = new SimpleQueue();\n readRequests.forEach(function (readRequest) {\n readRequest._closeSteps();\n });\n }\n }\n function ReadableStreamError(stream, e) {\n stream._state = 'errored';\n stream._storedError = e;\n var reader = stream._reader;\n if (reader === undefined) {\n return;\n }\n defaultReaderClosedPromiseReject(reader, e);\n if (IsReadableStreamDefaultReader(reader)) {\n ReadableStreamDefaultReaderErrorReadRequests(reader, e);\n }\n else {\n ReadableStreamBYOBReaderErrorReadIntoRequests(reader, e);\n }\n }\n // Helper functions for the ReadableStream.\n function streamBrandCheckException$1(name) {\n return new TypeError(\"ReadableStream.prototype.\".concat(name, \" can only be used on a ReadableStream\"));\n }\n\n function convertQueuingStrategyInit(init, context) {\n assertDictionary(init, context);\n var highWaterMark = init === null || init === void 0 ? void 0 : init.highWaterMark;\n assertRequiredField(highWaterMark, 'highWaterMark', 'QueuingStrategyInit');\n return {\n highWaterMark: convertUnrestrictedDouble(highWaterMark)\n };\n }\n\n // The size function must not have a prototype property nor be a constructor\n var byteLengthSizeFunction = function (chunk) {\n return chunk.byteLength;\n };\n setFunctionName(byteLengthSizeFunction, 'size');\n /**\n * A queuing strategy that counts the number of bytes in each chunk.\n *\n * @public\n */\n var ByteLengthQueuingStrategy = /** @class */ (function () {\n function ByteLengthQueuingStrategy(options) {\n assertRequiredArgument(options, 1, 'ByteLengthQueuingStrategy');\n options = convertQueuingStrategyInit(options, 'First parameter');\n this._byteLengthQueuingStrategyHighWaterMark = options.highWaterMark;\n }\n Object.defineProperty(ByteLengthQueuingStrategy.prototype, \"highWaterMark\", {\n /**\n * Returns the high water mark provided to the constructor.\n */\n get: function () {\n if (!IsByteLengthQueuingStrategy(this)) {\n throw byteLengthBrandCheckException('highWaterMark');\n }\n return this._byteLengthQueuingStrategyHighWaterMark;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ByteLengthQueuingStrategy.prototype, \"size\", {\n /**\n * Measures the size of `chunk` by returning the value of its `byteLength` property.\n */\n get: function () {\n if (!IsByteLengthQueuingStrategy(this)) {\n throw byteLengthBrandCheckException('size');\n }\n return byteLengthSizeFunction;\n },\n enumerable: false,\n configurable: true\n });\n return ByteLengthQueuingStrategy;\n }());\n Object.defineProperties(ByteLengthQueuingStrategy.prototype, {\n highWaterMark: { enumerable: true },\n size: { enumerable: true }\n });\n if (typeof SymbolPolyfill.toStringTag === 'symbol') {\n Object.defineProperty(ByteLengthQueuingStrategy.prototype, SymbolPolyfill.toStringTag, {\n value: 'ByteLengthQueuingStrategy',\n configurable: true\n });\n }\n // Helper functions for the ByteLengthQueuingStrategy.\n function byteLengthBrandCheckException(name) {\n return new TypeError(\"ByteLengthQueuingStrategy.prototype.\".concat(name, \" can only be used on a ByteLengthQueuingStrategy\"));\n }\n function IsByteLengthQueuingStrategy(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_byteLengthQueuingStrategyHighWaterMark')) {\n return false;\n }\n return x instanceof ByteLengthQueuingStrategy;\n }\n\n // The size function must not have a prototype property nor be a constructor\n var countSizeFunction = function () {\n return 1;\n };\n setFunctionName(countSizeFunction, 'size');\n /**\n * A queuing strategy that counts the number of chunks.\n *\n * @public\n */\n var CountQueuingStrategy = /** @class */ (function () {\n function CountQueuingStrategy(options) {\n assertRequiredArgument(options, 1, 'CountQueuingStrategy');\n options = convertQueuingStrategyInit(options, 'First parameter');\n this._countQueuingStrategyHighWaterMark = options.highWaterMark;\n }\n Object.defineProperty(CountQueuingStrategy.prototype, \"highWaterMark\", {\n /**\n * Returns the high water mark provided to the constructor.\n */\n get: function () {\n if (!IsCountQueuingStrategy(this)) {\n throw countBrandCheckException('highWaterMark');\n }\n return this._countQueuingStrategyHighWaterMark;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CountQueuingStrategy.prototype, \"size\", {\n /**\n * Measures the size of `chunk` by always returning 1.\n * This ensures that the total queue size is a count of the number of chunks in the queue.\n */\n get: function () {\n if (!IsCountQueuingStrategy(this)) {\n throw countBrandCheckException('size');\n }\n return countSizeFunction;\n },\n enumerable: false,\n configurable: true\n });\n return CountQueuingStrategy;\n }());\n Object.defineProperties(CountQueuingStrategy.prototype, {\n highWaterMark: { enumerable: true },\n size: { enumerable: true }\n });\n if (typeof SymbolPolyfill.toStringTag === 'symbol') {\n Object.defineProperty(CountQueuingStrategy.prototype, SymbolPolyfill.toStringTag, {\n value: 'CountQueuingStrategy',\n configurable: true\n });\n }\n // Helper functions for the CountQueuingStrategy.\n function countBrandCheckException(name) {\n return new TypeError(\"CountQueuingStrategy.prototype.\".concat(name, \" can only be used on a CountQueuingStrategy\"));\n }\n function IsCountQueuingStrategy(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_countQueuingStrategyHighWaterMark')) {\n return false;\n }\n return x instanceof CountQueuingStrategy;\n }\n\n function convertTransformer(original, context) {\n assertDictionary(original, context);\n var cancel = original === null || original === void 0 ? void 0 : original.cancel;\n var flush = original === null || original === void 0 ? void 0 : original.flush;\n var readableType = original === null || original === void 0 ? void 0 : original.readableType;\n var start = original === null || original === void 0 ? void 0 : original.start;\n var transform = original === null || original === void 0 ? void 0 : original.transform;\n var writableType = original === null || original === void 0 ? void 0 : original.writableType;\n return {\n cancel: cancel === undefined ?\n undefined :\n convertTransformerCancelCallback(cancel, original, \"\".concat(context, \" has member 'cancel' that\")),\n flush: flush === undefined ?\n undefined :\n convertTransformerFlushCallback(flush, original, \"\".concat(context, \" has member 'flush' that\")),\n readableType: readableType,\n start: start === undefined ?\n undefined :\n convertTransformerStartCallback(start, original, \"\".concat(context, \" has member 'start' that\")),\n transform: transform === undefined ?\n undefined :\n convertTransformerTransformCallback(transform, original, \"\".concat(context, \" has member 'transform' that\")),\n writableType: writableType\n };\n }\n function convertTransformerFlushCallback(fn, original, context) {\n assertFunction(fn, context);\n return function (controller) { return promiseCall(fn, original, [controller]); };\n }\n function convertTransformerStartCallback(fn, original, context) {\n assertFunction(fn, context);\n return function (controller) { return reflectCall(fn, original, [controller]); };\n }\n function convertTransformerTransformCallback(fn, original, context) {\n assertFunction(fn, context);\n return function (chunk, controller) { return promiseCall(fn, original, [chunk, controller]); };\n }\n function convertTransformerCancelCallback(fn, original, context) {\n assertFunction(fn, context);\n return function (reason) { return promiseCall(fn, original, [reason]); };\n }\n\n // Class TransformStream\n /**\n * A transform stream consists of a pair of streams: a {@link WritableStream | writable stream},\n * known as its writable side, and a {@link ReadableStream | readable stream}, known as its readable side.\n * In a manner specific to the transform stream in question, writes to the writable side result in new data being\n * made available for reading from the readable side.\n *\n * @public\n */\n var TransformStream = /** @class */ (function () {\n function TransformStream(rawTransformer, rawWritableStrategy, rawReadableStrategy) {\n if (rawTransformer === void 0) { rawTransformer = {}; }\n if (rawWritableStrategy === void 0) { rawWritableStrategy = {}; }\n if (rawReadableStrategy === void 0) { rawReadableStrategy = {}; }\n if (rawTransformer === undefined) {\n rawTransformer = null;\n }\n var writableStrategy = convertQueuingStrategy(rawWritableStrategy, 'Second parameter');\n var readableStrategy = convertQueuingStrategy(rawReadableStrategy, 'Third parameter');\n var transformer = convertTransformer(rawTransformer, 'First parameter');\n if (transformer.readableType !== undefined) {\n throw new RangeError('Invalid readableType specified');\n }\n if (transformer.writableType !== undefined) {\n throw new RangeError('Invalid writableType specified');\n }\n var readableHighWaterMark = ExtractHighWaterMark(readableStrategy, 0);\n var readableSizeAlgorithm = ExtractSizeAlgorithm(readableStrategy);\n var writableHighWaterMark = ExtractHighWaterMark(writableStrategy, 1);\n var writableSizeAlgorithm = ExtractSizeAlgorithm(writableStrategy);\n var startPromise_resolve;\n var startPromise = newPromise(function (resolve) {\n startPromise_resolve = resolve;\n });\n InitializeTransformStream(this, startPromise, writableHighWaterMark, writableSizeAlgorithm, readableHighWaterMark, readableSizeAlgorithm);\n SetUpTransformStreamDefaultControllerFromTransformer(this, transformer);\n if (transformer.start !== undefined) {\n startPromise_resolve(transformer.start(this._transformStreamController));\n }\n else {\n startPromise_resolve(undefined);\n }\n }\n Object.defineProperty(TransformStream.prototype, \"readable\", {\n /**\n * The readable side of the transform stream.\n */\n get: function () {\n if (!IsTransformStream(this)) {\n throw streamBrandCheckException('readable');\n }\n return this._readable;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TransformStream.prototype, \"writable\", {\n /**\n * The writable side of the transform stream.\n */\n get: function () {\n if (!IsTransformStream(this)) {\n throw streamBrandCheckException('writable');\n }\n return this._writable;\n },\n enumerable: false,\n configurable: true\n });\n return TransformStream;\n }());\n Object.defineProperties(TransformStream.prototype, {\n readable: { enumerable: true },\n writable: { enumerable: true }\n });\n if (typeof SymbolPolyfill.toStringTag === 'symbol') {\n Object.defineProperty(TransformStream.prototype, SymbolPolyfill.toStringTag, {\n value: 'TransformStream',\n configurable: true\n });\n }\n function InitializeTransformStream(stream, startPromise, writableHighWaterMark, writableSizeAlgorithm, readableHighWaterMark, readableSizeAlgorithm) {\n function startAlgorithm() {\n return startPromise;\n }\n function writeAlgorithm(chunk) {\n return TransformStreamDefaultSinkWriteAlgorithm(stream, chunk);\n }\n function abortAlgorithm(reason) {\n return TransformStreamDefaultSinkAbortAlgorithm(stream, reason);\n }\n function closeAlgorithm() {\n return TransformStreamDefaultSinkCloseAlgorithm(stream);\n }\n stream._writable = CreateWritableStream(startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, writableHighWaterMark, writableSizeAlgorithm);\n function pullAlgorithm() {\n return TransformStreamDefaultSourcePullAlgorithm(stream);\n }\n function cancelAlgorithm(reason) {\n return TransformStreamDefaultSourceCancelAlgorithm(stream, reason);\n }\n stream._readable = CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, readableHighWaterMark, readableSizeAlgorithm);\n // The [[backpressure]] slot is set to undefined so that it can be initialised by TransformStreamSetBackpressure.\n stream._backpressure = undefined;\n stream._backpressureChangePromise = undefined;\n stream._backpressureChangePromise_resolve = undefined;\n TransformStreamSetBackpressure(stream, true);\n stream._transformStreamController = undefined;\n }\n function IsTransformStream(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_transformStreamController')) {\n return false;\n }\n return x instanceof TransformStream;\n }\n // This is a no-op if both sides are already errored.\n function TransformStreamError(stream, e) {\n ReadableStreamDefaultControllerError(stream._readable._readableStreamController, e);\n TransformStreamErrorWritableAndUnblockWrite(stream, e);\n }\n function TransformStreamErrorWritableAndUnblockWrite(stream, e) {\n TransformStreamDefaultControllerClearAlgorithms(stream._transformStreamController);\n WritableStreamDefaultControllerErrorIfNeeded(stream._writable._writableStreamController, e);\n TransformStreamUnblockWrite(stream);\n }\n function TransformStreamUnblockWrite(stream) {\n if (stream._backpressure) {\n // Pretend that pull() was called to permit any pending write() calls to complete. TransformStreamSetBackpressure()\n // cannot be called from enqueue() or pull() once the ReadableStream is errored, so this will will be the final time\n // _backpressure is set.\n TransformStreamSetBackpressure(stream, false);\n }\n }\n function TransformStreamSetBackpressure(stream, backpressure) {\n // Passes also when called during construction.\n if (stream._backpressureChangePromise !== undefined) {\n stream._backpressureChangePromise_resolve();\n }\n stream._backpressureChangePromise = newPromise(function (resolve) {\n stream._backpressureChangePromise_resolve = resolve;\n });\n stream._backpressure = backpressure;\n }\n // Class TransformStreamDefaultController\n /**\n * Allows control of the {@link ReadableStream} and {@link WritableStream} of the associated {@link TransformStream}.\n *\n * @public\n */\n var TransformStreamDefaultController = /** @class */ (function () {\n function TransformStreamDefaultController() {\n throw new TypeError('Illegal constructor');\n }\n Object.defineProperty(TransformStreamDefaultController.prototype, \"desiredSize\", {\n /**\n * Returns the desired size to fill the readable side’s internal queue. It can be negative, if the queue is over-full.\n */\n get: function () {\n if (!IsTransformStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException('desiredSize');\n }\n var readableController = this._controlledTransformStream._readable._readableStreamController;\n return ReadableStreamDefaultControllerGetDesiredSize(readableController);\n },\n enumerable: false,\n configurable: true\n });\n TransformStreamDefaultController.prototype.enqueue = function (chunk) {\n if (chunk === void 0) { chunk = undefined; }\n if (!IsTransformStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException('enqueue');\n }\n TransformStreamDefaultControllerEnqueue(this, chunk);\n };\n /**\n * Errors both the readable side and the writable side of the controlled transform stream, making all future\n * interactions with it fail with the given error `e`. Any chunks queued for transformation will be discarded.\n */\n TransformStreamDefaultController.prototype.error = function (reason) {\n if (reason === void 0) { reason = undefined; }\n if (!IsTransformStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException('error');\n }\n TransformStreamDefaultControllerError(this, reason);\n };\n /**\n * Closes the readable side and errors the writable side of the controlled transform stream. This is useful when the\n * transformer only needs to consume a portion of the chunks written to the writable side.\n */\n TransformStreamDefaultController.prototype.terminate = function () {\n if (!IsTransformStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException('terminate');\n }\n TransformStreamDefaultControllerTerminate(this);\n };\n return TransformStreamDefaultController;\n }());\n Object.defineProperties(TransformStreamDefaultController.prototype, {\n enqueue: { enumerable: true },\n error: { enumerable: true },\n terminate: { enumerable: true },\n desiredSize: { enumerable: true }\n });\n setFunctionName(TransformStreamDefaultController.prototype.enqueue, 'enqueue');\n setFunctionName(TransformStreamDefaultController.prototype.error, 'error');\n setFunctionName(TransformStreamDefaultController.prototype.terminate, 'terminate');\n if (typeof SymbolPolyfill.toStringTag === 'symbol') {\n Object.defineProperty(TransformStreamDefaultController.prototype, SymbolPolyfill.toStringTag, {\n value: 'TransformStreamDefaultController',\n configurable: true\n });\n }\n // Transform Stream Default Controller Abstract Operations\n function IsTransformStreamDefaultController(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_controlledTransformStream')) {\n return false;\n }\n return x instanceof TransformStreamDefaultController;\n }\n function SetUpTransformStreamDefaultController(stream, controller, transformAlgorithm, flushAlgorithm, cancelAlgorithm) {\n controller._controlledTransformStream = stream;\n stream._transformStreamController = controller;\n controller._transformAlgorithm = transformAlgorithm;\n controller._flushAlgorithm = flushAlgorithm;\n controller._cancelAlgorithm = cancelAlgorithm;\n controller._finishPromise = undefined;\n controller._finishPromise_resolve = undefined;\n controller._finishPromise_reject = undefined;\n }\n function SetUpTransformStreamDefaultControllerFromTransformer(stream, transformer) {\n var controller = Object.create(TransformStreamDefaultController.prototype);\n var transformAlgorithm;\n var flushAlgorithm;\n var cancelAlgorithm;\n if (transformer.transform !== undefined) {\n transformAlgorithm = function (chunk) { return transformer.transform(chunk, controller); };\n }\n else {\n transformAlgorithm = function (chunk) {\n try {\n TransformStreamDefaultControllerEnqueue(controller, chunk);\n return promiseResolvedWith(undefined);\n }\n catch (transformResultE) {\n return promiseRejectedWith(transformResultE);\n }\n };\n }\n if (transformer.flush !== undefined) {\n flushAlgorithm = function () { return transformer.flush(controller); };\n }\n else {\n flushAlgorithm = function () { return promiseResolvedWith(undefined); };\n }\n if (transformer.cancel !== undefined) {\n cancelAlgorithm = function (reason) { return transformer.cancel(reason); };\n }\n else {\n cancelAlgorithm = function () { return promiseResolvedWith(undefined); };\n }\n SetUpTransformStreamDefaultController(stream, controller, transformAlgorithm, flushAlgorithm, cancelAlgorithm);\n }\n function TransformStreamDefaultControllerClearAlgorithms(controller) {\n controller._transformAlgorithm = undefined;\n controller._flushAlgorithm = undefined;\n controller._cancelAlgorithm = undefined;\n }\n function TransformStreamDefaultControllerEnqueue(controller, chunk) {\n var stream = controller._controlledTransformStream;\n var readableController = stream._readable._readableStreamController;\n if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(readableController)) {\n throw new TypeError('Readable side is not in a state that permits enqueue');\n }\n // We throttle transform invocations based on the backpressure of the ReadableStream, but we still\n // accept TransformStreamDefaultControllerEnqueue() calls.\n try {\n ReadableStreamDefaultControllerEnqueue(readableController, chunk);\n }\n catch (e) {\n // This happens when readableStrategy.size() throws.\n TransformStreamErrorWritableAndUnblockWrite(stream, e);\n throw stream._readable._storedError;\n }\n var backpressure = ReadableStreamDefaultControllerHasBackpressure(readableController);\n if (backpressure !== stream._backpressure) {\n TransformStreamSetBackpressure(stream, true);\n }\n }\n function TransformStreamDefaultControllerError(controller, e) {\n TransformStreamError(controller._controlledTransformStream, e);\n }\n function TransformStreamDefaultControllerPerformTransform(controller, chunk) {\n var transformPromise = controller._transformAlgorithm(chunk);\n return transformPromiseWith(transformPromise, undefined, function (r) {\n TransformStreamError(controller._controlledTransformStream, r);\n throw r;\n });\n }\n function TransformStreamDefaultControllerTerminate(controller) {\n var stream = controller._controlledTransformStream;\n var readableController = stream._readable._readableStreamController;\n ReadableStreamDefaultControllerClose(readableController);\n var error = new TypeError('TransformStream terminated');\n TransformStreamErrorWritableAndUnblockWrite(stream, error);\n }\n // TransformStreamDefaultSink Algorithms\n function TransformStreamDefaultSinkWriteAlgorithm(stream, chunk) {\n var controller = stream._transformStreamController;\n if (stream._backpressure) {\n var backpressureChangePromise = stream._backpressureChangePromise;\n return transformPromiseWith(backpressureChangePromise, function () {\n var writable = stream._writable;\n var state = writable._state;\n if (state === 'erroring') {\n throw writable._storedError;\n }\n return TransformStreamDefaultControllerPerformTransform(controller, chunk);\n });\n }\n return TransformStreamDefaultControllerPerformTransform(controller, chunk);\n }\n function TransformStreamDefaultSinkAbortAlgorithm(stream, reason) {\n var controller = stream._transformStreamController;\n if (controller._finishPromise !== undefined) {\n return controller._finishPromise;\n }\n // stream._readable cannot change after construction, so caching it across a call to user code is safe.\n var readable = stream._readable;\n // Assign the _finishPromise now so that if _cancelAlgorithm calls readable.cancel() internally,\n // we don't run the _cancelAlgorithm again.\n controller._finishPromise = newPromise(function (resolve, reject) {\n controller._finishPromise_resolve = resolve;\n controller._finishPromise_reject = reject;\n });\n var cancelPromise = controller._cancelAlgorithm(reason);\n TransformStreamDefaultControllerClearAlgorithms(controller);\n uponPromise(cancelPromise, function () {\n if (readable._state === 'errored') {\n defaultControllerFinishPromiseReject(controller, readable._storedError);\n }\n else {\n ReadableStreamDefaultControllerError(readable._readableStreamController, reason);\n defaultControllerFinishPromiseResolve(controller);\n }\n return null;\n }, function (r) {\n ReadableStreamDefaultControllerError(readable._readableStreamController, r);\n defaultControllerFinishPromiseReject(controller, r);\n return null;\n });\n return controller._finishPromise;\n }\n function TransformStreamDefaultSinkCloseAlgorithm(stream) {\n var controller = stream._transformStreamController;\n if (controller._finishPromise !== undefined) {\n return controller._finishPromise;\n }\n // stream._readable cannot change after construction, so caching it across a call to user code is safe.\n var readable = stream._readable;\n // Assign the _finishPromise now so that if _flushAlgorithm calls readable.cancel() internally,\n // we don't also run the _cancelAlgorithm.\n controller._finishPromise = newPromise(function (resolve, reject) {\n controller._finishPromise_resolve = resolve;\n controller._finishPromise_reject = reject;\n });\n var flushPromise = controller._flushAlgorithm();\n TransformStreamDefaultControllerClearAlgorithms(controller);\n uponPromise(flushPromise, function () {\n if (readable._state === 'errored') {\n defaultControllerFinishPromiseReject(controller, readable._storedError);\n }\n else {\n ReadableStreamDefaultControllerClose(readable._readableStreamController);\n defaultControllerFinishPromiseResolve(controller);\n }\n return null;\n }, function (r) {\n ReadableStreamDefaultControllerError(readable._readableStreamController, r);\n defaultControllerFinishPromiseReject(controller, r);\n return null;\n });\n return controller._finishPromise;\n }\n // TransformStreamDefaultSource Algorithms\n function TransformStreamDefaultSourcePullAlgorithm(stream) {\n // Invariant. Enforced by the promises returned by start() and pull().\n TransformStreamSetBackpressure(stream, false);\n // Prevent the next pull() call until there is backpressure.\n return stream._backpressureChangePromise;\n }\n function TransformStreamDefaultSourceCancelAlgorithm(stream, reason) {\n var controller = stream._transformStreamController;\n if (controller._finishPromise !== undefined) {\n return controller._finishPromise;\n }\n // stream._writable cannot change after construction, so caching it across a call to user code is safe.\n var writable = stream._writable;\n // Assign the _finishPromise now so that if _flushAlgorithm calls writable.abort() or\n // writable.cancel() internally, we don't run the _cancelAlgorithm again, or also run the\n // _flushAlgorithm.\n controller._finishPromise = newPromise(function (resolve, reject) {\n controller._finishPromise_resolve = resolve;\n controller._finishPromise_reject = reject;\n });\n var cancelPromise = controller._cancelAlgorithm(reason);\n TransformStreamDefaultControllerClearAlgorithms(controller);\n uponPromise(cancelPromise, function () {\n if (writable._state === 'errored') {\n defaultControllerFinishPromiseReject(controller, writable._storedError);\n }\n else {\n WritableStreamDefaultControllerErrorIfNeeded(writable._writableStreamController, reason);\n TransformStreamUnblockWrite(stream);\n defaultControllerFinishPromiseResolve(controller);\n }\n return null;\n }, function (r) {\n WritableStreamDefaultControllerErrorIfNeeded(writable._writableStreamController, r);\n TransformStreamUnblockWrite(stream);\n defaultControllerFinishPromiseReject(controller, r);\n return null;\n });\n return controller._finishPromise;\n }\n // Helper functions for the TransformStreamDefaultController.\n function defaultControllerBrandCheckException(name) {\n return new TypeError(\"TransformStreamDefaultController.prototype.\".concat(name, \" can only be used on a TransformStreamDefaultController\"));\n }\n function defaultControllerFinishPromiseResolve(controller) {\n if (controller._finishPromise_resolve === undefined) {\n return;\n }\n controller._finishPromise_resolve();\n controller._finishPromise_resolve = undefined;\n controller._finishPromise_reject = undefined;\n }\n function defaultControllerFinishPromiseReject(controller, reason) {\n if (controller._finishPromise_reject === undefined) {\n return;\n }\n setPromiseIsHandledToTrue(controller._finishPromise);\n controller._finishPromise_reject(reason);\n controller._finishPromise_resolve = undefined;\n controller._finishPromise_reject = undefined;\n }\n // Helper functions for the TransformStream.\n function streamBrandCheckException(name) {\n return new TypeError(\"TransformStream.prototype.\".concat(name, \" can only be used on a TransformStream\"));\n }\n\n exports.ByteLengthQueuingStrategy = ByteLengthQueuingStrategy;\n exports.CountQueuingStrategy = CountQueuingStrategy;\n exports.ReadableByteStreamController = ReadableByteStreamController;\n exports.ReadableStream = ReadableStream;\n exports.ReadableStreamBYOBReader = ReadableStreamBYOBReader;\n exports.ReadableStreamBYOBRequest = ReadableStreamBYOBRequest;\n exports.ReadableStreamDefaultController = ReadableStreamDefaultController;\n exports.ReadableStreamDefaultReader = ReadableStreamDefaultReader;\n exports.TransformStream = TransformStream;\n exports.TransformStreamDefaultController = TransformStreamDefaultController;\n exports.WritableStream = WritableStream;\n exports.WritableStreamDefaultController = WritableStreamDefaultController;\n exports.WritableStreamDefaultWriter = WritableStreamDefaultWriter;\n\n}));\n//# sourceMappingURL=ponyfill.js.map\n\n\n//# sourceURL=webpack://hsu-utils/./node_modules/web-streams-polyfill/dist/ponyfill.js?");
178
+
179
+ /***/ }),
180
+
181
+ /***/ "?5d76":
182
+ /*!************************!*\
183
+ !*** canvas (ignored) ***!
184
+ \************************/
185
+ /***/ (() => {
186
+
187
+ eval("/* (ignored) */\n\n//# sourceURL=webpack://hsu-utils/canvas_(ignored)?");
188
+
189
+ /***/ }),
190
+
191
+ /***/ "?0f9d":
192
+ /*!********************!*\
193
+ !*** fs (ignored) ***!
194
+ \********************/
195
+ /***/ (() => {
196
+
197
+ eval("/* (ignored) */\n\n//# sourceURL=webpack://hsu-utils/fs_(ignored)?");
198
+
199
+ /***/ }),
200
+
201
+ /***/ "?239a":
202
+ /*!**********************!*\
203
+ !*** http (ignored) ***!
204
+ \**********************/
205
+ /***/ (() => {
206
+
207
+ eval("/* (ignored) */\n\n//# sourceURL=webpack://hsu-utils/http_(ignored)?");
208
+
209
+ /***/ }),
210
+
211
+ /***/ "?c0f2":
212
+ /*!***********************!*\
213
+ !*** https (ignored) ***!
214
+ \***********************/
215
+ /***/ (() => {
216
+
217
+ eval("/* (ignored) */\n\n//# sourceURL=webpack://hsu-utils/https_(ignored)?");
218
+
219
+ /***/ }),
220
+
221
+ /***/ "?7812":
222
+ /*!*********************!*\
223
+ !*** url (ignored) ***!
224
+ \*********************/
225
+ /***/ (() => {
226
+
227
+ eval("/* (ignored) */\n\n//# sourceURL=webpack://hsu-utils/url_(ignored)?");
228
+
229
+ /***/ }),
230
+
231
+ /***/ "?6bdd":
232
+ /*!**********************!*\
233
+ !*** zlib (ignored) ***!
234
+ \**********************/
235
+ /***/ (() => {
236
+
237
+ eval("/* (ignored) */\n\n//# sourceURL=webpack://hsu-utils/zlib_(ignored)?");
129
238
 
130
239
  /***/ })
131
240
 
@@ -156,6 +265,19 @@ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {
156
265
  /******/ }
157
266
  /******/
158
267
  /************************************************************************/
268
+ /******/ /* webpack/runtime/global */
269
+ /******/ (() => {
270
+ /******/ __webpack_require__.g = (function() {
271
+ /******/ if (typeof globalThis === 'object') return globalThis;
272
+ /******/ try {
273
+ /******/ return this || new Function('return this')();
274
+ /******/ } catch (e) {
275
+ /******/ if (typeof window === 'object') return window;
276
+ /******/ }
277
+ /******/ })();
278
+ /******/ })();
279
+ /******/
280
+ /************************************************************************/
159
281
  /******/
160
282
  /******/ // startup
161
283
  /******/ // Load entry module and return exports